Home / Function/ aadd_texts() — langchain Function Reference

aadd_texts() — langchain Function Reference

Architecture documentation for the aadd_texts() function in vectorstores.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  675dc134_0c09_bf23_f892_4a4af82a4549["aadd_texts()"]
  bf62db79_4217_463c_798f_6f8528ed0d6e["Qdrant"]
  675dc134_0c09_bf23_f892_4a4af82a4549 -->|defined in| bf62db79_4217_463c_798f_6f8528ed0d6e
  abe1bf7a_a00e_6397_9fc7_cf87714d9167["afrom_texts()"]
  abe1bf7a_a00e_6397_9fc7_cf87714d9167 -->|calls| 675dc134_0c09_bf23_f892_4a4af82a4549
  7268a9dd_664a_8cff_f4f9_a345b28dafd3["_agenerate_rest_batches()"]
  675dc134_0c09_bf23_f892_4a4af82a4549 -->|calls| 7268a9dd_664a_8cff_f4f9_a345b28dafd3
  style 675dc134_0c09_bf23_f892_4a4af82a4549 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/qdrant/langchain_qdrant/vectorstores.py lines 183–223

    async def aadd_texts(
        self,
        texts: Iterable[str],
        metadatas: list[dict] | None = None,
        ids: Sequence[str] | None = None,
        batch_size: int = 64,
        **kwargs: Any,
    ) -> list[str]:
        """Run more texts through the embeddings and add to the `VectorStore`.

        Args:
            texts: Iterable of strings to add to the `VectorStore`.
            metadatas: Optional list of metadatas associated with the texts.
            ids:
                Optional list of ids to associate with the texts. Ids have to be
                uuid-like strings.
            batch_size:
                How many vectors upload per-request.
                Default: `64`
            **kwargs: Additional keyword arguments.

        Returns:
            List of ids from adding the texts into the `VectorStore`.

        """
        if self.async_client is None or isinstance(
            self.async_client._client, AsyncQdrantLocal
        ):
            msg = "QdrantLocal cannot interoperate with sync and async clients"
            raise NotImplementedError(msg)

        added_ids = []
        async for batch_ids, points in self._agenerate_rest_batches(
            texts, metadatas, ids, batch_size
        ):
            await self.async_client.upsert(
                collection_name=self.collection_name, points=points, **kwargs
            )
            added_ids.extend(batch_ids)

        return added_ids

Subdomains

Called By

Frequently Asked Questions

What does aadd_texts() do?
aadd_texts() is a function in the langchain codebase, defined in libs/partners/qdrant/langchain_qdrant/vectorstores.py.
Where is aadd_texts() defined?
aadd_texts() is defined in libs/partners/qdrant/langchain_qdrant/vectorstores.py at line 183.
What does aadd_texts() call?
aadd_texts() calls 1 function(s): _agenerate_rest_batches.
What calls aadd_texts()?
aadd_texts() is called by 1 function(s): afrom_texts.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free