Chat

Module to hold the chat repository.

class ChatRepository(manager, model=<class 'command_line_assistant.daemon.database.models.chat.ChatModel'>)[source]

Class that implements the chat repository methods.

Default constructor for chat repository.

Parameters:
  • manager (DatabaseManager) – The database manager instance.

  • model (ChatModel) – The SQLAlchemy model to use in the repository.

select_latest_chat(user_id)[source]

Select the latest chat for a given user

Return type:

ChatModel

Parameters:

user_id (str) – The user’s identifier

Returns:

The chat entry

Return type:

ChatModel