batch() — langchain Function Reference
Architecture documentation for the batch() function in test_runnable.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 593bb72a_4695_6c93_b95c_e277aca006ae["batch()"] 192ffa80_aa8c_9fdf_71de_8d2c6c5ac8d1["ControlledExceptionRunnable"] 593bb72a_4695_6c93_b95c_e277aca006ae -->|defined in| 192ffa80_aa8c_9fdf_71de_8d2c6c5ac8d1 c865b13d_440d_195f_8f93_74aa1a302124["test_passthrough_tap()"] c865b13d_440d_195f_8f93_74aa1a302124 -->|calls| 593bb72a_4695_6c93_b95c_e277aca006ae c815e74e_a60f_9f8b_d559_154085048c7a["test_with_config()"] c815e74e_a60f_9f8b_d559_154085048c7a -->|calls| 593bb72a_4695_6c93_b95c_e277aca006ae 885a7702_d799_80c5_7111_a31c94ee5e8e["test_default_method_implementations()"] 885a7702_d799_80c5_7111_a31c94ee5e8e -->|calls| 593bb72a_4695_6c93_b95c_e277aca006ae 275ec322_b94e_59cc_b503_f5f88356efb1["test_prompt()"] 275ec322_b94e_59cc_b503_f5f88356efb1 -->|calls| 593bb72a_4695_6c93_b95c_e277aca006ae 39e9ce18_afd0_bc6c_ae16_f073a179b7e0["test_prompt_with_chat_model()"] 39e9ce18_afd0_bc6c_ae16_f073a179b7e0 -->|calls| 593bb72a_4695_6c93_b95c_e277aca006ae eb2f915f_755e_dd2c_1ba1_afcfb20dd5be["test_router_runnable()"] eb2f915f_755e_dd2c_1ba1_afcfb20dd5be -->|calls| 593bb72a_4695_6c93_b95c_e277aca006ae be9051e1_675b_b440_1772_caff1939fc2f["test_higher_order_lambda_runnable()"] be9051e1_675b_b440_1772_caff1939fc2f -->|calls| 593bb72a_4695_6c93_b95c_e277aca006ae 4becb306_21ba_dac9_68f8_27e88f689364["test_retrying()"] 4becb306_21ba_dac9_68f8_27e88f689364 -->|calls| 593bb72a_4695_6c93_b95c_e277aca006ae 4b8272eb_38a4_8b7f_1979_8fbc0d8cb6f6["test_retry_batch_preserves_order()"] 4b8272eb_38a4_8b7f_1979_8fbc0d8cb6f6 -->|calls| 593bb72a_4695_6c93_b95c_e277aca006ae ddb31a72_b9b1_0f3c_afc0_e5a9b2ad7fc4["test_seq_batch_return_exceptions()"] ddb31a72_b9b1_0f3c_afc0_e5a9b2ad7fc4 -->|calls| 593bb72a_4695_6c93_b95c_e277aca006ae 8710f0c7_ddeb_700b_8de4_7a25105fc4b1["test_seq_abatch_return_exceptions()"] 8710f0c7_ddeb_700b_8de4_7a25105fc4b1 -->|calls| 593bb72a_4695_6c93_b95c_e277aca006ae 388b25eb_5f7b_8bf0_d403_f62071fdfc90["test_runnable_branch_batch()"] 388b25eb_5f7b_8bf0_d403_f62071fdfc90 -->|calls| 593bb72a_4695_6c93_b95c_e277aca006ae c524acaf_5dca_5dbd_855c_a6af20aa19c7["test_runnable_gen()"] c524acaf_5dca_5dbd_855c_a6af20aa19c7 -->|calls| 593bb72a_4695_6c93_b95c_e277aca006ae style 593bb72a_4695_6c93_b95c_e277aca006ae fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/runnables/test_runnable.py lines 4205–4219
def batch(
self,
inputs: list[str],
config: RunnableConfig | list[RunnableConfig] | None = None,
*,
return_exceptions: bool = False,
**kwargs: Any,
) -> list[str]:
return self._batch_with_config(
self._batch,
inputs,
config,
return_exceptions=return_exceptions,
**kwargs,
)
Domain
Subdomains
Called By
- test_default_method_implementations()
- test_higher_order_lambda_runnable()
- test_passthrough_tap()
- test_prompt()
- test_prompt_with_chat_model()
- test_retry_batch_preserves_order()
- test_retrying()
- test_router_runnable()
- test_runnable_branch_batch()
- test_runnable_gen()
- test_runnable_gen_context_config()
- test_runnable_iter_context_config()
- test_runnable_lambda_context_config()
- test_seq_abatch_return_exceptions()
- test_seq_batch_return_exceptions()
- test_with_config()
Source
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 4205.
What calls batch()?
batch() is called by 16 function(s): test_default_method_implementations, test_higher_order_lambda_runnable, test_passthrough_tap, test_prompt, test_prompt_with_chat_model, test_retry_batch_preserves_order, test_retrying, test_router_runnable, and 8 more.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free