File tree Expand file tree Collapse file tree
agents/matmaster_agent/sub_agents/built_in_agent/demo_frontend_agent Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727class DemoFrontendAgent (BaseSyncAgentWithToolValidator ):
2828 async def _run_events (self , ctx : InvocationContext ) -> AsyncGenerator [Event , None ]:
2929 function_call_id = f"added_{ str (uuid .uuid4 ()).replace ('-' , '' )[:24 ]} "
30+ # 在 args 里带上三 id,前端用户确认/取消后可用以请求 POST /awp/frontend-tool-result
3031 yield context_function_call_event (
3132 ctx ,
3233 self .name ,
3334 function_call_id ,
3435 DEMO_FRONTEND_TOOL ,
3536 ModelRole ,
36- {'message' : '请确认' , 'title' : '前端 Demo Tool' },
37+ {
38+ 'message' : '请确认' ,
39+ 'title' : '前端 Demo Tool' ,
40+ 'session_id' : ctx .session .id ,
41+ 'invocation_id' : ctx .invocation_id ,
42+ 'function_call_id' : function_call_id ,
43+ },
3744 )
3845 demo_result = await wait_for_frontend_tool_result (
3946 ctx .session .id , ctx .invocation_id , function_call_id
You can’t perform that action at this time.
0 commit comments