praval.hitl.service

Service facade for HITL operations used by Agent APIs and CLI.

Classes

HITLService([db_path, store])

High-level helper over HITLStore for common operations.

class praval.hitl.service.HITLService(db_path=None, store=None)[source]

Bases: object

High-level helper over HITLStore for common operations.

Parameters:
  • db_path (Optional[str])

  • store (Optional[HITLStore])

__init__(db_path=None, store=None)[source]
Parameters:
  • db_path (str | None)

  • store (HITLStore | None)

get_pending_interventions(*, run_id=None, agent_name=None, limit=100)[source]
Return type:

List[InterventionRequest]

Parameters:
  • run_id (str | None)

  • agent_name (str | None)

  • limit (int)

list_interventions(*, run_id=None, agent_name=None, limit=100)[source]
Return type:

List[InterventionRequest]

Parameters:
  • run_id (str | None)

  • agent_name (str | None)

  • limit (int)

get_intervention(intervention_id)[source]
Return type:

Optional[InterventionRequest]

Parameters:

intervention_id (str)

approve_intervention(intervention_id, *, reviewer, edited_args=None)[source]
Return type:

InterventionRequest

Parameters:
  • intervention_id (str)

  • reviewer (str)

  • edited_args (Dict[str, Any] | None)

reject_intervention(intervention_id, *, reviewer, reason)[source]
Return type:

InterventionRequest

Parameters:
  • intervention_id (str)

  • reviewer (str)

  • reason (str)

get_suspended_run(run_id)[source]
Return type:

Optional[SuspendedRunState]

Parameters:

run_id (str)

mark_run_completed(run_id, response)[source]
Return type:

None

Parameters:
  • run_id (str)

  • response (str)

cancel_run(run_id, reason)[source]
Return type:

None

Parameters:
  • run_id (str)

  • reason (str)