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
This PR revamps the design of `ChatInput` to better respond to error
messages when sending the message or streaming a response. Error
messages now appear right above the text input and there's logic to
remove `optimisticMessage`s when the error occurs before the message is
added to the thread.
Copy file name to clipboardExpand all lines: pingpong/ai.py
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -320,8 +320,8 @@ async def run_thread(
320
320
yield (
321
321
orjson.dumps(
322
322
{
323
-
"type": "error",
324
-
"detail": "OpenAI was unable to process your request. Please refresh the page and try again. If the issue persists, check https://pingpong-hks.statuspage.io/.",
323
+
"type": "rate_limit_error",
324
+
"detail": "OpenAI was unable to process your request. If the issue persists, check PingPong's status page for updates.",
325
325
}
326
326
)
327
327
+b"\n"
@@ -336,8 +336,8 @@ async def run_thread(
336
336
# openai_error.message returns the entire error message in a string with all parameters. We can use the body to get the message if it exists, or we fall back to the whole thing.
337
337
orjson.dumps(
338
338
{
339
-
"type": "error",
340
-
"detail": "OpenAI was unable to process your request: "
339
+
"type": "presend_error",
340
+
"detail": "OpenAI was unable to process your request. "
0 commit comments