set_config_context() — langchain Function Reference
Architecture documentation for the set_config_context() function in config.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD d7bec70c_4aaf_33f2_2cf8_ddd315d62618["set_config_context()"] 217fac2f_15f6_1c1e_2b6e_1dae6dfdea14["config.py"] d7bec70c_4aaf_33f2_2cf8_ddd315d62618 -->|defined in| 217fac2f_15f6_1c1e_2b6e_1dae6dfdea14 style d7bec70c_4aaf_33f2_2cf8_ddd315d62618 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/langchain_core/runnables/config.py lines 188–213
def set_config_context(config: RunnableConfig) -> Generator[Context, None, None]:
"""Set the child Runnable config + tracing context.
Args:
config: The config to set.
Yields:
The config context.
"""
ctx = copy_context()
config_token, _ = ctx.run(_set_config_context, config)
try:
yield ctx
finally:
ctx.run(var_child_runnable_config.reset, config_token)
ctx.run(
_set_tracing_context,
{
"parent": None,
"project_name": None,
"tags": None,
"metadata": None,
"enabled": None,
"client": None,
},
)
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does set_config_context() do?
set_config_context() is a function in the langchain codebase, defined in libs/core/langchain_core/runnables/config.py.
Where is set_config_context() defined?
set_config_context() is defined in libs/core/langchain_core/runnables/config.py at line 188.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free