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
36.65k stars 4.97k forks source link

Supported When the agent calls workflow tools, the workflow settings directly return the output of the workflow, rather than letting the agent process it based on the return of the tools #6007

Open Hisir0909 opened 3 days ago

Hisir0909 commented 3 days ago

Self Checks

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

I'm trying to use the workflow tool to output some formatted content. I used the direct output mode of the workflow end node in coze, but I don't seem to find this output mode in dify.

2. Additional context or comments

No response

3. Can you help us with this feature?

crazywoola commented 3 days ago

In workflow, you should use End node. I am not quite understand what you described in the title, can you explain it with more details.

Hisir0909 commented 3 days ago

The output of the workflow I designed is: {"operate":"add","agrs":{"id":1,"balance":2}} This is actually constructing a request parameter to modify the system data. At this time, I hope that the agent will directly return the result of the workflow, rather than letting it think again based on the results of the tool.

Hisir0909 commented 3 days ago

I know that I should actually initiate an http request in the workflow using these parameters and finally return only the result of the request. However, due to some previous reasons, I cannot directly initiate an http request. Instead, I have to accept the return value of AI and then the caller can initiate the request himself.

crazywoola commented 3 days ago

You published the workflow as a tool, and call it in an agent right? I think if you want to make sure you get the results correctly from the workflow tool, you should not use agent in this case, you need to use a chatflow to make sure there is no agent call. It has some limitations, because it depends on what flow you make.

Hisir0909 commented 18 hours ago

@crazywoola In chatflow I can use Question Classifier to achieve the effect of function_call, right?

crazywoola commented 10 hours ago

@crazywoola In chatflow I can use Question Classifier to achieve the effect of function_call, right?

Yes, because the Classifier can direct to different tools. You can do it like this. But it's not a mature way. I guess we will support built-in way to do fc.