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
50.05k stars 7.15k forks source link

【Agent】No tools for use as expected #7320

Closed kenneth-bro closed 2 months ago

kenneth-bro commented 2 months ago

Self Checks

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

dosubot[bot] commented 2 months ago

@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.

crazywoola commented 2 months ago

Please change this description in English.

See the bot's answer.