feat(runtime): implement single-article consolidation runtime and modularize codebase
This commit is contained in:
@@ -0,0 +1,126 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://schemas.aftech.internal/article-consolidation/v1/candidates-payload.schema.json",
|
||||
"x-contract-version": "1.0.0",
|
||||
"title": "CandidatesPayload",
|
||||
"description": "Normalized candidate payload supplied to LLM hygiene prompt (projection of internal CandidateObjects)",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"language",
|
||||
"selected_extractor",
|
||||
"metadata_candidates",
|
||||
"block_candidates",
|
||||
"link_candidates",
|
||||
"image_candidates"
|
||||
],
|
||||
"properties": {
|
||||
"language": {
|
||||
"type": "string"
|
||||
},
|
||||
"selected_extractor": {
|
||||
"type": "string",
|
||||
"enum": ["trafilatura", "newspaper4k", "readability"]
|
||||
},
|
||||
"metadata_candidates": {
|
||||
"type": "object",
|
||||
"required": ["title_candidates", "subtitle_candidates", "author_candidates"],
|
||||
"properties": {
|
||||
"title_candidates": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["candidate_id", "source", "text"],
|
||||
"properties": {
|
||||
"candidate_id": { "type": "string" },
|
||||
"source": { "type": "string" },
|
||||
"text": { "type": "string" }
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"subtitle_candidates": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["candidate_id", "source", "text"],
|
||||
"properties": {
|
||||
"candidate_id": { "type": "string" },
|
||||
"source": { "type": "string" },
|
||||
"text": { "type": "string" }
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"author_candidates": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["candidate_id", "source", "text"],
|
||||
"properties": {
|
||||
"candidate_id": { "type": "string" },
|
||||
"source": { "type": "string" },
|
||||
"text": { "type": "string" }
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"block_candidates": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["candidate_id", "type", "order_index", "text", "source_extractor"],
|
||||
"properties": {
|
||||
"candidate_id": { "type": "string" },
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["paragraph", "heading", "list_item", "quote"]
|
||||
},
|
||||
"order_index": { "type": "integer" },
|
||||
"text": { "type": "string" },
|
||||
"source_extractor": {
|
||||
"type": "string",
|
||||
"enum": ["trafilatura", "newspaper4k", "readability"]
|
||||
},
|
||||
"equivalences": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" }
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"link_candidates": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["candidate_id", "url", "anchor_text", "parent_block_id"],
|
||||
"properties": {
|
||||
"candidate_id": { "type": "string" },
|
||||
"url": { "type": "string" },
|
||||
"anchor_text": { "type": "string" },
|
||||
"parent_block_id": { "type": "string" }
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"image_candidates": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["candidate_id", "url"],
|
||||
"properties": {
|
||||
"candidate_id": { "type": "string" },
|
||||
"url": { "type": "string" },
|
||||
"alt": { "type": ["string", "null"] },
|
||||
"caption": { "type": ["string", "null"] },
|
||||
"parent_block_id": { "type": ["string", "null"] }
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
Reference in New Issue
Block a user