@vapi-ai/web 2.1.1 → 2.1.4

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 CHANGED
@@ -37,7 +37,7 @@ vapi.start({
37
37
  content: "You are an assistant.",
38
38
  },
39
39
  ],
40
- }
40
+ },
41
41
  voice: {
42
42
  provider: "11labs",
43
43
  voiceId: "burt",
@@ -147,7 +147,7 @@ These events allow you to react to changes in the state of the call or speech.
147
147
  ```
148
148
  MIT License
149
149
 
150
- Copyright (c) 2023 Vapi Labs Inc.
150
+ Copyright (c) 2024 Vapi Labs Inc.
151
151
 
152
152
  Permission is hereby granted, free of charge, to any person obtaining a copy
153
153
  of this software and associated documentation files (the "Software"), to deal
package/api.ts CHANGED
@@ -1768,6 +1768,10 @@ export interface ElevenLabsVoice {
1768
1768
  | 'eleven_turbo_v2'
1769
1769
  | 'eleven_turbo_v2_5'
1770
1770
  | 'eleven_monolingual_v1';
1771
+ /**
1772
+ * This is the language (ISO 639-1) that is enforced for the model. Currently only Turbo v2.5 supports language enforcement. For other models, an error will be returned if language code is provided.
1773
+ */
1774
+ language?: string;
1771
1775
  }
1772
1776
 
1773
1777
  export interface LMNTVoice {
@@ -10555,4 +10559,4 @@ export class Api<
10555
10559
  ...params,
10556
10560
  }),
10557
10561
  };
10558
- }
10562
+ }
package/dist/api.d.ts CHANGED
@@ -1192,6 +1192,10 @@ export interface ElevenLabsVoice {
1192
1192
  * @example "eleven_turbo_v2_5"
1193
1193
  */
1194
1194
  model?: 'eleven_multilingual_v2' | 'eleven_turbo_v2' | 'eleven_turbo_v2_5' | 'eleven_monolingual_v1';
1195
+ /**
1196
+ * This is the language (ISO 639-1) that is enforced for the model. Currently only Turbo v2.5 supports language enforcement. For other models, an error will be returned if language code is provided.
1197
+ */
1198
+ language?: string;
1195
1199
  }
1196
1200
  export interface LMNTVoice {
1197
1201
  /**
package/dist/vapi.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { Call, CreateAssistantDTO, CreateSquadDTO, AssistantOverrides } from './api';
3
- import { DailyAdvancedConfig, DailyCall } from '@daily-co/daily-js';
3
+ import { DailyAdvancedConfig, DailyCall, DailyFactoryOptions } from '@daily-co/daily-js';
4
4
  import type { ChatCompletionMessageParam } from 'openai/resources';
5
5
  import EventEmitter from 'events';
6
6
  export interface AddMessageMessage {
@@ -40,7 +40,8 @@ export default class Vapi extends VapiEventEmitter {
40
40
  private call;
41
41
  private speakingTimeout;
42
42
  private dailyCallConfig;
43
- constructor(apiToken: string, apiBaseUrl?: string, dailyCallConfig?: Pick<DailyAdvancedConfig, 'avoidEval'>);
43
+ private dailyCallObject;
44
+ constructor(apiToken: string, apiBaseUrl?: string, dailyCallConfig?: Pick<DailyAdvancedConfig, 'avoidEval' | 'alwaysIncludeMicInPermissionPrompt'>, dailyCallObject?: Pick<DailyFactoryOptions, 'audioSource'>);
44
45
  private cleanup;
45
46
  start(assistant?: CreateAssistantDTO | string, assistantOverrides?: AssistantOverrides, squad?: CreateSquadDTO | string): Promise<Call | null>;
46
47
  private onAppMessage;
package/dist/vapi.js CHANGED
@@ -61,11 +61,13 @@ class Vapi extends VapiEventEmitter {
61
61
  call = null;
62
62
  speakingTimeout = null;
63
63
  dailyCallConfig = {};
64
- constructor(apiToken, apiBaseUrl, dailyCallConfig) {
64
+ dailyCallObject = {};
65
+ constructor(apiToken, apiBaseUrl, dailyCallConfig, dailyCallObject) {
65
66
  super();
66
67
  client_1.client.baseUrl = apiBaseUrl ?? 'https://api.vapi.ai';
67
68
  client_1.client.setSecurityData(apiToken);
68
69
  this.dailyCallConfig = dailyCallConfig ?? {};
70
+ this.dailyCallObject = dailyCallObject ?? {};
69
71
  }
70
72
  cleanup() {
71
73
  this.started = false;
@@ -94,7 +96,7 @@ class Vapi extends VapiEventEmitter {
94
96
  }
95
97
  const isVideoRecordingEnabled = webCall?.artifactPlan?.videoRecordingEnabled ?? false;
96
98
  this.call = daily_js_1.default.createCallObject({
97
- audioSource: true,
99
+ audioSource: this.dailyCallObject.audioSource ?? true,
98
100
  videoSource: isVideoRecordingEnabled,
99
101
  dailyConfig: this.dailyCallConfig
100
102
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vapi-ai/web",
3
- "version": "2.1.1",
3
+ "version": "2.1.4",
4
4
  "description": "",
5
5
  "main": "dist/vapi.js",
6
6
  "types": "dist/vapi.d.ts",
package/vapi.ts CHANGED
@@ -5,6 +5,7 @@ import DailyIframe, {
5
5
  DailyEventObjectAppMessage,
6
6
  DailyEventObjectParticipant,
7
7
  DailyEventObjectRemoteParticipantsAudioLevel,
8
+ DailyFactoryOptions,
8
9
  } from '@daily-co/daily-js';
9
10
 
10
11
  import type { ChatCompletionMessageParam } from 'openai/resources';
@@ -110,12 +111,19 @@ export default class Vapi extends VapiEventEmitter {
110
111
  private call: DailyCall | null = null;
111
112
  private speakingTimeout: NodeJS.Timeout | null = null;
112
113
  private dailyCallConfig: DailyAdvancedConfig = {}
113
-
114
- constructor(apiToken: string, apiBaseUrl?: string, dailyCallConfig?: Pick<DailyAdvancedConfig, 'avoidEval'>) {
114
+ private dailyCallObject: DailyFactoryOptions = {}
115
+
116
+ constructor(
117
+ apiToken: string,
118
+ apiBaseUrl?: string,
119
+ dailyCallConfig?: Pick<DailyAdvancedConfig, 'avoidEval' | 'alwaysIncludeMicInPermissionPrompt'>,
120
+ dailyCallObject?: Pick<DailyFactoryOptions, 'audioSource'>
121
+ ) {
115
122
  super();
116
123
  client.baseUrl = apiBaseUrl ?? 'https://api.vapi.ai';
117
124
  client.setSecurityData(apiToken);
118
125
  this.dailyCallConfig = dailyCallConfig ?? {}
126
+ this.dailyCallObject = dailyCallObject ?? {}
119
127
  }
120
128
 
121
129
  private cleanup() {
@@ -156,7 +164,7 @@ export default class Vapi extends VapiEventEmitter {
156
164
  const isVideoRecordingEnabled = webCall?.artifactPlan?.videoRecordingEnabled ?? false;
157
165
 
158
166
  this.call = DailyIframe.createCallObject({
159
- audioSource: true,
167
+ audioSource: this.dailyCallObject.audioSource ?? true,
160
168
  videoSource: isVideoRecordingEnabled,
161
169
  dailyConfig: this.dailyCallConfig
162
170
  });