[.Net][Feature Request]: Eanble step-by-step execution for two agent chat API. #3339
Labels
api-break-change
Will break existing api and needs an migration for previous code to work
good first issue
Good for newcomers
Milestone
Is your feature request related to a problem? Please describe.
Similar to how
GroupChatExtension.SendAsync
returns anIAsyncEnumerable
iterator, theAgentExtension.SendAsync(this IAgent agent, IAgent receiver, IEnumerable<IMessage> chatHistory, int maxRound = 10, CancellationToken ct = default(CancellationToken))
should also return anIAsyncEnuemrable
so the conversation can be driven step by step.Describe the solution you'd like
Return
IAsyncEnumerabe
inAgentExtension.SendAsync(this IAgent agent, IAgent receiver, IEnumerable<IMessage> chatHistory, int maxRound = 10, CancellationToken ct = default(CancellationToken))
Before
After
API break change
this issue deprecates the following APIs. It's recommended to use
GroupChatExtension.SendAsync
insteadAgentExtension.SendMessageToGroupAsync(IGroupChat, string, IEnumerable<IMessage>, int)
AgentExtension.SendMessageToGroupAsync(IGroupChat, IEnumerable<IMessage>, int)
This issue also changes the return type of
AgentExtension.SendAsync
fromTask<IEnumerable<IMessage>>
toIAsyncEnumerable<IMessage>
. You can useToArrayAsync
or something similar to convertIAsyncEnumerable
toIEnumerable
if you don't want to iterate over messages usingawait foreach
Additional context
See also #3214 on how groupchat.sendasync implement step-by-step execution by returning
IAsyncEnumerable
No response
The text was updated successfully, but these errors were encountered: