以下是小爱的回答: 本设备暂不支持该功能哦
Traceback (most recent call last):
File "/home/xjh/xiaogpt/xiaogpt.py", line 502, in
asyncio.run(miboy.run_forever())
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/home/xjh/xiaogpt/xiaogpt.py", line 386, in run_forever
await self.do_chat_with_xiaoai(last_record, query, key)
File "/home/xjh/xiaogpt/xiaogpt.py", line 347, in do_chat_with_xiaoai
message = await self.ask_gpt(query)
File "/home/xjh/xiaogpt/xiaogpt.py", line 268, in ask_gpt
return await self.ask_chatgpt_api(query)
File "/home/xjh/xiaogpt/xiaogpt.py", line 272, in ask_chatgpt_api
message = await self.chatbot.ask(query)
File "/home/xjh/xiaogpt/xiaogpt.py", line 95, in ask
completion = openai.ChatCompletion.create(model="gpt-3.5-turbo", messages=ms)
File "/home/xjh/.local/lib/python3.10/site-packages/openai/lib/_old_api.py", line 39, in call
raise APIRemovedInV1(symbol=self._symbol)
openai.lib._old_api.APIRemovedInV1:
You tried to access openai.ChatCompletion, but this is no longer supported in openai>=1.0.0 - see the README at https://github.com/openai/openai-python for the API.
You can run openai migrate to automatically upgrade your codebase to use the 1.0.0 interface.
Alternatively, you can pin your installation to the old version, e.g. pip install openai==0.28
以下是小爱的回答: 本设备暂不支持该功能哦 Traceback (most recent call last): File "/home/xjh/xiaogpt/xiaogpt.py", line 502, in
asyncio.run(miboy.run_forever())
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/home/xjh/xiaogpt/xiaogpt.py", line 386, in run_forever
await self.do_chat_with_xiaoai(last_record, query, key)
File "/home/xjh/xiaogpt/xiaogpt.py", line 347, in do_chat_with_xiaoai
message = await self.ask_gpt(query)
File "/home/xjh/xiaogpt/xiaogpt.py", line 268, in ask_gpt
return await self.ask_chatgpt_api(query)
File "/home/xjh/xiaogpt/xiaogpt.py", line 272, in ask_chatgpt_api
message = await self.chatbot.ask(query)
File "/home/xjh/xiaogpt/xiaogpt.py", line 95, in ask
completion = openai.ChatCompletion.create(model="gpt-3.5-turbo", messages=ms)
File "/home/xjh/.local/lib/python3.10/site-packages/openai/lib/_old_api.py", line 39, in call
raise APIRemovedInV1(symbol=self._symbol)
openai.lib._old_api.APIRemovedInV1:
You tried to access openai.ChatCompletion, but this is no longer supported in openai>=1.0.0 - see the README at https://github.com/openai/openai-python for the API.
You can run
openai migrate
to automatically upgrade your codebase to use the 1.0.0 interface.Alternatively, you can pin your installation to the old version, e.g.
pip install openai==0.28
A detailed migration guide is available here: https://github.com/openai/openai-python/discussions/742