Skip to main content

logger.file_logger

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: Union[str, Agent],
request: Dict[str, Union[float, str, List[Dict[str,
str]]]],
response: Union[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: Union[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, Union[LLMConfig, List[LLMConfig]]] = {}) -> None

Log a new wrapper instance.

log_new_client

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

Log a new client instance.

log_function_use

def log_function_use(source: Union[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.