feat: initialize project structure with SQLite database, crawler framework, and LLM-based JD analysis integration
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package analyzer
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/hireme/hireme/internal/config"
|
||||
)
|
||||
|
||||
type AnalysisOutput struct {
|
||||
MatchedHighlights []string `json:"matched_highlights"`
|
||||
MissingHighlights []string `json:"missing_highlights"`
|
||||
TailoringSuggestions []string `json:"tailoring_suggestions"`
|
||||
}
|
||||
|
||||
type LLMAnalyzer interface {
|
||||
AnalyzeJD(ctx context.Context, jobTitle, rawContent string) (*AnalysisOutput, error)
|
||||
}
|
||||
|
||||
func NewAnalyzer(cfg *config.Config) (LLMAnalyzer, error) {
|
||||
provider := strings.ToLower(cfg.LLMProvider)
|
||||
switch provider {
|
||||
case "gemini":
|
||||
if cfg.GeminiAPIKey == "" {
|
||||
return nil, fmt.Errorf("GEMINI_API_KEY is required for provider 'gemini'")
|
||||
}
|
||||
return NewGeminiAnalyzer(cfg.GeminiAPIKey), nil
|
||||
case "deepseek":
|
||||
if cfg.DeepSeekAPIKey == "" {
|
||||
return nil, fmt.Errorf("DEEPSEEK_API_KEY is required for provider 'deepseek'")
|
||||
}
|
||||
return NewDeepSeekAnalyzer(cfg.DeepSeekAPIKey, cfg.DeepSeekBaseURL), nil
|
||||
case "mock":
|
||||
return NewMockAnalyzer(), nil
|
||||
default:
|
||||
return NewMockAnalyzer(), nil
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user