afrom_texts() — langchain Function Reference
Architecture documentation for the afrom_texts() function in vectorstores.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD abe1bf7a_a00e_6397_9fc7_cf87714d9167["afrom_texts()"] bf62db79_4217_463c_798f_6f8528ed0d6e["Qdrant"] abe1bf7a_a00e_6397_9fc7_cf87714d9167 -->|defined in| bf62db79_4217_463c_798f_6f8528ed0d6e ac7b5827_8ed2_b07c_6d88_57b31096cc99["aconstruct_instance()"] abe1bf7a_a00e_6397_9fc7_cf87714d9167 -->|calls| ac7b5827_8ed2_b07c_6d88_57b31096cc99 675dc134_0c09_bf23_f892_4a4af82a4549["aadd_texts()"] abe1bf7a_a00e_6397_9fc7_cf87714d9167 -->|calls| 675dc134_0c09_bf23_f892_4a4af82a4549 style abe1bf7a_a00e_6397_9fc7_cf87714d9167 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/qdrant/langchain_qdrant/vectorstores.py lines 1430–1611
async def afrom_texts(
cls: type[Qdrant],
texts: list[str],
embedding: Embeddings,
metadatas: list[dict] | None = None,
ids: Sequence[str] | None = None,
location: str | None = None,
url: str | None = None,
port: int | None = 6333,
grpc_port: int = 6334,
prefer_grpc: bool = False, # noqa: FBT001, FBT002
https: bool | None = None, # noqa: FBT001
api_key: str | None = None,
prefix: str | None = None,
timeout: int | None = None,
host: str | None = None,
path: str | None = None,
collection_name: str | None = None,
distance_func: str = "Cosine",
content_payload_key: str = CONTENT_KEY,
metadata_payload_key: str = METADATA_KEY,
vector_name: str | None = VECTOR_NAME,
batch_size: int = 64,
shard_number: int | None = None,
replication_factor: int | None = None,
write_consistency_factor: int | None = None,
on_disk_payload: bool | None = None, # noqa: FBT001
hnsw_config: models.HnswConfigDiff | None = None,
optimizers_config: models.OptimizersConfigDiff | None = None,
wal_config: models.WalConfigDiff | None = None,
quantization_config: models.QuantizationConfig | None = None,
init_from: models.InitFrom | None = None,
on_disk: bool | None = None, # noqa: FBT001
force_recreate: bool = False, # noqa: FBT001, FBT002
**kwargs: Any,
) -> Qdrant:
"""Construct Qdrant wrapper from a list of texts.
Args:
texts: A list of texts to be indexed in Qdrant.
embedding: A subclass of `Embeddings`, responsible for text vectorization.
metadatas:
An optional list of metadata. If provided it has to be of the same
length as a list of texts.
ids:
Optional list of ids to associate with the texts. Ids have to be
uuid-like strings.
location:
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.
url: either host or str of "scheme | None, host, port | None,
prefix | None".
port: Port of the REST API interface. Default: 6333
grpc_port: Port of the gRPC interface. Default: 6334
prefer_grpc:
If true - use gPRC interface whenever possible in custom methods.
Default: False
https: If true - use HTTPS(SSL) protocol. Default: None
api_key:
API key for authentication in Qdrant Cloud. Default: None
Can also be set via environment variable `QDRANT_API_KEY`.
prefix:
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:
Timeout for REST and gRPC API requests.
Default: 5.0 seconds for REST and unlimited for gRPC
host:
Host name of Qdrant service. If url and host are None, set to
'localhost'. Default: None
path:
Path in which the vectors will be stored while using local mode.
Default: None
collection_name:
Name of the Qdrant collection to be used. If not provided,
it will be created randomly. Default: None
distance_func:
Distance function. One of: "Cosine" / "Euclid" / "Dot".
Domain
Subdomains
Source
Frequently Asked Questions
What does afrom_texts() do?
afrom_texts() is a function in the langchain codebase, defined in libs/partners/qdrant/langchain_qdrant/vectorstores.py.
Where is afrom_texts() defined?
afrom_texts() is defined in libs/partners/qdrant/langchain_qdrant/vectorstores.py at line 1430.
What does afrom_texts() call?
afrom_texts() calls 2 function(s): aadd_texts, aconstruct_instance.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free