File size: 480 Bytes
51a7f02
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import os
from qdrant_client import QdrantClient
from langchain.embeddings import OpenAIEmbeddings
from langchain.vectorstores import Qdrant

embeddings = OpenAIEmbeddings()
client = QdrantClient(url="https://32f125d3-5ab1-4058-a10a-bd38a1ebd647.us-east-1-0.aws.cloud.qdrant.io",
                                    api_key=os.getenv("QDRANT_API_KEY"))

def get_instance(collection: str = "test"):
    return Qdrant(client=client,collection_name=collection,embeddings=embeddings)