32 lines
753 B
Python
32 lines
753 B
Python
"""LangGraph state object passed between nodes for a single SKU run."""
|
|
from __future__ import annotations
|
|
|
|
from typing import Optional, TypedDict
|
|
|
|
from pricing_agent.schemas import (
|
|
CompetitiveSnapshot,
|
|
FeeStack,
|
|
PricingDecision,
|
|
SkuInput,
|
|
)
|
|
|
|
|
|
class PricingState(TypedDict, total=False):
|
|
# Input
|
|
sku_input: SkuInput
|
|
|
|
# Populated as the graph runs
|
|
fee_stack: FeeStack
|
|
competitive: CompetitiveSnapshot
|
|
decision: PricingDecision
|
|
analysis: dict # sales-trend + inventory + verdict (COSMOS only)
|
|
|
|
# Human-in-the-loop outcome
|
|
human_action: str # "approve" | "edit" | "reject"
|
|
human_price: Optional[float]
|
|
human_note: str
|
|
|
|
# Write-back result
|
|
written: bool
|
|
audit_id: str
|