【Agent】No tools for use as expected #5057

Closed
opened 2026-02-21 18:09:11 -05:00 by yindo · 2 comments
Owner

Originally created by @kenneth-bro on GitHub (Aug 15, 2024).

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

0.7.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

在定义Agent的时候,配置工具后,使用gpt-4o和gpt-4o-mini可以正确调用工具,但是使用其他模型,如 deepseek-coder、doubao-lite-128k、moonshot-v1-128k 都无法正确调用工具。 这个是模型的问题还是平台的问题?

image

image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @kenneth-bro on GitHub (Aug 15, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.7.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 在定义Agent的时候,配置工具后,使用gpt-4o和gpt-4o-mini可以正确调用工具,但是使用其他模型,如 deepseek-coder、doubao-lite-128k、moonshot-v1-128k 都无法正确调用工具。 这个是模型的问题还是平台的问题? ![image](https://github.com/user-attachments/assets/92b3bbb6-f38d-44c8-8395-b0a6f88cfa37) ![image](https://github.com/user-attachments/assets/4df4b22e-aea5-45b5-b15d-4780f5199320) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:09:11 -05:00
yindo closed this issue 2026-02-21 18:09:11 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 15, 2024):

@kenneth-bro Hello there! I'm here to help you with any bugs, questions, or contributions while you wait for a human maintainer. Let's tackle this together!

The issue with tools not being invoked correctly when using models like deepseek-coder, doubao-lite-128k, and moonshot-v1-128k in Dify version 0.7.0 (Docker) is a problem with the models. Specifically, the doubao-lite-128k model supports tool invocation, while the moonshot-v1-128k model does not have the ModelFeature.TOOL_CALL feature, indicating it does not support tool invocation [1][2].

To ensure proper tool invocation, you need to verify the configurations and credentials for each model. For example, the moonshot-v1-128k model requires the function_calling_type to be set to tool_call in the credentials:

credentials = {
    'api_key': 'your_api_key',
    'function_calling_type': 'tool_call',
    'context_size': 4096,
    'max_tokens': 512,
    # other necessary credentials
}

Ensure that your credentials dictionary includes 'function_calling_type': 'tool_call' when invoking the model [3].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Aug 15, 2024): <!-- Greeting --> @kenneth-bro Hello there! I'm here to help you with any bugs, questions, or contributions while you wait for a human maintainer. Let's tackle this together! <!-- Answer --> The issue with tools not being invoked correctly when using models like `deepseek-coder`, `doubao-lite-128k`, and `moonshot-v1-128k` in Dify version 0.7.0 (Docker) is a problem with the models. Specifically, the `doubao-lite-128k` model supports tool invocation, while the `moonshot-v1-128k` model does not have the `ModelFeature.TOOL_CALL` feature, indicating it does not support tool invocation <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/model_providers/volcengine_maas/llm/models.py)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/api/core/tools/utils/model_invocation_utils.py)</sup>. To ensure proper tool invocation, you need to verify the configurations and credentials for each model. For example, the `moonshot-v1-128k` model requires the `function_calling_type` to be set to `tool_call` in the credentials: ```yaml credentials = { 'api_key': 'your_api_key', 'function_calling_type': 'tool_call', 'context_size': 4096, 'max_tokens': 512, # other necessary credentials } ``` Ensure that your credentials dictionary includes `'function_calling_type': 'tool_call'` when invoking the model <sup>[[3]](https://github.com/langgenius/dify/issues/5814)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Aug 15, 2024):

Please change this description in English.

See the bot's answer.

@crazywoola commented on GitHub (Aug 15, 2024): Please change this description in English. See the bot's answer.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#5057