chore(python): update embedding API to use openai 1.6.1 (#751)

API has changed significantly, namely `openai.Embedding.create` no
longer exists.
https://github.com/openai/openai-python/discussions/742

Update the OpenAI embedding function and put a minimum on the openai sdk
version.
This commit is contained in:
Chang She
2023-12-28 15:05:57 -08:00
committed by Weston Pace
parent 7bac1131fb
commit c97ae6b787
4 changed files with 10 additions and 5 deletions

View File

@@ -50,7 +50,7 @@ tests = ["pandas>=1.4", "pytest", "pytest-mock", "pytest-asyncio", "requests", "
dev = ["ruff", "pre-commit", "black"]
docs = ["mkdocs", "mkdocs-jupyter", "mkdocs-material", "mkdocstrings[python]"]
clip = ["torch", "pillow", "open-clip"]
embeddings = ["openai", "sentence-transformers", "torch", "pillow", "open-clip-torch", "cohere", "InstructorEmbedding"]
embeddings = ["openai>=1.6.1", "sentence-transformers", "torch", "pillow", "open-clip-torch", "cohere", "InstructorEmbedding"]
[build-system]
requires = ["setuptools", "wheel"]