Closed cnevelle-blueprint closed 6 months ago
🤖
Hello @cnevelle-blueprint,
I'm Dosu, a bot designed to assist with debugging, answering questions, and helping users like you become contributors. While we're waiting for a human maintainer to assist you, I'm here to help as best I can. Looking forward to working together to resolve your issue!
Based on the error message you provided, it seems like the issue is related to the tool_outputs
field in the request body. The error message indicates that a string type was expected for the output
field of the first tool output, but a different type was provided.
In the invoke
method of the OpenAIAssistantRunnable
class, the tool_outputs
field is expected to be a list of dictionaries, where each dictionary represents the output of a tool. Each dictionary should have an output
field that is a string.
Here is an example of how the tool_outputs
field should be structured:
tool_outputs = [
{"output": "tool1 output"},
{"output": "tool2 output"},
...
]
In your research_tool
function, you are adding multiple tools to the tools
list and then passing this list to the AgentExecutor
and OpenAIAssistantRunnable
. However, it's not clear from the provided code how the outputs of these tools are structured and whether they meet the expected format.
To resolve the issue, you should ensure that the outputs of all tools added to the tools
list are strings. If a tool's output is not a string, you should convert it to a string before adding it to the tools
list.
If you are still facing the issue, please provide more details about the tools you are using and how their outputs are structured. This will help in identifying the exact cause of the issue and providing a more accurate solution.
For more information about the invoke
method and the expected format of the tool_outputs
field, you can refer to the OpenAIAssistantRunnable class in the LangChain codebase.
facing the same issue
System Info
Python 3.11 running locally in PyCharm.
Who can help?
@hwchase17 @agola11
Information
Related Components
Reproduction
Expected behavior
I am looking to have my agent run using the Assistants API. Instead, I receive the following error: