models.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. from __future__ import annotations
  2. from typing import Any, Literal, TypedDict
  3. RunStatus = Literal["running", "success", "partial_success", "blocked", "failed"]
  4. DecisionAction = Literal[
  5. "ADD_TO_CONTENT_POOL",
  6. "KEEP_CONTENT_FOR_REVIEW",
  7. "REJECT_CONTENT",
  8. ]
  9. SearchQueryEffectStatus = Literal["success", "pending", "failed", "rule_blocked"]
  10. class RunState(TypedDict, total=False):
  11. run_id: str
  12. policy_run_id: str
  13. schema_version: str
  14. policy_bundle_id: str
  15. platform: str
  16. platform_mode: str
  17. source: str | dict[str, Any] | None
  18. strategy_version: str
  19. strategy_source_ref: dict[str, Any]
  20. current_step: str
  21. status: RunStatus
  22. errors: list[str]
  23. source_context: dict[str, Any]
  24. pattern_seed_pack: dict[str, Any]
  25. search_queries: list[dict[str, Any]]
  26. platform_results: list[dict[str, Any]]
  27. query_failures: list[dict[str, Any]]
  28. discovered_content_items: list[dict[str, Any]]
  29. content_media_records: list[dict[str, Any]]
  30. pattern_recall_evidence: list[dict[str, Any]]
  31. evidence_bundles: list[dict[str, Any]]
  32. policy_bundle: dict[str, Any]
  33. rule_decisions: list[dict[str, Any]]
  34. walk_actions: list[dict[str, Any]]
  35. source_path_record_basis: list[dict[str, Any]]
  36. run_events: list[dict[str, Any]]
  37. source_path_records: list[dict[str, Any]]
  38. search_clues: list[dict[str, Any]]
  39. final_output: dict[str, Any]
  40. strategy_review: dict[str, Any]