mirror of
https://github.com/microsoft/semantic-kernel.git
synced 2026-10-12 02:19:06 +00:00
### Motivation and Context In order to keep documentation examples up to date, moving them to a repo where they will actually be built and run. ### Description Move documentation examples from doc repo to this one. ### Contribution Checklist - [ ] The code builds clean without any errors or warnings - [ ] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [ ] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄
2.3 KiB
2.3 KiB
Semantic Kernel OpenAI plugin starter
This project provides starter code to create a OpenAI 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 prompt endpoints
- The ability to add additional native functions as endpoints to the plugin
Prerequisites
- .NET 6 is required to run this starter.
- Azure Functions Core Tools is required to run this starter.
- Install the recommended extensions
- C#
- Semantic Kernel Tools (optional)
Configuring the starter
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.
Using appsettings.json
Configure an OpenAI endpoint
- Copy settings.json.openai-example to
./appsettings.json - Edit the
kernelobject to add your OpenAI endpoint configuration - Edit the
aiPluginobject 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
kernelobject to add your Azure OpenAI endpoint configuration - Edit the
aiPluginobject to define the properties that get exposed in the ai-plugin.json file
Using local.settings.json
- Copy local.settings.json.example to
./azure-function/local.settings.json - Edit the
Valuesobject to add your OpenAI endpoint configuration in theapiKeyproperty
Running the starter
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/net8.0
func host start