Skip to main content
View module source on GitHub Models for LangChain logging and tracing functionality. This module contains data models used for tracking and logging LangChain operations, including metadata storage and run information.

Metadata

RunMetadata class to holds the metadata info associated with a run

__init__

Initializes the RunMetadata object Arguments:

Container

Container class to hold the container id, type and name for logging

create

Creates the container in the logger

id

Returns:

type

Returns:

is_created

Checks if the container has been created Returns:

parent

Returns:

add_generation

Adds a generation to the container Returns:

add_tool_call

Adds a tool call to the container Returns:

add_event

Adds an event to the container. Arguments: Returns: None

add_span

Adds a span to the container Returns:

add_retrieval

Adds a retrieval to the container Returns:

add_tags

Adds tags to the container Arguments:

add_error

Adds an error to the container Arguments:

set_input

Sets the input to the container Arguments:

set_output

Sets the output to the container Arguments:

add_metadata

Adds metadata to the container Arguments:

end

Ends the container

TraceContainer

A trace in the logger

add_generation

Adds a generation to the container Returns:

end

Ends the container

SpanContainer

A span in the logger

end

Ends the container