feat: implement RAG-enabled chat hook and admin file upload component
This commit is contained in:
@@ -36,9 +36,16 @@ const UploadZone = ({ onUploadComplete }) => {
|
||||
})
|
||||
.catch((err) => {
|
||||
const isCancelled = err?.name === 'AbortError';
|
||||
let errorMsg = err?.message || 'Unknown error';
|
||||
if (err?.name === 'LLMTruncatedError') {
|
||||
errorMsg = 'File is too large for the AI context window. Please split into smaller chunks.';
|
||||
} else if (err?.name === 'LLMValidationError') {
|
||||
errorMsg = 'AI output was malformed (not JSON). Please try again.';
|
||||
}
|
||||
|
||||
setQueue((q) => q.map((item) =>
|
||||
item.id === next.id
|
||||
? { ...item, status: isCancelled ? 'cancelled' : 'failed', error: isCancelled ? null : err.message }
|
||||
? { ...item, status: isCancelled ? 'cancelled' : 'failed', error: isCancelled ? null : errorMsg }
|
||||
: item
|
||||
));
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user