dify icon indicating copy to clipboard operation
dify copied to clipboard

OpenRouter ToolConfig Field Undefined Error When Using Tools in v0.15.0

Open fmobeireek opened this issue 1 year ago • 1 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

v0.15.0

Cloud or Self Hosted

Cloud

Steps to reproduce

  1. Create an agent.
  2. Set the llm to claude-3.5-sonnet from OpenRouter.
  3. Enable tools.
  4. Send a request that trigger a tool to the Agent.
  5. Observe the error returned.

✔️ Expected Behavior

The tools should work seamlessly with OpenRouter integration as they did in version 0.14.0.

❌ Actual Behavior

When tools are enabled, the message fails, returning a completion_request_error with the message: The toolConfig field must be defined when using toolUse and toolResult content blocks.

fmobeireek avatar Jan 08 '25 14:01 fmobeireek

The error you're encountering, where the toolConfig field must be defined when using toolUse and toolResult content blocks, suggests that there might be a missing or improperly configured toolConfig field in your setup. In version 0.15.0, there are specific dependencies or conditions required for the toolConfig field to be correctly defined:

  1. Authentication: Ensure that the user is authenticated. If notAuthed is true, an error will occur.

  2. Tool Inputs Schema: The tool_parameters must meet the conditions specified in the toolInputsSchema. Each required field in this schema must have a corresponding value in tool_parameters. Fields of type variable must have non-empty values.

  3. Tool Setting Schema: The tool_configurations must meet the conditions specified in the toolSettingSchema. Each required field in this schema must have a corresponding non-empty value in tool_configurations [1].

Make sure these conditions are met in your configuration. If the issue persists, it might be helpful to review any changes in the configuration requirements between versions 0.14.0 and 0.15.0, as there might be undocumented changes affecting the toolConfig field.

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 08 '25 14:01 dosubot[bot]

should be the same issue as issue #12460

zyp512918954 avatar Jan 10 '25 04:01 zyp512918954

I ran it on the main branch and found no errors. However, in the 1.50 version, an error occurred. Therefore, I think it will be fixed in the next version.

halogen22 avatar Jan 10 '25 12:01 halogen22

Issue resolved in version 0.15.1

fmobeireek avatar Jan 14 '25 08:01 fmobeireek