diff --git a/surfsense_backend/app/prompts/system_defaults.py b/surfsense_backend/app/prompts/system_defaults.py new file mode 100644 index 000000000..1afdcf242 --- /dev/null +++ b/surfsense_backend/app/prompts/system_defaults.py @@ -0,0 +1,76 @@ +SYSTEM_PROMPT_DEFAULTS: list[dict] = [ + { + "slug": "fix-grammar", + "name": "Fix grammar", + "prompt": ( + "Fix the grammar and spelling in the following text." + " Return only the corrected text, nothing else.\n\n{selection}" + ), + "mode": "transform", + "icon": "check", + }, + { + "slug": "make-shorter", + "name": "Make shorter", + "prompt": ( + "Make the following text more concise while preserving its meaning." + " Return only the shortened text, nothing else.\n\n{selection}" + ), + "mode": "transform", + "icon": "minimize", + }, + { + "slug": "translate", + "name": "Translate", + "prompt": ( + "Translate the following text to English." + " If it is already in English, translate it to French." + " Return only the translation, nothing else.\n\n{selection}" + ), + "mode": "transform", + "icon": "languages", + }, + { + "slug": "rewrite", + "name": "Rewrite", + "prompt": ( + "Rewrite the following text to improve clarity and readability." + " Return only the rewritten text, nothing else.\n\n{selection}" + ), + "mode": "transform", + "icon": "pen-line", + }, + { + "slug": "summarize", + "name": "Summarize", + "prompt": ( + "Summarize the following text concisely." + " Return only the summary, nothing else.\n\n{selection}" + ), + "mode": "transform", + "icon": "list", + }, + { + "slug": "explain", + "name": "Explain", + "prompt": "Explain the following text in simple terms:\n\n{selection}", + "mode": "explore", + "icon": "book-open", + }, + { + "slug": "ask-knowledge-base", + "name": "Ask my knowledge base", + "prompt": "Search my knowledge base for information related to:\n\n{selection}", + "mode": "explore", + "icon": "search", + }, + { + "slug": "look-up-web", + "name": "Look up on the web", + "prompt": "Search the web for information about:\n\n{selection}", + "mode": "explore", + "icon": "globe", + }, +] + +SYSTEM_PROMPT_SLUGS: set[str] = {p["slug"] for p in SYSTEM_PROMPT_DEFAULTS}