ワンクリックで
poml-syntax
Use complete and proper POML markup syntax for creating POML prompts
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use complete and proper POML markup syntax for creating POML prompts
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | poml-syntax |
| description | Use complete and proper POML markup syntax for creating POML prompts |
Read this entire POML syntax reference.
POML Basic Syntax¶ Estimated time to read: 2 minutes
POML (Prompt Orchestration Markup Language) provides a convenient way to create prompts using a markup language that is easy to read and write. The standalone file mode is the most commonly used approach, where you create a file with a .poml extension. This file contains XML-like syntax that POML renders into a prompt. This mode is particularly useful for creating reusable templates and managing complex prompts without embedding POML directly in JSX files or using a Python SDK.
In this mode, you wrap your content with a top-level tag, allowing POML to parse and render your markup correctly. Below is a guide on how to effectively use the standalone file mode.
To create a POML file, simply create a file with the .poml extension and wrap your content within the tag:
Hello, world!
You can also type anything without a poml tag, and it will be treated as a string. It's called "free text mode" in POML. However, it has several limitations currently, including unabling to render any XML tags wrapped with <>, unabling to use many special characters, and unabling to use all the wonderful features of POML. So, it's always recommended to use the poml tag before everything.Tip: Glossary for Beginners:
Tag: A tag is a fundamental building block in XML (and POML). It's used to mark the beginning and end of an element. Tags are enclosed in angle brackets (< and >). For example,
is an opening tag, and
is a closing tag. Everything between the opening and closing tags is considered part of that element. Attribute: An attribute provides additional information about an element. Attributes are placed inside the opening tag, and they consist of a name and a value (enclosed in double quotes). For example, in, speaker is the attribute name, and "human" is the attribute value. Content: The content is the text or other elements that appear between the opening and closing tags of an element. For example, in
Hello, world!
, "Hello, world!" is the content of theelement. Escape Characters: In POML, you can use escape characters to include special characters in your content and attribute values. Due to an implementation issue, the escape syntax in POML is slightly different from what you would know in HTML or XML. For example, to include a double quote (") in your content, you can use #quot; (rather than "). Here are some common escape characters:
#quot; for " #apos; for ' #amp; for & #lt; for < #gt; for > #hash; for # #lbrace; for { #rbrace; for } It's not necessary to use the escape characters for most cases, but they can be helpful when you are having trouble displaying those characters in certain cases.
Template Engine¶ Estimated time to read: 5 minutes
The template engine of POML allows you to incorporate dynamic content and control structures. Here are some key features.
Expressions¶ You can use expressions enclosed in double curly brackets ({{ }}) to evaluate variables or expressions dynamically:
Hello, {{name}}!
In this example, if name is set to "Alice" (e.g., using a tag, described below), the output will be "Hello, Alice!".Usage in Attributes¶ Expressions can also be used within attribute values:
This is task No. {{index}}. This renders to the following when index is set to 1.This is task No. 1. Expression Usages¶ POML supports various JavaScript expressions within the double curly brackets. This includes but is not limited to:
Variables: {{variableName}} Arithmetic: {{a + b}}, {{x * y}}, {{count / total}} String Concatenation: {{firstName + " " + lastName}} Array Access: {{myArray[0]}} Object Property Access: {{myObject.propertyName}} Function Calls: {{myFunction(arg1, arg2)}} (if myFunction is defined in the context) Ternary Operators: {{condition ? valueIfTrue : valueIfFalse}} Accessing loop variables: {{loop.index}} (explained in the "For Attribute" section) Let Expressions¶ The tag allows you to define variables, import data from external files, and set values within your POML template.
Syntax 1: Setting a variable from a value¶
Hello, world!{{greeting}}
This will output "Hello, world!". When using the content approach (as shown above), the text is treated as a literal string.Alternatively, you can use the value attribute which must contain an evaluatable JavaScript expression:
{{greeting}}
Note that when using the value attribute, string literals must be properly quoted (e.g., "'Hello, world!'" or '"Hello, world!"') since the value is evaluated as JavaScript. The value attribute can contain strings, numbers, arrays, objects, or any valid JavaScript expression.Syntax 2: Importing data from a file¶
First user: {{users[0].name}}
This imports the contents of users.json and assigns it to the users variable. The src attribute specifies the path to the file (relative to the POML file). The optional type attribute can specify the file type (e.g., "json", "text", "csv"). If not provided, POML attempts to infer it from the file extension.Syntax 3: Importing data from a file without a name¶
API Key: {{apiKey}}
If config.json contains { "apiKey": "your_api_key" }, this will output "API Key: your_api_key". When you use src without name, and the file content is a JSON object, the properties of that object are directly added to the context. Syntax 4: Setting a variable using inline JSON¶ { "name": "Alice", "age": 30 }Name: {{person.name}}, Age: {{person.age}}
This defines a person variable with the given JSON object. You can also specify the type attribute: 5Count: {{count}}
Syntax 5: Setting a variable from an expression¶Total: {{ total }}
Type-Autocasting in Attributes¶ The attributes of components will be automatically cast based on their defined types in the component documentation. This means you don't have to worry about manually converting types in many cases.Boolean: If an attribute is defined as a boolean, values like "true", 1, "1", or {{true}} will be cast to the boolean value true. Similarly, "false", 0, "0", or {{false}} will be cast to false. Number: If an attribute is defined as a number, values like "123", 45.6, {{anyNumber}} or {{myNumber+1.3}} will be cast to their corresponding numeric values. Object: If an attribute is defined as an object, POML will attempt to parse the attribute value as a JSON string. For example, data="{{{name: 'John', age: 30}}}" or data='{"name":"John","age":30}' will be parsed into the corresponding JavaScript object. String: If an attribute is a string, no casting is performed. In the following example, the first auto-casting happened at let, where true is converted to boolean at let expression.
If MyComponent is defined with boolProp as boolean, numProp as number, objProp as object, and stringProp as string, the values will be interpreted and auto-casted again when MyComponent is used.For Attribute¶ To loop over a list, use the for attribute. The syntax is for="itemName in listName".
{{item}} This will render a list with "apple", "banana", and "cherry".Loop Variables¶ Inside the loop, you have access to special loop variables:
loop.index: The current iteration index (starting from 0). loop.length: The total number of items in the list. loop.first: true if it's the first iteration, false otherwise. loop.last: true if it's the last iteration, false otherwise. Example:
{{ example.input }} {{ example.output }} This will generate two examples, with captions "Example 1" and "Example 2", displaying the input and output from each demo in the all_demos array. Note that we use loop.index + 1 because loop.index starts from 0.If Condition¶ You can conditionally render elements using the if attribute:
This paragraph is visible.
This paragraph is hidden.
If isVisible is true, the first paragraph will be rendered. The second paragraph will not be rendered because isHidden is false. The value of if can be a simple variable name (which is treated as a boolean) or a POML expression.Include Files¶ You can split prompts into multiple files and include them using the tag.
The file specified in src is read and its contents are injected as if they were written in place. Variables from the current context are available inside the included file. The for and if attributes work as expected:Basic Components¶ Audio¶ Audio () embeds an audio file in the content.
Accepts either a file path (src) or base64-encoded audio data (base64). The MIME type can be provided via type or will be inferred from the file extension.
Usages¶ Parameters¶ src: Path to the audio file. If provided, the file will be read and encoded as base64. base64: Base64-encoded audio data. Cannot be used together with src. alt: The alternative text to show when the image cannot be displayed. type: The MIME type of the audio (e.g., audio/mpeg, audio/wav). If not specified, it will be inferred from the file extension. The type must be consistent with the real type of the file. The consistency will NOT be checked or converted. The type can be specified with or without the audio/ prefix. position: Can be one of: top, bottom, here. The position of the image. Default is here. syntax: Can be one of: markdown, html, json, yaml, xml, multimedia. Only when specified as multimedia, the image will be shown. Otherwise, the alt text will be shown. By default, it's multimedia when alt is not specified. Otherwise, it's undefined (inherit from parent). Bold¶ Bold () emphasizes text in a bold style when using markup syntaxes.
Usages¶
Task: Do something.
Parameters¶ syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. className: A class name for quickly styling the current block with stylesheets. speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content. writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc. whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end. charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker. tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker. priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits. CaptionedParagraph¶ CaptionedParagraph ( for short) creates a paragraph with a customized caption title.Usages¶ Do not exceed 1000 tokens. Please use simple words. Parameters¶ caption: The title or label for the paragraph. Required. captionSerialized: The serialized version of the caption when using "serializer" syntaxes. By default, it's same as caption. captionStyle: Can be one of: header, bold, plain, hidden. Determines the style of the caption, applicable only for "markup" syntaxes. Default is header. captionTextTransform: Can be one of: upper, level, capitalize, none. Specifies text transformation for the caption, applicable only for "markup" syntaxes. Default is none. captionEnding: Can be one of: colon, newline, colon-newline, none. A caption can ends with a colon, a newline or simply nothing. If not specified, it defaults to colon for bold or plain captionStyle, and none otherwise. blankLine: Boolean. Whether to add one more blank line (2 in total) before and after the paragraph. syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. Note xml and text are experimental. className: A class name for quickly styling the current block with stylesheets. speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content. name: The name of the content, used in serialization. type: The type of the content, used in serialization. writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc. whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end. charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker. tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker. priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits. Code¶ Code is used to represent code snippets or inline code in markup syntaxes.
Usages¶
const x = 42;
const x = 42;
Parameters¶
inline: Boolean. Whether to render code inline or as a block. Default is true.
lang: The language of the code snippet.
blankLine: Boolean. Whether to add one more blank line (2 in total) before and after the paragraph.
syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. Note xml and text are experimental.
className: A class name for quickly styling the current block with stylesheets.
speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content.
name: The name of the content, used in serialization.
type: The type of the content, used in serialization.
writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc.
whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end.
charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker.
tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker.
priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits.
Header¶
Header () renders headings in markup syntaxes. It's commonly used to highlight titles or section headings. The header level will be automatically computed based on the context. Use SubContent (
Usages¶
Section Title Parameters¶ blankLine: Boolean. Whether to add one more blank line (2 in total) before and after the paragraph. syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. Note xml and text are experimental. className: A class name for quickly styling the current block with stylesheets. speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content. name: The name of the content, used in serialization. type: The type of the content, used in serialization. writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc. whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end. charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker. tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker. priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits. Inline¶ Inline () is a container for inline content. When used with markup syntaxes, it wraps text in an inline style, without any preceding or following blank characters. In serializer syntaxes, it's treated as a generic value. Inline elements are not designed to be used alone (especially in serializer syntaxes). One might notice problematic renderings (e.g., speaker not applied) when using it alone.Usages¶
I'm listening to music right now.
Parameters¶ syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. className: A class name for quickly styling the current block with stylesheets. speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content. writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc. whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end. charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker. tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker. priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits. Italic¶ Italic () emphasizes text in an italic style when using markup syntaxes.Usages¶ Your italicized text. Parameters¶ syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. className: A class name for quickly styling the current block with stylesheets. speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content. writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc. whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end. charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker. tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker. priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits. List¶ List () is a container for multiple ListItem () elements. When used with markup syntaxes, a bullet or numbering is added.
Usages¶ Item 1 Item 2 Parameters¶ listStyle: Can be one of: star, dash, plus, decimal, latin. The style for the list marker, such as dash or star. Default is dash. blankLine: Boolean. Whether to add one more blank line (2 in total) before and after the paragraph. syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. Note xml and text are experimental. className: A class name for quickly styling the current block with stylesheets. speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content. name: The name of the content, used in serialization. type: The type of the content, used in serialization. writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc. whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end. charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker. tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker. priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits. ListItem¶ ListItem () is an item within a List component. In markup mode, it is rendered with the specified bullet or numbering style.
Usages¶
Item 1
Item 2
Parameters¶
blankLine: Boolean. Whether to add one more blank line (2 in total) before and after the paragraph.
syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. Note xml and text are experimental.
className: A class name for quickly styling the current block with stylesheets.
speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content.
name: The name of the content, used in serialization.
type: The type of the content, used in serialization.
writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc.
whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end.
charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker.
tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker.
priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits.
Newline¶
Newline (
) explicitly adds a line break, primarily in markup syntaxes. In serializer syntaxes, it's ignored.
Usages¶
Parameters¶
newLineCount: Number. The number of linebreaks to add.
syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content.
className: A class name for quickly styling the current block with stylesheets.
speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content.
writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc.
whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end.
charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker.
tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker.
priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits.
Paragraph¶
Paragraph (
) is a standalone section preceded by and followed by two blank lines in markup syntaxes. It's mostly used for text contents.
Usages¶
Contents of the paragraph.
Parameters¶ blankLine: Boolean. Whether to add one more blank line (2 in total) before and after the paragraph. syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. Note xml and text are experimental. className: A class name for quickly styling the current block with stylesheets. speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content. name: The name of the content, used in serialization. type: The type of the content, used in serialization. writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc. whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end. charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker. tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker. priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits. Strikethrough¶ Strikethrough (Usages¶
This messages is removed.
Parameters¶
syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content.
className: A class name for quickly styling the current block with stylesheets.
speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content.
writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc.
whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end.
charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker.
tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker.
priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits.
SubContent¶
SubContent (
Usages¶ Section Title
Sub-section details
Usages¶ Contents of the whole prompt.
To render the whole prompt in markdown syntax with a "human" speaker:
You are a helpful assistant.
What is the capital of France?
Experimental usage with limits and priority:This has lower priority and may be truncated first.
This has higher priority and will be preserved longer.
Parameters¶ syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. Note xml and text are experimental. className: A class name for quickly styling the current block with stylesheets. speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content. name: The name of the content, used in serialization. type: The type of the content, used in serialization. writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc. whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end. charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker. tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker. priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits. Underline¶ Underline () draws a line beneath text in markup syntaxes.Usages¶ This text is underlined. Parameters¶ syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. className: A class name for quickly styling the current block with stylesheets. speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content. writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc. whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end. charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker. tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker. priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits. Intentions¶ Example¶ Example is useful for providing a context, helping the model to understand what kind of inputs and outputs are expected. It can also be used to demonstrate the desired output style, clarifying the structure, tone, or level of detail in the response.
Usages¶ What is the capital of France? Paris Summarize the following passage in a single sentence. The sun provides energy for life on Earth through processes like photosynthesis. The sun is essential for energy and life processes on Earth. Parameters¶ caption: The title or label for the example paragraph. Default is Example. captionSerialized: The serialized version of the caption when using "serializer" syntaxes. Default is example. captionStyle: Determines the style of the caption, applicable only for "markup" syntaxes. Default is hidden. Options include header, bold, plain, or hidden. chat: Boolean. Indicates whether the example should be rendered in chat format. When used in a example set (), this is inherited from the example set. Otherwise, it defaults to false for "serializer" syntaxes and true for "markup" syntaxes. captionTextTransform: Specifies text transformation for the caption, applicable only for "markup" syntaxes. Options are upper, lower, capitalize, or none. Default is none. captionColon: Boolean. Indicates whether to append a colon after the caption. By default, this is true for bold or plain captionStyle, and false otherwise. blankLine: Boolean. Whether to add one more blank line (2 in total) before and after the paragraph. syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. Note xml and text are experimental. className: A class name for quickly styling the current block with stylesheets. speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content. name: The name of the content, used in serialization. type: The type of the content, used in serialization. writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc. whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end. charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker. tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker. priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits. ExampleInput¶ ExampleInput () is a paragraph that represents an example input. By default, it's spoken by a human speaker in a chat context, but you can manually specify the speaker.
Usages¶ What is the capital of France? When used with a template:
What is the capital of {{country}}? Parameters¶ caption: The title or label for the example input paragraph. Default is Input. captionSerialized: The serialized version of the caption when using "serializer" syntaxes. Default is input. speaker: The speaker for the example input. Default is human if chat context is enabled (see ). captionStyle: Can be one of: header, bold, plain, hidden. Determines the style of the caption, applicable only for "markup" syntaxes. Default is hidden if chat context is enabled. Otherwise, it's bold. captionTextTransform: Can be one of: upper, level, capitalize, none. Specifies text transformation for the caption, applicable only for "markup" syntaxes. Default is none. captionColon: Boolean. Indicates whether to append a colon after the caption. By default, this is true for bold or plain captionStyle, and false otherwise. blankLine: Boolean. Whether to add one more blank line (2 in total) before and after the paragraph. syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. Note xml and text are experimental. className: A class name for quickly styling the current block with stylesheets. name: The name of the content, used in serialization. type: The type of the content, used in serialization. writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc. whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end. charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker. tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker. priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits. ExampleOutput¶ ExampleOutput () is a paragraph that represents an example output. By default, it's spoken by a AI speaker in a chat context, but you can manually specify the speaker.
Usages¶ The capital of France is Paris. When used with a template:
The capital of {{country}} is {{capital}}. Parameters¶ caption: The title or label for the example output paragraph. Default is Output. captionSerialized: The serialized version of the caption when using "serializer" syntaxes. Default is output. speaker: The speaker for the example output. Default is ai if chat context is enabled (see ). captionStyle: Can be one of: header, bold, plain, hidden. Determines the style of the caption, applicable only for "markup" syntaxes. Default is hidden if chat context is enabled. Otherwise, it's bold. captionTextTransform: Can be one of: upper, level, capitalize, none. Specifies text transformation for the caption, applicable only for "markup" syntaxes. Default is none. captionColon: Boolean. Indicates whether to append a colon after the caption. By default, this is true for bold or plain captionStyle, and false otherwise. blankLine: Boolean. Whether to add one more blank line (2 in total) before and after the paragraph. syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. Note xml and text are experimental. className: A class name for quickly styling the current block with stylesheets. name: The name of the content, used in serialization. type: The type of the content, used in serialization. writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc. whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end. charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker. tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker. priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits. ExampleSet¶ Example set () is a collection of examples that are usually presented in a list. With the example set, you can manage multiple examples under a single title and optionally an introducer, as well as the same chat format. You can also choose to use purely without example set.
Usages¶ What is the capital of France? Paris What is the capital of Germany? Berlin Parameters¶ caption: The title or label for the example set paragraph. Default is Examples. captionSerialized: The serialized version of the caption when using "serializer" syntaxes. Default is examples. chat: Boolean. Indicates whether the examples should be rendered in chat format. By default, it's true for "markup" syntaxes and false for "serializer" syntaxes. introducer: An optional introducer text to be displayed before the examples. For example, Here are some examples:. captionStyle: Can be one of: header, bold, plain, hidden. Determines the style of the caption, applicable only for "markup" syntaxes. Default is header. captionTextTransform: Can be one of: upper, level, capitalize, none. Specifies text transformation for the caption, applicable only for "markup" syntaxes. Default is none. captionEnding: Can be one of: colon, newline, colon-newline, none. A caption can ends with a colon, a newline or simply nothing. If not specified, it defaults to colon for bold or plain captionStyle, and none otherwise. blankLine: Boolean. Whether to add one more blank line (2 in total) before and after the paragraph. syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. Note xml and text are experimental. className: A class name for quickly styling the current block with stylesheets. speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content. name: The name of the content, used in serialization. type: The type of the content, used in serialization. writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc. whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end. charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker. tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker. priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits. Hint¶ Hint can be used anywhere in the prompt where you want to provide a helpful tip or explanation. It is usually a short and concise statement that guides the LLM in the right direction.
Usages¶ Alice first purchased 4 apples and then 3 more, so she has 7 apples in total. Parameters¶ caption: The title or label for the hint paragraph. Default is Hint. captionSerialized: The serialized version of the caption when using "serializer" syntaxes. Default is hint. captionStyle: Can be one of: header, bold, plain, hidden. Determines the style of the caption, applicable only for "markup" syntaxes. Default is bold. captionTextTransform: Can be one of: upper, level, capitalize, none. Specifies text transformation for the caption, applicable only for "markup" syntaxes. Default is none. captionColon: Boolean. Indicates whether to append a colon after the caption. By default, this is true for bold or plain captionStyle, and false otherwise. blankLine: Boolean. Whether to add one more blank line (2 in total) before and after the paragraph. syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. Note xml and text are experimental. className: A class name for quickly styling the current block with stylesheets. speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content. name: The name of the content, used in serialization. type: The type of the content, used in serialization. writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc. whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end. charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker. tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker. priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits. Introducer¶ Introducer is a paragraph before a long paragraph (usually a list of examples, steps, or instructions). It serves as a context introducing what is expected to follow.
Usages¶ Here are some examples. Parameters¶ caption: The title or label for the introducer paragraph. Default is Introducer. captionSerialized: The serialized version of the caption when using "serializer" syntaxes. Default is introducer. captionStyle: Can be one of: header, bold, plain, hidden. Determines the style of the caption, applicable only for "markup" syntaxes. Default is hidden. captionTextTransform: Can be one of: upper, level, capitalize, none. Specifies text transformation for the caption, applicable only for "markup" syntaxes. Default is none. captionEnding: Can be one of: colon, newline, colon-newline, none. A caption can ends with a colon, a newline or simply nothing. If not specified, it defaults to colon for bold or plain captionStyle, and none otherwise. blankLine: Boolean. Whether to add one more blank line (2 in total) before and after the paragraph. syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. Note xml and text are experimental. className: A class name for quickly styling the current block with stylesheets. speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content. name: The name of the content, used in serialization. type: The type of the content, used in serialization. writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc. whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end. charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker. tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker. priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits. OutputFormat¶ Output format deals with the format in which the model should provide the output. It can be a specific format such as JSON, XML, or CSV, or a general format such as a story, a diagram or steps of instructions. Please refrain from specifying too complex formats that the model may not be able to generate, such as a PDF file or a video.
Usages¶ Respond with a JSON without additional characters or punctuations. Parameters¶ caption: The title or label for the output format paragraph. Default is Output Format. captionSerialized: The serialized version of the caption when using "serializer" syntaxes. Default is outputFormat. captionStyle: Can be one of: header, bold, plain, hidden. Determines the style of the caption, applicable only for "markup" syntaxes. Default is header. captionTextTransform: Can be one of: upper, level, capitalize, none. Specifies text transformation for the caption, applicable only for "markup" syntaxes. Default is none. captionEnding: Can be one of: colon, newline, colon-newline, none. A caption can ends with a colon, a newline or simply nothing. If not specified, it defaults to colon for bold or plain captionStyle, and none otherwise. blankLine: Boolean. Whether to add one more blank line (2 in total) before and after the paragraph. syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. Note xml and text are experimental. className: A class name for quickly styling the current block with stylesheets. speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content. name: The name of the content, used in serialization. type: The type of the content, used in serialization. writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc. whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end. charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker. tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker. priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits. Question¶ Question () is actually a combination of a question and a prompt for the answer. It's usually used at the end of a prompt to ask a question. The question is followed by a prompt for answer (e.g., Answer:) to guide the model to respond.
Usages¶ What is the capital of France? Parameters¶ questionCaption: The title or label for the question paragraph. Default is Question. answerCaption: The title or label for the answer paragraph. Default is Answer. captionSerialized: The serialized version of the caption when using "serializer" syntaxes. Default is question. captionStyle: Can be one of: header, bold, plain, hidden. Determines the style of the caption, applicable only for "markup" syntaxes. Default is bold. captionTextTransform: Can be one of: upper, level, capitalize, none. Specifies text transformation for the caption, applicable only for "markup" syntaxes. Default is none. captionEnding: Can be one of: colon, newline, colon-newline, none. A caption can ends with a colon, a newline or simply nothing. If not specified, it defaults to colon for bold or plain captionStyle, and none otherwise. blankLine: Boolean. Whether to add one more blank line (2 in total) before and after the paragraph. syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. Note xml and text are experimental. className: A class name for quickly styling the current block with stylesheets. speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content. name: The name of the content, used in serialization. type: The type of the content, used in serialization. writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc. whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end. charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker. tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker. priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits. Role¶ Specifies the role you want the language model to assume when responding. Defining a role provides the model with a perspective or context, such as a scientist, poet, child, or any other persona you choose.
Usages¶ You are a data scientist. Parameters¶ caption: The title or label for the role paragraph. Default is Role. captionSerialized: The serialized version of the caption when using "serializer" syntaxes. Default is role. captionStyle: Can be one of: header, bold, plain, hidden. Determines the style of the caption, applicable only for "markup" syntaxes. Default is header. captionTextTransform: Can be one of: upper, level, capitalize, none. Specifies text transformation for the caption, applicable only for "markup" syntaxes. Default is none. captionEnding: Can be one of: colon, newline, colon-newline, none. A caption can ends with a colon, a newline or simply nothing. If not specified, it defaults to colon for bold or plain captionStyle, and none otherwise. blankLine: Boolean. Whether to add one more blank line (2 in total) before and after the paragraph. syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. Note xml and text are experimental. className: A class name for quickly styling the current block with stylesheets. speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content. name: The name of the content, used in serialization. type: The type of the content, used in serialization. writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc. whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end. charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker. tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker. priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits. StepwiseInstructions¶ StepwiseInstructions that elaborates the task by providing a list of steps or instructions. Each step should be concise and clear, and the list should be easy to follow.
Usages¶ Interpret and rewrite user's query. Think of a plan to solve the query. Generate a response based on the plan. Parameters¶ caption: The title or label for the stepwise instructions paragraph. Default is Stepwise Instructions. captionSerialized: The serialized version of the caption when using "serializer" syntaxes. Default is stepwiseInstructions. captionStyle: Can be one of: header, bold, plain, hidden. Determines the style of the caption, applicable only for "markup" syntaxes. Default is header. captionTextTransform: Can be one of: upper, level, capitalize, none. Specifies text transformation for the caption, applicable only for "markup" syntaxes. Default is none. captionEnding: Can be one of: colon, newline, colon-newline, none. A caption can ends with a colon, a newline or simply nothing. If not specified, it defaults to colon for bold or plain captionStyle, and none otherwise. blankLine: Boolean. Whether to add one more blank line (2 in total) before and after the paragraph. syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. Note xml and text are experimental. className: A class name for quickly styling the current block with stylesheets. speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content. name: The name of the content, used in serialization. type: The type of the content, used in serialization. writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc. whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end. charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker. tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker. priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits. Task¶ Task represents the action you want the language model to perform. It is a directive or instruction that you want the model to follow. Task is usually not long, but rather a concise and clear statement. Users can also include a list of steps or instructions to complete the task.
Usages¶ Cook a recipe on how to prepare a beef dish. When including a list of steps:
Planning a schedule for a travel. Decide on the destination and plan the duration. Find useful information about the destination. Write down the schedule for each day. Parameters¶ caption: The title or label for the task paragraph. Default is Task. captionSerialized: The serialized version of the caption when using "serializer" syntaxes. Default is task. captionStyle: Can be one of: header, bold, plain, hidden. Determines the style of the caption, applicable only for "markup" syntaxes. Default is header. captionTextTransform: Can be one of: upper, level, capitalize, none. Specifies text transformation for the caption, applicable only for "markup" syntaxes. Default is none. captionEnding: Can be one of: colon, newline, colon-newline, none. A caption can ends with a colon, a newline or simply nothing. If not specified, it defaults to colon for bold or plain captionStyle, and none otherwise. blankLine: Boolean. Whether to add one more blank line (2 in total) before and after the paragraph. syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. Note xml and text are experimental. className: A class name for quickly styling the current block with stylesheets. speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content. name: The name of the content, used in serialization. type: The type of the content, used in serialization. writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc. whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end. charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker. tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker. priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits. Data Displays¶ Document¶ Displaying an external document like PDF, TXT or DOCX.Usages¶ To display a Word document without including the real multimedia:
Parameters¶ src: The source file to read the data from. This must be provided if records is not provided. buffer: Buffer. Document data buffer. Recommended to use src instead unless you want to use a string. base64: Base64 encoded string of the document data. Mutually exclusive with src and buffer. parser: Can be one of: auto, pdf, docx, txt. The parser to use for reading the data. If not provided, it will be inferred from the file extension. multimedia: Boolean. If true, the multimedias will be displayed. If false, the alt strings will be displayed at best effort. Default is true. selectedPages: The pages to be selected. This is only available for PDF documents. If not provided, all pages will be selected. You can use a string like 2 to specify a single page, or slice like 2:4 to specify a range of pages (2 inclusive, 4 exclusive). The pages selected are 0-indexed. Negative indexes like -1 is not supported here. syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. className: A class name for quickly styling the current block with stylesheets. speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content. writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc. whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end. charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker. tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker. priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits. Image¶ Image () displays an image in the content. Alternatively, it can also be shown as an alt text by specifying the syntax prop. Note that syntax must be specified as multimedia to show the image.Usages¶
Parameters¶
src: The path to the image file.
alt: The alternative text to show when the image cannot be displayed.
base64: The base64 encoded image data. It can not be specified together with src.
type: The MIME type of the image to be shown. If not specified, it will be inferred from the file extension. If specified, the image will be converted to the specified type. Can be image/jpeg, image/png, etc., or without the image/ prefix.
position: Can be one of: top, bottom, here. The position of the image. Default is here.
maxWidth: Number. The maximum width of the image to be shown.
maxHeight: Number. The maximum height of the image to be shown.
resize: Number. The ratio to resize the image to to be shown.
syntax: Can be one of: markdown, html, json, yaml, xml, multimedia. Only when specified as multimedia, the image will be shown. Otherwise, the alt text will be shown. By default, it's multimedia when alt is not specified. Otherwise, it's undefined (inherit from parent).
className: A class name for quickly styling the current block with stylesheets.
speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content.
writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc.
whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end.
charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker.
tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker.
priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits.
Object¶
Object (, ) displays external data or object content. When in serialize mode, it's serialized according to the given serializer.
Usages¶ Parameters¶ syntax: Can be one of: markdown, html, json, yaml, xml. The syntax or serializer of the content. Default is json. data: Object. The data object to render. className: A class name for quickly styling the current block with stylesheets. speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content. writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc. whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end. charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker. tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker. priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits. Table¶ Displaying a table with records and columns.
Usages¶
To import an excel file, and display the first 10 records in csv syntax:Usages¶ Paris Parameters¶ syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. Note xml and text are experimental. className: A class name for quickly styling the current block with stylesheets. speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content. name: The name of the content, used in serialization. type: The type of the content, used in serialization. writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc. whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end. charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker. tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker. priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits. Conversation¶ Display a conversation between system, human and AI.
Usages¶ Parameters¶ messages: Object. A list of message. Each message should have a speaker and a content field. selectedMessages: The messages to be selected. If not provided, all messages will be selected. You can use a string like 2 to specify a single message, or slice like 2:4 to specify a range of messages (2 inclusive, 4 exclusive). Or use -6: to select the last 6 messages. Folder¶ Displays a directory structure as a tree.
Usages¶ To display a directory structure with a filter for Python files:
Parameters¶ syntax: Can be one of: markdown, html, json, yaml, text, xml. The output syntax of the content. src: The source directory path to display. data: TreeItemData[]. Alternative to src, directly provide tree data structure. filter: RegExp. A regular expression to filter files. The regex is applied to the folder names and file names (not the full path). Directories are included by default unless all of their nested content is filtered out. When filter is on, empty directories will not be shown. maxDepth: Number. Maximum depth of directory traversal. Default is 3. showContent: Boolean. Whether to show file contents. Default is false. HumanMessage¶ Wrap the contents in a user message.Usages¶ What is the capital of France? Parameters¶ syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. Note xml and text are experimental. className: A class name for quickly styling the current block with stylesheets. speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content. name: The name of the content, used in serialization. type: The type of the content, used in serialization. writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc. whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end. charLimit: Number. Experimental. Soft character limit before truncation is applied. Content exceeding this limit will be truncated with a marker. tokenLimit: Number. Experimental. Soft token limit before truncation is applied. Content exceeding this limit will be truncated with a marker. priority: Number. Experimental. Priority used when truncating globally. Lower numbers are dropped first when content needs to be reduced to fit limits. MessageContent¶ Display a message content.
Usages¶ Parameters¶ content: Object. The content of the message. It can be a string, or an array of strings and multimedia content. SystemMessage¶ Wrap the contents in a system message.
Usages¶ Answer concisely. Parameters¶ syntax: Can be one of: markdown, html, json, yaml, xml, text. The syntax of the content. Note xml and text are experimental. className: A class name for quickly styling the current block with stylesheets. speaker: Can be one of: human, ai, system. The speaker of the content. By default, it's determined by the context and the content. name: The name of the content, used in serialization. type: The type of the content, used in serialization. writerOptions: Object. Experimental.. Optional JSON string to customize the format of markdown headers, JSON indents, etc. whiteSpace: Can be one of: pre, filter, trim. Experimental. Controls how whitespace is handled in text content. 'pre' (default when syntax is text): Preserves all whitespace as-is; 'filter' (default when syntax is not text): Removes leading/trailing whitespace and normalizes internal whitespace in the gaps; 'trim': Trims whitespace from the beginning and end.