Home / Function/ abatch() — langchain Function Reference

abatch() — langchain Function Reference

Architecture documentation for the abatch() function in base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  3189ace6_4bcd_eb11_db61_e611661e395c["abatch()"]
  70048a7c_06ac_54dc_f2cc_70cbfa8bcbc9["_ConfigurableModel"]
  3189ace6_4bcd_eb11_db61_e611661e395c -->|defined in| 70048a7c_06ac_54dc_f2cc_70cbfa8bcbc9
  1ec96341_0cad_d4df_0b5f_401dfd4ccd5a["_model()"]
  3189ace6_4bcd_eb11_db61_e611661e395c -->|calls| 1ec96341_0cad_d4df_0b5f_401dfd4ccd5a
  style 3189ace6_4bcd_eb11_db61_e611661e395c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/chat_models/base.py lines 831–857

    async def abatch(
        self,
        inputs: list[LanguageModelInput],
        config: RunnableConfig | list[RunnableConfig] | None = None,
        *,
        return_exceptions: bool = False,
        **kwargs: Any | None,
    ) -> list[Any]:
        config = config or None
        # If <= 1 config use the underlying models batch implementation.
        if config is None or isinstance(config, dict) or len(config) <= 1:
            if isinstance(config, list):
                config = config[0]
            return await self._model(config).abatch(
                inputs,
                config=config,
                return_exceptions=return_exceptions,
                **kwargs,
            )
        # If multiple configs default to Runnable.batch which uses executor to invoke
        # in parallel.
        return await super().abatch(
            inputs,
            config=config,
            return_exceptions=return_exceptions,
            **kwargs,
        )

Domain

Subdomains

Calls

Frequently Asked Questions

What does abatch() do?
abatch() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/chat_models/base.py.
Where is abatch() defined?
abatch() is defined in libs/langchain/langchain_classic/chat_models/base.py at line 831.
What does abatch() call?
abatch() calls 1 function(s): _model.

Analyze Your Own Codebase

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

Try Supermodel Free