perago.RuntimeTaskResult#
- class perago.RuntimeTaskResult(*, status, output=None, reason_for_incompletion=None)[源代码]#
Validated result payload returned by a worker attempt.
RuntimeTaskResultis Perago's internal representation of the status and payload that will be written back to Conductor. It enforces the mutually exclusive success and failure payload shapes before the SDK payload is assembled.- Parameters:
- status{"COMPLETED", "FAILED", "FAILED_WITH_TERMINAL_ERROR"}
Conductor task result status selected by the worker runtime.
- outputdict of str to Any or None, default=None
Completed task output.
COMPLETEDresults require this field, while failed results reject it.- reason_for_incompletionstr or None, default=None
Failure reason.
FAILEDandFAILED_WITH_TERMINAL_ERRORresults require this field, whileCOMPLETEDresults reject it.
- Raises:
- pydantic.ValidationError
If the payload shape is inconsistent with
statusor if unknown fields are provided.
- 参数:
参见
completed_resultBuild a completed result.
failed_resultBuild a retryable failed result.
terminal_failed_resultBuild a terminal failed result.
result_for_exceptionClassify an exception into a runtime result.
Notes
The model is frozen and rejects unknown fields.
worker_idis not part of this payload; it is attached separately when the Conductor SDK task result is updated.Examples
>>> RuntimeTaskResult(status="COMPLETED", output={"result": {"ok": True}}) RuntimeTaskResult(...)
Methods
conductor_payload()Convert the result to the Conductor update payload shape.
validate_payload_shape()Validate the mutually exclusive result payload shape.
Attributes
statusoutputreason_for_incompletion