| Name | Type | Description |
|---|---|---|
texts* | list[str] | A list of texts to be indexed in Qdrant. |
embedding* | Embeddings | A subclass of |
metadatas | list[dict] | None | Default: None |
ids | Sequence[str] | None | Default: None |
location | str | None | Default: None |
url | str | None | Default: None |
port | int | None | Default: 6333 |
grpc_port | int | Default: 6334 |
prefer_grpc | bool | Default: False |
https | bool | None | Default: None |
api_key | str | None | Default: None |
prefix | str | None | Default: None |
timeout | int | None | Default: None |
host | str | None | Default: None |
path | str | None | Default: None |
collection_name | str | None | Default: None |
distance_func | str | Default: 'Cosine' |
content_payload_key | str | Default: CONTENT_KEY |
metadata_payload_key | str | Default: METADATA_KEY |
vector_name | str | None | Default: VECTOR_NAME |
batch_size | int | Default: 64 |
shard_number | int | None | Default: None |
replication_factor | int | None | Default: None |
write_consistency_factor | int | None | Default: None |
on_disk_payload | bool | None | Default: None |
hnsw_config | models.HnswConfigDiff | None | Default: None |
optimizers_config | models.OptimizersConfigDiff | None | Default: None |
wal_config | models.WalConfigDiff | None | Default: None |
quantization_config | models.QuantizationConfig | None | Default: None |
init_from | models.InitFrom | None | Default: None |
on_disk | bool | None | Default: None |
force_recreate | bool | Default: False |
**kwargs | Any | Default: {} |
Construct Qdrant wrapper from a list of texts.
This is a user-friendly interface that:
This is intended to be a quick way to get started.
from langchain_qdrant import Qdrant
from langchain_openai import OpenAIEmbeddings
embeddings = OpenAIEmbeddings()
qdrant = Qdrant.from_texts(texts, embeddings, "localhost")An optional list of metadata. If provided it has to be of the same length as a list of texts.
Optional list of ids to associate with the texts. Ids have to be uuid-like strings.
If ':memory:' - use in-memory Qdrant instance.
If str - use it as a url parameter.
If None - fallback to relying on host and port parameters.
either host or str of "scheme | None, host, port | None, prefix | None".
Port of the REST API interface. Default: 6333
Port of the gRPC interface. Default: 6334
If true - use gPRC interface whenever possible in custom methods. Default: False
If true - use HTTPS(SSL) protocol. Default: None
API key for authentication in Qdrant Cloud. Default: None
Can also be set via environment variable QDRANT_API_KEY.
If not None - add prefix to the REST URL path. Example: service/v1 will result in http://localhost:6333/service/v1/{qdrant-endpoint} for REST API. Default: None
Timeout for REST and gRPC API requests. Default: 5.0 seconds for REST and unlimited for gRPC
Host name of Qdrant service. If url and host are None, set to 'localhost'. Default: None
Path in which the vectors will be stored while using local mode. Default: None
Name of the Qdrant collection to be used. If not provided, it will be created randomly. Default: None
Distance function. One of: "Cosine" / "Euclid" / "Dot". Default: "Cosine"
A payload key used to store the content of the document. Default: "page_content"
A payload key used to store the metadata of the document. Default: "metadata"
Name of the vector to be used internally in Qdrant. Default: None
How many vectors upload per-request. Default: 64
Number of shards in collection. Default is 1, minimum is 1.
Replication factor for collection. Default is 1, minimum is 1. Defines how many copies of each shard will be created. Have effect only in distributed mode.
Write consistency factor for collection. Default is 1, minimum is 1. Defines how many replicas should apply the operation for us to consider it successful. Increasing this number will make the collection more resilient to inconsistencies, but will also make it fail if not enough replicas are available. Does not have any performance impact. Have effect only in distributed mode.
If true - point`s payload will not be stored in memory. It will be read from the disk every time it is requested. This setting saves RAM by (slightly) increasing the response time. Note: those payload values that are involved in filtering and are indexed - remain in RAM.
Params for HNSW index
Params for optimizer
Params for Write-Ahead-Log
Params for quantization, if None - quantization will be disabled
Use data stored in another collection to initialize this collection
If true - vectors will be stored on disk, reducing memory usage.
Force recreating the collection
Additional arguments passed directly into REST client initialization