prepare() — langchain Function Reference
Architecture documentation for the prepare() function in configurable.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 6c8c0cc1_0a40_0783_8101_190958516082["prepare()"] 362fbd14_1215_07f6_f808_35a613dfc00b["DynamicRunnable"] 6c8c0cc1_0a40_0783_8101_190958516082 -->|defined in| 362fbd14_1215_07f6_f808_35a613dfc00b 248ca6fd_e22f_526e_f252_f7a2c997d6ec["get_input_schema()"] 248ca6fd_e22f_526e_f252_f7a2c997d6ec -->|calls| 6c8c0cc1_0a40_0783_8101_190958516082 b6bb4444_c935_aeb5_67e1_a841dfa846cc["get_output_schema()"] b6bb4444_c935_aeb5_67e1_a841dfa846cc -->|calls| 6c8c0cc1_0a40_0783_8101_190958516082 9435bb2f_f83c_18e7_280f_f06fab12b7c9["get_graph()"] 9435bb2f_f83c_18e7_280f_f06fab12b7c9 -->|calls| 6c8c0cc1_0a40_0783_8101_190958516082 d2daec15_b363_e821_e6c5_fd596970406d["invoke()"] d2daec15_b363_e821_e6c5_fd596970406d -->|calls| 6c8c0cc1_0a40_0783_8101_190958516082 36db5f71_2723_a4d9_b1dc_bca712e26207["ainvoke()"] 36db5f71_2723_a4d9_b1dc_bca712e26207 -->|calls| 6c8c0cc1_0a40_0783_8101_190958516082 8521cf9a_986c_818c_2bc6_6bd0a10e4e47["batch()"] 8521cf9a_986c_818c_2bc6_6bd0a10e4e47 -->|calls| 6c8c0cc1_0a40_0783_8101_190958516082 268e4621_c476_39f4_16bc_1bffcb10d575["abatch()"] 268e4621_c476_39f4_16bc_1bffcb10d575 -->|calls| 6c8c0cc1_0a40_0783_8101_190958516082 e40a8507_73ef_e407_b4f6_7b4a7458aeed["stream()"] e40a8507_73ef_e407_b4f6_7b4a7458aeed -->|calls| 6c8c0cc1_0a40_0783_8101_190958516082 7002e59f_86be_cdb4_fbe3_a9235f385812["astream()"] 7002e59f_86be_cdb4_fbe3_a9235f385812 -->|calls| 6c8c0cc1_0a40_0783_8101_190958516082 30908df3_c968_87d8_3077_4faab65f68b5["transform()"] 30908df3_c968_87d8_3077_4faab65f68b5 -->|calls| 6c8c0cc1_0a40_0783_8101_190958516082 84c24ba6_5349_bd71_ca3f_f1475e7e20f4["atransform()"] 84c24ba6_5349_bd71_ca3f_f1475e7e20f4 -->|calls| 6c8c0cc1_0a40_0783_8101_190958516082 5c326896_6667_7526_0374_d8c162087b8a["__getattr__()"] 5c326896_6667_7526_0374_d8c162087b8a -->|calls| 6c8c0cc1_0a40_0783_8101_190958516082 8b757577_57b1_e339_365a_8b77f7fb67ee["_prepare()"] 6c8c0cc1_0a40_0783_8101_190958516082 -->|calls| 8b757577_57b1_e339_365a_8b77f7fb67ee style 6c8c0cc1_0a40_0783_8101_190958516082 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/langchain_core/runnables/configurable.py lines 120–134
def prepare(
self, config: RunnableConfig | None = None
) -> tuple[Runnable[Input, Output], RunnableConfig]:
"""Prepare the `Runnable` for invocation.
Args:
config: The configuration to use.
Returns:
The prepared `Runnable` and configuration.
"""
runnable: Runnable[Input, Output] = self
while isinstance(runnable, DynamicRunnable):
runnable, config = runnable._prepare(merge_configs(runnable.config, config)) # noqa: SLF001
return runnable, cast("RunnableConfig", config)
Domain
Subdomains
Calls
Called By
Source
Frequently Asked Questions
What does prepare() do?
prepare() is a function in the langchain codebase, defined in libs/core/langchain_core/runnables/configurable.py.
Where is prepare() defined?
prepare() is defined in libs/core/langchain_core/runnables/configurable.py at line 120.
What does prepare() call?
prepare() calls 1 function(s): _prepare.
What calls prepare()?
prepare() is called by 12 function(s): __getattr__, abatch, ainvoke, astream, atransform, batch, get_graph, get_input_schema, and 4 more.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free