Container
Container utilities for data models and type definitions used throughout the maxim sdk.
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:
Name | Type | Description |
---|---|---|
metadata | Optional[Dict[str,Any]] | Metadata to initialize from |
Container
Container class to hold the container id, type and name for logging
create
Creates the container in the logger
id
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
Returns:
Name | Description |
---|---|
[Container](/sdk/python/references/logger/models/container) | parent container |
add_generation
Adds a generation to the container
Returns:
Name | Description |
---|---|
[Generation](/sdk/python/references/logger/components/generation) | Generation object |
add_tool_call
Adds a tool call to the container
Returns:
Name | Description |
---|---|
[ToolCall](/sdk/python/references/models/prompt) | ToolCall object |
add_event
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
Adds a span to the container
Returns:
Name | Description |
---|---|
[Span](/sdk/python/references/logger/components/span) | Span object |
add_retrieval
Adds a retrieval to the container
Returns:
Name | Description |
---|---|
[Retrieval](/sdk/python/references/logger/components/retrieval) | Retrieval object |
add_tags
Adds tags to the container
Arguments:
Name | Type | Description |
---|---|---|
tags | Optional[Dict[str,str]] | Tags to add |
add_error
Adds an error to the container
Arguments:
Name | Type | Description |
---|---|---|
error | GenerationError | Error to add |
set_input
Sets the input to the container
Arguments:
Name | Type | Description |
---|---|---|
input | str | Input to set |
set_output
Sets the output to the container
Arguments:
Name | Type | Description |
---|---|---|
output | str | Output to set |
add_metadata
Adds metadata to the container
Arguments:
Name | Type | Description |
---|---|---|
metadata | Optional[Dict[str,str]] | Metadata to add |
end
Ends the container
TraceContainer
A trace in the logger
add_generation
Adds a generation to the container
Returns:
Name | Description |
---|---|
[Generation](/sdk/python/references/logger/components/generation) | Generation object |
end
Ends the container
SpanContainer
A span in the logger
end
Ends the container