@@ -259,7 +259,7 @@ def insert_timing(self, message_id, timestamps):
259
259
self .cursor , self .conn = None , None
260
260
261
261
262
- def __call__ (self , message : List [str ], conversation_id : int , is_refresh : bool , server_received_msg_ts : datetime , client_msg_ts : float , client_timeout : float ):
262
+ def __call__ (self , message : List [str ], conversation_id : int , is_refresh : bool , server_received_msg_ts : datetime , client_sent_msg_ts : float , client_timeout : float ):
263
263
"""
264
264
Execute the chat functionality.
265
265
"""
@@ -301,7 +301,7 @@ def __call__(self, message: List[str], conversation_id: int, is_refresh: bool, s
301
301
302
302
# guard call to LLM; if timestamp from message is more than timeout secs in the past;
303
303
# return error=True and do not generate response as the client will have timed out
304
- if server_received_msg_ts .timestamp () - client_msg_ts > client_timeout :
304
+ if server_received_msg_ts .timestamp () - client_sent_msg_ts > client_timeout :
305
305
return None , None , None , True
306
306
307
307
# run chain to get result; limit users to 1000 queries per conversation; refreshing browser starts new conversation
@@ -437,7 +437,7 @@ def get_chat_response(self):
437
437
438
438
# store timing info for this message
439
439
timestamps ['server_received_msg_ts' ] = server_received_msg_ts
440
- timestamps ['client_sent_msg_ts' ] = client_sent_msg_ts
440
+ timestamps ['client_sent_msg_ts' ] = datetime . fromtimestamp ( client_sent_msg_ts )
441
441
self .chat .insert_timing (message_ids [- 1 ], timestamps )
442
442
443
443
# otherwise return A2rchi's response to client
0 commit comments