Demo – API Manifest Plugins for Semantic Kernel

El Bruno - Jun 3 - - Dev Community

Hi!

Today, it’s time to share some insights into the world of API Manifest Plugins for Semantic Kernel, these are a cool way to work with OpenAI’s Large Language Models (LLMs).

Introduction to API Manifest Plugins for Semantic Kernel

Semantic Kernel is at the forefront of AI development, allowing developers to import plugins from OpenAPI documents. However, importing entire OpenAPI documents for large APIs can be inefficient. To tackle this, Microsoft introduced API Manifest Plugins for Semantic Kernel

An API Manifest is a document that outlines an application’s API dependencies, including links to API descriptions, the requests made, and their authorization requirements. These plugins enable Semantic Kernel functions to be generated from API Manifest files, which can then be called by LLMs in various scenarios.

Key features include:

  • Slicing large API descriptions into task-specific parts.
  • Packaging multiple API dependencies into a single plugin.
  • Defining authorization requirements for API calls.

This approach not only streamlines the process but also enhances security and efficiency when integrating third-party APIs.

The Importance of Function Calling while working with OpenAI LLMs

Function calling is a game-changer for developers working with OpenAI LLMs. It allows the models to intelligently output JSON objects containing arguments to call one or many functions, based on the input provided.

This feature is crucial for:

  • Creating assistants that answer questions by calling external APIs.
  • Converting natural language into API calls.
  • Extracting structured data from text.

Supported by the latest models, function calling ensures that developers can get structured data back from the model more reliably.

Reference to the GitHub Repository

My GitHub repository “sk-API-Manifest-Plugins” is a sample entry for developers looking to leverage API Manifest Plugins with Semantic Kernel.

Scenario

In this scenario, we will assume that there are public APIs with information about superheroes, and a pet database with information about pets and their owner information.

There is a fictitious Superhero Pet Day, so the owner of a Pet Store will trigger a plan to find which clients have pets with superhero names.

The plan will detect these pets and send an email congratulating them for the Superhero Pet Day with information about their pet name super hero.
Enter fullscreen mode Exit fullscreen mode

Prerequisites

Once you cloned the repository, ensure you have:

Components

The repository includes:

  • 2 Sample API projects: PetStoreAPI and SuperHeroAPI.
  • 1 Semantic Kernel test project with a plan to solve the scenario. The project uses API Manifest to embed the plugins from the 2 APIs.
  • Bonus: the SK test also use a native plugin that emulates the email sent.

Running the Demo

To run the demo:

  1. Clone the repository from GitHub.
  2. Install the necessary dependencies listed in the repository.
  3. Follow the step-by-step guide to set up the environment and execute the demo.

Here is the start page of the console demo:

start page with the console start app

And the responses from the SK Planner:

The last step also show a table with all the details and steps that the planner performed to solve the scenario.

This hands-on experience will give you a practical understanding of how API Manifest Plugins work within Semantic Kernel.


For more detailed information and to explore the full capabilities of API Manifest Plugins and function calling with OpenAI LLMs, visit the official Semantic Kernel blog and the OpenAI documentation. Embrace the future of AI with these powerful tools at your disposal.

Happy coding!

Greetings

El Bruno

More posts in my blog ElBruno.com.


. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .