Save Routes¶
app.routes_save contains save/export-related HTTP route handlers. Route handlers stay thin and delegate non-HTTP orchestration to save services.
Character-description save and export routes.
This router owns the default-system-prompt, save, and save-export endpoints. It keeps HTTP concerns in the route layer while delegating save-folder creation and file writing to the service layer.
- app.routes_save.get_system_prompt()[source]¶
Return the default Character Description prompt as plain text.
This allows the frontend to resolve the effective system prompt when no custom override is set, ensuring saved files always contain the complete prompt text rather than a placeholder.
- app.routes_save.save_run(req)[source]¶
Persist a character-description session under the configured save root.
- app.routes_save.export_save(folder_name)[source]¶
Stream a save folder as a compressed zip archive for download.
The endpoint validates the folder name against a strict pattern to prevent path-traversal attacks, then bundles all known save-package files into a zip using
save_package.create_zip_archive().