-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata_model.py
29 lines (24 loc) · 848 Bytes
/
data_model.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# data_model.py
import datetime
class DataModel:
"""
This class holds the essential data for the state machine.
It does NOT include dynamic methods or triggers from transitions.
"""
def __init__(self, name, session_id, user_id, session_chat_history=None):
self.name = name
self.session_id = session_id
self.user_id = user_id
self.session_chat_history = session_chat_history or []
self.state = 'idle' # The current state of the user session
self.timestamp = datetime.datetime.now()
self.answer_message = None
self.active_tool = None
self.active_tool_params = None
self.counters = {
'tool_selection': 0,
'error': 0,
'completed': 0
}
self.error_message = ""
self.completed_time = None