Unify Function Call and Tool Call in Agent Mode
Self Checks
- [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.
1. Is this request related to a challenge you're experiencing? Tell me about your story.
I've been trying to use a custom OpenAI API compatiable API with Dify's Agent Mode, but I've encountered some difficulties. OpenAI has deprecated the function_call parameter in favor of the new tools parameter. However, the current implementation in Dify still distinguishes between function calls and tool calls, which creates confusion and limits functionality.
Specifically, the Agent page in Dify only supports function calls, while the backend code differentiates between function calls and tool calls. This discrepancy makes it challenging to fully utilize the latest OpenAI API features and creates unnecessary complexity in the codebase.
A similar issue has been raised in #13469, which highlights the need for better support of custom models and function calling in Agent Mode. I believe addressing this issue by unifying the handling of function calls and tool calls would resolve both concerns.
2. Additional context or comments
No response
3. Can you help us with this feature?
- [x] I am interested in contributing to this feature.
Hi, @linkedlist771. I'm Dosu, and I'm helping the Dify team manage their backlog. I'm marking this issue as stale.
Issue Summary:
- The issue involves a complication in Dify's Agent Mode due to the distinction between function calls and tool calls.
- OpenAI's recent API changes have deprecated the
function_callparameter, replacing it with thetoolsparameter. - This change has led to compatibility issues with custom OpenAI-compatible APIs.
- You proposed unifying these calls to streamline the codebase and improve compatibility.
- There have been no further comments or developments on this issue.
Next Steps:
- Please let us know if this issue is still relevant to the latest version of the Dify repository by commenting on this issue.
- If there is no further activity, this issue will be automatically closed in 15 days.
Thank you for your understanding and contribution!