Tool calling with runnables #7388
Unanswered
KeenanFernandes2000
asked this question in
Q&A
Replies: 1 comment 7 replies
-
I found similar issues that might help you resolve the error you're encountering:
To resolve your issue, make sure that for each tool call in your const messageHistory = [
new HumanMessage("message"),
new AIMessage({
content: "",
tool_calls: [
{
name: "toolName",
id: "tool_id",
args: {},
}
],
}),
new ToolMessage({
name: "toolName",
tool_call_id: "tool_id",
content: "string content",
})
]; Ensure that each To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Checked other resources
Commit to Help
Example Code
Description
I am trying to build a Q and A bot and once all the questions have been answered I want to send it to the analyser tool to qualify that user, but every time the tool gets used by the LLM i get the following error and I'm not sure how to fix it.
1 | export default "unknown";
^
error: 400 An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages: call_SvBE9iyZ69QERnYFsoyRC14h
Troubleshooting URL: https://js.langchain.com/docs/troubleshooting/errors/INVALID_TOOL_RESULTS/
Bun v1.1.33 (Windows x64)
System Info
"@langchain/community": "^0.3.12",
"@langchain/core": "^0.3.18",
"langchain": "^0.3.6",
"@langchain/openai": "^0.3.13",
Beta Was this translation helpful? Give feedback.
All reactions