Markdown
LLM response is rendered as Markdown with following features:
- GFM (GitHub Flavored Markdown)
- Math (KaTeX)
- Syntax Highlighting
- Code Preview
- Directives
Directives
We use remark-directive to extend Markdown, LLM won't use directives by default, but you can instruct the model to use directives when desired.
collapsible
Use this to render a collapsible section.
Syntax:
:::collapsible{title="some title"}
some markdown content here
:::
Preview:
some title
some markdown content here
For example you can ask LLM to generate a quiz, and use this directive to show questions and answers, here's an example system prompt:
<response-format>
the :::collapsible directive can be used to display collapsible content,
usage:
:::collapsible{title="summary"}
markdown content
:::
use this directive to show quiz, use the title attribute to display question, and the content to display answer.
do not mention the directive, the user are aware of it
</response-format>
Example conversation using this system prompt:
Code Preview
Supported languages:
- HTML
- Mermaid
Click the play button to preview the code: