Spaces:
Sleeping
Sleeping
File size: 1,363 Bytes
5774aff | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | """
Uplan LangGraph State Schema
TypedDict with Annotated reducers for parallel agent output merging.
operator.add ensures lists from parallel Send nodes are concatenated, not overwritten.
"""
from __future__ import annotations
import operator
from typing import Annotated, Optional
from typing_extensions import TypedDict
class UplanState(TypedDict):
# Input (purged after encode node)
document_bytes: Optional[list[bytes]]
# Encoding output
semantic_graph: Optional[dict] # SemanticGraph.model_dump()
encoding_metadata: Optional[dict] # token_count, page_count, duration_ms
# Rule engine output
rule_findings: Annotated[list[dict], operator.add]
# Agent outputs -- operator.add merges lists from parallel nodes
agent_findings: Annotated[list[dict], operator.add]
completed_agents: Annotated[list[str], operator.add]
# Visa context -- jurisdiction-aware thresholds
visa_context: Optional[dict] # VisaContext.to_dict()
document_checklist: list[dict] # [{label, status, validation_result}]
# Synthesis
verdict: Optional[dict]
risk_score: Optional[float]
# Privacy gate flag
raw_purged: bool
# Debug logger -- created in encode(), threaded through for CP4/CP5/CP6
# Set to None to disable debug logging
_debug_logger: Optional[object]
|