File size: 564 Bytes
d064c89
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from haystack.utils import Secret
from haystack_integrations.document_stores.qdrant import QdrantDocumentStore

from src.settings import settings


def get_index(index: str = "document") -> QdrantDocumentStore:
    return QdrantDocumentStore(
        url=settings.qdrant_database.url,
        api_key=Secret.from_env_var("QDRANT_DATABASE__API_KEY"),
        index=index,
        embedding_dim=settings.qdrant_database.embedding_dim,
        similarity="cosine",
        recreate_index=False,
        wait_result_from_api=True,
        return_embedding=True,
    )