graph TD
A[Streamlit Frontend] -->|Upload Documents| B[Session State Management]
B -->|Manage State| C[Document Processing Workflow]
C -->|Coordinate Analysis| D[AI Agents]
D -->|Analyze Documents| E[Azure AI Services]
D -->|Analyze Documents| F[Gemini AI Services]
C -->|Extract Text| G[Utility Functions]
A -->|Display Results| C
A -->|Interactive Chat| H[EnhancedChatAgent]
H -->|Query AI| D
E -->|Provide AI Capabilities| D
F -->|Provide AI Capabilities| D
code
but still the image i got Streamlit Frontend
Session State Management
Document Processing Workflow
AI Agents
Azure AI Services
Gemini AI Services
Utility Functions
EnhancedChatAgent
Unsupported markdown: code
why i am gettiting this Unsupported markdown: code
can you correct inside this You are an expert in cloud architecture and diagramming. Based on the provided project summary, please create the following:
A clear and concise explanation of the cloud architecture flow and its major components, describing their roles and interactions.
A Mermaid diagram illustrating the cloud architecture with:
Appropriate Mermaid syntax.
Nodes representing services/components with meaningful labels.
Clear connections and data flow between components.
Use of standard Mermaid shapes or cloud icons where applicable.
Output first the explanation, then the mermaid diagram code block enclosed with triple backticks. The diagram should be clear, use cloud icons or standard mermaid shapes, and highlight relationships and data flow.
Assistant
User
give em a prompt that can help me build like this
Assistant
Certainly! Here's a detailed prompt you can use to ask any AI or a documentation assistant to help you create a clear cloud architecture explanation along with a correct Mermaid diagram like the one above:
Prompt for Generating Cloud Architecture Explanation and Mermaid Diagram
User
still one block called Unsupported markdown: code comes other things are fine
Assistant
User
can you change in this
You are an expert in cloud architecture and technical diagramming.
I need you to help me with the following:
Given a summary of a cloud-based project, provide:
A clear and concise explanation of the cloud architecture flow.
Description of the major components, their roles, and how they interact with each other.
Create a Mermaid diagram illustrating the architecture with these requirements:
Use proper Mermaid syntax for flowcharts or graph TD style.
Represent each service/component as a labeled node with meaningful names.
Group related components in subgraphs where appropriate.
Show clear directional connections/arrows that represent data flow or control flow.
Use standard Mermaid shapes or icons when suitable (e.g., for cloud services).
The diagram should be well-structured and easy to understand.
Assistant
Certainly! Here is a clear explanation of the cloud architecture and a corrected Mermaid diagram for your project.
Cloud Architecture Flow and Major Components
Streamlit Frontend
The user interface where users upload documents, view processing results, and interact via an enhanced chat experience.
Session State Management
Maintains user session data and state across interactions to ensure continuity during workflow execution.
Document Processing Workflow
Coordinates the overall document analysis process, including managing the flow between preprocessing, AI analysis, and result aggregation.
AI Agents
Intelligent intermediaries that manage requests to multiple AI services, handle document analysis tasks, and provide insights.
Azure AI Services
Cloud-based AI capabilities from Azure, such as text analysis, language understanding, and vision APIs that assist AI agents in document processing.
Gemini AI Services
Another cloud AI platform integrated for complementary or specialized AI functionalities.
Utility Functions
Helper modules that perform auxiliary tasks such as text extraction, format normalization, and other technical processing.
EnhancedChatAgent
Provides an interactive chat interface, enabling users to query the AI models and receive dynamic responses during their document analysis.
Interactions and Data Flow
The user uploads documents via the Streamlit Frontend, triggering the Session State Management to store the current session information.
The Document Processing Workflow orchestrates tasks to analyze the uploaded documents using AI Agents.
These AI Agents interact bidirectionally with both Azure AI Services and Gemini AI Services to leverage their respective AI capabilities.
Utility Functions support this process by extracting and preparing text from the documents.
The EnhancedChatAgent allows users to interactively query the AI Agents, streamlining user communication within the app.
Finally, the Streamlit Frontend displays the results and charts, providing a continuous and responsive user experience.
Mermaid Diagram Code
mermaid
flowchart TD
subgraph Frontend
A[Streamlit Frontend]
H[EnhancedChatAgent]
end
subgraph State
B[Session State Management]
end
subgraph Workflow
C[Document Processing Workflow]
G[Utility Functions]
end
subgraph AI_Agents
D[AI Agents]
end
subgraph AI_Services
E[Azure AI Services]
F[Gemini AI Services]
end
A -->|Upload Documents| B
B -->|Manage State| C
C -->|Coordinate Analysis| D
D -->|Analyze Documents| E
D -->|Analyze Documents| F
C -->|Extract Text| G
A -->|Display Results| C
A -->|Interactive Chat| H
H -->|Query AI| D
E -->|Provide AI Capabilities| D
F -->|Provide AI Capabilities| D
This diagram uses subgraphs for logical grouping, meaningful node labels, and directional arrows to clarify data flow and dependencies. It is fully compliant with Mermaid syntax and renders correctly in environments supporting Mermaid diagrams.
code
You are an expert in cloud architecture and technical diagramming.
I need you to help me with the following:
1. Given a summary of a cloud-based project, provide:
- A clear and concise explanation of the cloud architecture flow.
- Description of the major components, their roles, and how they interact with each other.
2. Create a Mermaid diagram illustrating the architecture with these requirements:
- Use proper Mermaid syntax for flowcharts or graph TD style.
- Represent each service/component as a labeled node with meaningful names.
- Group related components in subgraphs where appropriate.
- Show clear directional connections/arrows that represent data flow or control flow.
- Use standard Mermaid shapes or icons when suitable (e.g., for cloud services).
- The diagram should be well-structured and easy to understand.
When you generate the Mermaid code block, please include it properly fenced inside triple backticks with the keyword `mermaid`.
Please ensure that the response is in two parts:
- First, the textual explanation describing the architecture and interactions.
- Then, the Mermaid diagram code block.
Here is the project summary for your reference:
[Insert your project summary here]
---
Example:
If the project summary describes a system with a frontend, state management, AI agents, several cloud AI services, utility functions, and an interactive chat agent that all interact, describe their roles and workflow clearly, then generate a Mermaid diagram showing the entities and their interactions.
---
Please proceed with the description and the Mermaid diagram.
This prompt instructs the AI to generate both explanation and diagram together, helping you avoid errors like unsupported markdown or incorrect Mermaid syntax. You can customize the [Insert your project summary here] area with your actual project details before running the prompt.
The error "Unsupported markdown: code" usually appears in environments that don’t support rendered mermaid code blocks or certain fenced code blocks in Markdown. This can happen if you paste Mermaid code blocks inside apps or platforms that either:
Do not support Mermaid rendering
Restrict fenced code blocks with specific languages (like mermaid)
Expect inline or plain text instead of code blocks
How to avoid the "Unsupported markdown: code" message:
Check your rendering environment:
If you’re using Streamlit or another frontend, confirm that Mermaid rendering is supported there.
Many Markdown previews don’t support Mermaid out of the box unless explicitly configured.
Use plain code blocks without language tags:
Sometimes, the environment only accepts basic code blocks (```) without language specification.
Try replacing:
code
```mermaid
<your mermaid code>
```
with
code
```
<your mermaid code>
```
Use image exports instead of raw Mermaid code:
Generate the diagram using tools like Mermaid Live Editor or other Mermaid renderers.
Export the diagram as an image or SVG and use that directly.
If you need to embed Mermaid for Streamlit:
Streamlit itself does not natively support Mermaid syntax rendering inside markdown. To integrate Mermaid diagrams with Streamlit, consider the following alternatives:
Use Streamlit components like streamlit-mermaid or implement a custom Streamlit component that renders Mermaid diagrams in the browser.
Convert the Mermaid diagram to SVG/PNG outside Streamlit and display it as an image inside Streamlit (st.image()).
Use st.markdownwithout the mermaid tag and show the code as plain text if Mermaid rendering is not supported.
Summary
If your environment does NOT support native Mermaid, you can try this simplified approach:
markdown
Here is the architecture Mermaid code (for environments that support Mermaid rendering):
```
flowchart TD
A[Streamlit Frontend] --> B[Session State Management]
B --> C[Document Processing Workflow]
C --> D[AI Agents]
D --> E[Azure AI Services]
D --> F[Gemini AI Services]
C --> G[Utility Functions]
A --> C
A --> H[EnhancedChatAgent]
H --> D
E --> D
F --> D
```
This will display the Mermaid code as text, avoiding markdown code block parsing errors.
Better yet: Example prompt to get both explanation and Mermaid code as plain code (no mermaid tag)
You can use this kind of prompt to an assistant if “mermaid”-tagged code blocks cause errors in your environment:
code
Please provide the explanation of my cloud architecture and then provide the Mermaid diagram code block. For compatibility, output the Mermaid diagram fenced with triple backticks but without the language specifier (`mermaid`). Example:
This avoids markdown parsers that throw errors on mermaid language blocks.
code
---
### Final note
If you want me to rewrite your diagram in a way that will definitely *not* cause the "Unsupported markdown: code" error in your specific environment, just tell me which app or tool you’re using to view/read this Markdown, and I can tailor the output accordingly!
When you generate the Mermaid code block, please include it properly fenced inside triple backticks with the keyword mermaid.
Please ensure that the response is in two parts:
First, the textual explanation describing the architecture and interactions.
Then, the Mermaid diagram code block.
Poject summary is provided by the user
Example:
If the project summary describes a system with a frontend, state management, AI agents, several cloud AI services, utility functions, and an interactive chat agent that all interact, describe their roles and workflow clearly, then generate a Mermaid diagram showing the entities and their interactions.
Please proceed with the description and the Mermaid diagram.
Certainly! Here's your revised prompt with a modification to avoid causing the "Unsupported markdown: code" error in environments that might not support mermaid-labeled code blocks. Instead of specifying the language as mermaid, the diagram will be output inside a plain triple backtick fence to ensure compatibility while still maintaining a clear structure.
Revised Prompt:
You are an expert in cloud architecture and technical diagramming.
I need you to help me with the following:
Given a summary of a cloud-based project, provide:
A clear and concise explanation of the cloud architecture flow.
A description of the major components, their roles, and how they interact with each other.
Create a Mermaid diagram illustrating the architecture with these requirements:
Use proper Mermaid syntax for flowcharts or graph TD style.
Represent each service/component as a labeled node with meaningful names.
Group related components in subgraphs where appropriate.
Show clear directional connections/arrows that represent data flow or control flow.
Use standard Mermaid shapes or icons when suitable (e.g., for cloud services).
The diagram should be well-structured and easy to understand.
When you generate the Mermaid code block, please include it properly fenced inside triple backticks without specifying the language (i.e., do not include mermaid after the triple backticks), to avoid markdown rendering issues in environments that do not support Mermaid natively.
Please ensure the response is in two parts:
First, the textual explanation describing the architecture and interactions.
Then, the Mermaid diagram code block (inside triple backticks with no language specifier).
Project summary is provided by the user.
Example:
If the project summary describes a system with a frontend, state management, AI agents, several cloud AI services, utility functions, and an interactive chat agent that all interact, describe their roles and workflow clearly, then generate a Mermaid diagram showing the entities and their interactions.
Please proceed with the description and the Mermaid diagram.
This approach eliminates the "Unsupported markdown: code" error by not specifying mermaid as the language, which often triggers unsupported markdown errors in some platforms. The Mermaid code will appear as a plain code block which you can then copy and render in any Mermaid-compatible environment, or convert externally.