@vapi-ai/web 1.0.167 → 1.0.169

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/api.ts CHANGED
@@ -67,7 +67,14 @@ export interface CreateAssistantDTO {
67
67
  * Basic Voices: davis, jenny, aria, steffan, sara, and jason.
68
68
  */
69
69
  voice?:
70
+ | "davis"
71
+ | "jenny"
72
+ | "aria"
73
+ | "steffan"
74
+ | "sara"
75
+ | "jason"
70
76
  | "burt"
77
+ | "andrea"
71
78
  | "phillip"
72
79
  | "steve"
73
80
  | "joseph"
@@ -77,13 +84,7 @@ export interface CreateAssistantDTO {
77
84
  | "drew"
78
85
  | "paul"
79
86
  | "mrb"
80
- | "matilda"
81
- | "davis"
82
- | "jenny"
83
- | "aria"
84
- | "steffan"
85
- | "sara"
86
- | "jason";
87
+ | "matilda";
87
88
  /** This is the assistant’s name, just for your own reference. */
88
89
  name?: string;
89
90
  /** This is the system prompt, which sets the objective and background before the call. */
@@ -94,8 +95,12 @@ export interface CreateAssistantDTO {
94
95
  callbackUrl?: string;
95
96
  /** This is the number the assistant will transfer to if it runs into any issues. */
96
97
  forwardingPhoneNumber?: string;
97
- /** Whether the AI should talk first when the call is connected. */
98
- startTalking?: boolean;
98
+ /** This is the first message that the assistant will say. If unspecified, it will wait for the user to speak. */
99
+ firstMessage?: string;
100
+ /** Whether the call should be recorded. */
101
+ recordingEnabled?: boolean;
102
+ /** Whether to leave a voicemail if a phone call isn't picked up. */
103
+ voicemailEnabled?: boolean;
99
104
  }
100
105
 
101
106
  export interface CreateOutboundCallDto {
@@ -132,7 +137,14 @@ export interface Assistant {
132
137
  * Basic Voices: davis, jenny, aria, steffan, sara, and jason.
133
138
  */
134
139
  voice?:
140
+ | "davis"
141
+ | "jenny"
142
+ | "aria"
143
+ | "steffan"
144
+ | "sara"
145
+ | "jason"
135
146
  | "burt"
147
+ | "andrea"
136
148
  | "phillip"
137
149
  | "steve"
138
150
  | "joseph"
@@ -142,13 +154,7 @@ export interface Assistant {
142
154
  | "drew"
143
155
  | "paul"
144
156
  | "mrb"
145
- | "matilda"
146
- | "davis"
147
- | "jenny"
148
- | "aria"
149
- | "steffan"
150
- | "sara"
151
- | "jason";
157
+ | "matilda";
152
158
  /** Unique identifier for the assistant. */
153
159
  id: string;
154
160
  /** Unique identifier for the organization that this assistant belongs to. */
@@ -167,8 +173,12 @@ export interface Assistant {
167
173
  callbackUrl?: string;
168
174
  /** This is the number the assistant will transfer to if it runs into any issues. */
169
175
  forwardingPhoneNumber?: string;
170
- /** Whether the AI should talk first when the call is connected. */
171
- startTalking?: boolean;
176
+ /** This is the first message that the assistant will say. If unspecified, it will wait for the user to speak. */
177
+ firstMessage?: string;
178
+ /** Whether the call should be recorded. */
179
+ recordingEnabled?: boolean;
180
+ /** Whether to leave a voicemail if a phone call isn't picked up. */
181
+ voicemailEnabled?: boolean;
172
182
  }
173
183
 
174
184
  export interface UpdateAssistantDTO {
@@ -182,7 +192,14 @@ export interface UpdateAssistantDTO {
182
192
  * Basic Voices: davis, jenny, aria, steffan, sara, and jason.
183
193
  */
184
194
  voice?:
195
+ | "davis"
196
+ | "jenny"
197
+ | "aria"
198
+ | "steffan"
199
+ | "sara"
200
+ | "jason"
185
201
  | "burt"
202
+ | "andrea"
186
203
  | "phillip"
187
204
  | "steve"
188
205
  | "joseph"
@@ -192,13 +209,7 @@ export interface UpdateAssistantDTO {
192
209
  | "drew"
193
210
  | "paul"
194
211
  | "mrb"
195
- | "matilda"
196
- | "davis"
197
- | "jenny"
198
- | "aria"
199
- | "steffan"
200
- | "sara"
201
- | "jason";
212
+ | "matilda";
202
213
  /** This is the assistant’s name, just for your own reference. */
203
214
  name?: string;
204
215
  /** This is the system prompt, which sets the objective and background before the call. */
@@ -209,8 +220,12 @@ export interface UpdateAssistantDTO {
209
220
  callbackUrl?: string;
210
221
  /** This is the number the assistant will transfer to if it runs into any issues. */
211
222
  forwardingPhoneNumber?: string;
212
- /** Whether the AI should talk first when the call is connected. */
213
- startTalking?: boolean;
223
+ /** This is the first message that the assistant will say. If unspecified, it will wait for the user to speak. */
224
+ firstMessage?: string;
225
+ /** Whether the call should be recorded. */
226
+ recordingEnabled?: boolean;
227
+ /** Whether to leave a voicemail if a phone call isn't picked up. */
228
+ voicemailEnabled?: boolean;
214
229
  }
215
230
 
216
231
  export interface BuyPhoneNumberDto {
package/dist/api.d.ts CHANGED
@@ -51,7 +51,7 @@ export interface CreateAssistantDTO {
51
51
  *
52
52
  * Basic Voices: davis, jenny, aria, steffan, sara, and jason.
53
53
  */
54
- voice?: "burt" | "phillip" | "steve" | "joseph" | "myra" | "paula" | "ryan" | "drew" | "paul" | "mrb" | "matilda" | "davis" | "jenny" | "aria" | "steffan" | "sara" | "jason";
54
+ voice?: "davis" | "jenny" | "aria" | "steffan" | "sara" | "jason" | "burt" | "andrea" | "phillip" | "steve" | "joseph" | "myra" | "paula" | "ryan" | "drew" | "paul" | "mrb" | "matilda";
55
55
  /** This is the assistant’s name, just for your own reference. */
56
56
  name?: string;
57
57
  /** This is the system prompt, which sets the objective and background before the call. */
@@ -62,8 +62,12 @@ export interface CreateAssistantDTO {
62
62
  callbackUrl?: string;
63
63
  /** This is the number the assistant will transfer to if it runs into any issues. */
64
64
  forwardingPhoneNumber?: string;
65
- /** Whether the AI should talk first when the call is connected. */
66
- startTalking?: boolean;
65
+ /** This is the first message that the assistant will say. If unspecified, it will wait for the user to speak. */
66
+ firstMessage?: string;
67
+ /** Whether the call should be recorded. */
68
+ recordingEnabled?: boolean;
69
+ /** Whether to leave a voicemail if a phone call isn't picked up. */
70
+ voicemailEnabled?: boolean;
67
71
  }
68
72
  export interface CreateOutboundCallDto {
69
73
  /** This is the assistant that will be used for the call. To create a transient assistant, use `assistant` instead. */
@@ -95,7 +99,7 @@ export interface Assistant {
95
99
  *
96
100
  * Basic Voices: davis, jenny, aria, steffan, sara, and jason.
97
101
  */
98
- voice?: "burt" | "phillip" | "steve" | "joseph" | "myra" | "paula" | "ryan" | "drew" | "paul" | "mrb" | "matilda" | "davis" | "jenny" | "aria" | "steffan" | "sara" | "jason";
102
+ voice?: "davis" | "jenny" | "aria" | "steffan" | "sara" | "jason" | "burt" | "andrea" | "phillip" | "steve" | "joseph" | "myra" | "paula" | "ryan" | "drew" | "paul" | "mrb" | "matilda";
99
103
  /** Unique identifier for the assistant. */
100
104
  id: string;
101
105
  /** Unique identifier for the organization that this assistant belongs to. */
@@ -114,8 +118,12 @@ export interface Assistant {
114
118
  callbackUrl?: string;
115
119
  /** This is the number the assistant will transfer to if it runs into any issues. */
116
120
  forwardingPhoneNumber?: string;
117
- /** Whether the AI should talk first when the call is connected. */
118
- startTalking?: boolean;
121
+ /** This is the first message that the assistant will say. If unspecified, it will wait for the user to speak. */
122
+ firstMessage?: string;
123
+ /** Whether the call should be recorded. */
124
+ recordingEnabled?: boolean;
125
+ /** Whether to leave a voicemail if a phone call isn't picked up. */
126
+ voicemailEnabled?: boolean;
119
127
  }
120
128
  export interface UpdateAssistantDTO {
121
129
  /** This is the OpenAI model that will be used. */
@@ -127,7 +135,7 @@ export interface UpdateAssistantDTO {
127
135
  *
128
136
  * Basic Voices: davis, jenny, aria, steffan, sara, and jason.
129
137
  */
130
- voice?: "burt" | "phillip" | "steve" | "joseph" | "myra" | "paula" | "ryan" | "drew" | "paul" | "mrb" | "matilda" | "davis" | "jenny" | "aria" | "steffan" | "sara" | "jason";
138
+ voice?: "davis" | "jenny" | "aria" | "steffan" | "sara" | "jason" | "burt" | "andrea" | "phillip" | "steve" | "joseph" | "myra" | "paula" | "ryan" | "drew" | "paul" | "mrb" | "matilda";
131
139
  /** This is the assistant’s name, just for your own reference. */
132
140
  name?: string;
133
141
  /** This is the system prompt, which sets the objective and background before the call. */
@@ -138,8 +146,12 @@ export interface UpdateAssistantDTO {
138
146
  callbackUrl?: string;
139
147
  /** This is the number the assistant will transfer to if it runs into any issues. */
140
148
  forwardingPhoneNumber?: string;
141
- /** Whether the AI should talk first when the call is connected. */
142
- startTalking?: boolean;
149
+ /** This is the first message that the assistant will say. If unspecified, it will wait for the user to speak. */
150
+ firstMessage?: string;
151
+ /** Whether the call should be recorded. */
152
+ recordingEnabled?: boolean;
153
+ /** Whether to leave a voicemail if a phone call isn't picked up. */
154
+ voicemailEnabled?: boolean;
143
155
  }
144
156
  export interface BuyPhoneNumberDto {
145
157
  /** This is the area code of the phone number to purchase. */
package/dist/vapi.js CHANGED
@@ -1,4 +1,13 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
13
  };
@@ -24,7 +33,7 @@ class Vapi extends events_1.default {
24
33
  assistant: typeof assistant === "string" ? undefined : assistant,
25
34
  assistantId: typeof assistant === "string" ? assistant : undefined,
26
35
  })
27
- .then(({ data }) => {
36
+ .then(({ data }) => __awaiter(this, void 0, void 0, function* () {
28
37
  var _a;
29
38
  const { url } = data;
30
39
  this.call = daily_js_1.default.createFrame({
@@ -32,14 +41,12 @@ class Vapi extends events_1.default {
32
41
  videoSource: false,
33
42
  });
34
43
  (_a = this.call.iframe()) === null || _a === void 0 ? void 0 : _a.style.setProperty("display", "none");
35
- this.call.join({ url });
36
- this.call.on("active-speaker-change", (e) => e && this.handleSpeakerChange(e));
37
- console.log("adddding");
38
- this.call.startRemoteParticipantsAudioLevelObserver();
44
+ yield this.call.join({ url });
45
+ this.call.startRemoteParticipantsAudioLevelObserver(500);
39
46
  this.call.on("remote-participants-audio-level", (e) => {
40
47
  console.log(e);
41
48
  });
42
- })
49
+ }))
43
50
  .catch((error) => {
44
51
  console.error(error);
45
52
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vapi-ai/web",
3
- "version": "1.0.167",
3
+ "version": "1.0.169",
4
4
  "description": "",
5
5
  "main": "dist/vapi.js",
6
6
  "types": "dist/vapi.d.ts",
package/vapi.ts CHANGED
@@ -29,7 +29,7 @@ export default class Vapi extends EventEmitter {
29
29
  assistant: typeof assistant === "string" ? undefined : assistant,
30
30
  assistantId: typeof assistant === "string" ? assistant : undefined,
31
31
  })
32
- .then(({ data }) => {
32
+ .then(async ({ data }) => {
33
33
  const { url } = data;
34
34
 
35
35
  this.call = DailyIframe.createFrame({
@@ -37,15 +37,9 @@ export default class Vapi extends EventEmitter {
37
37
  videoSource: false,
38
38
  });
39
39
  this.call.iframe()?.style.setProperty("display", "none");
40
- this.call.join({ url });
40
+ await this.call.join({ url });
41
41
 
42
- this.call.on(
43
- "active-speaker-change",
44
- (e) => e && this.handleSpeakerChange(e)
45
- );
46
-
47
- console.log("adddding");
48
- this.call.startRemoteParticipantsAudioLevelObserver();
42
+ this.call.startRemoteParticipantsAudioLevelObserver(500);
49
43
  this.call.on("remote-participants-audio-level", (e) => {
50
44
  console.log(e);
51
45
  });