This project provides starter code to create a ChatGPT plugin. 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
- The ability to add additional native functions as endpoints to the plugin
To learn more about using this starter, see the Semantic Kernel documentation that describes how to create a ChatGPT plugin.
- .NET 6 is required to run this starter.
- Azure Functions Core Tools is required to run this starter.
- Install the recommended extensions
To configure the starter, you need to provide the following information:
- Define the properties of the plugin in the appsettings.json file.
- Enter the API key for your AI endpoint in the local.settings.json file.
For Debugging the console application alone, we suggest using .NET Secret Manager to avoid the risk of leaking secrets into the repository, branches and pull requests.
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
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
cd bin/Debug/net6.0
func host start