_get_standardized_outputs() — langchain Function Reference
Architecture documentation for the _get_standardized_outputs() function in log_stream.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 0943f408_8b28_69b3_fbf5_b8fae15394f4["_get_standardized_outputs()"] bd3b753a_7a64_0c77_8d7a_afcce4658003["log_stream.py"] 0943f408_8b28_69b3_fbf5_b8fae15394f4 -->|defined in| bd3b753a_7a64_0c77_8d7a_afcce4658003 dd086141_42ce_3053_f911_051099488c1c["_on_run_update()"] dd086141_42ce_3053_f911_051099488c1c -->|calls| 0943f408_8b28_69b3_fbf5_b8fae15394f4 style 0943f408_8b28_69b3_fbf5_b8fae15394f4 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/langchain_core/tracers/log_stream.py lines 605–634
def _get_standardized_outputs(
run: Run, schema_format: Literal["original", "streaming_events", "original+chat"]
) -> Any | None:
"""Extract standardized output from a run.
Standardizes the outputs based on the type of the runnable used.
Args:
run: the run object.
schema_format: The schema format to use.
Returns:
An output if returned, otherwise `None`.
"""
outputs = load(run.outputs, allowed_objects="all")
if schema_format == "original":
if run.run_type == "prompt" and "output" in outputs:
# These were previously dumped before the tracer.
# Now we needn't do anything to them.
return outputs["output"]
# Return the old schema, without standardizing anything
return outputs
if run.run_type in {"retriever", "llm", "chat_model"}:
return outputs
if isinstance(outputs, dict):
return outputs.get("output", None)
return None
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does _get_standardized_outputs() do?
_get_standardized_outputs() is a function in the langchain codebase, defined in libs/core/langchain_core/tracers/log_stream.py.
Where is _get_standardized_outputs() defined?
_get_standardized_outputs() is defined in libs/core/langchain_core/tracers/log_stream.py at line 605.
What calls _get_standardized_outputs()?
_get_standardized_outputs() is called by 1 function(s): _on_run_update.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free