This project implements a ChatGPT plugin for Ethereum. It includes the following components:
- An endpoint that serves up an ai-plugin.json file for ChatGPT to discover the plugin
- A generator that automatically converts prompts into semantic function endpoints
- One native function that calls the Etherscan API endpoint for transaction information, and a CoinGecko API endpoint to get the historical price of Ethereum
- Two semantic functions that format the JSON response into CSV or OFX for import into accounting software
- Install
Docker
and VS CodeDev Containers
extension. - Clone project and run
Dev-Containers: Reopen in Container
command- The dev container will download and install the .NET 6 image and install the
C#
,Semantic Kernel Tools
, andGitHub Copilot
extensions.
- The dev container will download and install the .NET 6 image and install the
- Create a free Etherscan Account and get an API key
Configure an OpenAI endpoint
- Copy settings.json.openai-example to
./appsettings.json
- Edit the
kernel
object to add your OpenAI endpoint configuration - Edit the
aiPlugin
object to define the properties that get exposed in the ai-plugin.json file
Configure an Azure OpenAI endpoint
- Copy settings.json.azure-example to
./appsettings.json
- Edit the
kernel
object to add your Azure OpenAI endpoint configuration - Edit the
aiPlugin
object to define the properties that get exposed in the ai-plugin.json file
- Copy local.settings.json.example to
./azure-function/local.settings.json
- Edit the
Values
object to add your OpenAI endpoint configuration in theapiKey
property - Edit the
Values
object to add your Etherscan API endpoint configuration in theetherscanApiKey
property
To run the Azure Functions application just hit F5
.
To build and run the Azure Functions application from a terminal use the following commands:
cd azure-function
dotnet build
func start --csharp
Test the endpoint with the Swagger UI
To learn more, see the Semantic Kernel documentation that describes how to create a ChatGPT plugin.