FileLogger

class FileLogger(BaseLogger)

start

def start() -> str

Start the logger and return the session_id.

log_chat_completion

def log_chat_completion(invocation_id: uuid.UUID, client_id: int,
                        wrapper_id: int, source: str | Agent,
                        request: dict[str, float | str | list[dict[str, str]]],
                        response: str | ChatCompletion, is_cached: int,
                        cost: float, start_time: str) -> None

Log a chat completion.

log_new_agent

def log_new_agent(agent: ConversableAgent,
                  init_args: dict[str, Any] = \{}) -> None

Log a new agent instance.

log_event

def log_event(source: str | Agent, name: str, **kwargs: dict[str,
                                                             Any]) -> None

Log an event from an agent or a string source.

log_new_wrapper

def log_new_wrapper(
        wrapper: OpenAIWrapper,
        init_args: dict[str, LLMConfig | list[LLMConfig]] = \{}) -> None

Log a new wrapper instance.

log_new_client

def log_new_client(client: (AzureOpenAI
                            | OpenAI
                            | CerebrasClient
                            | GeminiClient
                            | AnthropicClient
                            | MistralAIClient
                            | TogetherClient
                            | GroqClient
                            | CohereClient
                            | OllamaClient
                            | BedrockClient), wrapper: OpenAIWrapper,
                   init_args: dict[str, Any]) -> None

Log a new client instance.

log_function_use

def log_function_use(source: str | Agent, function: F, args: dict[str, Any],
                     returns: Any) -> None

Log a registered function(can be a tool) use from an agent or a string source.

get_connection

def get_connection() -> None

Method is intentionally left blank because there is no specific connection needed for the FileLogger.

stop

def stop() -> None

Close the file handler and remove it from the logger.