File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 77from .pipeline_version import get_current_version
88
99
10+ DEFAULT_TIME_ELAPSED = {
11+ "time_elapsed" : 0 ,
12+ "has_error" : True ,
13+ "answer" : "" ,
14+ }
15+
16+
1017def get_all_by_conversation_id (
1118 project_id : str , conversation_id : str
1219) -> List [CognitionMessage ]:
@@ -141,13 +148,15 @@ def get_message_short_for_conversation_for_pipeline(
141148 time_elapsed = general .execute_first (query )
142149 if time_elapsed and time_elapsed [0 ]:
143150 time_elapsed = time_elapsed [0 ]
151+ else :
152+ time_elapsed = {}
144153
145154 return [
146155 {
147156 "id" : str (e .id ),
148157 "question" : e .question ,
149158 "created_at" : str (e .created_at ),
150- ** time_elapsed .get (str (e .id ), - 1 ),
159+ ** time_elapsed .get (str (e .id ), DEFAULT_TIME_ELAPSED ),
151160 }
152161 for e in (
153162 session .query (CognitionMessage )
You can’t perform that action at this time.
0 commit comments