Commit 802de113 by heheer Committed by GitHub

fix runtool empty message (#4911)

* fix runtool empty message

* del unused code

* fix
parent b4ecfb0b
...@@ -86,7 +86,6 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise< ...@@ -86,7 +86,6 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
}); });
// Check interactive entry // Check interactive entry
const interactiveResponse = lastInteractive;
props.node.isEntry = false; props.node.isEntry = false;
const hasReadFilesTool = toolNodes.some( const hasReadFilesTool = toolNodes.some(
(item) => item.flowNodeType === FlowNodeTypeEnum.readFiles (item) => item.flowNodeType === FlowNodeTypeEnum.readFiles
...@@ -143,7 +142,7 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise< ...@@ -143,7 +142,7 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
}) })
} }
]; ];
if (interactiveResponse) { if (lastInteractive && isEntry) {
return value.slice(0, -2); return value.slice(0, -2);
} }
return value; return value;
...@@ -183,7 +182,7 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise< ...@@ -183,7 +182,7 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
toolModel, toolModel,
maxRunToolTimes: 30, maxRunToolTimes: 30,
messages: adaptMessages, messages: adaptMessages,
interactiveEntryToolParams: interactiveResponse?.toolParams interactiveEntryToolParams: lastInteractive?.toolParams
}); });
} }
if (toolModel.functionCall) { if (toolModel.functionCall) {
...@@ -194,7 +193,7 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise< ...@@ -194,7 +193,7 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
toolNodes, toolNodes,
toolModel, toolModel,
messages: adaptMessages, messages: adaptMessages,
interactiveEntryToolParams: interactiveResponse?.toolParams interactiveEntryToolParams: lastInteractive?.toolParams
}); });
} }
...@@ -224,7 +223,7 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise< ...@@ -224,7 +223,7 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
toolNodes, toolNodes,
toolModel, toolModel,
messages: adaptMessages, messages: adaptMessages,
interactiveEntryToolParams: interactiveResponse?.toolParams interactiveEntryToolParams: lastInteractive?.toolParams
}); });
})(); })();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment