from dataclasses import dataclass, field


@dataclass
class AgentResult:
    """
    Agent Core 对 Django 层暴露的统一结果对象。

    任何底层编排实现都必须返回这一结构，确保：
    - Chat 页面有稳定字段可展示
    - Audit 模块有稳定字段可落库
    - 未来替换编排引擎时不影响 Django 业务层
    """
    answer: str = ""
    structured_output: dict = field(default_factory=dict)
    references: list = field(default_factory=list)
    tool_calls: list = field(default_factory=list)
    raw_output: str = ""
    model_name: str = "mock-model"
    latency_ms: int = 0
    status: str = "success"
    error: str = ""
    conversation_id: str = ""
    batch_id: str = ""
    product_name: str = ""
    node_results: list = field(default_factory=list)
    notification_payload: dict = field(default_factory=dict)
