Home / Function/ _patch_config() — langchain Function Reference

_patch_config() — langchain Function Reference

Architecture documentation for the _patch_config() function in retry.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  9efc1d1c_fe0c_3ced_4e9c_39e7311c06af["_patch_config()"]
  dcb89960_9531_c0ae_7764_c192a29f52c0["RunnableRetry"]
  9efc1d1c_fe0c_3ced_4e9c_39e7311c06af -->|defined in| dcb89960_9531_c0ae_7764_c192a29f52c0
  790f2192_2e50_38d8_2e94_a32c9487f5b6["_patch_config_list()"]
  790f2192_2e50_38d8_2e94_a32c9487f5b6 -->|calls| 9efc1d1c_fe0c_3ced_4e9c_39e7311c06af
  7b74a65c_4658_df66_f42d_f8d8eb8c5f5d["_invoke()"]
  7b74a65c_4658_df66_f42d_f8d8eb8c5f5d -->|calls| 9efc1d1c_fe0c_3ced_4e9c_39e7311c06af
  2547348e_7cd5_195f_d5d3_cbe68344929a["_ainvoke()"]
  2547348e_7cd5_195f_d5d3_cbe68344929a -->|calls| 9efc1d1c_fe0c_3ced_4e9c_39e7311c06af
  style 9efc1d1c_fe0c_3ced_4e9c_39e7311c06af fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/runnables/retry.py lines 159–166

    def _patch_config(
        config: RunnableConfig,
        run_manager: "T",
        retry_state: RetryCallState,
    ) -> RunnableConfig:
        attempt = retry_state.attempt_number
        tag = f"retry:attempt:{attempt}" if attempt > 1 else None
        return patch_config(config, callbacks=run_manager.get_child(tag))

Domain

Subdomains

Frequently Asked Questions

What does _patch_config() do?
_patch_config() is a function in the langchain codebase, defined in libs/core/langchain_core/runnables/retry.py.
Where is _patch_config() defined?
_patch_config() is defined in libs/core/langchain_core/runnables/retry.py at line 159.
What calls _patch_config()?
_patch_config() is called by 3 function(s): _ainvoke, _invoke, _patch_config_list.

Analyze Your Own Codebase

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

Try Supermodel Free