@uipath/ui-widgets-conversational-agent-chat 1.0.1 → 1.0.3
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 +53 -0
- package/dist/ConversationalAgentChat.css +17899 -6
- package/dist/ConversationalAgentChat.d.ts.map +1 -1
- package/dist/ConversationalAgentChat.js +30 -0
- package/dist/ConversationalAgentChat.js.map +1 -1
- package/dist/ConversationalAgentPickerChat.d.ts +4 -0
- package/dist/ConversationalAgentPickerChat.d.ts.map +1 -0
- package/dist/ConversationalAgentPickerChat.js +113 -0
- package/dist/ConversationalAgentPickerChat.js.map +1 -0
- package/dist/ConversationalAgentPickerChat.stories.d.ts +96 -0
- package/dist/ConversationalAgentPickerChat.stories.d.ts.map +1 -0
- package/dist/ConversationalAgentPickerChat.stories.js +209 -0
- package/dist/ConversationalAgentPickerChat.stories.js.map +1 -0
- package/dist/components/AgentList.d.ts +10 -0
- package/dist/components/AgentList.d.ts.map +1 -0
- package/dist/components/AgentList.js +20 -0
- package/dist/components/AgentList.js.map +1 -0
- package/dist/components/agentUtils.d.ts +4 -0
- package/dist/components/agentUtils.d.ts.map +1 -0
- package/dist/components/agentUtils.js +24 -0
- package/dist/components/agentUtils.js.map +1 -0
- package/dist/components/useFavorites.d.ts +7 -0
- package/dist/components/useFavorites.d.ts.map +1 -0
- package/dist/components/useFavorites.js +47 -0
- package/dist/components/useFavorites.js.map +1 -0
- package/dist/index.d.ts +2 -1
- 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 +17 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -1
- package/dist/utils/telemetryUtils.js +1 -1
- package/dist/utils/telemetryUtils.js.map +1 -1
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -69,6 +69,59 @@ function App() {
|
|
|
69
69
|
| `agentId` | `number` | Yes | The ID of the conversational agent release |
|
|
70
70
|
| `folderId` | `number` | Yes | The folder ID where conversations will be stored |
|
|
71
71
|
|
|
72
|
+
## `ConversationalAgentPickerChat` (agent picker + chat)
|
|
73
|
+
|
|
74
|
+
A higher-level component that lists all conversational agents accessible to a given SDK and opens a chat with the selected one. Useful when you don't know the `agentId`/`folderId` up front and want the user to pick.
|
|
75
|
+
|
|
76
|
+
### Usage
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
import { ConversationalAgentPickerChat } from "@uipath/ui-widgets-conversational-agent-chat";
|
|
80
|
+
import "@uipath/ui-widgets-conversational-agent-chat/ConversationalAgentChat.css";
|
|
81
|
+
import { UiPath } from "@uipath/uipath-typescript/core";
|
|
82
|
+
import { useEffect, useState } from "react";
|
|
83
|
+
|
|
84
|
+
function App() {
|
|
85
|
+
const [sdk, setSdk] = useState<UiPath | null>(null);
|
|
86
|
+
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
const init = async () => {
|
|
89
|
+
const uipath = new UiPath({
|
|
90
|
+
baseUrl: "https://cloud.uipath.com",
|
|
91
|
+
orgName: "your-org",
|
|
92
|
+
tenantName: "your-tenant",
|
|
93
|
+
secret: "your-secret",
|
|
94
|
+
});
|
|
95
|
+
await uipath.initialize();
|
|
96
|
+
setSdk(uipath);
|
|
97
|
+
};
|
|
98
|
+
init();
|
|
99
|
+
}, []);
|
|
100
|
+
|
|
101
|
+
if (!sdk) return <div>Loading...</div>;
|
|
102
|
+
|
|
103
|
+
return <ConversationalAgentPickerChat sdk={sdk} />;
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Props
|
|
108
|
+
|
|
109
|
+
| Prop | Type | Required | Description |
|
|
110
|
+
| ----------------- | ---------------------------------------------- | -------- | ---------------------------------------------------------------------- |
|
|
111
|
+
| `sdk` | `UiPath` | Yes | UiPath SDK instance. Changing it refetches the list and resets the UI. |
|
|
112
|
+
| `locale` | `Locale` | No | Passthrough to the inner chat. |
|
|
113
|
+
| `theme` | `"light" \| "dark" \| "light-hc" \| "dark-hc"` | No | Passthrough to the inner chat. |
|
|
114
|
+
| `readOnly` | `boolean` | No | Passthrough to the inner chat. |
|
|
115
|
+
| `overrideLabels` | `OverrideLabels` | No | Passthrough to the inner chat. |
|
|
116
|
+
| `onAgentSelected` | `(agent: AgentSummary) => void` | No | Fired when the user picks an agent (telemetry, routing, etc.). |
|
|
117
|
+
|
|
118
|
+
### Behavior
|
|
119
|
+
|
|
120
|
+
- Calls `ConversationalAgent(sdk).getAll()` on mount → renders one row per agent (`name` + `description`).
|
|
121
|
+
- Clicking an agent swaps to the chat view with that agent's `id` and `folderId`.
|
|
122
|
+
- "Back" clears the selection and returns to the list (no refetch).
|
|
123
|
+
- If the user's accessible tenants live behind your own auth/chrome, switch tenants by rebuilding the `UiPath` instance and passing the new one as `sdk` — the picker handles the rest.
|
|
124
|
+
|
|
72
125
|
## Features in Detail
|
|
73
126
|
|
|
74
127
|
### Streaming Responses
|