maeser.controllers.chat_logs_overview module

Contents

maeser.controllers.chat_logs_overview module#

This module contains the controller function for rendering the chat logs overview page.

It handles fetching log files, applying filters, and calculating aggregate data such as total tokens and cost.

maeser.controllers.chat_logs_overview.controller(chat_sessions_manager: ChatSessionManager, app_name: str = 'Maeser', main_logo_chat: str | None = None, favicon: str | None = None) str[source]#

Renders the home page with log files and aggregate token and cost data.

Parameters:
  • chat_sessions_manager (ChatSessionManager) – An instance of ChatSessionManager to manage chat sessions.

  • app_name (str) – The name of the app. This will be populated in the page’s title element and header. Defaults to ‘Maeser’.

  • main_logo_chat (str | None) – The dark version of the main logo. Defaults to None, in which case maeser/data/static/maeser-dark-header.png is used.

  • favicon (str | None) – The favicon image URL. Defaults to None, in which case maeser/data/static/maeser.png is used.

Returns:

Rendered home template with log file list.

Return type:

str