@egain/ai-agent-sdk 0.1.0 → 0.1.1
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 +11 -17
- package/dist/browser.js +1 -1
- package/dist/core/AiAgent.d.ts +2 -2
- package/dist/core/AiAgent.js +2 -2
- package/dist/core/api/CacheAdapter.d.ts +1 -1
- package/dist/core/api/CacheAdapter.js +1 -1
- package/dist/core/events/EventEmitter.d.ts +1 -1
- package/dist/core/events/EventEmitter.js +1 -1
- package/dist/core/message/BaseMessageHandler.d.ts +1 -1
- package/dist/core/message/BaseMessageHandler.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @egain/ai-agent-sdk
|
|
2
2
|
|
|
3
3
|
TypeScript-first SDK for eGain's AI Agent platform with WebSocket communication, automatic reconnection, and comprehensive message handling.
|
|
4
4
|
|
|
5
5
|
**Current release:** v0.0.14
|
|
6
6
|
|
|
7
|
-
[](https://www.npmjs.com/package/@egain/ai-agent-sdk)
|
|
8
8
|
[](https://www.typescriptlang.org/)
|
|
9
9
|
[](https://opensource.org/licenses/MIT)
|
|
10
10
|
|
|
@@ -24,19 +24,13 @@ TypeScript-first SDK for eGain's AI Agent platform with WebSocket communication,
|
|
|
24
24
|
## Installation
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
-
npm install @
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
**GitHub Packages Configuration** (`.npmrc`):
|
|
31
|
-
```ini
|
|
32
|
-
@eGain:registry=https://npm.pkg.github.com/
|
|
33
|
-
//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN
|
|
27
|
+
npm install @egain/ai-agent-sdk
|
|
34
28
|
```
|
|
35
29
|
|
|
36
30
|
## Quick Start
|
|
37
31
|
|
|
38
32
|
```typescript
|
|
39
|
-
import { AiAgent } from "@
|
|
33
|
+
import { AiAgent } from "@egain/ai-agent-sdk";
|
|
40
34
|
|
|
41
35
|
const agent = new AiAgent({
|
|
42
36
|
id: "your-agent-id",
|
|
@@ -62,7 +56,7 @@ await agent.send("Hello!");
|
|
|
62
56
|
For agents that use the portal / profile pipeline, listen for selection events and call `connect()` after `initialized`:
|
|
63
57
|
|
|
64
58
|
```typescript
|
|
65
|
-
import { AiAgent } from "@
|
|
59
|
+
import { AiAgent } from "@egain/ai-agent-sdk";
|
|
66
60
|
|
|
67
61
|
const agent = new AiAgent({
|
|
68
62
|
id: "your-agent-id",
|
|
@@ -154,7 +148,7 @@ import {
|
|
|
154
148
|
createContextMessage,
|
|
155
149
|
createFeedbackMessage,
|
|
156
150
|
createEscalationMessage
|
|
157
|
-
} from "@
|
|
151
|
+
} from "@egain/ai-agent-sdk";
|
|
158
152
|
|
|
159
153
|
// Send context (auto-cached for reconnect)
|
|
160
154
|
await agent.send(createContextMessage({
|
|
@@ -182,7 +176,7 @@ npm install ws
|
|
|
182
176
|
The SDK automatically loads the `ws` package when running in Node.js. Just import and use:
|
|
183
177
|
|
|
184
178
|
```typescript
|
|
185
|
-
import { AiAgent } from "@
|
|
179
|
+
import { AiAgent } from "@egain/ai-agent-sdk";
|
|
186
180
|
|
|
187
181
|
const agent = new AiAgent({
|
|
188
182
|
id: "your-agent-id",
|
|
@@ -198,14 +192,14 @@ If the automatic polyfill doesn't work in your environment, you can set it up ma
|
|
|
198
192
|
import WebSocket from "ws";
|
|
199
193
|
(global as any).WebSocket = WebSocket;
|
|
200
194
|
|
|
201
|
-
import { AiAgent } from "@
|
|
195
|
+
import { AiAgent } from "@egain/ai-agent-sdk";
|
|
202
196
|
// ... rest of code
|
|
203
197
|
```
|
|
204
198
|
|
|
205
199
|
## Browser (UMD)
|
|
206
200
|
|
|
207
201
|
```html
|
|
208
|
-
<script src="https://unpkg.com/@
|
|
202
|
+
<script src="https://unpkg.com/@egain/ai-agent-sdk/dist/browser.js"></script>
|
|
209
203
|
<script>
|
|
210
204
|
const agent = new eGain.AiAgent({ ... });
|
|
211
205
|
</script>
|
|
@@ -230,7 +224,7 @@ npm run docs:build # Build docs
|
|
|
230
224
|
|
|
231
225
|
## Examples
|
|
232
226
|
|
|
233
|
-
See [usage-examples](https://github.com/
|
|
227
|
+
See [usage-examples](https://github.com/egain/ai-agent-sdk/tree/master/ai-agent-sdk/usage-examples) in this repository for complete examples:
|
|
234
228
|
- **Basic Usage** - Simple getting started
|
|
235
229
|
- **Browser Test** - Browser integration with UI
|
|
236
230
|
- **Server Test** - Node.js implementation
|
|
@@ -292,4 +286,4 @@ MIT
|
|
|
292
286
|
|
|
293
287
|
## Support
|
|
294
288
|
|
|
295
|
-
For issues and questions, please open an issue on [GitHub](https://github.com/
|
|
289
|
+
For issues and questions, please open an issue on [GitHub](https://github.com/egain/ai-agent-sdk/issues).
|