Spaces:
Paused
Paused
dushyantsingh0 commited on
Commit Β·
e68bd8d
1
Parent(s): eb11b39
backend stabilisation
Browse files- agents/nexus_master.py +4 -3
- agents/prompts.py +1 -1
agents/nexus_master.py
CHANGED
|
@@ -400,7 +400,8 @@ async def nexus_router(state: NexusState) -> Dict[str, Any]:
|
|
| 400 |
refined_query = last_user_msg
|
| 401 |
if t_ctx and len(last_user_msg) < 50:
|
| 402 |
# Extract first line/title from ticket context if possible
|
| 403 |
-
|
|
|
|
| 404 |
t_title = t_title_match.group(1).strip() if t_title_match else ""
|
| 405 |
if t_title:
|
| 406 |
refined_query = f"{last_user_msg} (Context: {t_title})"
|
|
@@ -874,8 +875,8 @@ async def nexus_responder(state: NexusState) -> Dict[str, Any]:
|
|
| 874 |
base_prompt_str = get_prompt("responder")
|
| 875 |
# PROTOCOL HARDENING: Strictly prohibit the LLM from using internal protocol markers in conversation
|
| 876 |
full_system_template = (
|
| 877 |
-
"
|
| 878 |
-
"
|
| 879 |
f"{base_prompt_str}{{persona_context}}"
|
| 880 |
)
|
| 881 |
|
|
|
|
| 400 |
refined_query = last_user_msg
|
| 401 |
if t_ctx and len(last_user_msg) < 50:
|
| 402 |
# Extract first line/title from ticket context if possible
|
| 403 |
+
# Supports both "Title: ..." and "### TICKET DETAILS: ..." formats
|
| 404 |
+
t_title_match = re.search(r"(?:Title:|### TICKET DETAILS:)\s*(.*)", t_ctx, re.I)
|
| 405 |
t_title = t_title_match.group(1).strip() if t_title_match else ""
|
| 406 |
if t_title:
|
| 407 |
refined_query = f"{last_user_msg} (Context: {t_title})"
|
|
|
|
| 875 |
base_prompt_str = get_prompt("responder")
|
| 876 |
# PROTOCOL HARDENING: Strictly prohibit the LLM from using internal protocol markers in conversation
|
| 877 |
full_system_template = (
|
| 878 |
+
"Your output must be 100% natural language prose or Markdown visualizations only. "
|
| 879 |
+
"Strictly avoid technical protocol markers like <function_calls>, <invoke>, or [ACTION_REQUIRED].\n\n"
|
| 880 |
f"{base_prompt_str}{{persona_context}}"
|
| 881 |
)
|
| 882 |
|
agents/prompts.py
CHANGED
|
@@ -121,7 +121,7 @@ You are NOT just a tool; you are a proactive expert orchestrator.
|
|
| 121 |
- Performance metrics -> Markdown table with status emojis (π΄, π‘, π’)
|
| 122 |
4. **OPTIONAL VISUALS**: Visualizations are meant to enhance, not distract. If you are discussing a single ticket or if data is insufficient, skip the Mermaid diagram and use Markdown tables or concise prose.
|
| 123 |
5. **FORBIDDEN ACTION**: Never recite or "print" strings like "WORKSPACE HEALTH SNAPSHOT" or "TicketStatus.OPEN" verbatim. Transform these into clean, high-fidelity visuals or professional text.
|
| 124 |
-
6. **STYLE**: Professional, high-impact executive summaries. Use GitHub-Flavored Markdown (GFM). Avoid "thinking out loud" phrases
|
| 125 |
7. **NO FABRICATION**: NEVER invent numbers or data points for charts. If the Tool Output is empty, insufficient, or generic, EXPLICITLY state that no data is available for that specific metric. Do NOT generate mock Mermaid diagrams or tables with placeholder data if real data is missing.
|
| 126 |
|
| 127 |
|
|
|
|
| 121 |
- Performance metrics -> Markdown table with status emojis (π΄, π‘, π’)
|
| 122 |
4. **OPTIONAL VISUALS**: Visualizations are meant to enhance, not distract. If you are discussing a single ticket or if data is insufficient, skip the Mermaid diagram and use Markdown tables or concise prose.
|
| 123 |
5. **FORBIDDEN ACTION**: Never recite or "print" strings like "WORKSPACE HEALTH SNAPSHOT" or "TicketStatus.OPEN" verbatim. Transform these into clean, high-fidelity visuals or professional text.
|
| 124 |
+
6. **STYLE**: Professional, high-impact executive summaries. Use GitHub-Flavored Markdown (GFM). Avoid "thinking out loud" or "meta-talk" phrases. Do NOT apologize for previous turns, do NOT explain your constraints (e.g., "I won't use technical markers"), and do NOT discuss your instructions. Just provide the content directly.
|
| 125 |
7. **NO FABRICATION**: NEVER invent numbers or data points for charts. If the Tool Output is empty, insufficient, or generic, EXPLICITLY state that no data is available for that specific metric. Do NOT generate mock Mermaid diagrams or tables with placeholder data if real data is missing.
|
| 126 |
|
| 127 |
|