Untitled conversation
- User
flowchart TD subgraph "Internal Workflow for 'ask_llm_for_analysis' Tool" A(Start<br/>Input: query, context) --> B{Generate<br/>Structured Prompt}; B -- "Prompt includes required<br/>JSON output schema" --> C[Execute LLM Call<br/>(e.g., Gemini API)]; C --> D{Parse & Validate<br/>LLM Response}; D -- "Is output valid JSON<br/>& matches schema?" --> |✅ Yes| G[Return Structured Data<br/>(e.g., a validated JSON object)]; D -- "❌ No" --> E{Retry/Self-Correct}; E -- "Re-prompt LLM with error<br/>and request corrected format" --> C; E -- "Max retries reached" --> F[Return Error]; G --> H(End); F --> H; endError: Error: Parse error on line 4: ...xecute LLM Call<br/>(e.g., Gemini API)]; -----------------------^ Expecting 'SQE', 'DOUBLECIRCLEEND', 'PE', '-)', 'STADIUMEND', 'SUBROUTINEEND', 'PIPE', 'CYLINDEREND', 'DIAMOND_STOP', 'TAGEND', 'TRAPEND', 'INVTRAPEND', 'UNICODE_TEXT', 'TEXT', 'TAGSTART', got 'PS' Assistant
The error message
Expecting 'SQE', 'DOUBLECIRCLEEND', 'PE', '-)', 'STADIUMEND', ... got 'PS'indicates a parsing issue, and it's specifically pointing to the semicolon;at the end of your node and link definitions.In Mermaid flowcharts, you generally do not put semicolons at the end of lines defining nodes or links. Each line is treated as a separate statement.
The Fix: Remove all semicolons from the end of the lines defining your nodes and their connections.
Here's the corrected Mermaid code:
flowchart TD subgraph "Internal Workflow for 'ask_llm_for_analysis' Tool" A(Start<br/>Input: query, context) --> B{Generate<br/>Structured Prompt} B -- "Prompt includes required<br/>JSON output schema" --> C[Execute LLM Call<br/>(e.g., Gemini API)] C --> D{Parse & Validate<br/>LLM Response} D -- "Is output valid JSON<br/>& matches schema?" --> |✅ Yes| G[Return Structured Data<br/>(e.g., a validated JSON object)] D -- "❌ No" --> E{Retry/Self-Correct} E -- "Re-prompt LLM with error<br/>and request corrected format" --> C E -- "Max retries reached" --> F[Return Error] G --> H(End) F --> H end- User
flowchart TD subgraph "Internal Workflow for 'ask_llm_for_analysis' Tool" A(Start<br/>Input: query, context) --> B{Generate<br/>Structured Prompt} B -- "Prompt includes required<br/>JSON output schema" --> C["Execute LLM Call<br/>(e.g., Gemini API)"] C --> D{Parse & Validate<br/>LLM Response} D -- "Is output valid JSON<br/>& matches schema?" --> |✅ Yes| G["Return Structured Data<br/>(e.g., a validated JSON object)"] D -- "❌ No" --> E{Retry/Self-Correct} E -- "Re-prompt LLM with error<br/>and request corrected format" --> C E -- "Max retries reached" --> F[Return Error] G --> H(End) F --> H endError: Error: Parse error on line 6: ...atches schema?" --> |✅ Yes| G["Return St -----------------------^ Expecting 'AMP', 'COLON', 'DOWN', 'DEFAULT', 'NUM', 'COMMA', 'NODE_STRING', 'BRKT', 'MINUS', 'MULT', 'UNICODE_TEXT', got 'PIPE' Sample Diagrams Assistant
The error
Parse error on line 6: ... got 'PIPE'indicates that Mermaid is confused by the|✅ Yes|immediately following another link label"Is output valid JSON<br/>& matches schema?"and the-->arrow.You can't have two separate labels on a single arrow in that syntax. The
|label|syntax and the"label"syntax both serve to apply a label to the arrow. You've essentially tried to apply two labels.To fix this, you need to combine the two parts of your label into a single quoted string.
Here's the corrected code:
flowchart TD subgraph "Internal Workflow for 'ask_llm_for_analysis' Tool" A(Start<br/>Input: query, context) --> B{Generate<br/>Structured Prompt} B -- "Prompt includes required<br/>JSON output schema" --> C["Execute LLM Call<br/>(e.g., Gemini API)"] C --> D{Parse & Validate<br/>LLM Response} D -- "Is output valid JSON<br/>& matches schema? ✅ Yes" --> G["Return Structured Data<br/>(e.g., a validated JSON object)"] D -- "❌ No" --> E{Retry/Self-Correct} E -- "Re-prompt LLM with error<br/>and request corrected format" --> C E -- "Max retries reached" --> F[Return Error] G --> H(End) F --> H endKey Change: Original:
D -- "Is output valid JSON<br/>& matches schema?" --> |✅ Yes| G[...]Corrected:D -- "Is output valid JSON<br/>& matches schema? ✅ Yes" --> G[...]By integrating "✅ Yes" directly into the primary label, you resolve the parsing conflict.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.