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