@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/dist/core/AiAgent.d.ts
CHANGED
|
@@ -410,7 +410,7 @@ export interface AgentEvents {
|
|
|
410
410
|
*
|
|
411
411
|
* @example Direct flow (typical non–Contact Center agent)
|
|
412
412
|
* ```typescript
|
|
413
|
-
* import { AiAgent } from "@
|
|
413
|
+
* import { AiAgent } from "@egain/ai-agent-sdk";
|
|
414
414
|
*
|
|
415
415
|
* const agent = new AiAgent({
|
|
416
416
|
* id: "agent-id",
|
|
@@ -447,7 +447,7 @@ export interface AgentEvents {
|
|
|
447
447
|
*
|
|
448
448
|
* @example With context
|
|
449
449
|
* ```typescript
|
|
450
|
-
* import { AiAgent, createContextMessage } from "@
|
|
450
|
+
* import { AiAgent, createContextMessage } from "@egain/ai-agent-sdk";
|
|
451
451
|
*
|
|
452
452
|
* await agent.send(createContextMessage({
|
|
453
453
|
* context: { userId: "123", accountType: "premium" },
|
package/dist/core/AiAgent.js
CHANGED
|
@@ -57,7 +57,7 @@ const PIPELINE_PROFILES_CACHE_KEY_PREFIX = 'eg_profiles_';
|
|
|
57
57
|
*
|
|
58
58
|
* @example Direct flow (typical non–Contact Center agent)
|
|
59
59
|
* ```typescript
|
|
60
|
-
* import { AiAgent } from "@
|
|
60
|
+
* import { AiAgent } from "@egain/ai-agent-sdk";
|
|
61
61
|
*
|
|
62
62
|
* const agent = new AiAgent({
|
|
63
63
|
* id: "agent-id",
|
|
@@ -94,7 +94,7 @@ const PIPELINE_PROFILES_CACHE_KEY_PREFIX = 'eg_profiles_';
|
|
|
94
94
|
*
|
|
95
95
|
* @example With context
|
|
96
96
|
* ```typescript
|
|
97
|
-
* import { AiAgent, createContextMessage } from "@
|
|
97
|
+
* import { AiAgent, createContextMessage } from "@egain/ai-agent-sdk";
|
|
98
98
|
*
|
|
99
99
|
* await agent.send(createContextMessage({
|
|
100
100
|
* context: { userId: "123", accountType: "premium" },
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
* Implement your own cache adapter for custom storage backends (Redis, IndexedDB, etc.):
|
|
53
53
|
*
|
|
54
54
|
* ```typescript
|
|
55
|
-
* import { CacheAdapter, CacheEntry } from "@
|
|
55
|
+
* import { CacheAdapter, CacheEntry } from "@egain/ai-agent-sdk";
|
|
56
56
|
*
|
|
57
57
|
* class RedisCacheAdapter implements CacheAdapter {
|
|
58
58
|
* get<T>(key: string): CacheEntry<T> | null {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
* Implement your own cache adapter for custom storage backends (Redis, IndexedDB, etc.):
|
|
53
53
|
*
|
|
54
54
|
* ```typescript
|
|
55
|
-
* import { CacheAdapter, CacheEntry } from "@
|
|
55
|
+
* import { CacheAdapter, CacheEntry } from "@egain/ai-agent-sdk";
|
|
56
56
|
*
|
|
57
57
|
* class RedisCacheAdapter implements CacheAdapter {
|
|
58
58
|
* get<T>(key: string): CacheEntry<T> | null {
|
|
@@ -18,7 +18,7 @@ type EventMap = Record<string, any>;
|
|
|
18
18
|
*
|
|
19
19
|
* @example Creating a custom event emitter
|
|
20
20
|
* ```typescript
|
|
21
|
-
* import { EventEmitter } from "@
|
|
21
|
+
* import { EventEmitter } from "@egain/ai-agent-sdk";
|
|
22
22
|
*
|
|
23
23
|
* interface MyEvents {
|
|
24
24
|
* data: { value: number };
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* Extend `BaseMessageHandler` to create your own:
|
|
28
28
|
*
|
|
29
29
|
* ```typescript
|
|
30
|
-
* import { BaseMessageHandler, Message, MessageHandlerResult } from "@
|
|
30
|
+
* import { BaseMessageHandler, Message, MessageHandlerResult } from "@egain/ai-agent-sdk";
|
|
31
31
|
*
|
|
32
32
|
* class CustomHandler extends BaseMessageHandler {
|
|
33
33
|
* canHandle(message: Message): boolean {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* Extend `BaseMessageHandler` to create your own:
|
|
28
28
|
*
|
|
29
29
|
* ```typescript
|
|
30
|
-
* import { BaseMessageHandler, Message, MessageHandlerResult } from "@
|
|
30
|
+
* import { BaseMessageHandler, Message, MessageHandlerResult } from "@egain/ai-agent-sdk";
|
|
31
31
|
*
|
|
32
32
|
* class CustomHandler extends BaseMessageHandler {
|
|
33
33
|
* canHandle(message: Message): boolean {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* # @
|
|
2
|
+
* # @egain/ai-agent-sdk
|
|
3
3
|
*
|
|
4
4
|
* TypeScript-first SDK for eGain's AI Agent platform.
|
|
5
5
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* ## Quick Start
|
|
15
15
|
*
|
|
16
16
|
* ```typescript
|
|
17
|
-
* import { AiAgent } from "@
|
|
17
|
+
* import { AiAgent } from "@egain/ai-agent-sdk";
|
|
18
18
|
*
|
|
19
19
|
* const agent = new AiAgent({
|
|
20
20
|
* id: "your-agent-id",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* ```
|
|
34
34
|
*
|
|
35
35
|
* @packageDocumentation
|
|
36
|
-
* @module @
|
|
36
|
+
* @module @egain/ai-agent-sdk
|
|
37
37
|
*/
|
|
38
38
|
import './core/polyfills.js';
|
|
39
39
|
export { AiAgent } from './core/AiAgent.js';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* # @
|
|
2
|
+
* # @egain/ai-agent-sdk
|
|
3
3
|
*
|
|
4
4
|
* TypeScript-first SDK for eGain's AI Agent platform.
|
|
5
5
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* ## Quick Start
|
|
15
15
|
*
|
|
16
16
|
* ```typescript
|
|
17
|
-
* import { AiAgent } from "@
|
|
17
|
+
* import { AiAgent } from "@egain/ai-agent-sdk";
|
|
18
18
|
*
|
|
19
19
|
* const agent = new AiAgent({
|
|
20
20
|
* id: "your-agent-id",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* ```
|
|
34
34
|
*
|
|
35
35
|
* @packageDocumentation
|
|
36
|
-
* @module @
|
|
36
|
+
* @module @egain/ai-agent-sdk
|
|
37
37
|
*/
|
|
38
38
|
// Initialize polyfills for Node.js environment (WebSocket, fetch)
|
|
39
39
|
// This must be imported first to ensure polyfills are set up before any SDK code runs
|