mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-22 21:28:12 +02:00
feat(error-handling): implement LLM error adaptation and classification for chat streaming
- Introduced LLMErrorCategory and adapt_llm_exception to normalize LLM exceptions. - Updated llm_retryable_message and llm_permanent_message to utilize the new adaptation logic. - Enhanced classify_stream_exception to classify provider errors and return user-friendly messages. - Added tests for error classification and adaptation to ensure robustness. - Updated frontend error handling to display appropriate messages based on new classifications.
This commit is contained in:
parent
203ef78346
commit
8e8cf96faa
9 changed files with 533 additions and 38 deletions
|
|
@ -613,6 +613,18 @@ export default function NewChatPage() {
|
|||
return;
|
||||
}
|
||||
|
||||
if (normalized.channel === "inline") {
|
||||
if (normalized.assistantMessage) {
|
||||
await persistAssistantErrorMessage({
|
||||
threadId,
|
||||
assistantMsgId,
|
||||
text: normalized.assistantMessage,
|
||||
});
|
||||
}
|
||||
toast.error(normalized.userMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
toast.error(normalized.userMessage);
|
||||
},
|
||||
[currentUser?.id, persistAssistantErrorMessage, searchSpaceId, setPremiumAlertForThread]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue