Skip to content

Commit

Permalink
API update: Engines -> Models (#4915)
Browse files Browse the repository at this point in the history
# API update: Engines -> Models

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

Co-authored-by: assert <zhangchengming@kkguan.com>
  • Loading branch information
assert6 and assert6 committed May 18, 2023
1 parent c06a47a commit 8c28ad6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions langchain/embeddings/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def _get_len_safe_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,
)
Expand All @@ -234,7 +234,7 @@ def _get_len_safe_embeddings(
average = embed_with_retry(
self,
input="",
engine=self.deployment,
model=self.deployment,
request_timeout=self.request_timeout,
headers=self.headers,
)["data"][0]["embedding"]
Expand Down Expand Up @@ -266,7 +266,7 @@ def _embedding_func(self, text: str, *, engine: str) -> List[float]:
return embed_with_retry(
self,
input=[text],
engine=engine,
model=engine,
request_timeout=self.request_timeout,
headers=self.headers,
)["data"][0]["embedding"]
Expand Down

0 comments on commit 8c28ad6

Please sign in to comment.