Add Oracle23ai as a vector datasource (#5342)

Co-authored-by: walter from vm <walter.jin@oracle.com>
This commit is contained in:
tmuife
2024-06-22 01:48:07 +08:00
committed by GitHub
parent 27f0ae8416
commit 6a09409ec9
16 changed files with 712 additions and 301 deletions

View File

@@ -0,0 +1,30 @@
from core.rag.datasource.vdb.oracle.oraclevector import OracleVector, OracleVectorConfig
from core.rag.models.document import Document
from tests.integration_tests.vdb.test_vector_store import (
AbstractVectorTest,
get_example_text,
setup_mock_redis,
)
class OracleVectorTest(AbstractVectorTest):
def __init__(self):
super().__init__()
self.vector = OracleVector(
collection_name=self.collection_name,
config=OracleVectorConfig(
host="localhost",
port=1521,
user="dify",
password="dify",
database="FREEPDB1",
),
)
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) == 0
def test_oraclevector(setup_mock_redis):
OracleVectorTest().run_all_tests()