我正在尝试 OpenAI 中给出的这段代码。
链接:-文本生成 API
代码
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)
我收到一个错误
错误
"必须提供一个 'engine' 参数来创建一个 %s" % cls, "engine"。openai.error.InvalidRequestError:必须提供“引擎”参数才能创建 <class 'openai.api_resources.completion.Completion'>
我正在使用 python 3.7.6