diff --git a/.stats.yml b/.stats.yml index 49961a7f..d93eaabd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 3 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic-fb94a03f85580f7eacef034518becfb463502e6d74b0f7932f6153239de23a5b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic-209cf750b141ebe030a31486ce555fa23b87436cd4235e997b989dfe70dd1b0b.yml diff --git a/src/resources/beta/prompt-caching/messages.ts b/src/resources/beta/prompt-caching/messages.ts index 77f4d475..4668d11d 100644 --- a/src/resources/beta/prompt-caching/messages.ts +++ b/src/resources/beta/prompt-caching/messages.ts @@ -583,6 +583,14 @@ export namespace MessageCreateParams { */ export interface ToolChoiceAuto { type: 'auto'; + + /** + * Whether to disable parallel tool use. + * + * Defaults to `false`. If set to `true`, the model will output at most one tool + * use. + */ + disable_parallel_tool_use?: boolean; } /** @@ -590,6 +598,14 @@ export namespace MessageCreateParams { */ export interface ToolChoiceAny { type: 'any'; + + /** + * Whether to disable parallel tool use. + * + * Defaults to `false`. If set to `true`, the model will output exactly one tool + * use. + */ + disable_parallel_tool_use?: boolean; } /** @@ -602,6 +618,14 @@ export namespace MessageCreateParams { name: string; type: 'tool'; + + /** + * Whether to disable parallel tool use. + * + * Defaults to `false`. If set to `true`, the model will output exactly one tool + * use. + */ + disable_parallel_tool_use?: boolean; } export type MessageCreateParamsNonStreaming = PromptCachingMessagesAPI.MessageCreateParamsNonStreaming; diff --git a/src/resources/messages.ts b/src/resources/messages.ts index 2bcd89a1..9c5e46d7 100644 --- a/src/resources/messages.ts +++ b/src/resources/messages.ts @@ -690,6 +690,14 @@ export namespace MessageCreateParams { */ export interface ToolChoiceAuto { type: 'auto'; + + /** + * Whether to disable parallel tool use. + * + * Defaults to `false`. If set to `true`, the model will output at most one tool + * use. + */ + disable_parallel_tool_use?: boolean; } /** @@ -697,6 +705,14 @@ export namespace MessageCreateParams { */ export interface ToolChoiceAny { type: 'any'; + + /** + * Whether to disable parallel tool use. + * + * Defaults to `false`. If set to `true`, the model will output exactly one tool + * use. + */ + disable_parallel_tool_use?: boolean; } /** @@ -709,6 +725,14 @@ export namespace MessageCreateParams { name: string; type: 'tool'; + + /** + * Whether to disable parallel tool use. + * + * Defaults to `false`. If set to `true`, the model will output exactly one tool + * use. + */ + disable_parallel_tool_use?: boolean; } export type MessageCreateParamsNonStreaming = MessagesAPI.MessageCreateParamsNonStreaming; diff --git a/tests/api-resources/beta/prompt-caching/messages.test.ts b/tests/api-resources/beta/prompt-caching/messages.test.ts index e0e73f98..e7e2fada 100644 --- a/tests/api-resources/beta/prompt-caching/messages.test.ts +++ b/tests/api-resources/beta/prompt-caching/messages.test.ts @@ -34,7 +34,7 @@ describe('resource messages', () => { stream: false, system: [{ text: "Today's date is 2024-06-01.", type: 'text', cache_control: { type: 'ephemeral' } }], temperature: 1, - tool_choice: { type: 'auto' }, + tool_choice: { type: 'auto', disable_parallel_tool_use: true }, tools: [ { input_schema: { diff --git a/tests/api-resources/messages.test.ts b/tests/api-resources/messages.test.ts index 5592a7c4..870e9b53 100644 --- a/tests/api-resources/messages.test.ts +++ b/tests/api-resources/messages.test.ts @@ -34,7 +34,7 @@ describe('resource messages', () => { stream: false, system: [{ text: "Today's date is 2024-06-01.", type: 'text' }], temperature: 1, - tool_choice: { type: 'auto' }, + tool_choice: { type: 'auto', disable_parallel_tool_use: true }, tools: [ { input_schema: {