Files
semantic-kernel/dotnet/samples/CreateChatGptPlugin/MathPlugin/README.md
T
Gil LaHaye 22bfdf8001 .Net: Move documentation examples from documentation repo into SK repo (#4704)
### 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 😄
2024-02-01 00:20:17 +00:00

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

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

  1. Copy settings.json.openai-example to ./appsettings.json
  2. Edit the kernel object to add your OpenAI endpoint configuration
  3. Edit the aiPlugin object to define the properties that get exposed in the ai-plugin.json file

Configure an Azure OpenAI endpoint

  1. Copy settings.json.azure-example to ./appsettings.json
  2. Edit the kernel object to add your Azure OpenAI endpoint configuration
  3. Edit the aiPlugin object to define the properties that get exposed in the ai-plugin.json file

Using local.settings.json

  1. Copy local.settings.json.example to ./azure-function/local.settings.json
  2. Edit the Values object to add your OpenAI endpoint configuration in the apiKey property

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