Skip to content

Commit

Permalink
feat: allow a default timeout to be set for clients (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot authored and RobertCraigie committed Aug 23, 2023
1 parent 0fc31f4 commit 1c5b2e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core.ts
Expand Up @@ -135,7 +135,7 @@ export abstract class APIClient {
constructor({
baseURL,
maxRetries,
timeout = 60 * 1000, // 60s
timeout = 600000, // 10 minutes
httpAgent,
fetch: overridenFetch,
}: {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Expand Up @@ -92,7 +92,7 @@ export class Anthropic extends Core.APIClient {

super({
baseURL: options.baseURL!,
timeout: options.timeout,
timeout: options.timeout ?? 600000 /* 10 minutes */,
httpAgent: options.httpAgent,
maxRetries: options.maxRetries,
fetch: options.fetch,
Expand Down

0 comments on commit 1c5b2e2

Please sign in to comment.