maeser.controllers.training_post module

Contents

maeser.controllers.training_post module#

This module contains the controller to save training data from a post request.

maeser.controllers.training_post.controller(chat_session_manager: ChatSessionManager) flask.Response[source]#

Handle the post request to save training data.

Uses flask.request and expects a post request with the following fields:

  • name”: The name of the form respondent.

  • role”: The role/position of the respondent. Expected values are “Professor” or “Teachers Assistant”.

  • type”: The type of training data. Expected values are “Information” or “Style”.

  • question”: The question the user would ask the chatbot.

  • answer”: The answer the chatbot should generate in response to the user’s question.

Parameters:

chat_session_manager (ChatSessionManager) – The chat session manager instance.

Returns:

Redirects to the home page.

Return type:

Response