__init__.py 713 B

123456789101112131415161718192021222324
  1. from __future__ import annotations
  2. from typing import Any
  3. from content_agent.business_modules.rule_judgment.evaluator import decide
  4. from content_agent.interfaces import RuntimeFileStore
  5. def run(
  6. run_id: str,
  7. policy_run_id: str,
  8. evidence_bundles: list[dict[str, Any]],
  9. policy_bundle: dict[str, Any],
  10. runtime: RuntimeFileStore,
  11. start_index: int = 1,
  12. write_runtime: bool = True,
  13. ) -> list[dict[str, Any]]:
  14. decisions = [
  15. decide(run_id, policy_run_id, start_index + index, bundle, policy_bundle)
  16. for index, bundle in enumerate(evidence_bundles)
  17. ]
  18. if write_runtime:
  19. runtime.append_jsonl(run_id, "rule_decisions.jsonl", decisions)
  20. return decisions