Skip to main content
Version: 0.0.10 (stable)

agrag.common.data_models.document_run.build_run_status

build_run_status(*, document_key:str, state:DocumentRunState, cause:str | None, waiting:str | None, units:int, done:int, failed:int) -> DocumentRunStatus

Build the public status of a run from its state and unit counts.

Parameters:

  • document_key (str) – The key of the document the run saves.
  • state (DocumentRunState) – The lifecycle state of the run.
  • cause (str | None) – The message that stopped the run, or None.
  • waiting (str | None) – Why the last attempt could not proceed, or None.
  • units (int) – How many chunks the run saves in total.
  • done (int) – How many of those chunks are saved.
  • failed (int) – How many chunks failed on every attempt.

Returns: