The web search parameter for zhipu AI is not working
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
0.9.1
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
When using the Zhipu AI model, it will prompt that the currently selected parameters are unavailable:
And the reponses like this:
[zhipuai] Error: Completions.create() got an unexpected keyword argument 'web_search'
✔️ Expected Behavior
The web search parameter works well
❌ Actual Behavior
The web search parameter leads to fail request
The error message you're encountering, "Completions.create() got an unexpected keyword argument 'web_search'," suggests that the web_search parameter is not recognized by the function being called. This could be due to a mismatch between the parameters expected by the Zhipu AI model integration and those being provided.
Here are a few steps you can take to troubleshoot and potentially resolve this issue:
-
Check the Integration Code: Verify that the Zhipu AI model integration in your Dify setup is up-to-date and correctly implemented. The relevant files are located at
api/core/model_runtime/model_providers/zhipuai/zhipuai_sdk/__init__.pyandapi/core/model_runtime/model_providers/zhipuai/text_embedding/text_embedding.py[1][2]. -
Review Parameter Usage: Ensure that the
web_searchparameter is correctly implemented in the codebase. According to the documentation, this parameter is intended to control whether the model uses Internet search results during text generation [3]. -
Update Dify Version: Make sure you are using the latest version of Dify, as updates may include bug fixes or changes to parameter handling.
-
Consult Documentation: Review any available documentation or comments in the codebase that explain the usage of the
web_searchparameter to ensure it is being used correctly [3].
If these steps do not resolve the issue, it may be necessary to further investigate the specific implementation of the Completions.create() function to understand why it does not accept the web_search parameter.
To continue talking to Dosu, mention @dosu.