The problem of being unable to select the agent model has occurred. #13219

Closed
opened 2026-02-21 19:11:07 -05:00 by yindo · 11 comments
Owner

Originally created by @planwk on GitHub (Apr 22, 2025).

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

1.1.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

The agent application created by dify studio allows one to select this model. However, in the chatflow application created by the studio, the function calling of the agent node cannot select this model.

This is where the agent application can select this model and these tools.
Image
This is the agent node of the Chatflow application. You cannot select this model.

Image

I changed the fields corresponding to the provider_models table and added "support_function_call": true. However, it still doesn't work.

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @planwk on GitHub (Apr 22, 2025). ### 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 1.1.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce The agent application created by dify studio allows one to select this model. However, in the chatflow application created by the studio, the function calling of the agent node cannot select this model. This is where the agent application can select this model and these tools. ![Image](https://github.com/user-attachments/assets/b3256997-a208-403c-a2ec-bfdf0edf4404) This is the agent node of the Chatflow application. You cannot select this model. ![Image](https://github.com/user-attachments/assets/6c46fdbb-968b-46f8-bdf3-4056b368177d) I changed the fields corresponding to the provider_models table and added "support_function_call": true. However, it still doesn't work. ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug🤔 cant-reproduce labels 2026-02-21 19:11:07 -05:00
yindo closed this issue 2026-02-21 19:11:07 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 22, 2025):

I found a similar issue that might be relevant to your problem. There was an issue titled "Dify 1.2.0 Agent Model Stuck as Function Call and Tool Call Failure Irrespective of Model Configuration" which was resolved by a pull request that fixed an error in mode selection for the agent app [1]. The solution involved ensuring that the agent configuration is correctly set based on the mode, specifically addressing the agentConfig settings.

For your specific issue, ensure that the model you are trying to select supports the necessary tool-calling capabilities. Verify that your model provider credentials are correctly set up in the system settings under Model Providers. Additionally, check the logs for any error messages like ProviderNotInitializeError or ProviderModelCurrentlyNotSupportError, which can provide insights into what might be causing the issue [1].

