on main help sign in
chore: fix custom headers and system prefix
11a90e1Kujtim Hoxha
internal/config/load.go+11−10
@@ -145,16 +145,17 @@ func (c *Config) configureProviders(env env.Env, resolver VariableResolver, know
145 maps.Copy(headers, config.ExtraHeaders)
145 maps.Copy(headers, config.ExtraHeaders)
146 }
146 }
147 prepared := ProviderConfig{
147 prepared := ProviderConfig{
148− ID: string(p.ID),
148+ ID: string(p.ID),
149− Name: p.Name,
149+ Name: p.Name,
150− BaseURL: p.APIEndpoint,
150+ BaseURL: p.APIEndpoint,
151− APIKey: p.APIKey,
151+ APIKey: p.APIKey,
152− Type: p.Type,
152+ Type: p.Type,
153− Disable: config.Disable,
153+ Disable: config.Disable,
154− ExtraHeaders: headers,
154+ SystemPromptPrefix: config.SystemPromptPrefix,
155+ ExtraHeaders: headers,
155− ExtraBody: config.ExtraBody,
156+ ExtraBody: config.ExtraBody,
156− ExtraParams: make(map[string]string),
157+ ExtraParams: make(map[string]string),
157− Models: p.Models,
158+ Models: p.Models,
158 }
159 }
159
160
160 switch p.ID {
161 switch p.ID {
internal/llm/provider/anthropic.go+3−2
@@ -67,8 +67,8 @@ func createAnthropicClient(opts providerClientOptions, useBedrock bool) anthropi
67 if useBedrock {
67 if useBedrock {
68 anthropicClientOptions = append(anthropicClientOptions, bedrock.WithLoadDefaultConfig(context.Background()))
68 anthropicClientOptions = append(anthropicClientOptions, bedrock.WithLoadDefaultConfig(context.Background()))
69 }
69 }
70− for _, header := range opts.extraHeaders {
70+ for key, header := range opts.extraHeaders {
71− anthropicClientOptions = append(anthropicClientOptions, option.WithHeaderAdd(header, opts.extraHeaders[header]))
71+ anthropicClientOptions = append(anthropicClientOptions, option.WithHeaderAdd(key, header))
72 }
72 }
73 for key, value := range opts.extraBody {
73 for key, value := range opts.extraBody {
74 anthropicClientOptions = append(anthropicClientOptions, option.WithJSONSet(key, value))
74 anthropicClientOptions = append(anthropicClientOptions, option.WithJSONSet(key, value))
@@ -223,6 +223,7 @@ func (a *anthropicClient) preparedMessages(messages []anthropic.MessageParam, to
223 }
223 }
224
224
225 systemBlocks := []anthropic.TextBlockParam{}
225 systemBlocks := []anthropic.TextBlockParam{}
226+ slog.Info("Testing", "prefix", a.providerOptions.systemPromptPrefix)
226
227
227 // Add custom system prompt prefix if configured
228 // Add custom system prompt prefix if configured
228 if a.providerOptions.systemPromptPrefix != "" {
229 if a.providerOptions.systemPromptPrefix != "" {