Create your first ChatGPT plugin for Semantic Kernel

Matthew Bolanos

Image skpatternlarge

Yesterday, we announced the Semantic Kernel plugins hackathon in celebration of the new integrations Semantic Kernel has with ChatGPT plugins. In this article we’ll show you how to build your first ChatGPT plugin for Semantic Kernel.

What are ChatGPT plugins?

With plugins, you can give AI bots like ChatGPT and Chat Copilot superpowers they originally did not have. For example, you can write a plugin to make it easier for ChatGPT to handle math or cite its sources. From an enterprise perspective, plugins are key to providing users access to your apps and services via AI agents.

Cross platform plugins

What makes ChatGPT plugins special is that they are written with a special ai-plugin.json manifest file that allows them to be used by ChatGPT, Microsoft apps like M365 Business Chat and Bing, and most importantly, Semantic Kernel. By creating ChatGPT plugins now, you can future proof your current AI investments by creating integrations that you can use in all of your future AI solutions.

Building your first ChatGPT plugin

If you’ve already created plugins (previously known as skills) in Semantic Kernel, turning them into ChatGPT plugins is easy. We’ve created an in-depth tutorial on our docs site that teaches you how to create your first ChatGPT plugin. At a high-level though, all you really need to do is wrap your existing functions in HTTP endpoints and provide the necessary manifest files.

Plugins before and after

In the tutorial, we demonstrate how to take the Math Plugin we created in the native functions tutorial and wrap it in an Azure Function so you can give your LLMs the ability to perform basic math, but you can easily change the code to fit your specific needs. At the end of the tutorial, we then show you how to import and use your new ChatGPT plugin in Semantic Kernel with the brand new Stepwise Planner.

If you want to see the final solution, you can check it out in our documentation samples folder.

Check out our ChatGPT starter

To make it even easier to create ChatGPT plugins, we’ve also created a ChatGPT starter in our Semantic Kernel starters repo. With this starter, we make it particularly simple to create endpoints for semantic functions. Just add your semantic functions to the Prompts folder and then we’ll automatically generate the endpoint for you with our code generator.

Image Screenshot 2023 07 19 at 3 04 28 PM

In the starter, we automatically create an endpoint for the Joke semantic function.

If you already use the Semantic Kernel VS Code extension, you can quickly use our starter by opening the command pallet (Ctrl+Shift+P), typing in “Semantic Kernel: Create Project,” and then selecting C# ChatGPT Plugin. This will create a new project for you based on the starter.

Image Screenshot 2023 07 19 at 3 09 33 PM

We want to see what you build!

As always, we want to hear from you! If you build a cool plugin, we want to see it, so please submit it to the Semantic Kernel plugins hackathon. To do so, please fill out this form by July 25th. Once the hackathon ends, the Semantic Kernel team will begin reviewing the submissions and we’ll hold a community vote on the Semantic Kernel Discord server.

1 comment

Discussion is closed. Login to edit/delete existing comments.

  • Alex ChaoMicrosoft employee 0

    If you want to watch Matthew show you step by step how to build your ChatGPT Plugin in C#, check out this walk through! https://youtu.be/T7XLn11rpYI

Feedback usabilla icon