使用Dify 1.0.1版本的Agent节点配置functioncalling执行异常 #108

Open
opened 2026-02-16 11:19:46 -05:00 by yindo · 3 comments
Owner

Originally created by @Jackie-SA on GitHub (Mar 12, 2025).

1、Agent节点配置:

  • Agent节点的策略functioncalling
  • 模型qwen2.5
  • 输入:当前时间

2、预留执行异常:
Run failed: Failed to transform agent message: PluginInvokeError: {"args":{},"error_type":"ValidationError","message":"1 validation error for FunctionCallingParams\nmodel.entity\n Input should be a valid dictionary or instance of AIModelEntity [type=model_type, input_value=None, input_type=NoneType]\n For further information visit https://errors.pydantic.dev/2.8/v/model_type"}

请问指令格式有什么要求,如何修复这个异常问题?

Originally created by @Jackie-SA on GitHub (Mar 12, 2025). 1、Agent节点配置: - Agent节点的策略functioncalling - 模型qwen2.5 - 输入:当前时间 2、预留执行异常: Run failed: Failed to transform agent message: PluginInvokeError: {"args":{},"error_type":"ValidationError","message":"1 validation error for FunctionCallingParams\nmodel.entity\n Input should be a valid dictionary or instance of AIModelEntity [type=model_type, input_value=None, input_type=NoneType]\n For further information visit [https://errors.pydantic.dev/2.8/v/model_type"}](https://errors.pydantic.dev/2.8/v/model_type%22%7D) 请问指令格式有什么要求,如何修复这个异常问题?
yindo added the bugquestionstale labels 2026-02-16 11:19:46 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 12, 2025):

Hi @Jackie-SA! I'm here to help you with any bugs, questions, and to guide you on becoming a contributor. I'm Dosu, a bot designed for these tasks.

To resolve the ValidationError in Dify 1.0.1 when configuring the Agent node with the function calling strategy, ensure that your configuration adheres to the required format. Here are the key requirements:

  1. Model: Must be specified and is required. It should be a model-selector type.
  2. Tools: Must be an array of tools and is required.
  3. Query: Must be a string and is required.
  4. Max Iterations: Optional, but if specified, it should be a number between 1 and 50.

Here's an example of the correct format:

identity:
  name: function_calling
  author: Dify
  label:
    en_US: FunctionCalling
    zh_Hans: FunctionCalling
    pt_BR: FunctionCalling
description:
  en_US: Function Calling is a basic strategy for agent, model will use the tools provided to perform the task.
parameters:
  - name: model
    type: model-selector
    scope: tool-call&llm
    required: true
    label:
      en_US: Model
  - name: tools
    type: array[tools]
    required: true
    label:
      en_US: Tools list
  - name: query
    type: string
    required: true
    label:
      en_US: Query
  - name: max_iterations
    type: number
    required: false
    default: 5
    label:
      en_US: Max Iterations
    max: 50
    min: 1
extra:
  python:
    source: strategies/function_calling.py

Ensure that the model parameter is correctly defined as a model-selector type and that all required fields are present and correctly formatted. This should help resolve the ValidationError you are encountering [1][2][3].

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 (Mar 12, 2025): <!-- Greeting --> Hi @Jackie-SA! I'm here to help you with any bugs, questions, and to guide you on becoming a contributor. I'm Dosu, a bot designed for these tasks. <!-- Answer --> To resolve the `ValidationError` in Dify 1.0.1 when configuring the Agent node with the function calling strategy, ensure that your configuration adheres to the required format. Here are the key requirements: 1. **Model**: Must be specified and is required. It should be a model-selector type. 2. **Tools**: Must be an array of tools and is required. 3. **Query**: Must be a string and is required. 4. **Max Iterations**: Optional, but if specified, it should be a number between 1 and 50. Here's an example of the correct format: ```yaml identity: name: function_calling author: Dify label: en_US: FunctionCalling zh_Hans: FunctionCalling pt_BR: FunctionCalling description: en_US: Function Calling is a basic strategy for agent, model will use the tools provided to perform the task. parameters: - name: model type: model-selector scope: tool-call&llm required: true label: en_US: Model - name: tools type: array[tools] required: true label: en_US: Tools list - name: query type: string required: true label: en_US: Query - name: max_iterations type: number required: false default: 5 label: en_US: Max Iterations max: 50 min: 1 extra: python: source: strategies/function_calling.py ``` Ensure that the `model` parameter is correctly defined as a model-selector type and that all required fields are present and correctly formatted. This should help resolve the `ValidationError` you are encountering <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/en/plugins/schema-definition/agent.md)</sup><sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/jp/plugins/schema-definition/agent.md)</sup><sup>[[3]](https://github.com/langgenius/dify-docs/blob/main/zh_CN/guides/workflow/node/agent.md)</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/e3907546-59ba-4ebc-b23b-739f168a6fb8?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/e3907546-59ba-4ebc-b23b-739f168a6fb8?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/e3907546-59ba-4ebc-b23b-739f168a6fb8?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/e3907546-59ba-4ebc-b23b-739f168a6fb8?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/e3907546-59ba-4ebc-b23b-739f168a6fb8?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/e3907546-59ba-4ebc-b23b-739f168a6fb8?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/e3907546-59ba-4ebc-b23b-739f168a6fb8?feedback_type=other)</sup>
Author
Owner

@yuanshengson commented on GitHub (Mar 24, 2025):

我想问agent节点调用工作流工具为什么显示未安装,如何确定工具是否执行

@yuanshengson commented on GitHub (Mar 24, 2025): 我想问agent节点调用工作流工具为什么显示未安装,如何确定工具是否执行
Author
Owner

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

Hi, @Jackie-SA. I'm Dosu, and I'm helping the dify-docs team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • You reported a validation error with the function calling strategy using the qwen2.5 model in Dify 1.0.1.
  • I provided a detailed explanation of the required configuration format.
  • The response received a thumbs-down reaction from another user.
  • A related question was raised about tool installation and execution in the agent node.

Next Steps:

  • Please let us know if this issue is still relevant to the latest version of the dify-docs repository by commenting here.
  • If no updates are provided, the issue will be automatically closed in 7 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Apr 25, 2025): Hi, @Jackie-SA. I'm [Dosu](https://dosu.dev), and I'm helping the dify-docs team manage their backlog. I'm marking this issue as stale. **Issue Summary:** - You reported a validation error with the function calling strategy using the qwen2.5 model in Dify 1.0.1. - I provided a detailed explanation of the required configuration format. - The response received a thumbs-down reaction from another user. - A related question was raised about tool installation and execution in the agent node. **Next Steps:** - Please let us know if this issue is still relevant to the latest version of the dify-docs repository by commenting here. - If no updates are provided, the issue will be automatically closed in 7 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-docs-archived#108