add file
This commit is contained in:
+4
-8
@@ -1,14 +1,10 @@
|
|||||||
from langchain_qdrant import QdrantVectorStore
|
from langchain_community.vectorstores import Chroma
|
||||||
from langchain_ollama import OllamaEmbeddings
|
from langchain_ollama import OllamaEmbeddings
|
||||||
from langchain.schema import Document
|
from langchain.schema import Document
|
||||||
|
|
||||||
class QdrantStore:
|
class ChromaStore:
|
||||||
def __init__(self, host="localhost", port=6333, collection_name="rag_collection"):
|
def __init__(self, collection_name="rag_collection"):
|
||||||
self.client = QdrantVectorStore(
|
self.client = Chroma(embedding_function=OllamaEmbeddings(model="nomic-embed-text"), collection_name=collection_name)
|
||||||
url=f"http://{host}:{port}",
|
|
||||||
collection_name=collection_name,
|
|
||||||
embeddings=OllamaEmbeddings(model="nomic-embed-text")
|
|
||||||
)
|
|
||||||
# ensure collection exists
|
# ensure collection exists
|
||||||
if not self.client.collection_exists:
|
if not self.client.collection_exists:
|
||||||
self.client.create_collection()
|
self.client.create_collection()
|
||||||
|
|||||||
Reference in New Issue
Block a user