Skip to content

Commit 99fdced

Browse files
committed
Added demo for overlay chatbot with toolresponse MD
1 parent 45e8430 commit 99fdced

File tree

3 files changed

+752
-1
lines changed

3 files changed

+752
-1
lines changed

packages/module/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,28 @@ import ExpandIcon from '@patternfly/react-icons/dist/esm/icons/expand-icon';
5252
import OpenDrawerRightIcon from '@patternfly/react-icons/dist/esm/icons/open-drawer-right-icon';
5353
import OutlinedWindowRestoreIcon from '@patternfly/react-icons/dist/esm/icons/outlined-window-restore-icon';
5454
import { BarsIcon } from '@patternfly/react-icons/dist/esm/icons/bars-icon';
55+
import { CopyIcon } from '@patternfly/react-icons/dist/esm/icons/copy-icon';
56+
import { WrenchIcon } from '@patternfly/react-icons/dist/esm/icons/wrench-icon';
57+
import {
58+
Button,
59+
DescriptionList,
60+
DescriptionListDescription,
61+
DescriptionListGroup,
62+
DescriptionListTerm,
63+
ExpandableSection,
64+
ExpandableSectionVariant,
65+
Flex,
66+
FlexItem,
67+
Label
68+
} from '@patternfly/react-core';
5569
import PFHorizontalLogoColor from '../UI/PF-HorizontalLogo-Color.svg';
5670
import PFHorizontalLogoReverse from '../UI/PF-HorizontalLogo-Reverse.svg';
5771
import PFIconLogoColor from '../UI/PF-IconLogo-Color.svg';
5872
import PFIconLogoReverse from '../UI/PF-IconLogo-Reverse.svg';
5973
import userAvatar from '../Messages/user_avatar.svg';
6074
import patternflyAvatar from '../Messages/patternfly_avatar.jpg';
6175
import { getTrackingProviders } from "@patternfly/chatbot/dist/dynamic/tracking";
62-
import { useEffect,useCallback, useRef, useState, FunctionComponent, MouseEvent } from 'react';
76+
import { useEffect,useCallback, useRef, useState, FunctionComponent, MouseEvent, MouseEvent as ReactMouseEvent } from 'react';
6377
import saveAs from 'file-saver';
6478

6579
### Basic ChatBot
@@ -189,3 +203,21 @@ In this example, file download is implemented with [file-saver](https://www.npmj
189203
```js file="./ChatbotTranscripts.tsx" isFullscreen
190204

191205
```
206+
207+
### ChatBot with markdown tool response
208+
209+
This demo displays a ChatBot in overlay mode with a comprehensive markdown tool response example. This demo includes:
210+
211+
1. The [`<ChatbotToggle>`](/extensions/chatbot/ui#toggle) that controls the [`<Chatbot>` container.](/extensions/chatbot/ui#container)
212+
2. A [`<ChatbotHeader>`](/extensions/chatbot/ui#header) with display mode switching capabilities.
213+
3. A message with a [`<ToolResponse>`](/extensions/chatbot/messages#tool-response) component that demonstrates:
214+
- Markdown-formatted toggle content, subheading, and body
215+
- Comprehensive markdown formatting examples (headings, code blocks, lists, tables, images, footnotes, etc.)
216+
- Custom card title and card body with tool response details
217+
- The `shouldRetainStyles` prop set to `true` to preserve markdown styles
218+
219+
This example showcases how tool responses with rich markdown content render within an overlay ChatBot context.
220+
221+
```js file="./ChatbotWithMarkdownToolResponse.tsx" isFullscreen
222+
223+
```

0 commit comments

Comments
 (0)