Skip to main content
View module source on GitHub Configuration class for Maxim Logger. This class holds the configuration settings for the Logger, including the logger ID, auto-flush setting, and flush interval. Attributes:

LoggerConfig

Configuration class for Maxim Logger. This class holds the configuration settings for the Logger, including the logger ID, auto-flush setting, and flush interval. Attributes:

Logger

A class representing a logger for the Maxim SDK. This logger provides methods for creating sessions, traces, and various logging components such as spans, generations, retrievals, and tool calls. It uses a LogWriter to handle the actual logging operations. Attributes:

__init__

Initializes the logger with the given configuration. Arguments:

session

Creates a new session with the given configuration. Arguments: Returns:

trace

Creates a new trace with the given configuration. Arguments: Returns:

session_add_tag

Adds a tag to the session. Arguments:

session_end

Ends the session. Arguments:

session_event

Adds an event to the session. Arguments:

session_feedback

Adds a feedback to the session. Arguments:

session_add_attachment

Adds an attachment to the session.

session_add_feedback

Adds a feedback to the session.

session_trace

Adds a trace to the session. Arguments: Returns:

session_add_trace

Adds a trace to the session. Arguments: Returns:

trace_generation

Adds a generation to the trace. Arguments: Returns:

trace_add_generation

Adds a generation to the trace. Arguments: Returns:

trace_retrieval

Adds a retrieval to the trace. Arguments: Returns:

trace_add_retrieval

Adds a retrieval to the trace. Arguments: Returns:

trace_span

Adds a span to the trace. Arguments: Returns:

trace_add_span

Adds a span to the trace. Arguments: Returns:

trace_add_error

Adds an error to the trace.

trace_add_tag

Adds a tag to the trace. Arguments:

trace_add_tool_call

Adds a tool call to the trace. Arguments: Returns:

trace_event

Adds an event to the trace. Arguments:

trace_add_event

Adds an event to the trace.

trace_set_input

Sets the input for the trace. Arguments:

trace_set_output

Sets the output for the trace. Arguments:

trace_feedback

Adds a feedback to the trace. Arguments:

trace_add_feedback

Adds a feedback to the trace.

trace_add_metadata

Adds metadata to the trace. Arguments:

trace_add_attachment

Adds an attachment to the trace.

trace_end

Ends the trace. Arguments:

generation_set_model

Sets the model for the generation. Arguments:

generation_set_provider

Sets the provider for the generation.

generation_add_message

Adds a message to the generation. Arguments:

generation_set_model_parameters

Sets the model parameters for the generation. Arguments:

generation_result

Sets the result for the generation. Arguments:

generation_add_attachment

Adds an attachment to the generation.

generation_end

Ends the generation. Arguments:

generation_error

Sets the error for the generation. Arguments:

span_generation

Adds a generation to the span. Arguments: Returns:

span_add_generation

Adds a generation to the span. Arguments: Returns:

span_add_error

Adds an error to the span.

span_retrieval

Adds a retrieval to the span. Arguments: Returns:

span_add_retrieval

Adds a retrieval to the span. Arguments: Returns:

span_add_tool_call

Adds a tool call to the span. Arguments: Returns:

span_end

Ends the span. Arguments:

span_add_tag

Adds a tag to the span. Arguments:

span_event

Adds an event to the span. Arguments:

span_add_metadata

Adds metadata to the span. Arguments:

span_add_attachment

Adds an attachment to the span.

span_span

Adds a span to the span. Arguments: Returns:

span_add_sub_span

Adds a sub-span to the span. Arguments: Returns:

retrieval_end

Ends the retrieval. Arguments:

retrieval_input

Sets the input for the retrieval. Arguments:

retrieval_output

Sets the output for the retrieval. Arguments:

retrieval_add_tag

Adds a tag to the retrieval. Arguments:

retrieval_add_attachment

Adds an attachment to the retrieval.

tool_call_update

Updates the tool call. Arguments:

tool_call_result

Sets the result for the tool call. Arguments:

tool_call_error

Sets the error for the tool call. Arguments:

tool_call_add_metadata

Adds metadata to the tool call. Arguments:

id

Returns the ID of the logger.

flush

Flushes the writer.

cleanup

Cleans up the writer.