Skip to content

Commit 9e77443

Browse files
committed
fix: disable sdk retries because we handle retries ourselves
1 parent bb0bc62 commit 9e77443

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

providers/anthropic/anthropic.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ func WithHTTPClient(client option.HTTPClient) Option {
122122

123123
func (a *provider) LanguageModel(ctx context.Context, modelID string) (fantasy.LanguageModel, error) {
124124
clientOptions := make([]option.RequestOption, 0, 5+len(a.options.headers))
125+
clientOptions = append(clientOptions, option.WithMaxRetries(0))
126+
125127
if a.options.apiKey != "" && !a.options.useBedrock {
126128
clientOptions = append(clientOptions, option.WithAPIKey(a.options.apiKey))
127129
}

providers/openai/openai.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ func WithUseResponsesAPI() Option {
134134
// LanguageModel implements fantasy.Provider.
135135
func (o *provider) LanguageModel(_ context.Context, modelID string) (fantasy.LanguageModel, error) {
136136
openaiClientOptions := make([]option.RequestOption, 0, 5+len(o.options.headers)+len(o.options.sdkOptions))
137+
openaiClientOptions = append(openaiClientOptions, option.WithMaxRetries(0))
137138

138139
if o.options.apiKey != "" {
139140
openaiClientOptions = append(openaiClientOptions, option.WithAPIKey(o.options.apiKey))

0 commit comments

Comments
 (0)