mirror of
https://github.com/charmbracelet/crush.git
synced 2025-08-02 05:20:46 +03:00
fix: fix region detection for bedrock
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user