PEIN

Results 4 comments of PEIN

> Deleting the folder did not fix it for me. Me too.

> 这个老问题了,之前也好多人遇到过(包括我),去看一下readme里的疑难杂症解决→常见问题→配置代理,基本就可以解决啦。 我没有代理啊,只有cf woker或者云函数反代,只能用这个更改API地址,我qqbot用的这个API地址都是正常的。

看来是bug,打了个日志,API地址并没有修改成功 在源代码打日志的地方:chat_func.py: ```ptyhon # 如果有代理,使用代理发送请求,否则使用默认设置发送请求 if proxies: response = requests.post( API_URL, headers=headers, json=payload, stream=True, timeout=timeout, proxies=proxies, ) else: #打日志 print("no proxy:"+API_URL) response = requests.post( API_URL, headers=headers, json=payload, stream=True, timeout=timeout, )...

可能是因为chat_func.py已经在导入presets.py模块并加载了它的API_URL值,所以即使在utils.py模块中修改了它,chat_func.py仍然使用之前加载的原始值。 我在presets.py中加入了更新全局参数API_URL的函数,并在utils.py中def change_api_url(url):调用: ```python def update_api(url): global API_URL API_URL = url print("presets更改API:"+API_URL) ``` 并将chat_func.py中的stream=False时,更改API地址后可以在非流式情况下正常使用: ```python # 如果有代理,使用代理发送请求,否则使用默认设置发送请求 if proxies: response = requests.post( API_URL, headers=headers, json=payload, stream=True, timeout=timeout, proxies=proxies, ) else:...