diff --git a/internal/config/load.go b/internal/config/load.go index 6e7b9971ed7e13d0f6d58b7a00b0a4d0d7545d82..5c5b2efd09fcde01f06de7a6235157a816178aa0 100644 --- a/internal/config/load.go +++ b/internal/config/load.go @@ -145,16 +145,17 @@ func (c *Config) configureProviders(env env.Env, resolver VariableResolver, know maps.Copy(headers, config.ExtraHeaders) } prepared := ProviderConfig{ - ID: string(p.ID), - Name: p.Name, - BaseURL: p.APIEndpoint, - APIKey: p.APIKey, - Type: p.Type, - Disable: config.Disable, - ExtraHeaders: headers, - ExtraBody: config.ExtraBody, - ExtraParams: make(map[string]string), - Models: p.Models, + ID: string(p.ID), + Name: p.Name, + BaseURL: p.APIEndpoint, + APIKey: p.APIKey, + Type: p.Type, + Disable: config.Disable, + SystemPromptPrefix: config.SystemPromptPrefix, + ExtraHeaders: headers, + ExtraBody: config.ExtraBody, + ExtraParams: make(map[string]string), + Models: p.Models, } switch p.ID { diff --git a/internal/llm/provider/anthropic.go b/internal/llm/provider/anthropic.go index c65a2e95cf1077dbd1b71320501a7e63d693971f..400867a122cd296036f8839740d5c53106a900ee 100644 --- a/internal/llm/provider/anthropic.go +++ b/internal/llm/provider/anthropic.go @@ -70,8 +70,8 @@ func createAnthropicClient(opts providerClientOptions, useBedrock bool) anthropi if useBedrock { anthropicClientOptions = append(anthropicClientOptions, bedrock.WithLoadDefaultConfig(context.Background())) } - for _, header := range opts.extraHeaders { - anthropicClientOptions = append(anthropicClientOptions, option.WithHeaderAdd(header, opts.extraHeaders[header])) + for key, header := range opts.extraHeaders { + anthropicClientOptions = append(anthropicClientOptions, option.WithHeaderAdd(key, header)) } for key, value := range opts.extraBody { anthropicClientOptions = append(anthropicClientOptions, option.WithJSONSet(key, value))