调用百度API报错
sunweihunu opened this issue · comments
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
请检查一下是否有对应模型的权限(百度千帆的大模型都需要先授权才能使用)
参考:https://cloud.baidu.com/doc/WENXINWORKSHOP/s/yloieb01t
当然,如果access_key或secret_key不正确,也会出现类似错误
感谢你的意见。是我把access_key和secret_key输成了应用里面的API Key 和Secret Key,导致了这个错误。