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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user