feat(chat): add ParallelToolCalls option to ChatOptions and update related functionality

- Introduced a new ParallelToolCalls field in ChatOptions to control parallel execution of tool calls.
- Updated the BuildChatCompletionRequest method to handle the new ParallelToolCalls option, ensuring it is correctly propagated in requests.
- Enhanced the streamThinkingToEventBus function to utilize the ParallelToolCalls setting.
- Added comprehensive tests to validate the behavior of ParallelToolCalls in various scenarios, ensuring correct propagation and default handling.
This commit is contained in:
wizardchen
2026-03-24 18:08:03 +08:00
committed by lyingbug
parent af2956fdf1
commit de0169d7c0
4 changed files with 138 additions and 14 deletions
+5
View File
@@ -208,6 +208,11 @@ func (c *RemoteAPIChat) BuildChatCompletionRequest(messages []Message, opts *Cha
}
}
// 处理 ParallelToolCalls
if opts.ParallelToolCalls != nil {
req.ParallelToolCalls = *opts.ParallelToolCalls
}
// 处理 ToolChoice(标准实现)
if opts.ToolChoice != "" {
switch opts.ToolChoice {