on main help sign in
Merge pull request #352 from charmbracelet/fix_providers
1050005Kujtim 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+2−2
@@ -70,8 +70,8 @@ func createAnthropicClient(opts providerClientOptions, useBedrock bool) anthropi
70 if useBedrock {
70 if useBedrock {
71 anthropicClientOptions = append(anthropicClientOptions, bedrock.WithLoadDefaultConfig(context.Background()))
71 anthropicClientOptions = append(anthropicClientOptions, bedrock.WithLoadDefaultConfig(context.Background()))
72 }
72 }
73− for _, header := range opts.extraHeaders {
73+ for key, header := range opts.extraHeaders {
74− anthropicClientOptions = append(anthropicClientOptions, option.WithHeaderAdd(header, opts.extraHeaders[header]))
74+ anthropicClientOptions = append(anthropicClientOptions, option.WithHeaderAdd(key, header))
75 }
75 }
76 for key, value := range opts.extraBody {
76 for key, value := range opts.extraBody {
77 anthropicClientOptions = append(anthropicClientOptions, option.WithJSONSet(key, value))
77 anthropicClientOptions = append(anthropicClientOptions, option.WithJSONSet(key, value))