@smarter.sh/ui-chat 0.9.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -16
- package/dist/embed.js +53 -53
- package/dist/embed.js.map +1 -1
- package/dist/smarter-chat-library.es.js +5089 -4818
- package/dist/smarter-chat-library.es.js.map +1 -1
- package/dist/smarter-chat-library.umd.js +53 -53
- package/dist/smarter-chat-library.umd.js.map +1 -1
- package/dist/types/src/catalogs.gen.d.ts +12 -0
- package/dist/types/src/components/AppTitle/Component.d.ts +0 -4
- package/dist/types/src/components/DocsDialog/data.d.ts +3 -3
- package/dist/types/src/components/ErrorBoundary/Component.d.ts +1 -1
- package/dist/types/src/components/SmarterChat/Component.d.ts +6 -1
- package/dist/types/src/contract.gen.d.ts +8 -0
- package/dist/types/src/embed/element.d.ts +1 -1
- package/dist/types/src/embed/options.d.ts +5 -4
- package/dist/types/src/lib/i18n.d.ts +70 -0
- package/dist/types/src/types.d.ts +6 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -121,6 +121,8 @@ spec:
|
|
|
121
121
|
- **Optional developer Console.** As in the Smarter workbench, a resizable side panel can show the LLMClient's
|
|
122
122
|
configuration, the session's api calls, tool calls and Plugin usage, and a live server log stream.
|
|
123
123
|
- **Accessible.** It has labeled regions and controls, keyboard-resizable panels, and MathML for screen readers.
|
|
124
|
+
- **Translated.** Its own text is in English, Spanish or French: the page's language, or the one you ask for. The
|
|
125
|
+
LLMClient's welcome message, example prompts and responses are displayed as they are.
|
|
124
126
|
- **Typed.** It's written in TypeScript, and its types are generated from Smarter's api contract.
|
|
125
127
|
|
|
126
128
|
See [Features](https://docs.smarter.sh/smarter-framework/smarter-chat/features.html) for details.
|
|
@@ -195,22 +197,24 @@ the `<smarter-chat>` element, wherever the script is loaded:
|
|
|
195
197
|
The element's attributes, the script tag's `data-` attributes and the properties of `window.SmarterChatConfig` (in
|
|
196
198
|
camelCase, e.g. `apiKey`) are the same options. Only `chatbot` is required.
|
|
197
199
|
|
|
198
|
-
| Option | Default | Description
|
|
199
|
-
| --------------------- | --------------------- |
|
|
200
|
-
| `chatbot` | (required) | The deployed LLMClient's url.
|
|
201
|
-
| `api-key` | | A Smarter api key, for LLMClients that require one. It's public in the page.
|
|
202
|
-
| `mode` | `launcher` / `inline` | `launcher` (the script tag's default) or `inline` (the element's default).
|
|
203
|
-
| `position` | `bottom-right` | The launcher's corner: `bottom-right` or `bottom-left`.
|
|
204
|
-
| `open` | `false` | Start with the launcher open.
|
|
205
|
-
| `label` | `Chat` | The launcher's accessible name.
|
|
206
|
-
| `color` | `#ff5733` | The launcher button's color.
|
|
207
|
-
| `width`, `height` | `400px`, `600px` | The launcher's panel, or the inline chat (`100%`, `600px`). Any css length.
|
|
208
|
-
| `z-index` | `2147483000` | The launcher's stacking order.
|
|
209
|
-
| `session-cookie-name` | one per chatbot host | The cookie that keeps the chat session.
|
|
210
|
-
| `cookie-path` | `/` | The session cookie's path. `/` keeps one conversation across the whole site.
|
|
211
|
-
| `stream-progress` | `true` | Show a running prompt's steps, e.g. its tool calls.
|
|
212
|
-
| `debug` | `false` | Log to the browser console.
|
|
213
|
-
| `
|
|
200
|
+
| Option | Default | Description |
|
|
201
|
+
| --------------------- | --------------------- | --------------------------------------------------------------------------------- |
|
|
202
|
+
| `chatbot` | (required) | The deployed LLMClient's url. |
|
|
203
|
+
| `api-key` | | A Smarter api key, for LLMClients that require one. It's public in the page. |
|
|
204
|
+
| `mode` | `launcher` / `inline` | `launcher` (the script tag's default) or `inline` (the element's default). |
|
|
205
|
+
| `position` | `bottom-right` | The launcher's corner: `bottom-right` or `bottom-left`. |
|
|
206
|
+
| `open` | `false` | Start with the launcher open. |
|
|
207
|
+
| `label` | `Chat` | The launcher's accessible name. |
|
|
208
|
+
| `color` | `#ff5733` | The launcher button's color. |
|
|
209
|
+
| `width`, `height` | `400px`, `600px` | The launcher's panel, or the inline chat (`100%`, `600px`). Any css length. |
|
|
210
|
+
| `z-index` | `2147483000` | The launcher's stacking order. |
|
|
211
|
+
| `session-cookie-name` | one per chatbot host | The cookie that keeps the chat session. |
|
|
212
|
+
| `cookie-path` | `/` | The session cookie's path. `/` keeps one conversation across the whole site. |
|
|
213
|
+
| `stream-progress` | `true` | Show a running prompt's steps, e.g. its tool calls. |
|
|
214
|
+
| `debug` | `false` | Log to the browser console. |
|
|
215
|
+
| `language` | the page's | The chat's own language: `en`, `es` or `fr`, or a regional variant, e.g. `es-MX`. |
|
|
216
|
+
|
|
217
|
+
| `target` | | Script tag and `SmarterChatConfig` only: a css selector to render the chat inline in. |
|
|
214
218
|
|
|
215
219
|
Where you can't set a script tag's attributes, as in Google Tag Manager, set `window.SmarterChatConfig` (an object, or
|
|
216
220
|
an array of them) before the script runs:
|
|
@@ -393,6 +397,7 @@ Only `apiUrl` is required.
|
|
|
393
397
|
| `debugCookieExpiration` | `number` | one day | The debug cookie's lifetime, in milliseconds. |
|
|
394
398
|
| `smarterRequestId` | `string` | `""` | A unique id of the page request, sent as the `X-Smarter-RequestId` header, for tracing. |
|
|
395
399
|
| `logStreamUrl` | `string \| null` | `null` | The url of a server log stream (Server-Sent Events), for the Console's Server Logs tab. |
|
|
400
|
+
| `language` | `string \| null` | `null` | The language of the chat's own text: `en`, `es` or `fr`, or a regional variant, e.g. `es-MX`. By default, the page's `<html lang>`, or else the browser's. |
|
|
396
401
|
|
|
397
402
|
The props control where and how the chat runs on your page. Its content and look come from the manifest, so there is
|
|
398
403
|
no prop for the welcome message, the colors or the model.
|