Skip to content

svemir/openagents-plugins-factcheck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fact Checking Plugin

NOTE: modeled on https://github.com/moneya/plugin-zipcode-finder

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?"
}

About

openagents.com plugin for fact-checking

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published