Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ private async Task ExecuteResponseAsync(string responseId, ResponseState state,
// Update response status to completed if not already in a terminal state
if (!state.IsTerminal)
{
state.Response = state.Response! with
var completedResponse = state.Response! with
{
Status = ResponseStatus.Completed
};
Expand All @@ -565,7 +565,7 @@ private async Task ExecuteResponseAsync(string responseId, ResponseState state,
var completedEvent = new StreamingResponseCompleted
{
SequenceNumber = sequenceNumber,
Response = state.Response
Response = completedResponse
};

state.AddStreamingEvent(completedEvent);
Expand All @@ -574,7 +574,7 @@ private async Task ExecuteResponseAsync(string responseId, ResponseState state,
catch (OperationCanceledException)
{
// Update response status to cancelled
state.Response = state.Response! with
var cancelledResponse = state.Response! with
{
Status = ResponseStatus.Cancelled
};
Expand All @@ -583,15 +583,15 @@ private async Task ExecuteResponseAsync(string responseId, ResponseState state,
var cancelledEvent = new StreamingResponseCancelled
{
SequenceNumber = sequenceNumber,
Response = state.Response
Response = cancelledResponse
};

state.AddStreamingEvent(cancelledEvent);
}
catch (Exception ex)
{
// Update response status to failed
state.Response = state.Response! with
var failedResponse = state.Response! with
{
Status = ResponseStatus.Failed,
Error = new ResponseError
Expand All @@ -605,7 +605,7 @@ private async Task ExecuteResponseAsync(string responseId, ResponseState state,
var failedEvent = new StreamingResponseFailed
{
SequenceNumber = sequenceNumber,
Response = state.Response
Response = failedResponse
};

state.AddStreamingEvent(failedEvent);
Expand Down
Loading
Loading