AI-Powered Unstructured Data Processing
sources:
- id: bbc
type: url
url: "https://www.bbc.com/news/election"
- id: cnn
type: url
url: "https://www.cnn.com/elections/results"
- id: nyt
type: url
url: "https://www.nytimes.com/interactive/2024/11/05/us/elections/results.html"
update_frequency: 3600
processors:
- type: llm
prompt: |
Below is an article with presidency election results from a public news website.
Two candidates are running for presidency:
1 - Doanld Trump
2 - Kamala Harris
Your task is to understand if the winner of the election has already
been announced. If a winner has been annouced you shoud extract the
identifier (1 or 2) of the winning candidate and the total votes of the
winning and losing candidates. You must return the result as a JSON object
with the format described below:
{
"winner_announced": true/false,
"winning_candidate": {
"id": (1 or 2),
"total_votes": total vodtes for the winning cadidate
},
"losing_candidate": {
"id": (1 or 2),
"total_votes": total vodtes for the losing cadidate
}
}
publishers:
- type: bitlayer
contract_address: "0x1234567890abcdef1234567890abcdef12345678"
- type: bsc
contract_address: "0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef"
- type: merlin
contract_address: "0xabcdef123456abcdef123456abcdef123456abcdef"
validators:
type: threshold
threshold_value: "80%" # 80% of the values must match
output_schema:
$schema: "http://json-schema.org/draft-07/schema#"
title: "Election Result"
type: "object"
properties:
winner_announced:
type: "boolean"
description: "Indicates whether a winner has been announced."
winning_candidate:
type: "object"
properties:
id:
type: "integer"
enum: [1, 2]
description: "ID of the winning candidate (1 or 2)."
total_votes:
type: "integer"
minimum: 0
description: "Total votes received by the winning candidate."
required: ["id", "total_votes"]
losing_candidate:
type: "object"
properties:
id:
type: "integer"
enum: [1, 2]
description: "ID of the losing candidate (1 or 2)."
total_votes:
type: "integer"
minimum: 0
description: "Total votes received by the losing candidate."
required: ["id", "total_votes"]
required: ["winner_announced", "winning_candidate", "losing_candidate"]
additionalProperties: false
Aggregation Logic, Validation, and Data Trustworthiness
Last updated