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

View File

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

View File

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