0

I am trying to invoke semantic kernel plugin using OpenAPI call

var plugin = await kernel.ImportPluginFromOpenApiAsync(
      name,
      endpoint,
      new OpenApiFunctionExecutionParameters(httpClient));

var arguments = new KernelArguments
{
    ["param1"] = "..."
};

await plugin[functionName].InvokeAsync(kernel, arguments);

I am getting the following error: Message: 

Microsoft.OpenApi.Readers.Exceptions.OpenApiUnsupportedSpecVersionException : OpenAPI specification version '' is not supported.

Where should the version number be specified (say as v3.0.0), is it appsettings.json of the plugin project?

 "aiPlugin": {
   "schemaVersion": "v1",
   "nameForModel": "",
   "nameForHuman": "",
   "descriptionForModel": "",
   "descriptionForHuman": "",
   "auth": {
     "type": "none"
   },
   "api": {
     "type": "openapi",
     "url": "{url}/swagger.json",
   }, 

i tried adding to api section the following

openapi: 3.0.0

but it made no difference - still displayed as empty as '' from the error message.

Thank you

1
  • i rushed with the question ;~( the answer as to use the correct url with latest openapi version localhost:7071/openapi/v3.json Commented Apr 28, 2024 at 17:57

1 Answer 1

0

the answer was just to use the right url: http://localhost:7071/openapi/v3.json

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.