-
Notifications
You must be signed in to change notification settings - Fork 768
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
联系人回复消息报错Cannot read properties of undefined (reading 'choices') #170
Comments
我也是这个问题,解决了吗 |
我这个是因为讯飞的API接口出的问题,我的账号没有实名认证所以调用出错了,导致返回结构体不正确继而导致这个属性未找到的错误。你可以试着排查一下。 |
排查到了,已经提交讯飞的实名认证,你认证完就可以调了吗 |
是的 |
搞定了,感谢回复 |
|
👍👍 |
认证之后还是存在报错 |
我也是认证之后还是报这个错,怎么解决呢 |
每个人的报错原因可能都不一样,建议大家试着排查一下是否api已经认证,以及是不是回复的消息结构变化了导致属性未获取到 |
认证了,讯飞线上调适也通,三个key也都确认没错了,还是不行~ TypeError: Cannot read properties of undefined (reading 'choices') |
在代码里面打印了一下报错,发现提示的是apiAuthError, 最后排查到是 /src/xunfei/xunfei.js 文件内的httpUrl问题,完美解决,撒花🧨🧨🧨 |
web端调试没问题,也是报这个错,有其他方式解决的吗? |
那到底是咋解决的呢 |
https://console.xfyun.cn/services/sparkapiCenter 现在这个地址查看对应模型剩余的token,我现在用的是4.0 ultra,在xunfei.js,修改 httpUrl 为https://spark-api.xf-yun.com/v4.0/chat, authenticate 方法中新增一个case |
打开你的/src/xunfei/xunfei.js文件找到httpUrl改一下,我记得是版本问题 |
已经解决了,修改一下大模型版本号就可以了 |
恭喜恭喜✿✿ヽ(°▽°)ノ✿ |
uncaughtException TypeError: Cannot read properties of undefined (reading 'choices')
at WebSocket. (file:///Users/jevon/Downloads/wechat-bot-main/src/xunfei/xunfei.js:93:33)
at callListener (/Users/jevon/Downloads/wechat-bot-main/node_modules/ws/lib/event-target.js:290:14)
at WebSocket.onMessage (/Users/jevon/Downloads/wechat-bot-main/node_modules/ws/lib/event-target.js:209:9)
at WebSocket.emit (node:events:518:28)
at Receiver.receiverOnMessage (/Users/jevon/Downloads/wechat-bot-main/node_modules/ws/lib/websocket.js:1209:20)
at Receiver.emit (node:events:518:28)
at Receiver.dataMessage (/Users/jevon/Downloads/wechat-bot-main/node_modules/ws/lib/receiver.js:594:14)
at Receiver.getData (/Users/jevon/Downloads/wechat-bot-main/node_modules/ws/lib/receiver.js:496:10)
at Receiver.startLoop (/Users/jevon/Downloads/wechat-bot-main/node_modules/ws/lib/receiver.js:167:16)
at Receiver._write (/Users/jevon/Downloads/wechat-bot-main/node_modules/ws/lib/receiver.js:94:10)
The text was updated successfully, but these errors were encountered: