semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

Support for text/plain media type for RestAPI skill requests

Open SergeyMenshykh opened this issue 1 year ago • 0 comments

Motivation and Context

The PR adds support for "text/plain" media-type to RestAPI skills. Additionality, it adds extra metadata to RestAPI skills execution result.

It's useful for calls to REST APIs that either expect "plain/text" request payload media-type or return "plain/text" media-type.

Description

The following classes were changed:

  1. The RestApiOperationExtensions class is extended to advertise the input parameter/argument for requests having "text/plain" payload media-type so that model knows how to use it.
  2. New payload factory method is added to the RestApiOperationRunner class to create "text/plain" payload.
  3. A few other classes are slightly changed to support the "text/plain" payload.

Contribution Checklist

  • [x] The code builds clean without any errors or warnings
  • [x] The PR follows SK Contribution Guidelines (https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
  • [x] The code follows the .NET coding conventions (https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions) verified with dotnet format
  • [x] All unit tests pass, and I have added new tests where possible
  • [x] I didn't break anyone :smile:

SergeyMenshykh avatar Apr 17 '23 23:04 SergeyMenshykh