@elevenlabs/client 0.2.1 → 0.2.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.
@@ -40,7 +40,7 @@ export type BaseSessionConfig = {
40
40
  textOnly?: boolean;
41
41
  };
42
42
  };
43
- customLlmExtraBody?: any;
43
+ customLlmExtraBody?: unknown;
44
44
  dynamicVariables?: Record<string, string | number | boolean>;
45
45
  useWakeLock?: boolean;
46
46
  connectionDelay?: DelayConfig;
@@ -61,6 +61,11 @@ export declare abstract class BaseConnection {
61
61
  protected disconnectionDetails: DisconnectionDetails | null;
62
62
  protected onDisconnectCallback: OnDisconnectCallback | null;
63
63
  protected onMessageCallback: OnMessageCallback | null;
64
+ protected onDebug?: (info: unknown) => void;
65
+ constructor(config?: {
66
+ onDebug?: (info: unknown) => void;
67
+ });
68
+ protected debug(info: unknown): void;
64
69
  abstract close(): void;
65
70
  abstract sendMessage(message: OutgoingSocketEvent): void;
66
71
  onMessage(callback: OnMessageCallback): void;
@@ -1,6 +1,9 @@
1
1
  import { BaseConnection, type SessionConfig, type FormatConfig } from "./BaseConnection";
2
2
  import { type OutgoingSocketEvent } from "./events";
3
3
  import { Room } from "livekit-client";
4
+ export type ConnectionConfig = SessionConfig & {
5
+ onDebug?: (info: unknown) => void;
6
+ };
4
7
  export declare class WebRTCConnection extends BaseConnection {
5
8
  conversationId: string;
6
9
  readonly inputFormat: FormatConfig;
@@ -8,7 +11,7 @@ export declare class WebRTCConnection extends BaseConnection {
8
11
  private room;
9
12
  private isConnected;
10
13
  private constructor();
11
- static create(config: SessionConfig): Promise<WebRTCConnection>;
14
+ static create(config: ConnectionConfig): Promise<WebRTCConnection>;
12
15
  private setupRoomEventListeners;
13
16
  close(): void;
14
17
  sendMessage(message: OutgoingSocketEvent): Promise<void>;
@@ -1,4 +1,5 @@
1
1
  import type { Language } from "./connection";
2
+ import type { CONVERSATION_INITIATION_CLIENT_DATA_TYPE } from "./overrides";
2
3
  export type UserTranscriptionEvent = {
3
4
  type: "user_transcript";
4
5
  user_transcription_event: {
@@ -74,7 +75,7 @@ export type ClientToolResultEvent = {
74
75
  is_error: boolean;
75
76
  };
76
77
  export type InitiationClientDataEvent = {
77
- type: "conversation_initiation_client_data";
78
+ type: typeof CONVERSATION_INITIATION_CLIENT_DATA_TYPE;
78
79
  conversation_config_override?: {
79
80
  agent?: {
80
81
  prompt?: {
@@ -1,3 +1,4 @@
1
1
  import type { SessionConfig } from "./BaseConnection";
2
2
  import type { InitiationClientDataEvent } from "./events";
3
+ export declare const CONVERSATION_INITIATION_CLIENT_DATA_TYPE = "conversation_initiation_client_data";
3
4
  export declare function constructOverrides(config: SessionConfig): InitiationClientDataEvent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevenlabs/client",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "ElevenLabs JavaScript Client Library",
5
5
  "main": "./dist/lib.umd.js",
6
6
  "module": "./dist/lib.module.js",