Version: latest
agrag.ingestion.client_work.extraction.validate_extraction_reply
validate_extraction_reply(output:Mapping[str, object], chunk:Chunk, schema:GraphSchema) -> tuple[ExtractionReply | None, list[WorkResultError]]
Validate one client result against the schema and its source chunk.
Every known entity text must be copied exactly from the chunk, and every label must be declared. A result with an error is refused before any write job starts, and the returned errors tell the client what to change.
Parameters:
- output (
Mapping[str, object]) – The result body submitted by the client. - chunk (
Chunk) – The chunk the client read. It is untrusted input. - schema (
GraphSchema) – The schema the result must conform to.
Returns:
tuple[ExtractionReply | None, list[WorkResultError]]– The validated reply and no errors, orNonewith the errors found.