If you have already modified the provider_models table to include "support_function_call": true and it still doesn't work, double-check the other conditions required for a model to be selectable in the agent node of the Chatflow application. These include ensuring a strategy is selected, tool parameters are correctly set, and any required parameters have a value in the agent_parameters [2].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 22, 2025): <!-- Answer --> I found a similar issue that might be relevant to your problem. There was an issue titled "Dify 1.2.0 Agent Model Stuck as Function Call and Tool Call Failure Irrespective of Model Configuration" which was resolved by a pull request that fixed an error in mode selection for the agent app <sup>[[1]](https://github.com/langgenius/dify/issues/17917)</sup>. The solution involved ensuring that the agent configuration is correctly set based on the mode, specifically addressing the `agentConfig` settings. For your specific issue, ensure that the model you are trying to select supports the necessary tool-calling capabilities. Verify that your model provider credentials are correctly set up in the system settings under **Model Providers**. Additionally, check the logs for any error messages like `ProviderNotInitializeError` or `ProviderModelCurrentlyNotSupportError`, which can provide insights into what might be causing the issue <sup>[[1]](https://github.com/langgenius/dify/issues/17917)</sup>. If you have already modified the `provider_models` table to include `"support_function_call": true` and it still doesn't work, double-check the other conditions required for a model to be selectable in the agent node of the Chatflow application. These include ensuring a strategy is selected, tool parameters are correctly set, and any required parameters have a value in the `agent_parameters` <sup>[[2]](https://github.com/langgenius/dify/blob/main/web/app/components/workflow/nodes/agent/default.ts)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/24347627-274c-4c1b-83d8-07edcb249dad?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/24347627-274c-4c1b-83d8-07edcb249dad?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/24347627-274c-4c1b-83d8-07edcb249dad?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/24347627-274c-4c1b-83d8-07edcb249dad?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/24347627-274c-4c1b-83d8-07edcb249dad?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/24347627-274c-4c1b-83d8-07edcb249dad?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/24347627-274c-4c1b-83d8-07edcb249dad?feedback_type=other)</sup>
Author
Owner

@planwk commented on GitHub (Apr 22, 2025):

@dosu This is quite different from the previous issue. When adding the model, there was no corresponding selection available.

Image
Furthermore, I have examined the logs of the API and plugin services and found no relevant errors.
Are the agent applications and the agent nodes in Chatflow not the same thing?

@planwk commented on GitHub (Apr 22, 2025): @dosu This is quite different from the previous issue. When adding the model, there was no corresponding selection available. ![Image](https://github.com/user-attachments/assets/9d411894-4fdc-42c9-977d-296343713de8) Furthermore, I have examined the logs of the API and plugin services and found no relevant errors. Are the agent applications and the agent nodes in Chatflow not the same thing?
Author
Owner

@dosubot[bot] commented on GitHub (Apr 22, 2025):

Agent applications and agent nodes in Chatflow are not the same thing. They serve different purposes within the Dify platform. Agent applications are standalone applications that utilize agents to perform tasks, while agent nodes are components within a Chatflow application that use agents to handle specific parts of a workflow. The configuration and functionality of agent nodes in Chatflow may differ from those of agent applications, which could explain the discrepancy you're experiencing with model selection.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 22, 2025): <!-- Answer --> Agent applications and agent nodes in Chatflow are not the same thing. They serve different purposes within the Dify platform. Agent applications are standalone applications that utilize agents to perform tasks, while agent nodes are components within a Chatflow application that use agents to handle specific parts of a workflow. The configuration and functionality of agent nodes in Chatflow may differ from those of agent applications, which could explain the discrepancy you're experiencing with model selection. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/fae964ce-22d3-44ca-a9bc-bb7b897177ac?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/fae964ce-22d3-44ca-a9bc-bb7b897177ac?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/fae964ce-22d3-44ca-a9bc-bb7b897177ac?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/fae964ce-22d3-44ca-a9bc-bb7b897177ac?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/fae964ce-22d3-44ca-a9bc-bb7b897177ac?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/fae964ce-22d3-44ca-a9bc-bb7b897177ac?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/fae964ce-22d3-44ca-a9bc-bb7b897177ac?feedback_type=other)</sup>
Author
Owner

@planwk commented on GitHub (Apr 22, 2025):

@dosu I examined the interface and identified the discrepancy. It seems that the models corresponding to the "models/model-types/llm" interface did not return this field.

Image
However, this model is clearly supposed to support function calling. I have tested it with the code agent of Langchain and it does support it.
Could you please tell me how to select this model in the agent node of Chatflow? I need to do this now.

Image

@planwk commented on GitHub (Apr 22, 2025): @dosu I examined the interface and identified the discrepancy. It seems that the models corresponding to the "models/model-types/llm" interface did not return this field. ![Image](https://github.com/user-attachments/assets/0bb33c1d-22c0-4769-820e-d466a8e6f999) However, this model is clearly supposed to support function calling. I have tested it with the code agent of Langchain and it does support it. Could you please tell me how to select this model in the agent node of Chatflow? I need to do this now. ![Image](https://github.com/user-attachments/assets/8c5ce8cb-9adc-4a53-a9d8-e2e1cf94babf)
Author
Owner

@dosubot[bot] commented on GitHub (Apr 22, 2025):

To select the model in the agent node of a Chatflow application, ensure the following steps are completed:

  1. Model Configuration: Verify that the model configuration in System Settings-Model Providers is complete. This includes setting the model parameters and ensuring the model supports function calling. You mentioned that the model supports function calling, so ensure this feature is correctly reflected in the model's configuration.

  2. Interface Update: Modify the models/model-types/llm interface to include function calling support. You can update the get_customizable_model_schema method to append ModelFeature.TOOL_CALL to the model's features if the support_function_call credential is set to True. Additionally, ensure the _add_function_call method sets the function calling type appropriately in the credentials. This ensures the model schema includes function calling capabilities when the credential is provided [1][2].

  3. Agent Node Configuration: In the agent node's code, ensure the model selection logic is correctly implemented. The AgentNode component uses the useConfig hook to retrieve configuration details, including model parameters. Ensure that the models are filtered and mapped based on the FormTypeEnum.modelSelector type, which is crucial for making models selectable within the Chatflow application [3].

By following these steps, you should be able to select the model in the agent node of your Chatflow application.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 22, 2025): <!-- Answer --> To select the model in the agent node of a Chatflow application, ensure the following steps are completed: 1. **Model Configuration**: Verify that the model configuration in **System Settings-Model Providers** is complete. This includes setting the model parameters and ensuring the model supports function calling. You mentioned that the model supports function calling, so ensure this feature is correctly reflected in the model's configuration. 2. **Interface Update**: Modify the `models/model-types/llm` interface to include function calling support. You can update the `get_customizable_model_schema` method to append `ModelFeature.TOOL_CALL` to the model's features if the `support_function_call` credential is set to `True`. Additionally, ensure the `_add_function_call` method sets the function calling type appropriately in the credentials. This ensures the model schema includes function calling capabilities when the credential is provided <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/model_providers/xinference/llm/llm.py)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/model_providers/stepfun/llm/llm.py)</sup>. 3. **Agent Node Configuration**: In the agent node's code, ensure the model selection logic is correctly implemented. The `AgentNode` component uses the `useConfig` hook to retrieve configuration details, including model parameters. Ensure that the models are filtered and mapped based on the `FormTypeEnum.modelSelector` type, which is crucial for making models selectable within the Chatflow application <sup>[[3]](https://github.com/langgenius/dify/blob/main/web/app/components/workflow/nodes/agent/node.tsx)</sup>. By following these steps, you should be able to select the model in the agent node of your Chatflow application. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/a7ebcbe8-990d-470c-b647-cc1f68132b62?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/a7ebcbe8-990d-470c-b647-cc1f68132b62?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/a7ebcbe8-990d-470c-b647-cc1f68132b62?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/a7ebcbe8-990d-470c-b647-cc1f68132b62?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/a7ebcbe8-990d-470c-b647-cc1f68132b62?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/a7ebcbe8-990d-470c-b647-cc1f68132b62?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/a7ebcbe8-990d-470c-b647-cc1f68132b62?feedback_type=other)</sup>
Author
Owner

