@layercode/js-sdk 1.0.27 → 2.0.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/dist/types/index.d.ts
CHANGED
|
@@ -11,16 +11,16 @@ interface ILayercodeClient {
|
|
|
11
11
|
readonly status: string;
|
|
12
12
|
readonly userAudioAmplitude: number;
|
|
13
13
|
readonly agentAudioAmplitude: number;
|
|
14
|
-
readonly
|
|
14
|
+
readonly conversationId: string | null;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Interface for LayercodeClient constructor options
|
|
18
18
|
*/
|
|
19
19
|
interface LayercodeClientOptions {
|
|
20
|
-
/** The ID of the Layercode
|
|
21
|
-
|
|
22
|
-
/** The ID of the
|
|
23
|
-
|
|
20
|
+
/** The ID of the Layercode agent to connect to */
|
|
21
|
+
agentId: string;
|
|
22
|
+
/** The ID of the conversation to connect to */
|
|
23
|
+
conversationId?: string | null;
|
|
24
24
|
/** The endpoint URL for the audio agent API */
|
|
25
25
|
authorizeSessionEndpoint: string;
|
|
26
26
|
/** Metadata to send with webhooks */
|
|
@@ -28,8 +28,8 @@ interface LayercodeClientOptions {
|
|
|
28
28
|
/** Milliseconds before resuming assistant audio after temporary pause due to user interruption (which was actually a false interruption) */
|
|
29
29
|
vadResumeDelay?: number;
|
|
30
30
|
/** Callback when connection is established */
|
|
31
|
-
onConnect?: ({
|
|
32
|
-
|
|
31
|
+
onConnect?: ({ conversationId }: {
|
|
32
|
+
conversationId: string | null;
|
|
33
33
|
}) => void;
|
|
34
34
|
/** Callback when connection is closed */
|
|
35
35
|
onDisconnect?: () => void;
|
|
@@ -50,7 +50,7 @@ interface LayercodeClientOptions {
|
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* @class LayercodeClient
|
|
53
|
-
* @classdesc Core client for Layercode audio
|
|
53
|
+
* @classdesc Core client for Layercode audio agent that manages audio recording, WebSocket communication, and speech processing.
|
|
54
54
|
*/
|
|
55
55
|
declare class LayercodeClient implements ILayercodeClient {
|
|
56
56
|
private options;
|
|
@@ -73,7 +73,7 @@ declare class LayercodeClient implements ILayercodeClient {
|
|
|
73
73
|
status: string;
|
|
74
74
|
userAudioAmplitude: number;
|
|
75
75
|
agentAudioAmplitude: number;
|
|
76
|
-
|
|
76
|
+
conversationId: string | null;
|
|
77
77
|
/**
|
|
78
78
|
* Creates an instance of LayercodeClient.
|
|
79
79
|
* @param {Object} options - Configuration options
|
|
@@ -112,7 +112,7 @@ declare class LayercodeClient implements ILayercodeClient {
|
|
|
112
112
|
*/
|
|
113
113
|
private _setupAmplitudeMonitoring;
|
|
114
114
|
/**
|
|
115
|
-
* Connects to the Layercode
|
|
115
|
+
* Connects to the Layercode agent and starts the audio conversation
|
|
116
116
|
* @async
|
|
117
117
|
* @returns {Promise<void>}
|
|
118
118
|
*/
|
package/package.json
CHANGED