| 12345678910111213141516171819202122232425262728 | from core.rag.datasource.vdb.upstash.upstash_vector import UpstashVector, UpstashVectorConfigfrom core.rag.models.document import Documentfrom tests.integration_tests.vdb.__mock.upstashvectordb import setup_upstashvector_mockfrom tests.integration_tests.vdb.test_vector_store import AbstractVectorTest, get_example_textclass UpstashVectorTest(AbstractVectorTest):    def __init__(self):        super().__init__()        self.vector = UpstashVector(            collection_name="test_collection",            config=UpstashVectorConfig(                url="your-server-url",                token="your-access-token",            ),        )    def get_ids_by_metadata_field(self):        ids = self.vector.get_ids_by_metadata_field(key="document_id", value=self.example_doc_id)        assert len(ids) != 0    def search_by_full_text(self):        hits_by_full_text: list[Document] = self.vector.search_by_full_text(query=get_example_text())        assert len(hits_by_full_text) == 0def test_upstash_vector(setup_upstashvector_mock):    UpstashVectorTest().run_all_tests()
 |