main: 增强工具调用与上下文日志记录
- 添加 `disable_tools` 选项,支持达到调用上限后禁用工具 - 增加工具调用与结果的日志记录,提升调试信息 - 优化上下文构建,记录已加载的消息信息 - 完善流式消息推送逻辑,支持 `message.delta` 类型
This commit is contained in:
@@ -202,9 +202,9 @@ class RunLoop
|
||||
'should_stop' => fn () => $this->isCanceled($sessionId, $runId),
|
||||
];
|
||||
|
||||
// 达到工具调用上限后,强制禁用工具调用,避免再次触发 TOOL_CALL_LIMIT 错误
|
||||
// 达到工具调用上限后,禁用工具列表,避免再次触发 TOOL_CALL_LIMIT 错误
|
||||
if ($toolCallCount >= $this->maxToolCalls) {
|
||||
$options['tool_choice'] = 'none';
|
||||
$options['disable_tools'] = true;
|
||||
}
|
||||
|
||||
return $options;
|
||||
|
||||
Reference in New Issue
Block a user