Testing how Open Api based plugins can use HttpResponseContentReader delegate and IAutoFunctionInvocationFilter and SignalR #11567
-
I am testing how Open Api based plugins can use HttpResponseContentReader delegate and IAutoFunctionInvocationFilter and if these two can play nicely together. This is my custom delegate: namespace SemanticKernelDemoApi.Services; public static class CustomHttpContentReader /// A custom HTTP content reader to change the default behavior of reading HTTP content. /// /// The HTTP response content reader context. /// The cancellation token. /// The HTTP response content. public static async Task<object?> ReadHttpResponseContentAsync(HttpResponseContentReaderContext context, CancellationToken cancellationToken) { // Read JSON content as a stream rather than as a string, which is the default behavior if (context.Response.Content.Headers.ContentType?.MediaType == "application/json") { return await context.Response.Content.ReadAsStreamAsync(cancellationToken); }
} Here is how I simulate Repair objects retrieval: internal record Repair(int Id, string Title, string Description, string AssignedTo, string Date, string Image); internal class ProductsService
` Here is my custom IAutoFunctionInvocationFilter implemenation. ` namespace SemanticKernelDemoApi.Services; internal record Repair(int Id, string Title, string Description, string AssignedTo, string Date, string Image); public class ChatAutoFunctionInvocationFilter : IAutoFunctionInvocationFilter
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Tagging @SergeyMenshykh |
Beta Was this translation helpful? Give feedback.
Hi @radrad, I tried to reproduce the issue but was not able to.
Here's the sample that imports the repair service API as a plugin and uses LLM to call it: