Interface
ChatRepository
Bases: abc.ABC
Interface for the ChatRepository class,Defines the methods that the ChatRepository class should implement.
Parameters:
-
ABC
(abc.ABC
) –Abstract Base Class
Source code in src/project/database/Interface.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
add_message(message, role)
abstractmethod
summary
Parameters:
-
message
(str
) –Message to be added
-
role
(database.Session.Role
) –Role of the user
Source code in src/project/database/Interface.py
46 47 48 49 50 51 52 53 54 |
|
create_new_session()
abstractmethod
Method to create a new session.
Source code in src/project/database/Interface.py
13 14 15 16 17 |
|
get_all_session()
abstractmethod
Method to get all the sessions. Returns: list: List of all the sessions
Source code in src/project/database/Interface.py
19 20 21 22 23 24 25 |
|
get_current()
abstractmethod
Method to create a new session. Returns: Session: Current session
Source code in src/project/database/Interface.py
27 28 29 30 31 32 33 |
|
get_current_session(session_id)
abstractmethod
Method to get session by id
Parameters:
-
session_id
(int
) –Session id
Returns: Session: Session with the given id
Source code in src/project/database/Interface.py
35 36 37 38 39 40 41 42 43 44 |
|