-
Notifications
You must be signed in to change notification settings - Fork 1.5k
.NET: Documentation for Human-in-the-Loop, RequestInfoEvent / RequestPort and their compatibility with AgentWorkflowBuilder orchestrations #5064
Description
This issue is a reiteration of #4341 because it was closed before its question was fully covered
Sequential Orchestration with Human-in-the-Loop is now documented but it only covers HITL through tool approval.
However, it is unclear whether Agent Framework supports usecases where agents in a sequential workflow need to be able to iterate with a user (maybe in a subworkflow?) to request more information before making the actual tool call and continuing to the next agent in the sequence.
In my example for a hotel booking congierge below, the user has to give additional information about the hotel room they want or the taxi pickup location before their room or ride is booked via a tool.
Original issue (#4341):
The Workflow documentation lists various event types.
There is a separate page on the Human-in-the-Loop usecase but oddly enough that page does not make use of the
RequestInfoEventwhich I thought is intended to support that usecase.The Human-in-the-Loop sample does use
RequestInfoEventandRequestPort, but there is no documentation covering how that should be used.Also, it is not clear whether workflows built using
AgentWorkflowBuilder(e.g. in a standard Sequential Orchestration) would support interaction with the user at all using the Human-in-the-Loop concepts?My goal is to orchestrate a few agents in a row like the process below - e.g. to book a hotel room and then arrange transport to that chosen hotel. The individual agents are setup with the required tools and should be able to ask the user for input and approval.
The sample uses a custom
Executorwhich can send typed output and respond to typed input, but I'm not sure how to do that with standardAIAgent/ChatClientAgentinstances that are setup usingAgentWorkflowBuilder.BuildSequential(agents);. Loadingflowchart TD B@{ shape: manual-input, label: "🧑💻Input"} C@{ shape: manual-input, label: "🧑💻 Approval"} D@{ shape: manual-input, label: "🧑💻 Input"} E@{ shape: manual-input, label: "🧑💻 Approval"} subgraph Workflow A@{ shape: manual-input, label: "🧑💻 Input"} F[fa:fa-robot Hotel Agent] G[fa:fa-robot Ride Agent] L@{ shape: dbl-circ, label: "Process end" } end H@{ shape: rect, label: "🛠️Get hotel options" } I@{ shape: rect, label: "🛠️Book room" } J@{ shape: rect, label: "🛠️Get ride options" } K@{ shape: rect, label: "🛠️Book ride" } A -->|Start message| F F <-->B F <-->C F -->H F -->I F -->G G <-->D G <-->E G -->J G -->K G -->L