Function
worker_result
(envelope: WorkerEnvelope)
Source from the content-addressed store, hash-verified
| 781 | } |
| 782 | |
| 783 | fn worker_result(envelope: WorkerEnvelope) -> FlowResult<Json> { |
| 784 | if envelope.ok { |
| 785 | Ok(envelope.result.unwrap_or(Json::Null)) |
| 786 | } else { |
| 787 | Err(FlowError::Internal(envelope.error.unwrap_or_else(|| { |
| 788 | "NeMo Guardrails local Python worker failed".to_string() |
| 789 | }))) |
| 790 | } |
| 791 | } |
| 792 | |
| 793 | fn parse_check_result(result: Json) -> FlowResult<LocalCheckOutcome> { |
| 794 | let result: WorkerCheckResult = serde_json::from_value(result).map_err(|err| { |
Tested by
no test coverage detected