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

[issue-2503] Support passing toolChoice: null #2536

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion packages/core/core/prompt/prepare-tools-and-tool-choice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function prepareToolsAndToolChoice<
parameters: asSchema(tool.parameters).jsonSchema,
})),
toolChoice:
toolChoice == null
toolChoice === undefined
? { type: 'auto' }
: typeof toolChoice === 'string'
? { type: toolChoice }
Expand Down
1 change: 1 addition & 0 deletions packages/core/core/types/language-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Tool choice for the generation. It supports the following settings:
*/
// TODO rename to ToolChoice once shared/types.ts ToolChoice is gone
export type CoreToolChoice<TOOLS extends Record<string, unknown>> =
| null
| 'auto'
| 'none'
| 'required'
Expand Down