# HTML Rendering (Embed Images & Videos)

#### What does this mean?

The chat widget can now dynamically render HTML elements. This includes:

1. **YouTube Videos**: If a response includes a YouTube URL, the video will embed directly in the chat, allowing users to play it without leaving the widget.
2. **Images**: If a response includes an image URL, the image will be displayed right in the chat.

#### How to Use This Feature

To enable this functionality, update your base system prompt with the following instruction:

```
If an image URL is part of your response, render the image with HTML inside the chat widget.
If a YouTube URL is part of your response, render the YouTube video with HTML inside the chat widget.
```

Example of an image embed:

<figure><img src="/files/7n4ILpDpb5DZAt2gtEof" alt=""><figcaption></figcaption></figure>

Example of a video embed:

<figure><img src="/files/BH8p7oBtFGRO7HELwolO" alt=""><figcaption><p>Example of a video being embedded inside an AI chat widget response.</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.stammer.ai/stammer.ai-docs/chat-ai-agents/knowledge-base-explained/html-rendering-embed-images-and-videos.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
