23 lines
713 B
Python
23 lines
713 B
Python
"""委派执行结果的共享类型定义。"""
|
||
|
||
from __future__ import annotations
|
||
|
||
from dataclasses import dataclass
|
||
from typing import Any
|
||
|
||
|
||
@dataclass
|
||
class AgentRunResult:
|
||
"""统一描述一次 agent 执行结果。"""
|
||
|
||
# 执行方的稳定 ID,适合程序判断和日志检索。
|
||
agent_id: str
|
||
# 展示给用户或前端时使用的人类可读名称。
|
||
agent_name: str
|
||
# 归一化状态:通常是 `ok` / `error` / `cancelled` 等。
|
||
status: str
|
||
# 面向上层的简要总结,是最终展示和二次总结的主要输入。
|
||
summary: str
|
||
# 可选原始载荷,保留底层协议返回值,便于调试或后续扩展。
|
||
raw: dict[str, Any] | None = None
|