A proof-of-concept fact-checking plugin for OpenAgents. It was a fun way to learn about extism, OpenAgents, and tomatoes!

Introduction

This plugin checks a given statement with Google Fact Check Tools.

API Information

How it works

  • Retrieves a statement from the input.
  • Queries the fact-check API for existing claims about the given statement.
  • Chooses the best matching review
  • Outputs the matching claim, review title, rating, and source as a JSON string.

Usage

  1. Ensure the plugin is correctly integrated into the hosting environment.
  2. Call the run function with a statement to check and a Google API key
  3. Receive fact-check summary as output.
> extism call plugin.wasm run --input '{"statement":"Tomatoes are fruit","key":"*********"}' --wasi --allow-host 'factchecktools.googleapis.com'
Response to the above may be (formatted for easier reading)
{ "allRatings" : [ "Mixture" ], "claim" : "Tomatoes are officially considered fruits in the U.S.", "overallRating" : "Mixture", "rating" : "Mixture", "source" : "https://www.snopes.com/fact-check/tomatoes-fruits-vegetables/", "title" : "Are Tomatoes Fruits or Vegetables?" }
this territory is moderated
Booyah, thanks for posting!
Already awarded the bounty for this but good to see here
This is an election year - be cool to see some fact-checking agents calling politicians (and regulators and central bankers) out on lies etc.
reply
Thanks! I figured this would be a good way to learn the ropes.
reply