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

The echarts tool cannot generate the corresponding chart, only the code in echarts format #15163

Closed
5 tasks done
dashing9527 opened this issue Mar 7, 2025 · 7 comments
Closed
5 tasks done

Comments

@dashing9527
Copy link

dashing9527 commented Mar 7, 2025

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • 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": "随机生成一个柱状图"
}

"![](https://some-random-url.com/example-bar-chart.png)\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
@crazywoola
Copy link
Member

Copy link

dosubot bot commented Mar 7, 2025

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:

  1. Ensure that the URL being generated is correct and accessible.
  2. Verify that the server hosting the link is operational.
  3. Check for any network issues that might be preventing access to the link.
  4. 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

@dashing9527
Copy link
Author

试试这个 https://marketplace.dify.ai/plugins/langgenius/echarts

@crazywoola That's what I use

@crazywoola
Copy link
Member

@junjiem Can you take a look at this?

@crazywoola crazywoola reopened this Mar 7, 2025
@junjiem
Copy link
Contributor

junjiem commented Mar 11, 2025

This is not echarts tool problem, it is a problem that the llm capability or prompt in the agent.

@junjiem
Copy link
Contributor

junjiem commented Mar 11, 2025

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.

@dashing9527
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants