@@ -172,15 +172,15 @@ def get_colang_history(
172172 history += f'user "{ event ["text" ]} "\n '
173173 elif event ["type" ] == "UserIntent" :
174174 if include_texts :
175- history += f' { event [" intent" ]} \n '
175+ history += f" { event [' intent' ]} \n "
176176 else :
177- history += f' user { event [" intent" ]} \n '
177+ history += f" user { event [' intent' ]} \n "
178178 elif event ["type" ] == "BotIntent" :
179179 # If we have instructions, we add them before the bot message.
180180 # But we only do that for the last bot message.
181181 if "instructions" in event and idx == last_bot_intent_idx :
182182 history += f"# { event ['instructions' ]} \n "
183- history += f' bot { event [" intent" ]} \n '
183+ history += f" bot { event [' intent' ]} \n "
184184 elif event ["type" ] == "StartUtteranceBotAction" and include_texts :
185185 history += f' "{ event ["script" ]} "\n '
186186 # We skip system actions from this log
@@ -192,7 +192,7 @@ def get_colang_history(
192192 and event ["action_name" ] == "retrieve_relevant_chunks"
193193 ):
194194 continue
195- history += f' execute { event [" action_name" ]} \n '
195+ history += f" execute { event [' action_name' ]} \n "
196196 elif event ["type" ] == "InternalSystemActionFinished" and not event .get (
197197 "is_system_action"
198198 ):
@@ -349,9 +349,9 @@ def flow_to_colang(flow: Union[dict, Flow]) -> str:
349349 if "_type" not in element :
350350 raise Exception ("bla" )
351351 if element ["_type" ] == "UserIntent" :
352- colang_flow += f' user { element [" intent_name" ]} \n '
352+ colang_flow += f" user { element [' intent_name' ]} \n "
353353 elif element ["_type" ] == "run_action" and element ["action_name" ] == "utter" :
354- colang_flow += f' bot { element [" action_params" ][ " value" ]} \n '
354+ colang_flow += f" bot { element [' action_params' ][ ' value' ]} \n "
355355
356356 return colang_flow
357357
@@ -579,7 +579,7 @@ def escape_flow_name(name: str) -> str:
579579 return result
580580
581581
582- def get_and_clear_reasoning_trace () -> Optional [str ]:
582+ def get_and_clear_reasoning_trace_contextvar () -> Optional [str ]:
583583 """Get the current reasoning trace and clear it from the context.
584584
585585 Returns:
0 commit comments