maeser.blueprints module

maeser.blueprints module#

Blueprint definitions for the Maeser application.

This module sets up the Flask blueprint and associated routes for the Maeser application. It includes route handlers for chat interfaces, user management, feedback, and training functionalities.

© 2024 Blaine Freestone, Carson Bush

This file is part of Maeser.

Maeser is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Maeser is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with Maeser. If not, see <https://www.gnu.org/licenses/>.

maeser.blueprints.add_flask_blueprint(app: flask.Flask, flask_secret_key: str, chat_session_manager: ChatSessionManager, user_manager: UserManager | None = None, app_name: str | None = None, main_logo_light: str | None = None, main_logo_dark: str | None = None, chat_head: str | None = None, favicon: str | None = None) flask.Flask[source]#

Add the Maeser blueprint to the Flask application.

Parameters:
  • app (Flask) – The Flask application instance.

  • flask_secret_key (str) – The secret key for the Flask application.

  • chat_session_manager (ChatSessionManager) – The chat session manager instance.

  • user_manager (UserManager | None, optional) – The user manager instance. Defaults to None.

  • app_name (str | None, optional) – The name of the application. Defaults to None.

  • main_logo_light (str | None, optional) – URL or path to the light logo. Defaults to None.

  • main_logo_dark (str | None, optional) – URL or path to the dark logo. Defaults to None.

  • chat_head (str | None, optional) – URL or path to the chat header image. Defaults to None.

  • favicon (str | None, optional) – URL or path to the favicon. Defaults to None.

Returns:

The Flask application instance with the blueprint registered.

Return type:

Flask