mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
.NET: Declarative workflows - Gracefully handle agent scenarios when no response is returned (#5376)
* Gracefully handle agent scenarios when no response is returned * Make relevant object disposable and improve exception handling.
This commit is contained in:
committed by
GitHub
Unverified
parent
d5777bc546
commit
adcd2d33f5
+5
-1
@@ -45,7 +45,11 @@ internal sealed class RequestExternalInputExecutor(RequestExternalInput model, R
|
||||
await agentProvider.CreateMessageAsync(workflowConversationId, inputMessage, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
await context.SetLastMessageAsync(response.Messages.Last()).ConfigureAwait(false);
|
||||
ChatMessage? lastMessage = response.Messages.LastOrDefault();
|
||||
if (lastMessage is not null)
|
||||
{
|
||||
await context.SetLastMessageAsync(lastMessage).ConfigureAwait(false);
|
||||
}
|
||||
await this.AssignAsync(this.Model.Variable?.Path, response.Messages.ToFormula(), context).ConfigureAwait(false);
|
||||
|
||||
await context.RaiseCompletionEventAsync(this.Model, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
Reference in New Issue
Block a user