InvalidRequestError:必须提供一个';发动机&x27;调用openAI API生成文本时的参数

InvalidRequestError:必须提供一个';发动机&x27;调用openAI API生成文本时的参数,api,openai,Api,Openai,我正在尝试OpenAI中给出的代码 链接:- 代码 import openai prompt = """We’re releasing an API for accessing new AI models developed by OpenAI. Unlike most AI systems which are designed for one use-case, the API today provides a general-purpose “text in,

我正在尝试OpenAI中给出的代码

链接:-

代码

import openai

prompt = """We’re releasing an API for accessing new AI models developed by OpenAI. Unlike most AI systems which are designed for one use-case, the API today provides a general-purpose “text in, text out” interface, allowing users to try it on virtually any English language task. You can now request access in order to integrate the API into your product, develop an entirely new application, or help us explore the strengths and limits of this technology."""

response = openai.Completion.create(model="davinci", prompt=prompt, stop="\n", temperature=0.9, max_tokens=100)

print(response)
我犯了个错误

错误

必须提供“引擎”参数才能创建%s“%cls”,引擎。 openai.error.InvalidRequestError:必须提供“引擎”参数才能创建


我使用的是python 3.7.6

您似乎混淆了engine参数和model参数。请参阅本文档,了解正确的呼叫方式:

请将
model=“davinci”
更改为
engine=“davinci”
你应该可以走了