题意:OpenAI API error: "AttributeError: openai 模块 不存在名称为 Embedding 的属性。
问题背景:
According to OpenAi's documentation and a large number of demonstrations I found online, the following code should run without a problem in Python:
根据 OpenAI 的文档和我在网上找到的大量演示,以下代码应该在 Python 中没有问题地运行:
import openai
response = openai.Embedding.create(
input="porcine pals say",
model="text-embedding-ada-002"
)
However, when I run this code on my local Jupyter instance, I receive the following error:
然而,当我在我的本地 Jupyter 实例上运行这段代码时,我收到了以下错误:
AttributeError Traceback (most recent call last)
>! <ipython-input-209-e3e908b35b81