feat: implement YAML-based configuration, .env support, and customizable prompt templates for AI analysis
This commit is contained in:
@@ -9,8 +9,9 @@ import (
|
||||
)
|
||||
|
||||
type FilterConfig struct {
|
||||
HardKeywords []string `yaml:"hard_keywords"`
|
||||
ScoringWeights []filter.KeywordWeight `yaml:"scoring_weights"`
|
||||
HardKeywords []string `yaml:"hard_keywords"`
|
||||
AnalysisThreshold float64 `yaml:"analysis_threshold"`
|
||||
ScoringWeights []filter.KeywordWeight `yaml:"scoring_weights"`
|
||||
}
|
||||
|
||||
func LoadFilterConfig(path string) (*FilterConfig, error) {
|
||||
@@ -20,6 +21,8 @@ func LoadFilterConfig(path string) (*FilterConfig, error) {
|
||||
}
|
||||
|
||||
var cfg FilterConfig
|
||||
// Default threshold if not specified
|
||||
cfg.AnalysisThreshold = 25.0
|
||||
if err := yaml.Unmarshal(data, &cfg); err != nil {
|
||||
return nil, fmt.Errorf("failed to unmarshal filter config: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user