赞
踩
终于等到你!Python调用讯飞星火大模型API_哔哩哔哩_bilibili
记得在配置环境时
pip install websocket-client
现在运行程序理论上可以得到如下的输出:
我这边运行时报了一个错:
这个错误提示是因为on_close()
函数定义时只接受一个参数,但在调用时传入了3个参数。为了解决这个问题,需要修改on_close()
函数的定义,使其能够接收3个参数:
- def on_close(ws, code, reason):
- print("### closed ###")
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。