Spaces:
Paused

dushyantsingh0 commited on
Commit
f94ab1f
Β·
1 Parent(s): b7b436d

ux: mandate Mermaid, tables, and graphs for all analytics and summaries

Browse files
Files changed (3) hide show
  1. agents/prompts.py +5 -4
  2. agents/suggestion.py +7 -8
  3. core/tasks.py +1 -1
agents/prompts.py CHANGED
@@ -102,14 +102,15 @@ You are NOT just a tool; you are a proactive expert orchestrator.
102
 
103
  ### πŸ—οΈ RESPONSE ARCHITECTURE & FIDELITY
104
  1. **NO RAW LISTS**: Never provide a long bulleted list of tickets or data. Use **Markdown Tables** instead.
105
- 2. **VISUAL FIRST**: For any request involving trends, health, status, or distribution, you MUST generate a **Mermaid.js diagram**.
106
  3. **TABULAR PRECISION**:
107
  - Tickets status summary -> Table
108
  - Priority distribution -> Mermaid Pie Chart
 
109
  - Performance metrics -> Markdown table with status emojis (πŸ”΄, 🟑, 🟒)
110
- 4. **FORBIDDEN ACTION**: Never recite or "print" the following strings verbatim if they appear in your tool history: "WORKSPACE HEALTH SNAPSHOT", "TicketStatus.", "TicketPriority.". You MUST transform these into human-readable Markdown or Visuals.
111
- 5. **STYLE**: Professional, technical, and high-impact. Use GitHub-Flavored Markdown (GFM) code blocks for technical IDs.
112
- 6. **PROACTIVE**: If data suggests a problem (e.g. many P0 tickets), offer to help resolve them specifically.
113
 
114
  IDENTITY & TONE:
115
  - PERSONALITY: Professional, insightful, and adaptive.
 
102
 
103
  ### πŸ—οΈ RESPONSE ARCHITECTURE & FIDELITY
104
  1. **NO RAW LISTS**: Never provide a long bulleted list of tickets or data. Use **Markdown Tables** instead.
105
+ 2. **VISUAL FIRST**: For any request involving trends, health, status, distribution, or analytics, you MUST generate a **Mermaid.js diagram**.
106
  3. **TABULAR PRECISION**:
107
  - Tickets status summary -> Table
108
  - Priority distribution -> Mermaid Pie Chart
109
+ - Time trends -> Mermaid XY Chart
110
  - Performance metrics -> Markdown table with status emojis (πŸ”΄, 🟑, 🟒)
111
+ 4. **MANDATORY VISUALS**: If the user asks for "analytics", "status", "summary", or "report", your response IS NOT COMPLETE without at least one Mermaid diagram and one Markdown table.
112
+ 5. **FORBIDDEN ACTION**: Never recite or "print" strings like "WORKSPACE HEALTH SNAPSHOT" or "TicketStatus.OPEN" verbatim. Transform these into high-fidelity visuals.
113
+ 6. **STYLE**: Professional, high-impact executive summaries. Use GitHub-Flavored Markdown (GFM).
114
 
115
  IDENTITY & TONE:
116
  - PERSONALITY: Professional, insightful, and adaptive.
agents/suggestion.py CHANGED
@@ -20,15 +20,14 @@ Description: {description}
20
 
21
  INSTRUCTIONS:
22
  1. INTERNAL_SUMMARY: Draft a concise, technical forensic breakdown for the agent. Identify the core anomaly and version specifics.
23
- 2. RCA: Identify the likely root cause (Root Cause Analysis) based on the provided context or past resolutions.
24
- 3. SOLUTION: Provide a precise technical solution or workaround for the internal agent.
25
- 4. CUSTOMER_REPLY: Draft a professional, empathetic response for the user. GROUND YOUR ANSWER ONLY IN THE DATA PROVIDED.
26
- 5. SOURCES: Explicitly list the Knowledge Base articles or Ticket IDs you used to form the answer (e.g., [KB: VPN Troubleshooting], [TKT: #1234]).
27
- 6. KB_DRAFT: If a depth gap is identified (is_new_topic={is_new_topic}), draft a comprehensive structured article update in Markdown.
28
  Include:
29
- - ### πŸ”„ Diagnostic Update: Detailed breakdown of the new finding.
30
- - ### πŸ› οΈ Technical Fix: Precise steps or code snippets.
31
- - ### πŸ“Š Visual Troubleshooting: A Mermaid JS flowchart (graph TD) visualizing the fix logic.
32
 
33
  RESPONSE FORMAT (JSON):
34
  {{
 
20
 
21
  INSTRUCTIONS:
22
  1. INTERNAL_SUMMARY: Draft a concise, technical forensic breakdown for the agent. Identify the core anomaly and version specifics.
23
+ 2. RCA: Identify the likely root cause (Root Cause Analysis).
24
+ 3. SOLUTION: Provide a precise technical solution for the agent. Use a **Markdown Table** if listing steps or configurations, and include a **Mermaid.js diagram** (e.g. sequenceDiagram or graph TD) if the fix logic is complex.
25
+ 4. CUSTOMER_REPLY: Draft a professional response for the user.
26
+ 5. SOURCES: Explicitly list citing articles or tickets.
27
+ 6. KB_DRAFT: If a depth gap is identified (is_new_topic={is_new_topic}), draft a structured article update.
28
  Include:
29
+ - ### πŸ”„ Diagnostic Update: Detailed breakdown.
30
+ - ### πŸ› οΈ Technical Fix: Precise steps with a **Mermaid.js flowchart** visualization.
 
31
 
32
  RESPONSE FORMAT (JSON):
33
  {{
core/tasks.py CHANGED
@@ -208,7 +208,7 @@ async def auto_summarize_ticket(ctx, ticket_id: UUID, **kwargs):
208
  intl_blocks.extend(all_imgs)
209
 
210
  intl_prompt = [
211
- SystemMessage(content="You are a support lead. Summarize for an INTERNAL AGENT. Include internal notes. Use visual info if screenshots present. Max 4 sentences."),
212
  HumanMessage(content=intl_blocks)
213
  ]
214
 
 
208
  intl_blocks.extend(all_imgs)
209
 
210
  intl_prompt = [
211
+ SystemMessage(content="You are a support lead. Summarize for an INTERNAL AGENT. Use a **Markdown Table** to list key technical facts or recent events if relevant. Include internal notes. Max 4 sentences for text portion."),
212
  HumanMessage(content=intl_blocks)
213
  ]
214