OpenRouter ToolConfig Field Undefined Error When Using Tools in v0.15.0
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
- Create an agent.
- Set the llm to
claude-3.5-sonnetfrom OpenRouter. - Enable tools.
- Send a request that trigger a tool to the Agent.
- 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.
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:
-
Authentication: Ensure that the user is authenticated. If
notAuthedis true, an error will occur. -
Tool Inputs Schema: The
tool_parametersmust meet the conditions specified in thetoolInputsSchema. Each required field in this schema must have a corresponding value intool_parameters. Fields of typevariablemust have non-empty values. -
Tool Setting Schema: The
tool_configurationsmust meet the conditions specified in thetoolSettingSchema. Each required field in this schema must have a corresponding non-empty value intool_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
should be the same issue as issue #12460
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.
Issue resolved in version 0.15.1