The echarts tool cannot generate the corresponding chart, only the code in echarts format
Self Checks
- [x] This is only for bug report, if you would like to ask a question, please head to Discussions.
- [x] I have searched for existing issues search for existing issues, including closed ones.
- [x] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- [x] Please do not modify this template :) and fill in all the required fields.
Dify version
1.0.0
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
{
"inputs": {},
"query": "随机生成一个柱状图"
}
"\n\n这是一个基于随机数据生成的柱状图,展示了不同类别(A, B, C, D, E)上的数值变化。从图表中可以看出,从A到E,数值逐渐增加,这可能代表产量、订单量或任何其他度量标准的增长趋势。\n\n如果你希望对特定的数据进行分析或需要进一步的帮助,请提供更具体的信息或数据集。"
### ✔️ Expected Behavior
Generate echarts charts
### ❌ Actual Behavior
A link is returned that cannot be opened and has nothing to do with echarts
Try this https://marketplace.dify.ai/plugins/langgenius/echarts
The issue you're experiencing with the echarts tool not generating the expected chart and instead returning a non-functional link could be related to how Dify processes and returns links for generated charts. Dify uses the create_link_message interface to handle these links, and a link might be non-functional if the URL is incorrect, the server is down, or there are network issues. Additionally, Dify does not support deep links or custom protocol links, which could result in links being rendered as javascript:void(0) and not clickable [1][2].
To address this issue, you might want to check the following:
- Ensure that the URL being generated is correct and accessible.
- Verify that the server hosting the link is operational.
- Check for any network issues that might be preventing access to the link.
- Confirm that the link is properly formatted and not using unsupported protocols.
If these steps do not resolve the issue, it may be necessary to review the implementation code for any potential bugs or misconfigurations.
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
试试这个 https://marketplace.dify.ai/plugins/langgenius/echarts
@crazywoola That's what I use
@junjiem Can you take a look at this?
This is not echarts tool problem, it is a problem that the llm capability or prompt in the agent.
After the agent invokes the tool and returns the result, the agent sends the result to the LLM again for generation. It is better to have a switch at the tool level whether to return the result directly, and the agent decides whether to generate it again according to this parameter.
chatflow should be used to output from the 'direct reply' node after invoking the echarts tool If it is parallel, you need to reference echarts/text after line feed when replying directly This is the result of my test, I hope it can help the people behind
good
@junjiem
Can you teach me how to use the ECharts tool in an agent or workflow? It's not working in Agent.
Can you teach me how to use the ECharts tool in an agent or workflow?您能教我如何在代理或工作流中使用 ECharts 工具吗? It's not working in Agent.它不在代理中工作。
Give it some instructions, such as:
The ECharts chart needs to be output in the echarts code block format, such as: ```echarts { xAxis: { type: 'category', data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] }, yAxis: { type: 'value' }, series: [ { data: [150, 230, 224, 218, 135, 147, 260], type: 'line' } ] }
@junjiem Can you teach me how to use the ECharts tool in an agent or workflow?您能教我如何在代理或工作流中使用 ECharts 工具吗? It's not working in Agent.它不在代理中工作。
Give it some instructions, such as:
The ECharts chart needs to be output in the echarts code block format, such as: ```echarts { xAxis: { type: 'category', data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] }, yAxis: { type: 'value' }, series: [ { data: [150, 230, 224, 218, 135, 147, 260], type: 'line' } ] }
@junjiem Following your advice, I instructed the large model in the prompt to generate a chart for me using the format of a linear table as a reference. However, the large model still failed to generate an actual chart. During the output process, it generated a string of links, but ultimately responded to me with text.
@junjiem Can you teach me how to use the ECharts tool in an agent or workflow?您能教我如何在代理或工作流中使用 ECharts 工具吗? It's not working in Agent.它不在代理中工作。您能教我如何在代理或工作流程中使用 ECharts 工具吗?您能教我如何在代理或工作流程中使用 ECharts 工具吗? 它在代理中不起作用。它不在代理中工作。
Give it some instructions, such as:给它一些指令,例如: The ECharts chart needs to be output in the echarts code block format, such as:
echarts { xAxis: { type: 'category', data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] }, yAxis: { type: 'value' }, series: [ { data: [150, 230, 224, 218, 135, 147, 260], type: 'line' } ] }ECharts 图表需要以 echarts 代码块格式输出,例如:echarts { xAxis: { type: 'category', data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] }, yAxis: { type: 'value' }, series: [ { data: [150, 230, 224, 218, 135, 147, 260], type: 'line' } ] }```@junjiem Following your advice, I instructed the large model in the prompt to generate a chart for me using the format of a linear table as a reference. However, the large model still failed to generate an actual chart. During the output process, it generated a string of links, but ultimately responded to me with text.根据您的建议,我在提示中指示大模型使用线性表格格式为我生成图表。然而,大模型仍然未能生成实际的图表。在输出过程中,它生成了一串链接,但最终向我回应的是文本。
![]()
Switch to a more capable LLM model.
@junjiem Can you teach me how to use the ECharts tool in an agent or workflow?您能教我如何在代理或工作流中使用 ECharts 工具吗? It's not working in Agent.它不在代理中工作。您能教我如何在代理或工作流程中使用 ECharts 工具吗?您能教我如何在代理或工作流程中使用 ECharts 工具吗? 它在代理中不起作用。它不在代理中工作。
Give it some instructions, such as:给它一些指令,例如: The ECharts chart needs to be output in the echarts code block format, such as:
echarts { xAxis: { type: 'category', data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] }, yAxis: { type: 'value' }, series: [ { data: [150, 230, 224, 218, 135, 147, 260], type: 'line' } ] }ECharts 图表需要以 echarts 代码块格式输出,例如:echarts { xAxis: { type: 'category', data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] }, yAxis: { type: 'value' }, series: [ { data: [150, 230, 224, 218, 135, 147, 260], type: 'line' } ] }```@junjiem Following your advice, I instructed the large model in the prompt to generate a chart for me using the format of a linear table as a reference. However, the large model still failed to generate an actual chart. During the output process, it generated a string of links, but ultimately responded to me with text.根据您的建议,我在提示中指示大模型使用线性表格格式为我生成图表。然而,大模型仍然未能生成实际的图表。在输出过程中,它生成了一串链接,但最终向我回应的是文本。
![]()
Switch to a more capable LLM model.
TKS,I switched the model, and it worked.
