💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows
Python agentsaiai-agentsembeddingsinformation-retrievallanguage-modellarge-language-modelsllmnlppythonragretrieval-augmented-generationsearchsearch-enginesemantic-searchsentence-embeddingstransformerstxtaivector-databasevector-search
Update test
davidmezzetti79b4109aee87
diff --git a/test/python/testdatabase/testembeddings.py b/test/python/testdatabase/testembeddings.pyindex 5f0044b1..05409c44 100644--- a/test/python/testdatabase/testembeddings.py+++ b/test/python/testdatabase/testembeddings.py@@ -6,6 +6,8 @@ import osimport tempfileimport unittest+from pathlib import Path+from txtai.embeddings import Embeddingsfrom txtai.database import Database, SQLException@@ -131,6 +133,10 @@ class TestEmbeddings(unittest.TestCase):# Save to a different locationindexupdate = os.path.join(tempfile.gettempdir(), "embeddings.update")++ # Create existing file to test file save conflicts+ Path.touch(os.path.join(indexupdate, "documents"))+self.embeddings.save(indexupdate)# Save to same location@@ -148,11 +154,6 @@ class TestEmbeddings(unittest.TestCase):result = self.embeddings.search("feel good story", 1)[0]self.assertEqual(result["text"], self.data[4])- # Save back to same location- self.embeddings.save(index)- result = self.embeddings.search("feel good story", 1)[0]- self.assertEqual(result["text"], self.data[4])-def testNotImplemented(self):"""Tests exceptions for non-implemented methods