@uipath/ui-widgets-conversational-agent-chat 1.1.6 → 1.1.8
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 +62 -62
- package/dist/ConversationalAgentChat.css +835 -96
- package/dist/ConversationalAgentChat.d.ts +1 -1
- package/dist/ConversationalAgentChat.d.ts.map +1 -1
- package/dist/ConversationalAgentChat.js +87 -35
- package/dist/ConversationalAgentChat.js.map +1 -1
- package/dist/ConversationalAgentChat.stories.d.ts +1 -0
- package/dist/ConversationalAgentChat.stories.d.ts.map +1 -1
- package/dist/components/AgentSchemaForm/AgentSchemaField.d.ts +1 -1
- package/dist/components/AgentSchemaForm/AgentSchemaField.d.ts.map +1 -1
- package/dist/components/AgentSchemaForm/AgentSchemaField.js +9 -19
- package/dist/components/AgentSchemaForm/AgentSchemaField.js.map +1 -1
- package/dist/components/AgentSchemaForm/omitEmptyOptionalValues.d.ts +8 -0
- package/dist/components/AgentSchemaForm/omitEmptyOptionalValues.d.ts.map +1 -0
- package/dist/components/AgentSchemaForm/omitEmptyOptionalValues.js +31 -0
- package/dist/components/AgentSchemaForm/omitEmptyOptionalValues.js.map +1 -0
- package/dist/components/ClientSideTool.d.ts.map +1 -1
- package/dist/components/ClientSideTool.js +8 -3
- package/dist/components/ClientSideTool.js.map +1 -1
- package/dist/i18n/i18n.config.d.ts.map +1 -1
- package/dist/i18n/i18n.config.js +27 -0
- package/dist/i18n/i18n.config.js.map +1 -1
- package/dist/i18n/locales/de/index.json +319 -0
- package/dist/i18n/locales/en/index.json +3 -0
- package/dist/i18n/locales/es/index.json +319 -0
- package/dist/i18n/locales/es-mx/index.json +319 -0
- package/dist/i18n/locales/fr/index.json +319 -0
- package/dist/i18n/locales/ja/index.json +319 -0
- package/dist/i18n/locales/keys/index.json +3 -0
- package/dist/i18n/locales/ko/index.json +319 -0
- package/dist/i18n/locales/pt/index.json +319 -0
- package/dist/i18n/locales/pt-br/index.json +319 -0
- package/dist/i18n/locales/ro/index.json +319 -0
- package/dist/i18n/locales/tr/index.json +319 -0
- package/dist/i18n/locales/zh-cn/index.json +319 -0
- package/dist/i18n/locales/zh-tw/index.json +319 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +5 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -0
- package/dist/utils.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @uipath/ui-widgets-conversational-agent-chat
|
|
2
2
|
|
|
3
|
-
A React
|
|
3
|
+
A React chat interface powered by [UiPath Conversational Agents](https://uipath.github.io/uipath-typescript/api/interfaces/ConversationalAgentServiceModel/). Built on UiPath Apollo React chat components, it drops an AI chat experience into your application with streaming, attachments and tool-call visibility.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ A React component that provides a conversational AI chat interface powered by Ui
|
|
|
10
10
|
- Conversation history management
|
|
11
11
|
- Start new conversations or continue existing ones
|
|
12
12
|
- Built on Apollo React chat components
|
|
13
|
-
-
|
|
13
|
+
- Written in TypeScript for type safety
|
|
14
14
|
|
|
15
15
|
## Installation
|
|
16
16
|
|
|
@@ -18,17 +18,16 @@ A React component that provides a conversational AI chat interface powered by Ui
|
|
|
18
18
|
npm install @uipath/ui-widgets-conversational-agent-chat
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
This package requires the following peer dependencies:
|
|
21
|
+
### Peer dependencies
|
|
24
22
|
|
|
25
23
|
```bash
|
|
26
|
-
npm install react@^19.2.0 react-dom@^19.2.0 @uipath/uipath-typescript@^1.
|
|
24
|
+
npm install react@^19.2.0 react-dom@^19.2.0 @uipath/uipath-typescript@^1.5.5
|
|
27
25
|
```
|
|
28
26
|
|
|
29
27
|
## Usage
|
|
30
28
|
|
|
31
|
-
> **Note
|
|
29
|
+
> **Note: Theming**
|
|
30
|
+
> Add either a `light` or `dark` class to your HTML `<body>` element to enable proper theming.
|
|
32
31
|
|
|
33
32
|
```tsx
|
|
34
33
|
import { ConversationalAgentChat } from "@uipath/ui-widgets-conversational-agent-chat";
|
|
@@ -42,10 +41,13 @@ function App() {
|
|
|
42
41
|
useEffect(() => {
|
|
43
42
|
const init = async () => {
|
|
44
43
|
const uipath = new UiPath({
|
|
45
|
-
baseUrl: "https://
|
|
44
|
+
baseUrl: "https://api.uipath.com",
|
|
46
45
|
orgName: "your-org",
|
|
47
46
|
tenantName: "your-tenant",
|
|
48
|
-
|
|
47
|
+
clientId: "your-client-id",
|
|
48
|
+
redirectUri: "http://localhost:3000/callback",
|
|
49
|
+
scope:
|
|
50
|
+
"OR.Execution OR.Folders OR.Users OR.Jobs ConversationalAgents Traces.Api",
|
|
49
51
|
});
|
|
50
52
|
await uipath.initialize();
|
|
51
53
|
setSdk(uipath);
|
|
@@ -59,25 +61,24 @@ function App() {
|
|
|
59
61
|
}
|
|
60
62
|
```
|
|
61
63
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
### Props
|
|
64
|
+
> **Info: Scopes for streaming**
|
|
65
|
+
> The `ConversationalAgents` scope is what makes the real-time WebSocket session work; without it the REST calls succeed but the socket connection fails. See [OAuth Scopes](https://uipath.github.io/uipath-typescript/oauth-scopes/#conversational-agent) for the authoritative list.
|
|
65
66
|
|
|
66
|
-
|
|
67
|
-
| ------------------------ | ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
68
|
-
| `sdk` | `UiPath` | Yes | UiPath SDK instance for API communication |
|
|
69
|
-
| `agentId` | `number` | No | The ID of the conversational agent release. Required unless `existingConversationId` is provided. |
|
|
70
|
-
| `folderId` | `number` | No | The folder ID the agent lives in. When omitted, the widget resolves it by listing agents and matching on `agentId` — prefer passing it when known. |
|
|
71
|
-
| `existingConversationId` | `string` | No | Load an existing conversation by ID instead of creating a new one on first message. |
|
|
72
|
-
| `inputSchema` | `InputSchema` | No | Agent input schema. Takes precedence over the schema derived from the resolved agent; use when the caller has the schema but the agent can't be resolved (e.g. an in-progress draft). |
|
|
73
|
-
| `isDebugMode` | `boolean` | No | Debug flow: opens an empty conversation up front so inputs are collected in the widget, and submits update the existing conversation instead of creating a new one. |
|
|
74
|
-
| `externalUserId` | `string` | No | External user identifier sent as `x-uipath-external-user-id` (HTTP header / WebSocket query param). Required when authenticating via an app-scoped external app; omit for standard user tokens. |
|
|
67
|
+
## Props
|
|
75
68
|
|
|
76
|
-
|
|
69
|
+
| Prop | Type | Required | Description |
|
|
70
|
+
| ------------------------ | ------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
71
|
+
| `sdk` | `UiPath` | Yes | UiPath SDK instance for API communication |
|
|
72
|
+
| `agentId` | `number` | No | The ID of the conversational agent release. Required unless `existingConversationId` is provided |
|
|
73
|
+
| `folderId` | `number` | No | The folder ID the agent lives in. When omitted, the widget resolves it by listing agents and matching on `agentId` — prefer passing it when known |
|
|
74
|
+
| `existingConversationId` | `string` | No | Load an existing conversation by ID instead of creating a new one on the first message |
|
|
75
|
+
| `inputSchema` | `InputSchema` | No | Agent input schema. Takes precedence over the schema derived from the resolved agent; use when the caller has the schema but the agent can't be resolved (e.g. an in-progress draft) |
|
|
76
|
+
| `isDebugMode` | `boolean` | No | Debug flow: opens an empty conversation up front so inputs are collected in the widget, and submits update the existing conversation instead of creating a new one |
|
|
77
|
+
| `externalUserId` | `string` | No | External user identifier sent as `x-uipath-external-user-id` (HTTP header / WebSocket query param). Required when authenticating via an app-scoped external app; omit for standard user tokens |
|
|
77
78
|
|
|
78
|
-
|
|
79
|
+
## Agent picker + chat
|
|
79
80
|
|
|
80
|
-
|
|
81
|
+
`ConversationalAgentPickerChat` is a higher-level component that lists every conversational agent reachable by a given SDK instance and opens a chat with the selected one. Use it when you don't know the `agentId` / `folderId` up front and want the user to pick.
|
|
81
82
|
|
|
82
83
|
```tsx
|
|
83
84
|
import { ConversationalAgentPickerChat } from "@uipath/ui-widgets-conversational-agent-chat";
|
|
@@ -91,10 +92,13 @@ function App() {
|
|
|
91
92
|
useEffect(() => {
|
|
92
93
|
const init = async () => {
|
|
93
94
|
const uipath = new UiPath({
|
|
94
|
-
baseUrl: "https://
|
|
95
|
+
baseUrl: "https://api.uipath.com",
|
|
95
96
|
orgName: "your-org",
|
|
96
97
|
tenantName: "your-tenant",
|
|
97
|
-
|
|
98
|
+
clientId: "your-client-id",
|
|
99
|
+
redirectUri: "http://localhost:3000/callback",
|
|
100
|
+
scope:
|
|
101
|
+
"OR.Execution OR.Folders OR.Users OR.Jobs ConversationalAgents Traces.Api",
|
|
98
102
|
});
|
|
99
103
|
await uipath.initialize();
|
|
100
104
|
setSdk(uipath);
|
|
@@ -110,58 +114,60 @@ function App() {
|
|
|
110
114
|
|
|
111
115
|
### Props
|
|
112
116
|
|
|
113
|
-
| Prop | Type | Required | Description
|
|
114
|
-
| ----------------- | ---------------------------------------------- | -------- |
|
|
115
|
-
| `sdk` | `UiPath` | Yes | UiPath SDK instance. Changing it refetches the list and resets the UI
|
|
116
|
-
| `locale` | `Locale` | No | Passthrough to the inner chat
|
|
117
|
-
| `theme` | `"light" \| "dark" \| "light-hc" \| "dark-hc"` | No | Passthrough to the inner chat
|
|
118
|
-
| `readOnly` | `boolean` | No | Passthrough to the inner chat
|
|
119
|
-
| `overrideLabels` | `OverrideLabels` | No | Passthrough to the inner chat
|
|
120
|
-
| `onAgentSelected` | `(agent: AgentSummary) => void` | No | Fired when the user picks an agent (telemetry, routing, etc.)
|
|
117
|
+
| Prop | Type | Required | Description |
|
|
118
|
+
| ----------------- | ---------------------------------------------- | -------- | --------------------------------------------------------------------- |
|
|
119
|
+
| `sdk` | `UiPath` | Yes | UiPath SDK instance. Changing it refetches the list and resets the UI |
|
|
120
|
+
| `locale` | `Locale` | No | Passthrough to the inner chat |
|
|
121
|
+
| `theme` | `"light" \| "dark" \| "light-hc" \| "dark-hc"` | No | Passthrough to the inner chat |
|
|
122
|
+
| `readOnly` | `boolean` | No | Passthrough to the inner chat |
|
|
123
|
+
| `overrideLabels` | `OverrideLabels` | No | Passthrough to the inner chat |
|
|
124
|
+
| `onAgentSelected` | `(agent: AgentSummary) => void` | No | Fired when the user picks an agent (telemetry, routing, etc.) |
|
|
121
125
|
|
|
122
126
|
### Behavior
|
|
123
127
|
|
|
124
|
-
- Calls `ConversationalAgent(sdk).getAll()` on mount
|
|
128
|
+
- Calls `ConversationalAgent(sdk).getAll()` on mount, then renders one row per agent (`name` + `description`).
|
|
125
129
|
- Clicking an agent swaps to the chat view with that agent's `id` and `folderId`.
|
|
126
|
-
-
|
|
127
|
-
- If the user's accessible tenants live behind your own auth
|
|
130
|
+
- **Back** clears the selection and returns to the list — no refetch.
|
|
131
|
+
- If the user's accessible tenants live behind your own auth or chrome, switch tenants by rebuilding the `UiPath` instance and passing the new one as `sdk`; the picker handles the rest.
|
|
128
132
|
|
|
129
|
-
## Features in
|
|
133
|
+
## Features in detail
|
|
130
134
|
|
|
131
|
-
### Streaming
|
|
135
|
+
### Streaming responses
|
|
132
136
|
|
|
133
|
-
|
|
137
|
+
Responses stream in real time, so the conversation stays fluid while the agent generates its reply.
|
|
134
138
|
|
|
135
|
-
### File
|
|
139
|
+
### File attachments
|
|
136
140
|
|
|
137
|
-
Users can attach files to their messages via drag and drop or file picker.
|
|
141
|
+
Users can attach files to their messages via drag and drop or the file picker.
|
|
138
142
|
|
|
139
|
-
### Tool
|
|
143
|
+
### Tool call tracking
|
|
140
144
|
|
|
141
|
-
When the
|
|
145
|
+
When the agent uses tools, the widget displays:
|
|
142
146
|
|
|
143
147
|
- Tool name and input parameters
|
|
144
148
|
- Execution status
|
|
145
149
|
- Output results
|
|
146
150
|
- Error handling
|
|
147
151
|
|
|
148
|
-
### Session
|
|
152
|
+
### Session management
|
|
149
153
|
|
|
150
|
-
The widget
|
|
151
|
-
|
|
152
|
-
- Conversation creation and persistence
|
|
153
|
-
- Session initialization and maintenance
|
|
154
|
-
- Multiple conversation support via "New Chat"
|
|
154
|
+
The widget handles conversation creation and persistence, session initialization and maintenance, and multiple conversations via **New Chat**.
|
|
155
155
|
|
|
156
156
|
## Styling
|
|
157
157
|
|
|
158
|
-
The component comes with default styles. Import the CSS file in your application:
|
|
159
|
-
|
|
160
158
|
```tsx
|
|
161
159
|
import "@uipath/ui-widgets-conversational-agent-chat/ConversationalAgentChat.css";
|
|
162
160
|
```
|
|
163
161
|
|
|
164
|
-
|
|
162
|
+
Both light and dark themes are supported through the UiPath Apollo design system.
|
|
163
|
+
|
|
164
|
+
## TypeScript
|
|
165
|
+
|
|
166
|
+
```tsx
|
|
167
|
+
import type { ConversationalAgentChatProps } from "@uipath/ui-widgets-conversational-agent-chat";
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
<!-- docs:ignore -->
|
|
165
171
|
|
|
166
172
|
## Development
|
|
167
173
|
|
|
@@ -193,14 +199,8 @@ npm run test:ui
|
|
|
193
199
|
npm run test:coverage
|
|
194
200
|
```
|
|
195
201
|
|
|
196
|
-
## TypeScript Support
|
|
197
|
-
|
|
198
|
-
This package is written in TypeScript and includes type definitions. Import types as needed:
|
|
199
|
-
|
|
200
|
-
```tsx
|
|
201
|
-
import type { ConversationalAgentChatProps } from "@uipath/ui-widgets-conversational-agent-chat";
|
|
202
|
-
```
|
|
203
|
-
|
|
204
202
|
## License
|
|
205
203
|
|
|
206
204
|
MIT
|
|
205
|
+
|
|
206
|
+
<!-- /docs:ignore -->
|