@11labs/client 0.0.1 → 0.0.3-beta.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.
@@ -10,7 +10,7 @@ export type AgentResponseEvent = {
10
10
  agent_response: string;
11
11
  };
12
12
  };
13
- export type AudioEvent = {
13
+ export type AgentAudioEvent = {
14
14
  type: "audio";
15
15
  audio_event: {
16
16
  audio_base_64: string;
@@ -40,8 +40,46 @@ export type PingEvent = {
40
40
  type: "ping";
41
41
  ping_event: {
42
42
  event_id: number;
43
- average_ping_ms?: number;
43
+ ping_ms?: number;
44
44
  };
45
45
  };
46
- export type SocketEvent = UserTranscriptionEvent | AgentResponseEvent | AudioEvent | InterruptionEvent | InternalTentativeAgentResponseEvent | ConfigEvent | PingEvent;
47
- export declare function isValidSocketEvent(event: any): event is SocketEvent;
46
+ export type ClientToolCallEvent = {
47
+ type: "client_tool_call";
48
+ client_tool_call: {
49
+ tool_name: string;
50
+ tool_call_id: string;
51
+ parameters: any;
52
+ expects_response: boolean;
53
+ };
54
+ };
55
+ export type IncomingSocketEvent = UserTranscriptionEvent | AgentResponseEvent | AgentAudioEvent | InterruptionEvent | InternalTentativeAgentResponseEvent | ConfigEvent | PingEvent | ClientToolCallEvent;
56
+ export type PongEvent = {
57
+ type: "pong";
58
+ event_id: number;
59
+ };
60
+ export type UserAudioEvent = {
61
+ user_audio_chunk: string;
62
+ };
63
+ export type ClientToolResultEvent = {
64
+ tool_call_id: string;
65
+ response: any;
66
+ is_error: boolean;
67
+ };
68
+ export type ClientOverridesEvent = {
69
+ type: "conversation_initiation_client_data";
70
+ conversation_initiation_client_data: {
71
+ custom_llm_extra_body?: any;
72
+ agent?: {
73
+ prompt?: {
74
+ prompt?: string;
75
+ };
76
+ first_message?: string;
77
+ language?: "en";
78
+ };
79
+ tts?: {
80
+ voice_id?: string;
81
+ };
82
+ };
83
+ };
84
+ export type OutgoingSocketEvent = PongEvent | UserAudioEvent | ClientOverridesEvent | ClientToolResultEvent;
85
+ export declare function isValidSocketEvent(event: any): event is IncomingSocketEvent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@11labs/client",
3
- "version": "0.0.1",
3
+ "version": "0.0.3-beta.1",
4
4
  "description": "ElevenLabs JavaScript Client Library",
5
5
  "main": "./dist/lib.umd.js",
6
6
  "module": "./dist/lib.module.js",