with_types() — langchain Function Reference
Architecture documentation for the with_types() function in base.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD c9c7c02b_0dcd_70ff_1897_383c5e6adb58["with_types()"] 4a62481c_02cb_a5de_1833_50669d5351a6["Runnable"] c9c7c02b_0dcd_70ff_1897_383c5e6adb58 -->|defined in| 4a62481c_02cb_a5de_1833_50669d5351a6 0f2938ba_950e_46e8_852e_5087c4a53c28["with_types()"] 0f2938ba_950e_46e8_852e_5087c4a53c28 -->|calls| c9c7c02b_0dcd_70ff_1897_383c5e6adb58 0f2938ba_950e_46e8_852e_5087c4a53c28["with_types()"] c9c7c02b_0dcd_70ff_1897_383c5e6adb58 -->|calls| 0f2938ba_950e_46e8_852e_5087c4a53c28 style c9c7c02b_0dcd_70ff_1897_383c5e6adb58 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/langchain_core/runnables/base.py lines 1838–1858
def with_types(
self,
*,
input_type: type[Input] | None = None,
output_type: type[Output] | None = None,
) -> Runnable[Input, Output]:
"""Bind input and output types to a `Runnable`, returning a new `Runnable`.
Args:
input_type: The input type to bind to the `Runnable`.
output_type: The output type to bind to the `Runnable`.
Returns:
A new `Runnable` with the types bound.
"""
return RunnableBinding(
bound=self,
custom_input_type=input_type,
custom_output_type=output_type,
kwargs={},
)
Domain
Subdomains
Defined In
Calls
Called By
Source
Frequently Asked Questions
What does with_types() do?
with_types() is a function in the langchain codebase, defined in libs/core/langchain_core/runnables/base.py.
Where is with_types() defined?
with_types() is defined in libs/core/langchain_core/runnables/base.py at line 1838.
What does with_types() call?
with_types() calls 1 function(s): with_types.
What calls with_types()?
with_types() is called by 1 function(s): with_types.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free