Files
nvi/api/runtime/state.py

21 lines
601 B
Python

"""Shared state passed between runtime nodes.
This is the one type langgraph sees. Domain code in api/plan, api/analyses,
api/tools never imports it — they take/return their own dataclasses.
"""
from __future__ import annotations
from typing import Annotated, Any, TypedDict
from operator import add
class RunState(TypedDict, total=False):
run_id: str
question: str
plan_rationale: str
plan_steps: list[dict[str, Any]] # serialised PlanStep
findings: Annotated[list[dict[str, Any]], add] # serialised Finding; concatenated by langgraph
answer: str
error: str