mirror of
https://github.com/RockChinQ/QChatGPT.git
synced 2024-11-16 19:57:04 +08:00
fix: 超额切换时未修改openai库的api_key
This commit is contained in:
parent
b1d40b1628
commit
20aebd6d30
|
@ -225,6 +225,7 @@ class QQBotManager:
|
||||||
self.notify_admin("API调用额度超限,请向OpenAI账户充值或在config.py中更换api_key")
|
self.notify_admin("API调用额度超限,请向OpenAI账户充值或在config.py中更换api_key")
|
||||||
reply = "[bot]err:API调用额度超额,请联系作者,或等待修复"
|
reply = "[bot]err:API调用额度超额,请联系作者,或等待修复"
|
||||||
else:
|
else:
|
||||||
|
openai.api_key = pkg.openai.manager.get_inst().key_mgr.get_using_key()
|
||||||
self.notify_admin("API调用额度超限,已切换到{}".format(name))
|
self.notify_admin("API调用额度超限,已切换到{}".format(name))
|
||||||
reply = "[bot]err:API调用额度超额,已自动切换,请重新发送消息"
|
reply = "[bot]err:API调用额度超额,已自动切换,请重新发送消息"
|
||||||
except openai.error.InvalidRequestError as e:
|
except openai.error.InvalidRequestError as e:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user