Skip to content

Commit

Permalink
.Net: Promote OpenAPI package to preview (#9704)
Browse files Browse the repository at this point in the history
### Motivation, Context and Description
Promote Functions.OpenApi package to preview. Closes:
#9636
  • Loading branch information
SergeyMenshykh authored Nov 14, 2024
1 parent 9c50788 commit 691f561
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 7 deletions.
6 changes: 0 additions & 6 deletions dotnet/src/Functions/Functions.OpenApi/AssemblyInfo.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Net.Http;
using Microsoft.Extensions.Logging;
using Microsoft.SemanticKernel.Http;
Expand Down Expand Up @@ -46,6 +47,7 @@ public class OpenApiFunctionExecutionParameters
/// To support more complex payloads, it should be disabled and the payload should be provided via the 'payload' argument.
/// See the 'Providing Payload for OpenAPI Functions' ADR for more details: https://github.com/microsoft/semantic-kernel/blob/main/docs/decisions/0062-open-api-payload.md
/// </summary>
[Experimental("SKEXP0040")]
public bool EnableDynamicPayload { get; set; }

/// <summary>
Expand All @@ -56,11 +58,13 @@ public class OpenApiFunctionExecutionParameters
/// the parameters 'sender.email' and 'sender.receiver' will be correctly resolved from arguments with the same names.
/// See the 'Providing Payload for OpenAPI Functions' ADR for more details: https://github.com/microsoft/semantic-kernel/blob/main/docs/decisions/0062-open-api-payload.md
/// </summary>
[Experimental("SKEXP0040")]
public bool EnablePayloadNamespacing { get; set; }

/// <summary>
/// Optional list of HTTP operations to skip when importing the OpenAPI document.
/// </summary>
[Experimental("SKEXP0040")]
public IList<string> OperationsToExclude { get; set; }

/// <summary>
Expand All @@ -72,6 +76,7 @@ public class OpenApiFunctionExecutionParameters
/// as a stream rather than as a string.
/// If the custom reader is not provided, or the reader returns null, the internal reader is used.
/// </summary>
[Experimental("SKEXP0040")]
public HttpResponseContentReader? HttpResponseContentReader { get; set; }

/// <summary>
Expand All @@ -94,6 +99,7 @@ public class OpenApiFunctionExecutionParameters
/// <param name="enablePayloadNamespacing">Determines whether payload parameter names are augmented with namespaces.
/// Namespaces prevent naming conflicts by adding the parent parameter name as a prefix, separated by dots.</param>
/// <param name="operationsToExclude">Optional list of operations not to import, e.g. in case they are not supported</param>
[Experimental("SKEXP0040")]
public OpenApiFunctionExecutionParameters(
HttpClient? httpClient = null,
AuthenticateRequestAsyncCallback? authCallback = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<AssemblyName>Microsoft.SemanticKernel.Plugins.OpenApi</AssemblyName>
<RootNamespace>$(AssemblyName)</RootNamespace>
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
<VersionSuffix>alpha</VersionSuffix>
<NoWarn>$(NoWarn);SKEXP0040</NoWarn>
<VersionSuffix>preview</VersionSuffix>
</PropertyGroup>
<Import Project="$(RepoRoot)/dotnet/nuget/nuget-package.props" />
<Import Project="$(RepoRoot)/dotnet/src/InternalUtilities/src/InternalUtilities.props" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;

Expand All @@ -11,4 +12,5 @@ namespace Microsoft.SemanticKernel.Plugins.OpenApi;
/// <param name="context">The context containing HTTP operation details.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>The HTTP response content.</returns>
[Experimental("SKEXP0040")]
public delegate Task<object?> HttpResponseContentReader(HttpResponseContentReaderContext context, CancellationToken cancellationToken = default);
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Diagnostics.CodeAnalysis;
using System.Net.Http;

namespace Microsoft.SemanticKernel.Plugins.OpenApi;

/// <summary>
/// Represents the context for HTTP response content reader.
/// </summary>
[Experimental("SKEXP0040")]
public sealed class HttpResponseContentReaderContext
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
Expand All @@ -26,6 +27,7 @@ namespace Microsoft.SemanticKernel.Plugins.OpenApi;
/// <summary>
/// Parser for OpenAPI documents.
/// </summary>
[Experimental("SKEXP0040")]
public sealed class OpenApiDocumentParser(ILoggerFactory? loggerFactory = null)
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
// Copyright (c) Microsoft. All rights reserved.

using System;
using System.Diagnostics.CodeAnalysis;

namespace Microsoft.SemanticKernel.Plugins.OpenApi;

/// <summary>
/// Options for OpenAPI document parser.
/// </summary>
[Experimental("SKEXP0040")]
public sealed class OpenApiDocumentParserOptions
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
// Copyright (c) Microsoft. All rights reserved.

using System;
using System.Diagnostics.CodeAnalysis;

namespace Microsoft.SemanticKernel.Plugins.OpenApi;

/// <summary>
/// Represents the context for an operation selection predicate.
/// </summary>
[Experimental("SKEXP0040")]
public readonly struct OperationSelectionPredicateContext : IEquatable<OperationSelectionPredicateContext>
{
/// <summary>
Expand Down

0 comments on commit 691f561

Please sign in to comment.