API update: Engines -> Models (#4915)

# API update: Engines -> Models

see: https://community.openai.com/t/api-update-engines-models/18597

Co-authored-by: assert <zhangchengming@kkguan.com>
This commit is contained in:
张城铭 2023-05-18 21:54:42 +08:00 committed by GitHub
parent c06a47a691
commit 8c28ad6dac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -216,7 +216,7 @@ class OpenAIEmbeddings(BaseModel, Embeddings):
response = embed_with_retry(
self,
input=tokens[i : i + _chunk_size],
engine=self.deployment,
model=self.deployment,
request_timeout=self.request_timeout,
headers=self.headers,
)
@ -234,7 +234,7 @@ class OpenAIEmbeddings(BaseModel, Embeddings):
average = embed_with_retry(
self,
input="",
engine=self.deployment,
model=self.deployment,
request_timeout=self.request_timeout,
headers=self.headers,
)["data"][0]["embedding"]
@ -266,7 +266,7 @@ class OpenAIEmbeddings(BaseModel, Embeddings):
return embed_with_retry(
self,
input=[text],
engine=engine,
model=engine,
request_timeout=self.request_timeout,
headers=self.headers,
)["data"][0]["embedding"]