-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Run failed: Failed to invoke tool: Object of type FileVar is not JSON serializable #9386
Comments
Hello, @hufangdong86! I'm here to assist you with any bugs, questions, or contributions. I can help you while waiting for a human maintainer. To resolve the error "Object of type FileVar is not JSON serializable" in Dify version 0.8.3-0.9.2, you need to ensure that def _convert_tool_messages(self, messages: list[ToolInvokeMessage]) -> tuple[str, list[dict], list[dict]]:
"""
Convert ToolInvokeMessages into tuple[plain_text, files, json]
"""
# transform message and handle file storage
messages = ToolFileMessageTransformer.transform_tool_invoke_messages(
messages=messages,
user_id=self.user_id,
tenant_id=self.tenant_id,
conversation_id=None,
)
# extract plain text and files
files = self._extract_tool_response_binary(messages)
plain_text = self._extract_tool_response_text(messages)
json = self._extract_tool_response_json(messages)
# Convert FileVar objects to dictionaries
files_as_dicts = [file_var.to_dict() for file_var in files]
return plain_text, files_as_dicts, json This change ensures that the |
Version 0.6.11 is normal, but it becomes abnormal from version 0.8.2 onwards. |
@dosu def _convert_tool_messages(self, messages: list[ToolInvokeMessage]) -> tuple[str, list[dict], list[dict]]:
But the chart is not displayed. |
Hello! Could you provide the minimal DSL that can reproduce this issue? |
To address the issue where the chart is not displayed after making the Here are a few steps to troubleshoot and potentially resolve the issue:
If these steps do not resolve the issue, there might be a change in how data is handled between versions 0.6.11 and 0.8.2 that affects chart rendering. Reviewing the release notes or change logs for these versions might provide additional insights into any changes that could impact chart display. |
charts is a workflow |
@laipz8200 Hello, have you located the issue? |
It will be fixed in v0.10.0. If you want, you can try v0.10.0-beta3 before we release it. |
Self Checks
Dify version
0.8.3-0.9.2
Cloud or Self Hosted
Cloud, Self Hosted (Docker), Self Hosted (Source)
Steps to reproduce
✔️ Expected Behavior
No response
❌ Actual Behavior
No response
The text was updated successfully, but these errors were encountered: