Skip to content

.Net: New Feature: Function invocation approval in realistic scenario #11643

Open
@RamType0

Description

@RamType0

name: Feature request
about: Suggest an idea for this project


I am using semantic kernel to make LLM integrated app.
It is hosted on ASP.NET Core SignalR, and users receive LLM generated response as IAsyncEnumerable.

public class SignalRHub : Hub
{

    public IAsyncEnumerable<ResponsePart> GetChatResponseStreamingAsync(UserMessage userMessage);

}

In this scenario, how could we implement function invocation approval system easily?
Function invocation approval is well-known use case, as it is provided as sample.
But we could not use the solution which the sample is using.

In my scenario, We should do following steps

  1. Ask user for approval to invoke function.
  2. Receive invocation approval result from user.
  3. Resume function invocation if the user approved its invocation.

But there is no API to pause function invocation and resume it after.

Another way to do this is to ask user for approval by sending other message from server, and not to send approval request as one of the yielded response from IAsyncEnumerable.

But this solution makes the client side execution flow to complicated, and also lead SignalR timeout(due to too long duration between yielding element from IAsyncEnumerable).

I know that we could implement this feature via manual function invocation, but it requires lots of code.

Metadata

Metadata

Assignees

Labels

.NETIssue or Pull requests regarding .NET code

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions