File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -100,8 +100,9 @@ func NewClient(provider string) IAI {
100100}
101101
102102type AIConfiguration struct {
103- Providers []AIProvider `mapstructure:"providers"`
104- DefaultProvider string `mapstructure:"defaultprovider"`
103+ Providers []AIProvider `mapstructure:"providers"`
104+ DefaultProvider string `mapstructure:"defaultprovider"`
105+ PromptMap map [string ]string `mapstructure:"promptmap"`
105106}
106107
107108type AIProvider struct {
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ type Analysis struct {
4141 Client * kubernetes.Client
4242 Language string
4343 AIClient ai.IAI
44+ PromptMap map [string ]string
4445 Results []common.Result
4546 Errors []string
4647 Namespace string
@@ -159,6 +160,16 @@ func NewAnalysis(
159160 if err := aiClient .Configure (& aiProvider ); err != nil {
160161 return nil , err
161162 }
163+
164+ // Override values from configAI.PromptMap
165+ if len (configAI .PromptMap ) > 0 {
166+ for key , value := range configAI .PromptMap {
167+ if key != "raw" {
168+ ai .PromptMap [key ] = value
169+ }
170+ }
171+ }
172+
162173 a .AIClient = aiClient
163174 a .AnalysisAIProvider = aiProvider .Name
164175 return a , nil
You can’t perform that action at this time.
0 commit comments