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 Andrew Miracle
parent dc8d6835c0
commit a3fafd6b54
4 changed files with 10 additions and 5 deletions

View File

@@ -29,7 +29,7 @@ from lancedb.pydantic import LanceModel, Vector
@pytest.mark.slow
@pytest.mark.parametrize("alias", ["sentence-transformers", "openai"])
def test_sentence_transformer(alias, tmp_path):
def test_basic_text_embeddings(alias, tmp_path):
db = lancedb.connect(tmp_path)
registry = get_registry()
func = registry.get(alias).create(max_retries=0)