@telnyx/ai-chat-widget 4.2.0 → 5.0.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 +10 -26
- package/dist/index.cjs +61 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +6 -15
- package/dist/index.mjs +7750 -8338
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +61 -67
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,34 +1,18 @@
|
|
|
1
1
|
# AI Widget Setup (local)
|
|
2
2
|
|
|
3
|
-
This is a simple guide to
|
|
3
|
+
This is a simple guide to run the AI Widget's demo app locally.
|
|
4
4
|
|
|
5
5
|
## Prerequisites
|
|
6
6
|
|
|
7
|
-
1. Node.js
|
|
8
|
-
2.
|
|
7
|
+
1. Node.js (see `.nvmrc` at the repo root)
|
|
8
|
+
2. npm
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## Setup
|
|
11
11
|
|
|
12
|
-
1.
|
|
13
|
-
2.
|
|
12
|
+
1. From the repo root, install dependencies: `npm install`
|
|
13
|
+
2. Set the widget's `chatAPIUrl` prop to your AIDA support-agent endpoint —
|
|
14
|
+
see the root `README.md` for the full prop reference.
|
|
15
|
+
3. Build the widget so the demo can resolve it: `npm run build -w packages/ai-chat-widget`
|
|
16
|
+
4. Run the demo: `npm run dev --workspace=demo`
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
1. Make the request trigger a `GET` request
|
|
18
|
-
2. Make the arguments `question`, `sessionId`, and `userId` as query parameters
|
|
19
|
-
3. Make the response a `stream` response.
|
|
20
|
-
|
|
21
|
-
### Step 2: Setup the flow URL in local ai-widget's code
|
|
22
|
-
|
|
23
|
-
1. Search for `flowBaseUrl` in the code
|
|
24
|
-
2. Replace the value with the flow URL
|
|
25
|
-
3. Replace the URL `api.telnyx.com/v2` with `localhost:5173` or the URL where the ai-widget is hosted
|
|
26
|
-
|
|
27
|
-
### Step 3: Setup the vite proxy with Bearer token
|
|
28
|
-
|
|
29
|
-
1. Replace the Bearer token with the token from the Telnyx portal in the `vite.config.js` file.
|
|
30
|
-
|
|
31
|
-
### Step 4: Run the project
|
|
32
|
-
|
|
33
|
-
1. Install the dependencies using `pnpm install`
|
|
34
|
-
2. Run the project using `pnpm run dev`
|
|
18
|
+
See `apps/demo/.env.example` for the environment variables the demo app reads.
|