You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: mxgo/config.py
+29Lines changed: 29 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,35 @@
58
58
},
59
59
},
60
60
}
61
+
62
+
# System capabilities - extracted from email handles and their templates
63
+
SYSTEM_CAPABILITIES="""## Available Email Processing Handles
64
+
65
+
- **summarize**: Systematically analyze and summarize content from all sources with clear structure and action focus. Processes email content, attachments, and external references to provide executive summaries, main points, action items, and additional context.
66
+
67
+
- **research**: Conduct comprehensive research and provide detailed analysis with proper sections and citations. Uses deep research tools to gather current information, analyze findings, and provide supporting evidence with academic tone.
68
+
69
+
- **simplify**: Transform complex content into clear, accessible explanations using simple language and relatable examples. Breaks down technical jargon, adds helpful analogies, and makes content understandable to general audiences.
70
+
71
+
- **ask**: Execute custom tasks and workflows systematically with research, analysis, and professional presentation. Handles any custom request, research needs, content creation, and provides comprehensive solutions with proper formatting.
72
+
73
+
- **fact-check**: Systematically verify claims and statements with comprehensive source validation and transparent uncertainty handling. Extracts all verifiable claims, searches for evidence, cross-references multiple sources, and provides clear verification status.
74
+
75
+
- **background-research**: Conduct comprehensive business intelligence research on individuals and organizations. Provides strategic insights for business decisions, company analysis, professional profiles, and competitive context.
76
+
77
+
- **translate**: Provide accurate translations with cultural context preservation and clear explanation of translation decisions. Detects source language, chooses appropriate translation approach, and provides cultural adaptations.
78
+
79
+
- **meeting**: Intelligently extract, research, and schedule meetings or appointments with proper validation. Handles participant research, time resolution, and generates calendar invitations with comprehensive meeting details.
80
+
81
+
- **pdf**: Intelligently analyze email content and create professional PDF document exports. Removes email metadata, preserves content structure, and generates clean, formatted documents for sharing or archiving.
82
+
83
+
- **schedule**: Analyze email content to extract scheduling requirements for future or recurring task processing. Creates appropriate cron expressions for reminders, recurring tasks, and future email processing.
84
+
85
+
- **delete**: Analyze email content to identify and delete scheduled tasks. Handles task ID extraction and provides clear confirmation of task removal.
86
+
87
+
- **news**: Search for current news and breaking stories with comprehensive analysis and grouping. Provides structured news summaries with source citations, grouped by themes to avoid repetition.
88
+
"""
89
+
61
90
RATE_LIMIT_PER_DOMAIN_HOUR= { # Consistent structure for domain limits
Copy file name to clipboardExpand all lines: mxgo/prompts/template_prompts.py
+37-10Lines changed: 37 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
Template prompts for different email processing handlers.
3
3
"""
4
4
5
+
frommxgo.configimportSYSTEM_CAPABILITIES
6
+
5
7
# Summarize email handler template
6
8
SUMMARIZE_TEMPLATE="""
7
9
Systematically analyze and summarize content from all available sources with clear structure and action focus.
@@ -1108,7 +1110,7 @@
1108
1110
"""
1109
1111
1110
1112
# Future handler template
1111
-
FUTURE_TEMPLATE="""
1113
+
FUTURE_TEMPLATE=f"""
1112
1114
Analyze email content to extract scheduling requirements for future or recurring task processing and create appropriate cron expressions.
1113
1115
1114
1116
# Future Task Scheduling Process
@@ -1177,14 +1179,8 @@
1177
1179
- **distilled_future_task_instructions**: Clear, detailed instructions about how the task should be processed when executed in the future. This should include the processing approach, any specific requirements, and what the expected outcome should be. **CRITICAL: If the original email contains attachments, you MUST include detailed context about the attachments in these instructions since attachments will not be available during scheduled execution. Include attachment names, types, sizes, and any relevant content or context from the attachments.**
1178
1180
- **start_time**: (Optional) Start time for the task in ISO 8601 format - task will not execute before this time (e.g., "2024-09-01T00:00:00Z")
1179
1181
- **end_time**: (Optional) End time for the task in ISO 8601 format - task will not execute after this time (e.g., "2024-12-31T23:59:59Z")
1180
-
- **future_handle_alias**: The specific email handle to use for the future task. Select one of the following based on the user's instructions:
1181
-
- **`ask`**: (Default) For general questions, custom tasks, or when no other handle fits.
1182
-
- **`news`**: For fetching the latest news on a specific topic (e.g., "send me the news on AI every Friday").
1183
-
- **`research`**: For conducting in-depth research on a topic at a later time.
1184
-
- **`summarize`**: For summarizing the content of the email at a future date.
1185
-
- **`fact-check`**: For verifying claims in the email content later.
1186
-
- **`simplify`**: For explaining the content of the email in simple terms at a scheduled time.
1187
-
- **`translate`**: For translating the email content at a future time.
1182
+
- **future_handle_alias**: The specific email handle to use for the future task. Select one of the available email processing handles based on the user's instructions:
4. **User-friendly confirmation** - explain what was scheduled and when it will happen
1443
1439
5. **Error handling** - validate timing requests and provide alternatives if invalid
1444
-
"""
1440
+
"""# noqa: S608
1445
1441
1446
1442
# Delete handler template
1447
1443
DELETE_TEMPLATE="""
@@ -1835,3 +1831,34 @@
1835
1831
- Focus on **actionable insights** and current developments
1836
1832
- Maintain **professional news analysis** tone
1837
1833
"""
1834
+
1835
+
NEWSLETTER_TEMPLATE="""
1836
+
## Primary Goal: Generate a high-quality, engaging, and well-researched newsletter.
1837
+
1838
+
## STEP 1: Deconstruct the Request & Plan the Outline
1839
+
- **Analyze the Core Topic**: Identify the central theme from the user's prompt: **"{prompt}"**.
1840
+
- **Review Specific Instructions**: Carefully read all user-provided instructions below regarding sources, formatting, and geographic focus.
1841
+
- **Create a Research Outline**: Based on the topic, generate a logical 3-5 section outline for the newsletter. This will be your plan for research. The outline should be more than just keywords; it should represent the narrative flow of the newsletter.
1842
+
1843
+
## STEP 2: Conduct Comprehensive Research (Per Section)
1844
+
- For EACH section in your outline, use the `web_search` tool to gather detailed, current, and authoritative information.
1845
+
- **Prioritize Sources**: If the user has specified sources, you MUST prioritize them in your search.
1846
+
- **Data & Evidence**: Focus on finding specific data, statistics, expert quotes, and verifiable facts. Avoid vague generalizations.
1847
+
1848
+
## STEP 3: Synthesize and Draft the Newsletter
1849
+
- **Introduction**: Write a compelling opening that introduces the topic and hooks the reader.
1850
+
- **Body**: Draft each section from your outline, synthesizing the research findings into a coherent narrative. Do not simply list facts. Weave them together to tell a story or build an argument.
1851
+
- **Conclusion**: Write a concise summary or a forward-looking statement to conclude the newsletter.
1852
+
- **Adhere to User Instructions**: Ensure the draft meets all specific user instructions.
1853
+
1854
+
## STEP 4: Final Review and Formatting
1855
+
- **Apply Markdown**: Format the entire newsletter using professional Markdown, including headings (`###`), bullet points, and bold/italic text for emphasis.
1856
+
- **Check for Quality**: Review the draft for clarity, accuracy, and engagement. Ensure it directly addresses the user's core prompt.
1857
+
- **Source Attribution**: The system will handle the final "References" section. You do not need to add manual citations in the text.
1858
+
1859
+
---
1860
+
1861
+
## Specific Instructions for This Newsletter
1862
+
You MUST adhere to the following user-provided instructions:
# System capabilities - extracted from email handles and their templates
22
-
SYSTEM_CAPABILITIES="""## Available Email Processing Handles
23
-
24
-
- **summarize**: Systematically analyze and summarize content from all sources with clear structure and action focus. Processes email content, attachments, and external references to provide executive summaries, main points, action items, and additional context.
25
-
26
-
- **research**: Conduct comprehensive research and provide detailed analysis with proper sections and citations. Uses deep research tools to gather current information, analyze findings, and provide supporting evidence with academic tone.
27
-
28
-
- **simplify**: Transform complex content into clear, accessible explanations using simple language and relatable examples. Breaks down technical jargon, adds helpful analogies, and makes content understandable to general audiences.
29
-
30
-
- **ask**: Execute custom tasks and workflows systematically with research, analysis, and professional presentation. Handles any custom request, research needs, content creation, and provides comprehensive solutions with proper formatting.
31
-
32
-
- **fact-check**: Systematically verify claims and statements with comprehensive source validation and transparent uncertainty handling. Extracts all verifiable claims, searches for evidence, cross-references multiple sources, and provides clear verification status.
33
-
34
-
- **background-research**: Conduct comprehensive business intelligence research on individuals and organizations. Provides strategic insights for business decisions, company analysis, professional profiles, and competitive context.
35
-
36
-
- **translate**: Provide accurate translations with cultural context preservation and clear explanation of translation decisions. Detects source language, chooses appropriate translation approach, and provides cultural adaptations.
37
-
38
-
- **meeting**: Intelligently extract, research, and schedule meetings or appointments with proper validation. Handles participant research, time resolution, and generates calendar invitations with comprehensive meeting details.
39
-
40
-
- **pdf**: Intelligently analyze email content and create professional PDF document exports. Removes email metadata, preserves content structure, and generates clean, formatted documents for sharing or archiving.
41
-
42
-
- **schedule**: Analyze email content to extract scheduling requirements for future or recurring task processing. Creates appropriate cron expressions for reminders, recurring tasks, and future email processing.
43
-
44
-
- **delete**: Analyze email content to identify and delete scheduled tasks. Handles task ID extraction and provides clear confirmation of task removal.
45
-
46
-
- **news**: Search for current news and breaking stories with comprehensive analysis and grouping. Provides structured news summaries with source citations, grouped by themes to avoid repetition.
47
-
"""
48
-
49
22
SUGGESTION_INSTRUCTIONS=f"""## Email Analysis and Suggestion Guidelines
50
23
51
24
You are an intelligent email assistant that analyzes email content to provide a crisp overview and suggest appropriate processing handles.
0 commit comments