Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add required as an option for tool_choice in chat/completions api #242

Merged
merged 4 commits into from
Apr 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6731,7 +6731,7 @@ paths:
}
}

main();
main();
response: |
{
"object": "list",
Expand Down Expand Up @@ -6818,7 +6818,7 @@ paths:
console.log(batch);
}

main();
main();
response: &batch_object |
{
"id": "batch_abc123",
Expand Down Expand Up @@ -6897,7 +6897,7 @@ paths:
console.log(batch);
}

main();
main();
response: |
{
"id": "batch_abc123",
Expand Down Expand Up @@ -7523,18 +7523,20 @@ 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.
enum: [none, auto]
`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

Expand Down Expand Up @@ -10001,15 +10003,17 @@ 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.
`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.
enum: [none, auto]
`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

Expand Down
Loading