update task-loop type

This commit is contained in:
锦恢 2025-05-11 23:49:39 +08:00
parent 942755b3e6
commit 8f6d431ef1
3 changed files with 7 additions and 7 deletions

View File

@ -359,11 +359,11 @@ export class TaskLoop {
pinkLog('调用工具数量:' + this.streamingToolCalls.value.length);
for (const toolCall of this.streamingToolCalls.value || []) {
for (let toolCall of this.streamingToolCalls.value || []) {
const toolCallResult = await handleToolCalls(toolCall);
this.onToolCalled(toolCallResult);
toolCall = this.onToolCall(toolCall);
let toolCallResult = await handleToolCalls(toolCall);
toolCallResult = this.onToolCalled(toolCallResult);
if (toolCallResult.state === MessageState.ParseJsonError) {
// 如果是因为解析 JSON 错误,则重新开始

View File

@ -1,6 +1,6 @@
{
"name": "openmcp-sdk",
"version": "0.0.3",
"version": "0.0.4",
"description": "openmcp-sdk",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"

View File

@ -104,8 +104,8 @@ export class TaskLoop {
* @description toolcall
* @param handler
*/
registerOnToolCalled(handler: (toolCallResult: ToolCallResult) => void): void;
registerOnToolCalled(handler: (toolCallResult: ToolCallResult) => ToolCallResult): void;
/**
* @description toolcall
* @param handler