from kilostar.utils.ray_hook import ray_actor_hook async def approval(message: str, trace_id: str) -> str: """当任务存在某些高风险操作或者计划需要让用户审批,发送请求给用户等待用户审批。 Args: message: 发送给用户的请求 trace_id: 当前工作流的 trace_id Returns: 用户的审批结果 """ actor_list = ray_actor_hook("global_workflow_manager") await actor_list.global_workflow_manager.put_pending.remote(trace_id, message) reply = await actor_list.global_workflow_manager.get_received.remote(trace_id) return reply