[2023-03-28 11:37:10,686 nonebot] ERROR: Failed to import "hoshino.modules.aichat-chatGPT.client", error: module 'openai' has no attribute 'ChatCompletion'
[2023-03-28 11:37:10,686 nonebot] ERROR: module 'openai' has no attribute 'ChatCompletion'
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/nonebot/plugin.py", line 253, in load_plugin
module = importlib.import_module(module_path)
File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 848, in exec_module
File "", line 219, in _call_with_frames_removed
File "/root/HoshinoBot/hoshino/modules/aichat-chatGPT/client.py", line 6, in
class Client:
File "/root/HoshinoBot/hoshino/modules/aichat-chatGPT/client.py", line 7, in Client
chat = openai.ChatCompletion()
AttributeError: module 'openai' has no attribute 'ChatCompletion'
[2023-03-28 11:37:10,686 nonebot] ERROR: Failed to import "hoshino.modules.aichat-chatGPT.client", error: module 'openai' has no attribute 'ChatCompletion' [2023-03-28 11:37:10,686 nonebot] ERROR: module 'openai' has no attribute 'ChatCompletion' Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/nonebot/plugin.py", line 253, in load_plugin module = importlib.import_module(module_path) File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 848, in exec_module
File "", line 219, in _call_with_frames_removed
File "/root/HoshinoBot/hoshino/modules/aichat-chatGPT/client.py", line 6, in
class Client:
File "/root/HoshinoBot/hoshino/modules/aichat-chatGPT/client.py", line 7, in Client
chat = openai.ChatCompletion()
AttributeError: module 'openai' has no attribute 'ChatCompletion'
根据查询,说是较新版本的openai没有这个,应将 ChatCompletion改为 Completion