@@ -92,6 +92,7 @@ async def merge_or_valid_new_memos(
9292 temperature = 0.2 , # precise
9393 ** PROMPTS [USE_LANGUAGE ]["merge_yolo" ].get_kwargs (),
9494 )
95+ oneline_response = r .data ().replace ("\n " , "<br/>" )
9596 if not r .ok ():
9697 TRACE_LOG .warning (
9798 project_id ,
@@ -100,14 +101,15 @@ async def merge_or_valid_new_memos(
100101 )
101102 return r
102103 memo_actions = parse_string_into_merge_yolo_action (r .data ())
104+
105+ abort_infos = []
103106 for i , m in enumerate (new_memos ):
104107 update_response = memo_actions .get (i + 1 , None )
105108 if update_response is None :
106- oneline_response = r .data ().replace ("\n " , "<br/>" )
107109 TRACE_LOG .warning (
108110 project_id ,
109111 user_id ,
110- f"No Corresponding Merge Action: { m [ 0 ]} , <raw_response> { oneline_response } </raw_response>" ,
112+ f"No Corresponding Merge Action: { new_memos_input [ i ]} , <raw_response> { oneline_response } </raw_response>" ,
111113 )
112114 continue
113115 f_c , f_a = m [1 ], m [2 ]
@@ -166,17 +168,19 @@ async def merge_or_valid_new_memos(
166168 }
167169 )
168170 elif update_response ["action" ] == "ABORT" :
169- oneline_response = r .data ().replace ("\n " , "<br/>" )
170- TRACE_LOG .info (
171- project_id ,
172- user_id ,
173- f"Invalid merge: { m [0 ]} . <raw_response> { oneline_response } </raw_response>" ,
174- )
171+ abort_infos .append (new_memos_input [i ])
175172 else :
176173 TRACE_LOG .warning (
177174 project_id ,
178175 user_id ,
179176 f"Unkown merge action: { update_response ['action' ]} " ,
180177 )
181178 continue
179+
180+ if len (abort_infos ):
181+ TRACE_LOG .info (
182+ project_id ,
183+ user_id ,
184+ f"Invalid merge: { abort_infos } . <raw_response> { oneline_response } </raw_response>" ,
185+ )
182186 return Promise .resolve (profile_session_results )
0 commit comments