mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 03:20:02 +08:00
Add rich text and learning blocks, media uploads, page trees, and revisioned notebook storage. Present AI suggestions at their target blocks with durable accept and dismiss actions. Unify saved outputs as Favorites with typed expandable blocks, stable source links, atomic batch insertion, nesting, dragging, and undo/redo. Validation: 99 frontend tests and 99 backend tests pass in an isolated snapshot, along with TypeScript, scoped ESLint, dependency architecture, and locale parity checks.
13 lines
821 B
TypeScript
13 lines
821 B
TypeScript
/** Keep provider payloads and account identifiers out of the writing surface. */
|
|
export function noteGenerationError(message: string) {
|
|
if (/insufficient credits|HTTP 402|payment required/i.test(message))
|
|
return 'The generation provider has insufficient credits. Add credits in its settings, then retry.'
|
|
if (/No module named ['"]manim|manim.*not installed/i.test(message))
|
|
return 'Animation rendering requires Manim. Install the animation dependencies, then retry.'
|
|
if (/Configure distinct host and expert voices/i.test(message))
|
|
return 'Configure distinct host and expert voices for the active TTS model.'
|
|
if (/HTTP \d{3}|\{"error"|Traceback|Error code:/i.test(message))
|
|
return 'The generation service could not complete this request. Check the provider settings and retry.'
|
|
return message
|
|
}
|