题意:OpenAI API 错误:“尝试访问 openai.ChatCompletion,但在 openai>=1.0.0 版本中已不再支持此功能”
问题背景:
I am currently working on a chatbot, and as I am using Windows 11 it does not let me migrate to newer OpenAI library or downgrade it. Could I replace the ChatCompletion
function with something else to work on my version?
我目前正在开发一个聊天机器人,由于我使用的是Windows 11系统,它不允许我迁移到更新的OpenAI库或将其降级。我能否用其他东西替换ChatCompletion
函数,以便在我的当前版本上工作?
This is the code: 这是代码
import openai
openai.api_key = "private"
def chat_gpt(prompt):
response = openai.ChatCompletion.create(
model="gpt-3.5-t