💡 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
Reformat test
davidmezzetti9312a6ba6434
diff --git a/test/python/testdatabase/testembeddings.py b/test/python/testdatabase/testembeddings.pyindex 38cecbfe..8072ca79 100644--- a/test/python/testdatabase/testembeddings.py+++ b/test/python/testdatabase/testembeddings.py@@ -278,6 +278,26 @@ class TestEmbeddings(unittest.TestCase):with self.assertRaises(ValueError):self.embeddings.index([(0, {"text": "This is a test", "flag": float("NaN")}, None)])+ def testMultiData(self):+ """+ Test indexing with multiple data types (text, documents)+ """++ embeddings = Embeddings({"path": "sentence-transformers/nli-mpnet-base-v2", "content": True, "batch": len(self.data)})++ # Create an index using mixed data (text and documents)+ data = []+ for uid, text in enumerate(self.data):+ data.append((uid, text, None))+ data.append((uid, {"content": text}, None))++ embeddings.index(data)++ # Search for best match+ result = embeddings.search("feel good story", 1)[0]++ self.assertEqual(result["text"], self.data[4])+def testMultiSave(self):"""Tests multiple successive saves@@ -330,26 +350,6 @@ class TestEmbeddings(unittest.TestCase):self.assertRaises(NotImplementedError, database.embed, None, None)self.assertRaises(NotImplementedError, database.query, None, None)- def testMultiData(self):- """- Test indexing with multiple data types (text, documents)- """-- embeddings = Embeddings({"path": "sentence-transformers/nli-mpnet-base-v2", "content": True, "batch": len(self.data)})-- # Create an index using mixed data (text and documents)- data = []- for uid, text in enumerate(self.data):- data.append((uid, text, None))- data.append((uid, {"content": text}, None))-- embeddings.index(data)-- # Search for best match- result = embeddings.search("feel good story", 1)[0]-- self.assertEqual(result["text"], self.data[4])-def testQueryModel(self):"""Test index