When I use the tool in Agent, it returns OPEN AI 400 Bad Request. #20457
Replies: 6 comments 3 replies
-
The error you're encountering, To resolve this issue, ensure that for every Here's a quick example to illustrate how to format a tool call and its response correctly: msgs: List = [
HumanMessage("Example question?"),
AIMessage(
content="",
tool_calls=[
ToolCall(
name="ExampleTool",
args={"key": "value"},
id="unique_id",
)
],
),
ToolMessage("Example response", tool_call_id="unique_id"),
] In this example, a Make sure to implement logic that tracks these IDs and correctly associates responses with their calls, especially if you're dynamically generating tool calls and responses. This should help in resolving the Sources
|
Beta Was this translation helpful? Give feedback.
-
Any update on it? |
Beta Was this translation helpful? Give feedback.
-
any solution??? |
Beta Was this translation helpful? Give feedback.
-
Any update? |
Beta Was this translation helpful? Give feedback.
-
@im facing the issye can someone help me here |
Beta Was this translation helpful? Give feedback.
-
i already fixed it, is there a man? who want to solve it |
Beta Was this translation helpful? Give feedback.
-
Checked other resources
Commit to Help
Example Code
Description
I want to integrate Google search into my chatbot and use streaming output. It returned the following error:
openai.BadRequestError: Error code: 400
.I searched on both Google and Github but did not find any relevant information.
The complete return information is:
System Info
System Information
Package Information
Beta Was this translation helpful? Give feedback.
All reactions