include_run() — langchain Function Reference
Architecture documentation for the include_run() function in log_stream.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 98bcd7e4_7b8f_2694_2f03_85ddc533e9b2["include_run()"] 78fc514f_5439_00c6_7e00_021af9ce4e07["LogStreamCallbackHandler"] 98bcd7e4_7b8f_2694_2f03_85ddc533e9b2 -->|defined in| 78fc514f_5439_00c6_7e00_021af9ce4e07 79906bae_a315_8c6a_0f74_2bca8c58615c["_on_run_create()"] 79906bae_a315_8c6a_0f74_2bca8c58615c -->|calls| 98bcd7e4_7b8f_2694_2f03_85ddc533e9b2 style 98bcd7e4_7b8f_2694_2f03_85ddc533e9b2 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/langchain_core/tracers/log_stream.py lines 389–426
def include_run(self, run: Run) -> bool:
"""Check if a `Run` should be included in the log.
Args:
run: The `Run` to check.
Returns:
`True` if the `Run` should be included, `False` otherwise.
"""
if run.id == self.root_id:
return False
run_tags = run.tags or []
if (
self.include_names is None
and self.include_types is None
and self.include_tags is None
):
include = True
else:
include = False
if self.include_names is not None:
include = include or run.name in self.include_names
if self.include_types is not None:
include = include or run.run_type in self.include_types
if self.include_tags is not None:
include = include or any(tag in self.include_tags for tag in run_tags)
if self.exclude_names is not None:
include = include and run.name not in self.exclude_names
if self.exclude_types is not None:
include = include and run.run_type not in self.exclude_types
if self.exclude_tags is not None:
include = include and all(tag not in self.exclude_tags for tag in run_tags)
return include
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does include_run() do?
include_run() is a function in the langchain codebase, defined in libs/core/langchain_core/tracers/log_stream.py.
Where is include_run() defined?
include_run() is defined in libs/core/langchain_core/tracers/log_stream.py at line 389.
What calls include_run()?
include_run() is called by 1 function(s): _on_run_create.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free