AI output formats¶
Alan AI agents can use different data formats and media types to deliver information to the user. By supporting various data outputs, they provide rich, personalized experiences adapted to user needs.
Alan AI supports the following key output data formats and media types:
Plain text¶
Use plain text for straightforward answers and messages that do not require formatting, such as short responses, notifications and alerts.
intent("What payment methods do you accept?", p => {
p.play("We accept a variety of payment methods, including Visa, MasterCard, American Express, and PayPal. Additionally, we offer bank transfers for larger transactions.");
});
Markdown¶
Use markdown to enhance readability through simple text formatting, such as headings, bullet points and emphasis (bold, italic).
Note
To allow displaying markdown-formatted text in responses in intents, use the opts({markdown:true})
option. For details, see Play options.
Alan AI supports both native Markdown syntax and HTML-formatted text:
intent("Can you provide details about the Introduction to Data Science course?", p => {
p.play(`The **Introduction to Data Science** course is designed to equip learners with fundamental skills in data science. This course covers key concepts and tools used in the field, including: \n\n - **Data Analysis**: Learn how to analyze and interpret data using various techniques. \n\n - **Statistical Methods**: Understand essential statistical methods for data analysis. \n\n - **Programming with Python**: Gain practical experience in Python for data manipulation and analysis.`, opts({markdown:true}));
});
intent("Can you provide details about the Introduction to Data Science course?", p => {
p.play(`<p>The <strong>Introduction to Data Science</strong> course is designed to equip learners with fundamental skills in data science. This course covers key concepts and tools used in the field, including:</p>\n\n<ul>\n <li><strong>Data Analysis</strong>: Learn how to analyze and interpret data using various techniques.</li>\n <li><strong>Statistical Methods</strong>: Understand essential statistical methods for data analysis.</li>\n <li><strong>Programming with Python</strong>: Gain practical experience in Python for data manipulation and analysis.</li>\n</ul>`, opts({markdown:true}));
});
Images¶
Use images to deliver complex information that is best understood visually.
intent("Show the AWS cloud architecture scheme", p => {
p.play(`![AWS cloud architecture](https://docs.aws.amazon.com/images/solutions/latest/workload-discovery-on-aws/images/workload-discovery-arch-diagram.png) \n\n **AWS cloud architecture** is the design and organization of resources and services within Amazon Web Services to create scalable, flexible, and efficient cloud-based applications and solutions.`, opts({markdown:true}));
});
intent("Show the AWS cloud architecture scheme", p => {
p.play(`<img src="https://docs.aws.amazon.com/images/solutions/latest/workload-discovery-on-aws/images/workload-discovery-arch-diagram.png" alt="AWS cloud architecture" /> \n\n\ <p><strong>AWS cloud architecture</strong> is the design and organization of resources and services within Amazon Web Services to create scalable, flexible, and efficient cloud-based applications and solutions.</p>`, opts({markdown:true}));
});
Forms¶
Use forms to gather user input, such as contact information, feedback or survey responses.
intent("Take survey", p => {
p.play(`<iframe src="https://r1qcxycjze5.typeform.com/to/XipMWa93" frameborder="0" width="600" height="400">Loading…</iframe>`, opts({markdown:true}));
});
Charts¶
Use charts to display data trends and patterns over time, helping users understand complex datasets.
intent("Show the monthly income report by country", p => {
p.play(`<iframe src="https://quickchart.io/chart-maker/view/zm-9f0f6e24-c8fc-4ce5-b40d-dc387c78c49f" frameborder="0" width="500" height="250"></iframe>`, opts({markdown:true}));
});
Maps¶
Use maps to present location-based data, such as addresses, routes and geospatial analysis.
intent("What's your address?", p => {
p.play(`We are located at: \n\n **Georgia State Capitol** \n\n 206 Washington Street SW \n\n Atlanta, GA 30334 \n\n USA`, opts({markdown:true}));
p.play(`<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d329234.7890065586!2d-84.3884!3d33.749!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x88f50e2c6cb2c639%3A0x6f63a43b7e589fa5!2sGeorgia%20State%20Capitol!5e0!3m2!1sen!2sus!4v1635430471187!5m2!1sen!2sus&z=16" class="map-iframe" allowfullscreen="" loading="lazy" width="400" height="250"></iframe>`, opts({markdown:true}));
});