Skip to content

Testing how Open Api based plugins can use HttpResponseContentReader delegate and IAutoFunctionInvocationFilter and SignalR #11567

Answered by SergeyMenshykh
radrad asked this question in Q&A
Discussion options

You must be logged in to vote

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:

[Fact]
public async Task GetRepairs()
{
    IKernelBuilder builder = Kernel.CreateBuilder();

    builder.AddOpenAIChatCompletion(
        modelId: TestConfiguration.OpenAI.ChatModelId,
        apiKey: TestConfiguration.OpenAI.ApiKey);

    Kernel kernel = builder.Build();
    kernel.AutoFunctionInvocationFilters.Add(new OpenApiFunctionInvocationFilter());

    await kernel.ImportPluginFromOpenApiAsync(
        "listRepairs",
        new Uri("https://localhost:7261/swagger/v1/swagger.json"),
        new OpenApiFunctionExecutionParameters()

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SergeyMenshykh
Comment options

Answer selected by sophialagerkranspandey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants