Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions src/components/chat/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ TODO: Add description

## Properties

| Property | Attribute | Description | Type | Default |
| --------------------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- |
| `callbacks` _(required)_ | -- | Specifies the callbacks required in the control. | `{ clear: () => Promise<void>; sendChatToLLM: (chat: ChatMessage[]) => void; stopGeneratingAnswer?: () => Promise<void>; uploadImage: (imageFile: File) => Promise<string>; }` | `undefined` |
| `disabled` | `disabled` | Specifies if all interactions are disabled | `boolean` | `false` |
| `generatingResponse` _(required)_ | `generating-response` | `true` if a response for the assistant is being generated. | `boolean` | `undefined` |
| `hyperlinkToDownloadFile` | -- | Specifies an object containing an HTMLAnchorElement reference. Use this property to render a button to download the code when displaying a code block. | `{ anchor: HTMLAnchorElement; }` | `undefined` |
| `imageUpload` | `image-upload` | Specifies if the control can render a button to load images from the file system. | `boolean` | `false` |
| `isMobile` _(required)_ | `is-mobile` | Specifies if the chat is used in a mobile device. | `boolean` | `undefined` |
| `items` | -- | Specifies the items that the chat will display. | `ChatMessage[]` | `[]` |
| `loadingState` _(required)_ | `loading-state` | Specifies if the chat is waiting for the data to be loaded. | `"all-records-loaded" \| "initial" \| "loading" \| "more-data-to-fetch"` | `undefined` |
| `markdownTheme` | `markdown-theme` | Specifies the theme to be used for rendering the markdown. If `null`, no theme will be applied. | `string` | `"ch-markdown-viewer"` |
| `renderCode` | -- | This property allows us to implement custom rendering for the code blocks. | `(options: MarkdownViewerCodeRenderOptions) => any` | `undefined` |
| `renderItem` | -- | This property allows us to implement custom rendering of chat items. If allow us to implement the render of the cell content. | `(messageModel: ChatMessageByRole<"error" \| "user" \| "assistant">) => any` | `undefined` |
| `translations` _(required)_ | -- | Specifies the literals required in the control. | `{ accessibleName: { chat: string; clearChat: string; copyResponseButton: string; downloadCodeButton: string; imagePicker: string; removeUploadedImage: string; sendButton: string; sendInput: string; stopGeneratingAnswerButton: string; }; placeholder: { sendInput: string; }; text: { copyCodeButton: string; processing: string; sourceFiles: string; }; }` | `undefined` |
| Property | Attribute | Description | Type | Default |
| --------------------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- |
| `callbacks` _(required)_ | -- | Specifies the callbacks required in the control. | `{ clear: () => Promise<void>; sendChatToLLM: (chat: ChatMessage[]) => void; stopGeneratingAnswer?: () => Promise<void>; uploadImage: (imageFile: File) => Promise<string>; }` | `undefined` |
| `disabled` | `disabled` | Specifies if all interactions are disabled | `boolean` | `false` |
| `generatingResponse` _(required)_ | `generating-response` | `true` if a response for the assistant is being generated. | `boolean` | `undefined` |
| `hyperlinkToDownloadFile` | -- | Specifies an object containing an HTMLAnchorElement reference. Use this property to render a button to download the code when displaying a code block. | `{ anchor: HTMLAnchorElement; }` | `undefined` |
| `imageUpload` | `image-upload` | Specifies if the control can render a button to load images from the file system. | `boolean` | `false` |
| `isMobile` _(required)_ | `is-mobile` | Specifies if the chat is used in a mobile device. | `boolean` | `undefined` |
| `items` | -- | Specifies the items that the chat will display. | `ChatMessage[]` | `[]` |
| `loadingState` _(required)_ | `loading-state` | Specifies if the chat is waiting for the data to be loaded. | `"all-records-loaded" \| "initial" \| "loading" \| "more-data-to-fetch"` | `undefined` |
| `markdownTheme` | `markdown-theme` | Specifies the theme to be used for rendering the markdown. If `null`, no theme will be applied. | `string` | `"ch-markdown-viewer"` |
| `renderCode` | -- | This property allows us to implement custom rendering for the code blocks. | `(options: MarkdownViewerCodeRenderOptions) => any` | `undefined` |
| `renderItem` | -- | This property allows us to implement custom rendering of chat items. If allow us to implement the render of the cell content. | `(messageModel: ChatMessageByRole<"error" \| "user" \| "assistant">) => any` | `undefined` |
| `translations` _(required)_ | -- | Specifies the literals required in the control. | `{ accessibleName: { clearChat: string; copyResponseButton: string; downloadCodeButton: string; imagePicker: string; removeUploadedImage: string; sendButton: string; sendInput: string; stopGeneratingAnswerButton: string; }; placeholder: { sendInput: string; }; text: { copyCodeButton: string; processing: string; sourceFiles: string; }; }` | `undefined` |


## Methods
Expand Down
1 change: 0 additions & 1 deletion src/components/chat/translations.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export type ChatTranslations = {
accessibleName: {
chat: string;
clearChat: string;
copyResponseButton: string;
downloadCodeButton: string;
Expand Down
1 change: 0 additions & 1 deletion src/showcase/assets/components/chat/callbacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ export const chatCallbacks: ChatInternalCallbacks = {

export const chatTranslations: ChatTranslations = {
accessibleName: {
chat: "Chat",
clearChat: "Clear chat",
copyResponseButton: "Copy assistant response",
downloadCodeButton: "Download code",
Expand Down
Loading