fix: fix region detection for bedrock

This commit is contained in:
Kujtim Hoxha
2025-07-30 17:16:37 +02:00
parent 8c9a59c5cb
commit 329c4dafa7
2 changed files with 5 additions and 0 deletions

View File

@@ -189,6 +189,10 @@ func (c *Config) configureProviders(env env.Env, resolver VariableResolver, know
}
continue
}
prepared.ExtraParams["region"] = env.Get("AWS_REGION")
if prepared.ExtraParams["region"] == "" {
prepared.ExtraParams["region"] = env.Get("AWS_DEFAULT_REGION")
}
for _, model := range p.Models {
if !strings.HasPrefix(model.ID, "anthropic.") {
return fmt.Errorf("bedrock provider only supports anthropic models for now, found: %s", model.ID)

View File

@@ -160,6 +160,7 @@ func NewProvider(cfg config.ProviderConfig, opts ...ProviderClientOption) (Provi
apiKey: resolvedAPIKey,
extraHeaders: resolvedExtraHeaders,
extraBody: cfg.ExtraBody,
extraParams: cfg.ExtraParams,
systemPromptPrefix: cfg.SystemPromptPrefix,
model: func(tp config.SelectedModelType) catwalk.Model {
return *config.Get().GetModelByType(tp)