example

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSkillAnalysisChain

func CreateSkillAnalysisChain() (*gochains.BaseChain, error)

CreateSkillAnalysisChain creates a structured chain for skill analysis

func GenerateSimpleAnswer

func GenerateSimpleAnswer(
	ctx context.Context,
	clientChan chan<- event.ProgressEvent,
) (interface{}, error)
func CreateQuestionGeneratorChain() (*gochains.BaseChain, error) {
	template := `Generate interview questions for the following requirements:

Position: {{.position}} Seek Traits: {seek_traits} Number of Questions: {number_of_questions}

Create relevant interview questions that assess the candidate's fit for this role.`

	responseSchemas := []outputparser.ResponseSchema{
		{Name: "questions", Description: "List of interview questions separated by newlines"},
		{Name: "difficulty_level", Description: "Overall difficulty level (Beginner/Intermediate/Advanced)"},
		{Name: "focus_areas", Description: "Main focus areas covered by the questions"},
		{Name: "estimated_time", Description: "Estimated time needed for the interview"},
	}

	return gochains.NewChainBuilder().
		WithTemplate(template).
		WithParams([]string{"position", "seek_traits", "number_of_questions"}).
		WithStructuredOutput(responseSchemas).
		WithModel(llmmodels.ProviderOpenaAI, "gpt-4-turbo-preview").
		WithMaxTokens(1500).
		WithTemperature(0.3).
		Build()
}

// CreateSimpleChain creates a regular chain (backwards compatible)

func CreateSimpleChain(template string, params []string) (*gochains.BaseChain, error) {
	return gochains.NewChainBuilder().
		WithTemplate(template).
		WithParams(params).
		WithModel(llmmodels.ProviderOpenaAI, "gpt-3.5-turbo").
		WithMaxTokens(800).
		WithTemperature(0.7).
		Build()
}

GenerateSimpleAnswer demonstrates how to generate a simple, non-structured text answer.

func GenerateSkillsAnalysis

func GenerateSkillsAnalysis(
	ctx context.Context,
	request SkillGeneratorRequest,
	userID string,
	clientChan chan<- event.ProgressEvent,
) (map[string]any, error)

GenerateSkillsAnalysis generates skills analysis using structured output

Types

type QuestionGeneratorRequest

type QuestionGeneratorRequest struct {
	Position, SeekTraits string
	NumberOfQuestions    int
}

type SimpleAnswerRequest

type SimpleAnswerRequest struct {
	Topic string
}

type SkillGeneratorRequest

type SkillGeneratorRequest struct {
	Position       string
	JobDescription string
	CompanyValues  string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL