You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
awaitResponse.WriteAsJsonAsync(new{error="This conversation has grown too long. Please start a new one.",errorCode="context_limit_exceeded"},cancellationToken);
150
+
try
151
+
{
152
+
awaitResponse.WriteAsJsonAsync(new{error="This conversation has grown too long. Please start a new one.",errorCode="context_limit_exceeded"},cancellationToken);
awaitResponse.WriteAsync("data: {\"type\":\"error\",\"message\":\"This conversation has grown too long. Please start a new one.\",\"errorCode\":\"context_limit_exceeded\"}\n\n",cancellationToken);
155
170
awaitResponse.Body.FlushAsync(cancellationToken);
156
171
}
157
-
catch(Exceptionex)when(exisIOException or OperationCanceledException or ObjectDisposedException)
172
+
catch(ExceptionwriteException)when(writeExceptionisIOException or OperationCanceledException or ObjectDisposedException)
158
173
{
159
174
// Best-effort write to an already-streaming response. Kestrel can throw
160
175
// IOException (connection reset), OperationCanceledException, or
0 commit comments