langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
51.86k stars 7.52k forks source link

Why do workflow tools need to return JSON and TEXT two same results? #10783

Open swingchen01 opened 4 hours ago

swingchen01 commented 4 hours ago

Self Checks

1. Is this request related to a challenge you're experiencing? Tell me about your story.

Workflow tools return JSON and TEXT two same results, are there any special scenarios to consider? This will cause the FunctionCallAgentRunner to provide the duplicate tool results to the LLM"s API, which will take up twice the number of tokens.

2. Additional context or comments

If two same result is no special purpose, this logic will bring more performance consumption, more token consumption and fees, and more LLM context occupation

3. Can you help us with this feature?

dosubot[bot] commented 4 hours ago

I found two similar discussions regarding the issue of workflow tools returning duplicate results in JSON and TEXT formats:

  1. Why do workflow tools need to return two identical results? One is JSON, and the other is TEXT, which is currently unsolved and was last updated on November 9, 2024 [1].

  2. How to resolve the issue where the agent tool invocation returns duplicate response content, which is also unsolved and was last updated on September 9, 2024 [2].

These discussions might provide additional insights or context regarding the rationale behind this design choice and any potential solutions or workarounds.

To continue talking to Dosu, mention @dosu.