Explorar o código

fix: change tool_choice from required to auto for native protocol (#9242)

Daniel hai 1 mes
pai
achega
5069ce92a0
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/core/task/Task.ts

+ 1 - 1
src/core/task/Task.ts

@@ -2957,7 +2957,7 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
 			mode: mode,
 			mode: mode,
 			taskId: this.taskId,
 			taskId: this.taskId,
 			// Include tools and tool protocol when using native protocol and model supports it
 			// Include tools and tool protocol when using native protocol and model supports it
-			...(shouldIncludeTools ? { tools: allTools, tool_choice: "required", toolProtocol } : {}),
+			...(shouldIncludeTools ? { tools: allTools, tool_choice: "auto", toolProtocol } : {}),
 		}
 		}
 
 
 		// The provider accepts reasoning items alongside standard messages; cast to the expected parameter type.
 		// The provider accepts reasoning items alongside standard messages; cast to the expected parameter type.