invoke() — langchain Function Reference
Architecture documentation for the invoke() function in router.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 7ef8f2a4_9aa2_9baa_0143_41c8a576c151["invoke()"] 65b9aaca_53f2_847d_9ab7_024fe53cbbd2["RouterRunnable"] 7ef8f2a4_9aa2_9baa_0143_41c8a576c151 -->|defined in| 65b9aaca_53f2_847d_9ab7_024fe53cbbd2 c9737a6d_ee16_ffc7_0ee4_5b2b93274f59["batch()"] c9737a6d_ee16_ffc7_0ee4_5b2b93274f59 -->|calls| 7ef8f2a4_9aa2_9baa_0143_41c8a576c151 style 7ef8f2a4_9aa2_9baa_0143_41c8a576c151 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/langchain_core/runnables/router.py lines 107–117
def invoke(
self, input: RouterInput, config: RunnableConfig | None = None, **kwargs: Any
) -> Output:
key = input["key"]
actual_input = input["input"]
if key not in self.runnables:
msg = f"No runnable associated with key '{key}'"
raise ValueError(msg)
runnable = self.runnables[key]
return runnable.invoke(actual_input, config)
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does invoke() do?
invoke() is a function in the langchain codebase, defined in libs/core/langchain_core/runnables/router.py.
Where is invoke() defined?
invoke() is defined in libs/core/langchain_core/runnables/router.py at line 107.
What calls invoke()?
invoke() is called by 1 function(s): batch.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free