From 359eeb33b08b371451f216d1e21dd3334ec15f36 Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Thu, 6 Jun 2024 14:55:21 -0400 Subject: [PATCH] feat(api): updates (#887) --- .stats.yml | 2 +- src/resources/beta/threads/runs/runs.ts | 14 ++++++++++++++ src/resources/beta/threads/threads.ts | 7 +++++++ src/resources/chat/completions.ts | 7 +++++++ tests/api-resources/beta/threads/runs/runs.test.ts | 1 + tests/api-resources/beta/threads/threads.test.ts | 1 + tests/api-resources/chat/completions.test.ts | 1 + 7 files changed, 32 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 11d2b0b18..eb81a249f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 64 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-0577fd0d08da6b867b002a5accd45f7116ef91c4940b41cf45dc479938c77163.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-ff436357b12348b7c1c930469332a79cd23ac6ec537e645c411893c42de42e57.yml diff --git a/src/resources/beta/threads/runs/runs.ts b/src/resources/beta/threads/runs/runs.ts index 9e44ccfe5..ed5a5ff68 100644 --- a/src/resources/beta/threads/runs/runs.ts +++ b/src/resources/beta/threads/runs/runs.ts @@ -402,6 +402,13 @@ export interface Run { */ object: 'thread.run'; + /** + * Whether to enable + * [parallel function calling](https://platform.openai.com/docs/guides/function-calling) + * during tool use. + */ + parallel_tool_calls: boolean; + /** * Details on the action required to continue the run. Will be `null` if no action * is required. @@ -685,6 +692,13 @@ export interface RunCreateParamsBase { | 'gpt-3.5-turbo-16k-0613' | null; + /** + * Whether to enable + * [parallel function calling](https://platform.openai.com/docs/guides/function-calling) + * during tool use. + */ + parallel_tool_calls?: boolean; + /** * Specifies the format that the model must output. Compatible with * [GPT-4o](https://platform.openai.com/docs/models/gpt-4o), diff --git a/src/resources/beta/threads/threads.ts b/src/resources/beta/threads/threads.ts index 9d27b0328..6978e6eb5 100644 --- a/src/resources/beta/threads/threads.ts +++ b/src/resources/beta/threads/threads.ts @@ -560,6 +560,13 @@ export interface ThreadCreateAndRunParamsBase { | 'gpt-3.5-turbo-16k-0613' | null; + /** + * Whether to enable + * [parallel function calling](https://platform.openai.com/docs/guides/function-calling) + * during tool use. + */ + parallel_tool_calls?: boolean; + /** * Specifies the format that the model must output. Compatible with * [GPT-4o](https://platform.openai.com/docs/models/gpt-4o), diff --git a/src/resources/chat/completions.ts b/src/resources/chat/completions.ts index cbf7bcc2c..eeaab3d70 100644 --- a/src/resources/chat/completions.ts +++ b/src/resources/chat/completions.ts @@ -757,6 +757,13 @@ export interface ChatCompletionCreateParamsBase { */ n?: number | null; + /** + * Whether to enable + * [parallel function calling](https://platform.openai.com/docs/guides/function-calling) + * during tool use. + */ + parallel_tool_calls?: boolean; + /** * Number between -2.0 and 2.0. Positive values penalize new tokens based on * whether they appear in the text so far, increasing the model's likelihood to diff --git a/tests/api-resources/beta/threads/runs/runs.test.ts b/tests/api-resources/beta/threads/runs/runs.test.ts index 3ee6ecb4e..5aba82ff8 100644 --- a/tests/api-resources/beta/threads/runs/runs.test.ts +++ b/tests/api-resources/beta/threads/runs/runs.test.ts @@ -124,6 +124,7 @@ describe('resource runs', () => { max_prompt_tokens: 256, metadata: {}, model: 'gpt-4-turbo', + parallel_tool_calls: true, response_format: 'none', stream: false, temperature: 1, diff --git a/tests/api-resources/beta/threads/threads.test.ts b/tests/api-resources/beta/threads/threads.test.ts index ebc78f357..85f89533c 100644 --- a/tests/api-resources/beta/threads/threads.test.ts +++ b/tests/api-resources/beta/threads/threads.test.ts @@ -213,6 +213,7 @@ describe('resource threads', () => { max_prompt_tokens: 256, metadata: {}, model: 'gpt-4-turbo', + parallel_tool_calls: true, response_format: 'none', stream: false, temperature: 1, diff --git a/tests/api-resources/chat/completions.test.ts b/tests/api-resources/chat/completions.test.ts index 21277e1d6..9404e9e18 100644 --- a/tests/api-resources/chat/completions.test.ts +++ b/tests/api-resources/chat/completions.test.ts @@ -34,6 +34,7 @@ describe('resource completions', () => { logprobs: true, max_tokens: 0, n: 1, + parallel_tool_calls: true, presence_penalty: -2, response_format: { type: 'json_object' }, seed: -9223372036854776000,