-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.Net: API Manifest Plugins #4961
Merged
markwallace-microsoft
merged 18 commits into
microsoft:main
from
zengin:zengin/api-manifest-prototype
Feb 15, 2024
Merged
.Net: API Manifest Plugins #4961
markwallace-microsoft
merged 18 commits into
microsoft:main
from
zengin:zengin/api-manifest-prototype
Feb 15, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zengin
commented
Feb 12, 2024
dotnet/src/Functions/Functions.OpenApi/Extensions/OpenApiKernelExtensions.cs
Show resolved
Hide resolved
dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/OpenApiKernelExtensions.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Functions/Functions.OpenApi/Extensions/OpenApiKernelExtensions.cs
Show resolved
Hide resolved
zengin
commented
Feb 12, 2024
dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/OpenApiKernelExtensions.cs
Outdated
Show resolved
Hide resolved
…ngin/semantic-kernel into zengin/api-manifest-prototype
SergeyMenshykh
approved these changes
Feb 14, 2024
@dmytrostruk @markwallace-microsoft can I get one more review, please? Thanks! |
markwallace-microsoft
approved these changes
Feb 15, 2024
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Feb 15, 2024
This was referenced Mar 21, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
This PR contains main implementation part of #4662 and adds it into
Functions.OpenApi.Extensions
project. There were also couple of bug fixes in the mentioned PR, those will be handled in subsequent PRs.API Manifest can describe capabilities of an AI plugin for a chat-based system among other things. For a full description of API Manifest, see the API Manifest Specification.
API Manifest refers to one or more OpenAPI documents as API dependencies and it selects a subset of operations from those documents to describe the capabilities of an AI plugin.
Description
Semantic Kernel has a way of creating plugins from OpenAPI operations, but it has a couple of limitations that can be addressed with API Manifest:
Not being able to slice OpenAPI operations is a major limitation, especially for large APIs such as Microsoft Graph, which has over 1000 operations.
Today, we can create a Semantic Kernel plugin from an OpenAPI file and one OpenAPI file corresponds to one plugin. We don't have a way of selecting a subset of operations.
Proposed Solution
After Semantic Kernel APIManifest support, we will have an APIManifest file, which will be used as a filter on OpenAPI files and it can reference more than one OpenAPI file. The filter can be used as a guide to select only certain operations to be converted into functions.
Assume that we want to create a single plugin with
function11
fromOpenAPI1
andfunction21
andfunction22
fromOpenAPI2
. We want to preserve the one-to-one mapping between the APIManifest and the plugin, e.g. betweenApiManifestX
andPluginX
:If we use existing OpenAPI to Plugin public methods after on-the-fly slicing, we can only achieve the following because there is an assumption that a single OpenAPI is converted into a single plugin, which breaks APIManifest to Plugin one-to-one mapping. A single
APIManifestX
file corresponds to two plugins, namely,PluginX1
andPluginX2
:To avoid this, the implementation of regular OpenAPI plugin generation and API Manifest plugin generation meets at the function generation level, so reuse starts at
CreateRestApiFunction
.The PR also adds a KernelSyntaxExample for
/me/messages
endpoint of Microsoft Graph.Contribution Checklist