semantic-kernel
semantic-kernel copied to clipboard
Support for text/plain media type for RestAPI skill requests
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:
- 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.
- New payload factory method is added to the RestApiOperationRunner class to create "text/plain" payload.
- 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: