Skip to content

Commit

Permalink
chore: upgrades plugins library version
Browse files Browse the repository at this point in the history
  • Loading branch information
baywet committed Oct 22, 2024
1 parent b1320fe commit 177e126
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions dotnet/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@
<PackageVersion Include="MongoDB.Driver" Version="2.29.0" />
<PackageVersion Include="Microsoft.Graph" Version="[4.51.0, 5)" />
<PackageVersion Include="Microsoft.Identity.Client.Extensions.Msal" Version="[2.28.0, )" />
<PackageVersion Include="Microsoft.OpenApi" Version="1.6.21" />
<PackageVersion Include="Microsoft.OpenApi.Readers" Version="1.6.21" />
<PackageVersion Include="Microsoft.OpenApi" Version="1.6.22" />
<PackageVersion Include="Microsoft.OpenApi.Readers" Version="1.6.22" />
<PackageVersion Include="Microsoft.OpenApi.ApiManifest" Version="0.5.4-preview" />
<PackageVersion Include="Microsoft.Plugins.Manifest" Version="0.0.9-preview" />
<PackageVersion Include="Microsoft.Plugins.Manifest" Version="1.0.0-preview2" />
<PackageVersion Include="Google.Apis.CustomSearchAPI.v1" Version="[1.60.0.3001, )" />
<PackageVersion Include="Grpc.Net.Client" Version="2.65.0" />
<PackageVersion Include="protobuf-net" Version="3.2.30" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ public static async Task<KernelPlugin> CreatePluginFromMicrosoftManifestAsync(
var predicate = OpenApiFilterService.CreatePredicate(string.Join(",", manifestFunctions.Select(f => f.Name)), null, null, openApiDocument);
var filteredOpenApiDocument = OpenApiFilterService.CreateFilteredDocument(openApiDocument, predicate);

var serverUrl = filteredOpenApiDocument.Servers.FirstOrDefault()?.Url;
if (serverUrl is null)
var server = filteredOpenApiDocument.Servers.FirstOrDefault();
if (server is null)
{
logger.LogWarning("No server URL found in the OpenAPI document.");
logger.LogWarning("No server found in the OpenAPI document.");
continue;
}

Expand All @@ -155,13 +155,13 @@ public static async Task<KernelPlugin> CreatePluginFromMicrosoftManifestAsync(

foreach (var path in filteredOpenApiDocument.Paths)
{
var operations = OpenApiDocumentParser.CreateRestApiOperations(serverUrl, path.Key, path.Value, null, logger);
var operations = OpenApiDocumentParser.CreateRestApiOperations(server, path.Key, path.Value, null, logger);
foreach (RestApiOperation operation in operations)
{
try
{
logger.LogTrace("Registering Rest function {0}.{1}", pluginName, operation.Id);
functions.Add(OpenApiKernelExtensions.CreateRestApiFunction(pluginName, runner, operation, openApiFunctionExecutionParameters, new Uri(serverUrl), loggerFactory));
functions.Add(OpenApiKernelPluginFactory.CreateRestApiFunction(pluginName, runner, operation, openApiFunctionExecutionParameters, new Uri(server.Url), loggerFactory));
}
catch (Exception ex) when (!ex.IsCriticalException())
{
Expand Down

0 comments on commit 177e126

Please sign in to comment.