Documentation
¶
Index ¶
- func CreateSkillAnalysisChain() (*gochains.BaseChain, error)
- func GenerateSimpleAnswer(ctx context.Context, clientChan chan<- event.ProgressEvent) (interface{}, error)
- func GenerateSkillsAnalysis(ctx context.Context, request SkillGeneratorRequest, userID string, ...) (map[string]any, error)
- type QuestionGeneratorRequest
- type SimpleAnswerRequest
- type SkillGeneratorRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateSkillAnalysisChain ¶
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 SimpleAnswerRequest ¶
type SimpleAnswerRequest struct {
Topic string
}
type SkillGeneratorRequest ¶
Click to show internal directories.
Click to hide internal directories.