[INFO][2024-03-25 17:15:37][bridge.py:51] - create bot qwen for chat
[ERROR][2024-03-25 17:15:38][chat_channel.py:303] - Worker return exception: create token error, code=Forbidden, message=User not authorized to operate on the specified resource. RequestId: C2BA9D6F-8EE8-54B6-87FE-08B86D561792
Traceback (most recent call last):
File "C:\Users\juncheng.ye\AppData\Local\Programs\Python\Python39\lib\concurrent\futures\thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "D:\code\explore\chatgpt-on-wechat-4\channel\chat_channel.py", line 170, in _handle
reply = self._generate_reply(context)
File "D:\code\explore\chatgpt-on-wechat-4\channel\chat_channel.py", line 193, in _generate_reply
reply = super().build_reply_content(context.content, context)
File "D:\code\explore\chatgpt-on-wechat-4\channel\channel.py", line 38, in build_reply_content
return Bridge().fetch_reply_content(query, context)
File "D:\code\explore\chatgpt-on-wechat-4\bridge\bridge.py", line 66, in fetch_reply_content
return self.get_bot("chat").reply(query, context)
File "D:\code\explore\chatgpt-on-wechat-4\bridge\bridge.py", line 57, in get_bot
self.bots[typename] = create_bot(self.btype[typename])
File "D:\code\explore\chatgpt-on-wechat-4\bot\bot_factory.py", line 49, in create_bot
return AliQwenBot()
File "D:\code\explore\chatgpt-on-wechat-4\bot\ali\ali_qwen_bot.py", line 24, in init
self.api_key_expired_time = self.set_api_key()
File "D:\code\explore\chatgpt-on-wechat-4\bot\ali\ali_qwen_bot.py", line 149, in set_api_key
api_key, expired_time = self.api_key_client().create_token(agent_key=self.agent_key())
File "D:\code\explore\chatgpt-on-wechat\venv\lib\site-packages\broadscope_bailian\api\access_token_client.py", line 50, in create_token
raise RuntimeError("create token error, code=%s, message=%s RequestId: %s"
RuntimeError: create token error, code=Forbidden, message=User not authorized to operate on the specified resource. RequestId: C2BA9D6F-8EE8-54B6-87FE-08B86D561792
⚠️ 搜索是否存在类似issue
总结
通义千问快速接入文档:https://help.aliyun.com/zh/dashscope/developer-reference/quick-start 官方文档里只需填写API-KEY即可调用(就像chatGPT一样简单),为什么本系统需要5个参数呢:
另外我按着阿里云的文档鼓捣了一下午,这个填写的qwen_access_key_id、qwen_access_key_secret始终有问题,阿里云接口返回错误信息:
这是我按照教程配置的,已经添加了所有权限
同时我看到阿里官方的这段说明,是不是也表示 AccessKey、Access Secret Key 在新的对接文档里其实已经不需要了? https://help.aliyun.com/document_detail/2621347.html
举例
No response
动机
现有教程无法对接通义千问,好像是阿里云那边的问题,新建的AccessKey即便授权了,也无法正常获取token