Documentation Index
Fetch the complete documentation index at: https://www.getmaxim.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
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.
@dataclass
class Metadata()
RunMetadata class to holds the metadata info associated with a run
__init__
def __init__(metadata: Optional[Dict[str, Any]])
Initializes the RunMetadata object
Arguments:
| Name | Type | Description |
|---|
metadata | Optional[Dict[str,Any]] | Metadata to initialize from |
Container class to hold the container id, type and name for logging
create
def create(tags: Optional[Dict[str, str]] = None) -> None
Creates the container in the logger
Returns:
| Name | Description |
|---|
str | id of the container |
type
Returns:
| Name | Description |
|---|
str | type of the container |
is_created
Checks if the container has been created
Returns:
| Name | Description |
|---|
bool | True if the container has been created, False otherwise |
parent
def parent() -> Optional[str]
Returns:
| Name | Description |
|---|
[Container](/sdk/python/references/logger/models/container) | parent container |
add_generation
@abstractmethod
def add_generation(config: GenerationConfig) -> Generation
Adds a generation to the container
Returns:
| Name | Description |
|---|
[Generation](/sdk/python/references/logger/components/generation) | Generation object |
@abstractmethod
def add_tool_call(config: ToolCallConfig) -> ToolCall
Adds a tool call to the container
Returns:
| Name | Description |
|---|
[ToolCall](/sdk/python/references/models/prompt) | ToolCall object |
add_event
def add_event(event_id: str,
name: str,
tags: Dict[str, str],
metadata: Optional[Dict[str, Any]] = None) -> None
Adds an event to the container.
Arguments:
| Name | Type | Description |
|---|
event_id | str | Unique identifier for the event. |
name | str | Name of the event. |
tags | Dict[str, str] | Additional key-value pairs to associate with the event. |
Returns:
None
add_span
@abstractmethod
def add_span(config: SpanConfig) -> Span
Adds a span to the container
Returns:
| Name | Description |
|---|
[Span](/sdk/python/references/logger/components/span) | Span object |
add_retrieval
@abstractmethod
def add_retrieval(config: RetrievalConfig) -> Retrieval
Adds a retrieval to the container
Returns:
| Name | Description |
|---|
[Retrieval](/sdk/python/references/logger/components/retrieval) | Retrieval object |
def add_tags(tags: Dict[str, str]) -> None
Adds tags to the container
Arguments:
| Name | Type | Description |
|---|
tags | Optional[Dict[str,str]] | Tags to add |
add_error
def add_error(error: ErrorConfig) -> None
Adds an error to the container
Arguments:
| Name | Type | Description |
|---|
error | GenerationError | Error to add |
def set_input(input: str) -> None
Sets the input to the container
Arguments:
| Name | Type | Description |
|---|
input | str | Input to set |
set_output
def set_output(output) -> None
Sets the output to the container
Arguments:
| Name | Type | Description |
|---|
output | str | Output to set |
def add_metadata(metadata: Dict[str, str]) -> None
Adds metadata to the container
Arguments:
| Name | Type | Description |
|---|
metadata | Optional[Dict[str,str]] | Metadata to add |
end
Ends the container
class TraceContainer(Container)
A trace in the logger
add_generation
def add_generation(config: GenerationConfig) -> Generation
Adds a generation to the container
Returns:
| Name | Description |
|---|
[Generation](/sdk/python/references/logger/components/generation) | Generation object |
end
Ends the container
class SpanContainer(Container)
A span in the logger
end
Ends the container