from __future__ import annotations

from dataclasses import dataclass, field

from app.core.agent.runtime.execution_context import RuntimeExecutionContext
from app.core.agent.utils.process_v2.models import V2RouteResult
from app.core.rag.retrieval.session_retriever import RetrievalPlan


@dataclass(slots=True)
class DocExplainApiExposedContext:
    runtime: RuntimeExecutionContext
    route: V2RouteResult
    rag_session_id: str
    retrieval_plan: RetrievalPlan | None = None
    retrieved_rows: list[dict] = field(default_factory=list)
    endpoints: list[str] = field(default_factory=list)
    answer: str = ""
    answer_generated_payload: dict[str, object] | None = None

