AI Provider Integration
1. Write a deno script
The deno script will help you process the input & output of your service dynamically when being executed by AI executors. Since all services is different, the executors cannot run a program that contains a particular application's logic.
A simple example of a deno script that takes IPFS hashes as inputs, and call POST requests to a flower classification service:
You will see later that by creating a data source smart contract, you'll be able to pass an array of string parameters into this deno script.
After writing your deno script, please upload it to a public file hosting, which has a public URL that the AI executors can read from. In this case, we have uploaded it to a public github repository called deno-scripts
2. Deploy a data source contract
The data source contract is the trusted source for the executors to collect AI APIs & execute them. It stores the deno script's programming language, URL (which is the deno script's URL), and input parameters. These input parameters will be fed into your script as mentioned above and you can access them by using JSON parsing.
The simplest way to have a data source contract is to deploy an empty contract (without custom business logic).You can also customize the data source to suit your need, but it must follow the same template as provided by the Future-AI. Otherwise, the executors won't be able to run your service.
3. Deploy an script contract
The script is used to aggregate your data source result after it is called multiple times by the AI executors. When writing an script, you need to have at least one Aggregate
query message.
After deploying the script, please send us the two addresses & your service name (in string) so we can add them in the list of services. At the moment, only chosen services are added due to security & simplicity purposes.
Last updated