Skip to content
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

Mitigate support for OpenAPI 3.1 #354

Merged

Conversation

SergeyMenshykh
Copy link
Member

@SergeyMenshykh SergeyMenshykh commented Apr 6, 2023

Motivation and Context

This PR adds support for OpenAPI 3.1 spec to OpenAPI skills functionality that may be useful in scenarios when OpenAPI 3.1 skills are imported directly from OpenAPI documents or indirectly through ChatGPT plugins.

Description

To support the OpenAPI 3.1 specification, the OpenApiDocumentParser class performs the following actions:

  • Adapts/converts YAML content to JSON for further processing using System.Text.Json API.
  • Tries to find the 'openapi' property.
  • Downgrade the property value to latest supported version - 3.0.1 if the version in the document is higher.
  • Passes the updated JSON OpenAPI document to Microsoft.OpenAPI.NET library for parsing.

Other small changes introduced in this PR:

  • Cancellation toke is added to all ImportChatGptPluginSkill* and ImportOpenApiSkill* methods.
  • All the ImportChatGptPluginSkill* and ImportOpenApiSkill* methods are made asynchronous.
  • ReadAsync method of OpenApiReader class is used Read one.

Contribution Checklist

@SergeyMenshykh SergeyMenshykh changed the title Support for OpenAPIi 3.1 version Support for OpenAPI 3.1 version Apr 6, 2023
@SergeyMenshykh SergeyMenshykh added the PR: ready for review All feedback addressed, ready for reviews label Apr 6, 2023
@adrianwyatt adrianwyatt self-assigned this Apr 6, 2023
Copy link
Member

@lemillermicrosoft lemillermicrosoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM.

Copy link
Member

@shawncal shawncal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just 2 comments:

  • async/await thing mentioned below
  • where we are adding awaits, please add start adding .ConfigureAwait(false) as a general good practice (we'll need to make this change in the whole kernel project at some point)

@SergeyMenshykh
Copy link
Member Author

Just 2 comments:

  • async/await thing mentioned below
  • where we are adding awaits, please add start adding .ConfigureAwait(false) as a general good practice (we'll need to make this change in the whole kernel project at some point)

Removed the awaits where it was possible and added ConfigureAwait(false) to all awaits in OpenAPI sills functionality.

@adrianwyatt adrianwyatt added PR: ready to merge PR has been approved by all reviewers, and is ready to merge. PR: main and removed PR: ready for review All feedback addressed, ready for reviews labels Apr 7, 2023
@adrianwyatt adrianwyatt changed the title Support for OpenAPI 3.1 version Mitigate support for OpenAPI 3.1 Apr 7, 2023
@adrianwyatt adrianwyatt merged commit 605c508 into microsoft:main Apr 7, 2023
dehoward pushed a commit to lemillermicrosoft/semantic-kernel that referenced this pull request Jun 1, 2023
### Motivation and Context

This PR adds support for OpenAPI 3.1 spec to OpenAPI skills
functionality that may be useful in scenarios when OpenAPI 3.1 skills
are imported directly from OpenAPI documents or indirectly through
ChatGPT plugins.

### Description

To support the OpenAPI 3.1 specification, the OpenApiDocumentParser
class performs the following actions:
- Adapts/converts YAML content to JSON for further processing using
System.Text.Json API.
- Tries to find the 'openapi' property.
- Downgrade the property value to latest supported version - 3.0.1 if
the version in the document is higher.
- Passes the updated JSON OpenAPI document to Microsoft.OpenAPI.NET
library for parsing.

Other small changes introduced in this PR:
- Cancellation toke is added to all ImportChatGptPluginSkill* and
ImportOpenApiSkill* methods.
- All the ImportChatGptPluginSkill* and ImportOpenApiSkill* methods are
made asynchronous.
- ReadAsync method of OpenApiReader class is used Read one.
golden-aries pushed a commit to golden-aries/semantic-kernel that referenced this pull request Oct 10, 2023
…ft#354)

Bumps
[Microsoft.Azure.Cosmos](https://github.com/Azure/azure-cosmos-dotnet-v3)
from 3.35.3 to 3.35.4.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/changelog.md">Microsoft.Azure.Cosmos's
changelog</a>.</em></p>
<blockquote>
<h3><!-- raw HTML omitted --> <a
href="https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.4">3.35.4</a>
- 2023-09-15</h3>
<h4>Fixed</h4>
<ul>
<li><a
href="https://redirect.github.com/Azure/azure-cosmos-dotnet-v3/pull/3934">3934</a>
Subpartitioning: Fixes bug for queries on subpartitioned containers with
split physical partitions</li>
</ul>
<h3><!-- raw HTML omitted --> <a
href="https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.3-preview">3.35.3-preview</a>
- 2023-08-10</h3>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/Azure/azure-cosmos-dotnet-v3/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Microsoft.Azure.Cosmos&package-manager=nuget&previous-version=3.35.3&new-version=3.35.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: ready to merge PR has been approved by all reviewers, and is ready to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants