Home / Function/ with_config() — langchain Function Reference

with_config() — langchain Function Reference

Architecture documentation for the with_config() function in configurable.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  04d89f0e_4e07_ca93_b298_6c07ce57b182["with_config()"]
  018f968f_f1d1_6f85_05f3_0ff4abc12150["DynamicRunnable"]
  04d89f0e_4e07_ca93_b298_6c07ce57b182 -->|defined in| 018f968f_f1d1_6f85_05f3_0ff4abc12150
  style 04d89f0e_4e07_ca93_b298_6c07ce57b182 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/runnables/configurable.py lines 110–118

    def with_config(
        self,
        config: RunnableConfig | None = None,
        # Sadly Unpack is not well supported by mypy so this will have to be untyped
        **kwargs: Any,
    ) -> Runnable[Input, Output]:
        return self.__class__(
            **{**self.__dict__, "config": ensure_config(merge_configs(config, kwargs))}  # type: ignore[arg-type]
        )

Domain

Subdomains

Frequently Asked Questions

What does with_config() do?
with_config() is a function in the langchain codebase, defined in libs/core/langchain_core/runnables/configurable.py.
Where is with_config() defined?
with_config() is defined in libs/core/langchain_core/runnables/configurable.py at line 110.

Analyze Your Own Codebase

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

Try Supermodel Free