Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

docs: ai chat component (#64989)

Alex Yarosh33e9a2cc257d
diff --git a/docs/embedding/embedded-analytics-js.md b/docs/embedding/embedded-analytics-js.md
index f668c633d9d..a3c34033f54 100644
--- a/docs/embedding/embedded-analytics-js.md
+++ b/docs/embedding/embedded-analytics-js.md
@@ -22,6 +22,7 @@ Currently you can choose to embed:
- A question (chart). You can embed both questions built with the query builder and questions built with SQL.
- Full graphical [query builder](../questions/query-builder/editor.md) to enable people to build their own charts and explorations.
- A browser to navigate collections and open dashboards or questions.
+- [AI chat interface](./sdk/ai-chat.md).
## Quickstart
@@ -43,10 +44,10 @@ You can also follow the setup guide directly in Metabase in **Admin settings > E
2. Choose the _type_ of entity to embed:
- Dashboard
- - Question
+ - Chart
- Exploration (which will embed the Metabase query builder)
- Browser
- - Metabot question
+ - Metabot question (which will embed AI chat)
3. Next, select the entity you want to embed. For browser, pick the collection you want people to start from.
@@ -358,7 +359,7 @@ To render a dashboard:
### Question
-To render a question (chart).
+To render a question (chart):
```html
<metabase-question question-id="1"></metabase-question>
@@ -379,9 +380,9 @@ To render a question (chart).
- `is-save-enabled` (default is false)
- `target-collection` - this is to enforce saving into a particular collection. Values: regular ID, entity ID, `"personal”`, `"root”`
-- ### Browser
+### Browser
-To render a collection browser so people can navigate a collection and open dashboards or questions.
+To render a collection browser so people can navigate a collection and open dashboards or questions:
```html
<metabase-browser initial-collection="14" read-only="false"></metabase-browser>
@@ -395,6 +396,25 @@ To render a collection browser so people can navigate a collection and open dash
- `read-only` (default is true) – if true, people can interact with items (filter, summarize, drill-through) but cannot save. If false, they can create and edit items in the collection.
+### Metabot
+
+To render the AI chat interface:
+
+```html
+<metabase-metabot></metabase-metabot>
+```
+
+**Required parameters:**
+
+None.
+
+**Optional parameters:**
+
+- `layout` (default is `auto`) – how should the browser position the visualization with respect to the chat interface. Possible values are:
+ - `auto` (default): Metabot uses the `stacked` layout on mobile screens, and a `sidebar` layout on larger screens.
+ - `stacked`: the question visualization stacks on top of the chat interface.
+ - `sidebar`: the question visualization appears to the left of the chat interface, which is in the right sidebar.
+
## Embedding Metabase in a different domain
If you want to embed Metabase in another domain (say, if Metabase is hosted at `metabase.yourcompany.com`, but you want to embed Metabase at `yourcompany.github.io`), you can tell Metabase to set the session cookie's SameSite value to "none".
diff --git a/docs/embedding/sdk/ai-chat.md b/docs/embedding/sdk/ai-chat.md
index 42f46334cc6..5fe73e594bf 100644
--- a/docs/embedding/sdk/ai-chat.md
+++ b/docs/embedding/sdk/ai-chat.md
@@ -25,6 +25,10 @@ You can check out a [demo of the AI chat component](https://embedded-analytics-s
{% include_file "{{ dirname }}/snippets/questions/ai-question.tsx" %}
```
+## Props
+
+{% include_file "{{ dirname }}/api/snippets/MetabotQuestionProps.md" snippet="properties" %}
+
## API reference
- [Component](./api/MetabotQuestion.html)