Spaces:
Sleeping
Sleeping
Update index.html
Browse files- index.html +3 -11
index.html
CHANGED
|
@@ -710,7 +710,7 @@
|
|
| 710 |
}
|
| 711 |
|
| 712 |
// Add expiry notification
|
| 713 |
-
addMessage("Your session has expired due to inactivity. A new session will be created with your next question. Please be patient and retry if your request fails or you don
|
| 714 |
|
| 715 |
// Update history display
|
| 716 |
updateSessionHistory([]);
|
|
@@ -757,8 +757,7 @@
|
|
| 757 |
});
|
| 758 |
|
| 759 |
if (!response.ok) {
|
| 760 |
-
|
| 761 |
-
throw new Error(`HTTP error! status: ${response.status}, message: ${errorText}`);
|
| 762 |
}
|
| 763 |
|
| 764 |
const data = await response.json();
|
|
@@ -779,14 +778,7 @@
|
|
| 779 |
} catch (error) {
|
| 780 |
console.error('Error sending message:', error);
|
| 781 |
chatHistory.removeChild(typingIndicator);
|
| 782 |
-
|
| 783 |
-
if (error.message.includes('400')) {
|
| 784 |
-
addMessage("Your question was flagged by content moderation. Please rephrase your question and try again. Avoid any content that could be considered harmful, offensive, or inappropriate.", 'ai');
|
| 785 |
-
} else if (error.message.includes('429')) {
|
| 786 |
-
addMessage("Rate limit exceeded. Please wait a moment before sending another question.", 'ai');
|
| 787 |
-
} else {
|
| 788 |
-
addMessage("Sorry, there was an error processing your request. Please try again.", 'ai');
|
| 789 |
-
}
|
| 790 |
} finally {
|
| 791 |
sendButton.disabled = false;
|
| 792 |
}
|
|
|
|
| 710 |
}
|
| 711 |
|
| 712 |
// Add expiry notification
|
| 713 |
+
addMessage("Your session has expired due to inactivity. A new session will be created with your next question. Please be patient and retry if your request fails or you don’t get a response—your new session will begin once the timer resets.","ai");
|
| 714 |
|
| 715 |
// Update history display
|
| 716 |
updateSessionHistory([]);
|
|
|
|
| 757 |
});
|
| 758 |
|
| 759 |
if (!response.ok) {
|
| 760 |
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
|
|
| 761 |
}
|
| 762 |
|
| 763 |
const data = await response.json();
|
|
|
|
| 778 |
} catch (error) {
|
| 779 |
console.error('Error sending message:', error);
|
| 780 |
chatHistory.removeChild(typingIndicator);
|
| 781 |
+
addMessage("Sorry, there was an error processing your request. Please try again.", 'ai');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 782 |
} finally {
|
| 783 |
sendButton.disabled = false;
|
| 784 |
}
|