Home / Function/ _batch() — langchain Function Reference

_batch() — langchain Function Reference

Architecture documentation for the _batch() function in test_runnable.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  a92288d5_3ea4_6080_81b2_e09426cb961e["_batch()"]
  192ffa80_aa8c_9fdf_71de_8d2c6c5ac8d1["ControlledExceptionRunnable"]
  a92288d5_3ea4_6080_81b2_e09426cb961e -->|defined in| 192ffa80_aa8c_9fdf_71de_8d2c6c5ac8d1
  ddb31a72_b9b1_0f3c_afc0_e5a9b2ad7fc4["test_seq_batch_return_exceptions()"]
  ddb31a72_b9b1_0f3c_afc0_e5a9b2ad7fc4 -->|calls| a92288d5_3ea4_6080_81b2_e09426cb961e
  style a92288d5_3ea4_6080_81b2_e09426cb961e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/runnables/test_runnable.py lines 4188–4203

        def _batch(
            self,
            inputs: list[str],
        ) -> list[str | Exception]:
            outputs: list[str | Exception] = []
            for value in inputs:
                if value.startswith(self.fail_starts_with):
                    outputs.append(
                        ValueError(
                            f"ControlledExceptionRunnable({self.fail_starts_with}) "
                            f"fail for {value}"
                        )
                    )
                else:
                    outputs.append(value + "a")
            return outputs

Domain

Subdomains

Frequently Asked Questions

What does _batch() do?
_batch() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/runnables/test_runnable.py.
Where is _batch() defined?
_batch() is defined in libs/core/tests/unit_tests/runnables/test_runnable.py at line 4188.
What calls _batch()?
_batch() is called by 1 function(s): test_seq_batch_return_exceptions.

Analyze Your Own Codebase

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

Try Supermodel Free