-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: option to disable named tool choice #322
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -95,6 +95,12 @@ export interface LLMConfig { | |||||||||||||||
| temperature?: number | ||||||||||||||||
| maxRetries?: number | ||||||||||||||||
|
|
||||||||||||||||
| /** | ||||||||||||||||
| * remove the tool_choice field from the request. | ||||||||||||||||
| * @note fix "Invalid tool_choice type: 'object'" for some LLMs. | ||||||||||||||||
|
Comment on lines
+99
to
+100
|
||||||||||||||||
| * remove the tool_choice field from the request. | |
| * @note fix "Invalid tool_choice type: 'object'" for some LLMs. | |
| * Disable the named/object tool_choice form when forcing a specific tool. | |
| * When used together with `toolChoiceName`, the client sends `tool_choice: "required"` | |
| * instead of `{ type: "function", function: { name: toolChoiceName } }`, keeping the | |
| * `tool_choice` field but avoiding the object form that some LLMs reject with | |
| * errors like "Invalid tool_choice type: 'object'". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
disableNamedToolChoiceis part ofLLMConfig, but it’s destructured out here and therefore not included in thellmConfigobject persisted to storage. That duplicates config concerns (it then gets stored underadvancedConfig) and means anything reading onlyllmConfigwill miss the flag. Consider keepingdisableNamedToolChoicewithinllmConfigand out ofAdvancedConfigso it persists with the other LLM settings.