@telnyx/ai-chat-widget 2.0.2
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 +34 -0
- package/dist/index.cjs +2339 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +165 -0
- package/dist/index.mjs +47981 -0
- package/dist/index.mjs.map +1 -0
- package/dist/index.umd.js +2339 -0
- package/dist/index.umd.js.map +1 -0
- package/package.json +99 -0
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# AI Widget Setup (local)
|
|
2
|
+
|
|
3
|
+
This is a simple guide to setup the AI Widget in your project.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
1. Node.js
|
|
8
|
+
2. pnpm
|
|
9
|
+
|
|
10
|
+
### Step 1: Create a new flow at flow.telnyx.com
|
|
11
|
+
|
|
12
|
+
1. Go to [flow.telnyx.com](https://flow.telnyx.com)
|
|
13
|
+
2. Create a new flow
|
|
14
|
+
|
|
15
|
+
#### Step 1.1: Setup the flow trigger and response
|
|
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`
|