logger
autogen.logger.SqliteLogger
SqliteLogger
Sqlite logger class.
Initialize the SqliteLogger.
Name | Description |
---|---|
config | Type: dict[str, Any] |
Class Attributes
schema_version
Instance Methods
get_connection
Get connection.
log_chat_completion
Log chat completion.
Name | Description |
---|---|
invocation_id | Invocation ID. Type: uuid.UUID |
client_id | Client ID. Type: int |
wrapper_id | Wrapper ID. Type: int |
source | Source of the chat completion. Type: str | Agent |
request | Request for the chat completion. Type: dict[str, float | str | list[dict[str, str]]] |
response | Response for the chat completion. Type: str | ChatCompletion |
is_cached | Whether the response is cached. Type: int |
cost | Cost of the chat completion. Type: float |
start_time | Start time of the chat completion. Type: str |
log_event
Log event.
Name | Description |
---|---|
source | Source of the event. Type: str | Agent |
name | Name of the event. Type: str |
**kwargs | Additional arguments for the event. Type: dict[str, Any] |
log_function_use
Log function use.
Name | Description |
---|---|
source | Source of the function use. Type: str | Agent |
function | Function to log. Type: F |
args | Arguments of the function. Type: dict[str, Any] |
returns | Returns of the function. Type: Any |
log_new_agent
Log new agent.
Name | Description |
---|---|
agent | Agent to log. Type: ConversableAgent |
init_args | Initialization arguments of the agent Type: dict[str, Any] |
log_new_client
Log new client.
Name | Description |
---|---|
client | Client to log. Type: AzureOpenAI | OpenAI | CerebrasClient | GeminiClient | AnthropicClient | MistralAIClient | TogetherClient | GroqClient | CohereClient | OllamaClient | BedrockClient |
wrapper | Wrapper of the client. Type: OpenAIWrapper |
init_args | Initialization arguments of the client. Type: dict[str, Any] |
log_new_wrapper
Log new wrapper.
Name | Description |
---|---|
wrapper | Wrapper to log. Type: OpenAIWrapper |
init_args | Initialization arguments of the wrapper Type: dict[str, LLMConfig | list[LLMConfig]] |
start
Open a connection to the logging database, and start recording.
Returns:
session_id (str): a unique id for the logging session
Type | Description |
---|---|
str | session_id (str): a unique id for the logging session |
stop
Stop the logger