Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] 简洁阐述问题 / Concise description of the issue #5148

Open
d597797974 opened this issue Dec 20, 2024 · 1 comment
Open

[BUG] 简洁阐述问题 / Concise description of the issue #5148

d597797974 opened this issue Dec 20, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@d597797974
Copy link

1734678128798

调用/tool/call接口时,报错。

@d597797974 d597797974 added the bug Something isn't working label Dec 20, 2024
Copy link

dosubot bot commented Dec 20, 2024

Hello @d597797974! I'm here to help you with any bugs, questions, or contributions you have. Let's get to the bottom of this together.

The error you're encountering is likely due to the ToolOutput class not being directly serializable by FastAPI's default JSON encoder. In the Langchain-Chatchat project, the BaseToolOutput class is used to handle serialization of tool outputs. This class provides a method to convert the tool's output into a string or JSON format, depending on the format parameter provided during initialization [1].

To resolve the serialization issue, ensure that the ToolOutput (or BaseToolOutput) instance is properly converted to a string or JSON before being returned by the /tool/call endpoint. You can do this by explicitly calling str() on the ToolOutput instance or ensuring it is initialized with the correct format parameter to handle JSON conversion.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant