Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

调用百度API报错 #1285

Closed
sunweihunu opened this issue May 21, 2024 · 2 comments
Closed

调用百度API报错 #1285

sunweihunu opened this issue May 21, 2024 · 2 comments

Comments

@sunweihunu
Copy link

Bug description
设置如下
llm:
api_type: qianfan
access_key: ''
secret_key: '
'
model: 'ERNIE-Speed'

运行DataInterpreter的简单例子报错:
metagpt\lib\site-packages\qianfan\resources\requestor\openapi_requestor.py", line 232, in _check_error
raise errors.APIError(error_code, err_msg, req_id)
qianfan.errors.APIError: api return error, req_id: code: 14, msg: IAM Certification failed

Bug solved method

Environment information

  • LLM type and model name:ERNIE-Speed
  • System version: Win10
  • Python version: 3.9.0
  • MetaGPT version or branch: 0.8.1
  • packages version: qianfan 0.3.2
  • installation method: pip install metagpt

Screenshots or logs

@usamimeri
Copy link
Contributor

usamimeri commented May 22, 2024

be664299b930e5d90a8dfbfdd43f80b

请检查一下是否有对应模型的权限(百度千帆的大模型都需要先授权才能使用)
参考:https://cloud.baidu.com/doc/WENXINWORKSHOP/s/yloieb01t

当然,如果access_key或secret_key不正确,也会出现类似错误

@sunweihunu
Copy link
Author

感谢你的意见。是我把access_key和secret_key输成了应用里面的API Key 和Secret Key,导致了这个错误。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants