From bc425facc38f6100249dfe217a152e99707a54c9 Mon Sep 17 00:00:00 2001 From: Brian Zhang Date: Thu, 25 Apr 2024 09:24:37 -0700 Subject: [PATCH 1/4] add required as an option for tool_choice in chat/completions api --- openapi.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openapi.yaml b/openapi.yaml index 888df352..e1cc2eb9 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -7534,7 +7534,8 @@ components: description: > `none` means the model will not call a function and instead generates a message. `auto` means the model can pick between generating a message or calling a function. - enum: [none, auto] + `required` means the model must pick a function to call. + enum: [none, auto, required] - $ref: "#/components/schemas/ChatCompletionNamedToolChoice" x-oaiExpandable: true From 72e092b52baf7f9a236ef7b591f177c19b21107b Mon Sep 17 00:00:00 2001 From: Erin Kavanaugh Date: Thu, 25 Apr 2024 15:32:34 -0700 Subject: [PATCH 2/4] update with assistants change --- openapi.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index e1cc2eb9..a362d879 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -10009,8 +10009,9 @@ components: - type: string description: > `none` means the model will not call a function and instead generates a message. - `auto` means the model can pick between generating a message or calling a function. - enum: [none, auto] + `auto` means the model can pick between generating a message or calling a function or tool. + `required` means the model must pick one of the available tools or functions before responding to the user. + enum: [none, auto, required] - $ref: "#/components/schemas/AssistantsNamedToolChoice" x-oaiExpandable: true From d80fc6c1ffd1d02499901a39140a635a6e1d5335 Mon Sep 17 00:00:00 2001 From: Erin Kavanaugh Date: Thu, 25 Apr 2024 15:40:19 -0700 Subject: [PATCH 3/4] update description text --- openapi.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/openapi.yaml b/openapi.yaml index a362d879..858438b3 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -10003,6 +10003,7 @@ components: Controls which (if any) tool is called by the model. `none` means the model will not call any tools and instead generates a message. `auto` is the default value and means the model can pick between generating a message or calling a tool. + `required` means the model must pick one of the available tools or functions before responding to the user. Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. oneOf: From c3bd52f9726f03c01773aa89571154738b77bac5 Mon Sep 17 00:00:00 2001 From: Brian Zhang Date: Thu, 25 Apr 2024 16:44:52 -0700 Subject: [PATCH 4/4] update description for tool_choice param to indicate parallel function calling --- openapi.yaml | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 858438b3..46ea760a 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -6731,7 +6731,7 @@ paths: } } - main(); + main(); response: | { "object": "list", @@ -6818,7 +6818,7 @@ paths: console.log(batch); } - main(); + main(); response: &batch_object | { "id": "batch_abc123", @@ -6897,7 +6897,7 @@ paths: console.log(batch); } - main(); + main(); response: | { "id": "batch_abc123", @@ -7523,18 +7523,19 @@ components: ChatCompletionToolChoiceOption: description: | - Controls which (if any) function is called by the model. - `none` means the model will not call a function and instead generates a message. - `auto` means the model can pick between generating a message or calling a function. - Specifying a particular function via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that function. + Controls which (if any) tool is called by the model. + `none` means the model will not call any tool and instead generates a message. + `auto` means the model can pick between generating a message or calling one or more tools. + `required` means the model must call one or more tools. + Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - `none` is the default when no functions are present. `auto` is the default if functions are present. + `none` is the default when no tools are present. `auto` is the default if tools are present. oneOf: - type: string description: > - `none` means the model will not call a function and instead generates a message. - `auto` means the model can pick between generating a message or calling a function. - `required` means the model must pick a function to call. + `none` means the model will not call any tool and instead generates a message. + `auto` means the model can pick between generating a message or calling one or more tools. + `required` means the model must call one or more tools. enum: [none, auto, required] - $ref: "#/components/schemas/ChatCompletionNamedToolChoice" x-oaiExpandable: true @@ -10002,16 +10003,16 @@ components: description: | Controls which (if any) tool is called by the model. `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling a tool. - `required` means the model must pick one of the available tools or functions before responding to the user. + `auto` is the default value and means the model can pick between generating a message or calling one or more tools. + `required` means the model must call one or more tools before responding to the user. Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. oneOf: - type: string description: > - `none` means the model will not call a function and instead generates a message. - `auto` means the model can pick between generating a message or calling a function or tool. - `required` means the model must pick one of the available tools or functions before responding to the user. + `none` means the model will not call any tools and instead generates a message. + `auto` means the model can pick between generating a message or calling one or more tools. + `required` means the model must call one or more tools before responding to the user. enum: [none, auto, required] - $ref: "#/components/schemas/AssistantsNamedToolChoice" x-oaiExpandable: true