Persist embeddings components to specified schema, closes #829

This commit is contained in:
davidmezzetti
2024-12-04 15:18:05 -05:00
parent 92489ac89a
commit 3f7bb71a3e
12 changed files with 114 additions and 9 deletions
+12
View File
@@ -57,3 +57,15 @@ class TestClient(Common.TestRDBMS):
self.backend = f"sqlite:///{path}"
self.embeddings.config["content"] = self.backend
def testSchema(self):
"""
Test database creation with a specified schema
"""
# Default sequence id
embeddings = Embeddings(path="sentence-transformers/nli-mpnet-base-v2", content=self.backend, schema="txtai")
embeddings.index(self.data)
result = embeddings.search("feel good story", 1)[0]
self.assertEqual(result["text"], self.data[4])