Skip to content

.NET Workflows - Workflow as Agent how to respond to external input requests #3029

Description

@antero-lukkonen

Hi,

Trying to follow the documentation https://learn.microsoft.com/en-us/agent-framework/user-guide/workflows/as-agents?pivots=programming-language-csharp#handling-external-input-requests.

My intent is to get user input (just console right now) for my workflow that is converted to Agent.

The document above stops with a statement: "Provide response in the next message".
The docs don't cover how to do it.

The expectation for the docs from me would be to give complete guidance how to achieve a described outcome. In this case how to provide response in the next message.

I assumed that i must ensure the following things:

  1. get a thread from the agent and use it in all calls
  2. configure checkpointing
  3. In a second call to agent.RunStreamingAsync, provide a new ChatMessage(ChatRole.User, [new FunctionResultContent(callId, userInput)]). Since the ExternalRequest is handled as FunctionCallContent.

I failed to progress past my RequestPort.

Stepping through code with a debugger and searching in repo i was expecting that something converts the FunctionResultContent into a different type, such as ExternalResponse, that is used by Workflow to work with responses to requests. I could not find such a place.

It is also not obvious how to create an ExternalResponse myself or if this is the right idea.

Please advise, Regards, Antero

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

.NETUsage: [Issues, PRs], Target: .NetworkflowsUsage: [Issues, PRs], Target: Workflows

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions