dify icon indicating copy to clipboard operation
dify copied to clipboard

v1.0.0-beta.1 agent doesn't work with OpenAI-API-compatible plugin in workflow

Open wl102 opened this issue 11 months ago • 3 comments

Self Checks

  • [x] This is only for bug report, if you would like to ask a question, please head to Discussions.
  • [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.

Dify version

1.0.0-beta.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

error log

[NodeRunStartedEvent] Node ID: 1737517673139 Node Title: Agent-情报分析 Type: agent

[NodeRunFailedEvent] Node ID: 1737517673139 Node Title: Agent-情报分析 Type: agent Error: 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"} Inputs: {'instruction': '你是有用的助手,负责查询安全情报信息,你可以使用工具获取外部知识,保证答案的真实、准确性。\n\n\n## 指令\n1. 根据给定的相关信息,查询安全情报信息,如果文本存在多个相关信息,则多次调用工具,并返回一个总结。\n2. 如果查询结果为空,则返回 "没有查询到相关信息"。\n3. 结果使用中文回答,不要输出任何无关的信息。', 'maximum_iterations': '2', 'model': {'mode': 'chat', 'model': 'deepseek-chat', 'model_type': 'llm', 'provider': 'langgenius/openai_api_compatible/openai_api_compatible', 'type': 'model-selector', 'completion_params': {}}, 'query': "查询['10.45.111.68', '10.45.136.7', '8.8.8.8', '10.45.136.6', '10.45.136.3', '10.45.136.4']、['v.beahh.com']、[]、[]的情报信息。", 'tools': [{'enabled': True, 'extra': {'description': ''}, 'parameters': {'ip': ''}, 'provider_name': '/virustotal/virustotal', 'tool_name': 'get_ip_report'}, {'enabled': True, 'extra': {'description': ''}, 'parameters': {'domain': ''}, 'provider_name': '/virustotal/virustotal', 'tool_name': 'get_domain_report'}, {'enabled': True, 'extra': {'description': ''}, 'parameters': {'hash': ''}, 'provider_name': '/virustotal/virustotal', 'tool_name': 'get_filehash_report'}, {'enabled': True, 'extra': {'description': ''}, 'parameters': {'url': ''}, 'provider_name': '/virustotal/virustotal', 'tool_name': 'get_url_report'}]} Process Data: Outputs:

[GraphRunFailedEvent] reason: 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"} 2025-01-24 03:08:57,224.224 INFO [Thread-41241 (process_request_thread)] [_internal.py:97] - 172.18.0.10 - - [24/Jan/2025 03:08:57] "POST /console/api/apps/593d6ab0-13c8-4577-9ddd-e2b1c32ca68a/workflows/draft HTTP/1.1" 200 -

model setting

Image

agent node

agent_strategy_name: function_calling agent_strategy_provider_name: langgenius/agent/agent

extra

it work when i use langgenius/deepseek plugin.

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

wl102 avatar Jan 24 '25 03:01 wl102

@wl102 Hello there! I'm here to help you with any bugs, questions, or contributions. Let's tackle this issue together!

I found a similar unsolved discussion titled "Agent node in workflow run status fails" which might be related to your issue [1].

The error you're encountering, "ValidationError" for FunctionCallingParams, suggests that the model parameter is not being correctly recognized as a valid dictionary or instance of AIModelEntity. This could be due to incorrect configuration or missing details in the model setup.

To address this, ensure that the model parameter in your FunctionCallingParams is correctly structured and includes all necessary fields. The model should be an instance of AgentModelConfig, which is required for the FunctionCallingParams in Dify [2]. Double-check the configuration form for the OpenAI API-compatible service to ensure all fields are correctly filled out, especially the model type and API endpoint.

If the issue persists, consider comparing the configuration with the one that works using the langgenius/deepseek plugin, as it might provide insights into what might be missing or misconfigured in the current setup.

To continue talking to Dosu, mention @dosu.


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

dosubot[bot] avatar Jan 24 '25 03:01 dosubot[bot]

deepseek 有已经开发好的模型适配商,设置里面使用对应的模型供应商填写 api 即可

CracKerMe avatar Jan 26 '25 23:01 CracKerMe

Hi, @wl102. I'm Dosu, and I'm helping the Dify team manage their backlog. I'm marking this issue as stale.

Issue Summary

  • A bug was reported in the v1.0.0-beta.1 version of the Dify agent with an OpenAI-API-compatible plugin in Docker.
  • The issue involved a validation error with the FunctionCallingParams.
  • It was suggested that the error might be due to incorrect configuration of the model parameter.
  • The issue appears to be resolved by correcting the configuration as per AgentModelConfig requirements.

Next Steps

  • Please confirm if this issue is still relevant to the latest version of the Dify repository. If so, you can keep the discussion open by commenting here.
  • If there are no further updates, this issue will be automatically closed in 15 days.

Thank you for your understanding and contribution!

dosubot[bot] avatar Feb 26 '25 16:02 dosubot[bot]

@wl102 same problem with openai-api-compatible, is it resolved now?

k359792067 avatar Mar 11 '25 03:03 k359792067

@wl102 same problem with openai-api-compatible, is it resolved now? Unfortunately, it wasn't resolved.

wl102 avatar Mar 11 '25 09:03 wl102