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:
@@ -95,10 +95,12 @@ func (e *AgentEngine) streamThinkingToEventBus(
|
||||
logger.Debugf(ctx, "[Agent][Thinking] Iteration-%d: temp=%.2f, tools=%d, thinking=%v",
|
||||
iteration+1, e.config.Temperature, len(tools), e.config.Thinking)
|
||||
|
||||
parallelToolCalls := true
|
||||
opts := &chat.ChatOptions{
|
||||
Temperature: e.config.Temperature,
|
||||
Tools: tools,
|
||||
Thinking: e.config.Thinking,
|
||||
Temperature: e.config.Temperature,
|
||||
Tools: tools,
|
||||
Thinking: e.config.Thinking,
|
||||
ParallelToolCalls: ¶llelToolCalls,
|
||||
}
|
||||
|
||||
pendingToolCalls := make(map[string]bool)
|
||||
|
||||
Reference in New Issue
Block a user