__init__.py 655 B

12345678910111213141516171819202122
  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. ) -> list[dict[str, Any]]:
  13. decisions = [
  14. decide(run_id, policy_run_id, start_index + index, bundle, policy_bundle)
  15. for index, bundle in enumerate(evidence_bundles)
  16. ]
  17. runtime.append_jsonl(run_id, "rule_decisions.jsonl", decisions)
  18. return decisions