A set of tools that can be used to programmatically check the correctness of entries on Kleros' 3x metaregistries.
Submitting and challenging entries on Kleros Curate can be a very time-consuming and subjective task. The scripts/tools in this repo are tools that uses Perplexity.ai (for online searches) and OpenAI's chatCompletion API (for policy interpretation, image recognition, etc ...) programmatically 'police' the three main registries of Kleros Curate (Tags, Tokens and Contract Domain Names). It can also automatically post the results on-chain as evidence under the entry.
In this latest versionm, each of the three mythological Sisters of Horae is assigned to each of the three registries:
- Dikē -> Tags
- Eunomia -> Tokens
- Eirene -> CDN
The policebot.py script is the main script here, which contains the 'handle_event' function. which takes the following arguments:
- _itemID (byte-encoded Curate itemID)
- data (the ipfs URI of the Light Curate object)
- registryType (accepts 'Tags', 'Tokens' or 'CDN' as values)
- timeStampToCheckAt (the unix time-stamp to take into account when looking for duplicates)
- mode (if set to 'COMMENT_ONCHAIN', it will post the results as evidence to the entry, otherwise it will just return the results locally)
The OpenAI API key and Ethereum address PK are just set as environmental variables for simplicity at this moment: OpenAI_API_Key (e.g. sk-FB7...........jkxyz) ETH_bot_private_key (e.g. 6034312......7760)