File tree Expand file tree Collapse file tree
agents/matmaster_agent/flow_agents Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4343 MATMASTER_FLOW_PLANS ,
4444 MATMASTER_GENERATE_NPS ,
4545 MATMASTER_INTENT_UI ,
46+ MATMASTER_THINKING_UI ,
4647)
4748from agents .matmaster_agent .flow_agents .execution_agent .agent import (
4849 MatMasterSupervisorAgent ,
@@ -548,6 +549,23 @@ async def _run_plan_make_agent(
548549 thinking_text = ''
549550 if not skip_thinking :
550551 try :
552+ for _thinking_ui_event in context_function_event (
553+ ctx ,
554+ self .name ,
555+ MATMASTER_THINKING_UI ,
556+ None ,
557+ ModelRole ,
558+ {
559+ 'matmaster_thinking_ui_args' : json .dumps (
560+ {
561+ 'title' : '正在思考' ,
562+ 'status' : 'start' ,
563+ }
564+ )
565+ },
566+ ):
567+ yield _thinking_ui_event
568+
551569 self ._thinking_agent .set_thinking_params (
552570 available_tools_with_info_str ,
553571 session_file_summary ,
@@ -580,6 +598,21 @@ async def _run_plan_make_agent(
580598 f'{ ctx .session .id } reasoning_agent result length={ len (thinking_text )} , '
581599 f'preview={ repr (thinking_text [:300 ]) if thinking_text else "empty" } '
582600 )
601+ for _thinking_ui_event in context_function_event (
602+ ctx ,
603+ self .name ,
604+ MATMASTER_THINKING_UI ,
605+ None ,
606+ ModelRole ,
607+ {
608+ 'matmaster_thinking_ui_args' : json .dumps (
609+ {
610+ 'status' : 'end' ,
611+ }
612+ )
613+ },
614+ ):
615+ yield _thinking_ui_event
583616 except Exception as e :
584617 logger .warning (
585618 f'{ ctx .session .id } reasoning_agent failed: { e } , proceed without thinking'
Original file line number Diff line number Diff line change 1010MATMASTER_FLOW_PLANS = 'matmaster_flow_plans'
1111MATMASTER_GENERATE_NPS = 'matmaster_generate_nps'
1212MATMASTER_INTENT_UI = 'matmaster_intent_ui'
13+ MATMASTER_THINKING_UI = 'matmaster_thinking_ui'
1314
1415# matmaster_flow 展示文案,直接传给前端(正常执行无标签则传空字符串)
1516EXECUTION_TYPE_LABEL_RETRY = '重试工具'
You can’t perform that action at this time.
0 commit comments