models.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. "TECHNICAL_RETRY_REQUIRED",
  9. ]
  10. SearchQueryEffectStatus = Literal["success", "pending", "failed", "rule_blocked"]
  11. class RunState(TypedDict, total=False):
  12. run_id: str
  13. policy_run_id: str
  14. schema_version: str
  15. policy_bundle_id: str
  16. platform: str
  17. platform_mode: str
  18. source: str | dict[str, Any] | None
  19. strategy_version: str
  20. strategy_source_ref: dict[str, Any]
  21. current_step: str
  22. status: RunStatus
  23. errors: list[str]
  24. source_context: dict[str, Any]
  25. pattern_seed_pack: dict[str, Any]
  26. search_queries: list[dict[str, Any]]
  27. platform_results: list[dict[str, Any]]
  28. query_failures: list[dict[str, Any]]
  29. discovered_content_items: list[dict[str, Any]]
  30. content_media_records: list[dict[str, Any]]
  31. pattern_recall_evidence: list[dict[str, Any]]
  32. evidence_bundles: list[dict[str, Any]]
  33. policy_bundle: dict[str, Any]
  34. rule_decisions: list[dict[str, Any]]
  35. walk_actions: list[dict[str, Any]]
  36. source_path_record_basis: list[dict[str, Any]]
  37. run_events: list[dict[str, Any]]
  38. source_path_records: list[dict[str, Any]]
  39. search_clues: list[dict[str, Any]]
  40. final_output: dict[str, Any]
  41. strategy_review: dict[str, Any]