From 8c28ad6daca3420d4428a464cd35f00df8b84f01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=9F=8E=E9=93=AD?= Date: Thu, 18 May 2023 21:54:42 +0800 Subject: [PATCH] API update: Engines -> Models (#4915) # API update: Engines -> Models see: https://community.openai.com/t/api-update-engines-models/18597 Co-authored-by: assert --- langchain/embeddings/openai.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/langchain/embeddings/openai.py b/langchain/embeddings/openai.py index 9eb488522f..f980db9d11 100644 --- a/langchain/embeddings/openai.py +++ b/langchain/embeddings/openai.py @@ -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"]