@planwk commented on GitHub (Apr 22, 2025):

@dosu Should we modify the source code of the Xorbits Inference plugin or the dify one?

@planwk commented on GitHub (Apr 22, 2025): @dosu Should we modify the source code of the Xorbits Inference plugin or the dify one?
Author
Owner

@dosubot[bot] commented on GitHub (Apr 22, 2025):

To address the issue of selecting the model in the agent node of a Chatflow application, you should focus on modifying the Dify codebase rather than the Xorbits Inference plugin. Specifically, ensure that the Dify platform correctly recognizes and supports the function calling capability of the model. This involves:

  1. Updating Model Configuration: Modify the Dify codebase to ensure that the model's function calling capability is correctly reflected in the configuration. This may involve updating the models/model-types/llm interface to include function calling support.

  2. Ensuring Correct Model Selection Logic: Verify that the logic for selecting models in the agent node of Chatflow is correctly implemented. This includes ensuring that the models are filtered and mapped based on their capabilities, such as function calling.

By focusing on these areas within the Dify codebase, you can ensure that the model is selectable in the agent node of your Chatflow application.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 22, 2025): <!-- Answer --> To address the issue of selecting the model in the agent node of a Chatflow application, you should focus on modifying the Dify codebase rather than the Xorbits Inference plugin. Specifically, ensure that the Dify platform correctly recognizes and supports the function calling capability of the model. This involves: 1. **Updating Model Configuration**: Modify the Dify codebase to ensure that the model's function calling capability is correctly reflected in the configuration. This may involve updating the `models/model-types/llm` interface to include function calling support. 2. **Ensuring Correct Model Selection Logic**: Verify that the logic for selecting models in the agent node of Chatflow is correctly implemented. This includes ensuring that the models are filtered and mapped based on their capabilities, such as function calling. By focusing on these areas within the Dify codebase, you can ensure that the model is selectable in the agent node of your Chatflow application. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/30c023e6-d6cf-4bbb-ba06-bcc7b03780e8?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/30c023e6-d6cf-4bbb-ba06-bcc7b03780e8?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/30c023e6-d6cf-4bbb-ba06-bcc7b03780e8?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/30c023e6-d6cf-4bbb-ba06-bcc7b03780e8?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/30c023e6-d6cf-4bbb-ba06-bcc7b03780e8?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/30c023e6-d6cf-4bbb-ba06-bcc7b03780e8?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/30c023e6-d6cf-4bbb-ba06-bcc7b03780e8?feedback_type=other)</sup>
Author
Owner

@planwk commented on GitHub (Apr 22, 2025):

@dosu It would be great if we could just modify the fields in the database. But modifying the source code would be extremely costly.

@planwk commented on GitHub (Apr 22, 2025): @dosu It would be great if we could just modify the fields in the database. But modifying the source code would be extremely costly.
Author
Owner

@dosubot[bot] commented on GitHub (Apr 22, 2025):

Modifying the database fields directly to update model capabilities without changing the source code is not typically supported in Dify. The model selection and capabilities are often tightly integrated with the codebase logic, which means changes in the database alone might not be sufficient to reflect the desired functionality in the application interface.

However, if you want to explore this approach, you could ensure that the provider_models table correctly reflects the model's capabilities, such as setting the support_function_call field to true. This table is crucial for managing model configurations and capabilities [1].

Keep in mind that even if you update the database, the application logic might still need to be adjusted to recognize and utilize these changes, which typically involves modifying the source code. If modifying the source code is not feasible, consider reaching out to the development team for potential feature requests or updates that could accommodate your needs.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 22, 2025): <!-- Answer --> Modifying the database fields directly to update model capabilities without changing the source code is not typically supported in Dify. The model selection and capabilities are often tightly integrated with the codebase logic, which means changes in the database alone might not be sufficient to reflect the desired functionality in the application interface. However, if you want to explore this approach, you could ensure that the `provider_models` table correctly reflects the model's capabilities, such as setting the `support_function_call` field to `true`. This table is crucial for managing model configurations and capabilities <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/models/provider.py)</sup>. Keep in mind that even if you update the database, the application logic might still need to be adjusted to recognize and utilize these changes, which typically involves modifying the source code. If modifying the source code is not feasible, consider reaching out to the development team for potential feature requests or updates that could accommodate your needs. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/43886b80-48eb-40e5-8c19-5f10530c1b03?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/43886b80-48eb-40e5-8c19-5f10530c1b03?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/43886b80-48eb-40e5-8c19-5f10530c1b03?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/43886b80-48eb-40e5-8c19-5f10530c1b03?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/43886b80-48eb-40e5-8c19-5f10530c1b03?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/43886b80-48eb-40e5-8c19-5f10530c1b03?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/43886b80-48eb-40e5-8c19-5f10530c1b03?feedback_type=other)</sup>
Author
Owner

@planwk commented on GitHub (Apr 22, 2025):

@dosu 3q

@planwk commented on GitHub (Apr 22, 2025): @dosu 3q
Author
Owner

@dosubot[bot] commented on GitHub (Apr 22, 2025):

You're welcome! If you have any more questions or need further assistance, feel free to ask. Happy coding!

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 22, 2025): <!-- Answer --> You're welcome! If you have any more questions or need further assistance, feel free to ask. Happy coding! <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/5dff313c-af48-4c0f-b74c-36d94ce093ab?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/5dff313c-af48-4c0f-b74c-36d94ce093ab?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/5dff313c-af48-4c0f-b74c-36d94ce093ab?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/5dff313c-af48-4c0f-b74c-36d94ce093ab?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/5dff313c-af48-4c0f-b74c-36d94ce093ab?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/5dff313c-af48-4c0f-b74c-36d94ce093ab?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/5dff313c-af48-4c0f-b74c-36d94ce093ab?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13219