@vapi-ai/web 1.0.267 → 1.1.3
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 +24 -8
- package/api.ts +1292 -124
- package/dist/api.d.ts +864 -105
- package/dist/api.js +79 -3
- package/dist/vapi.d.ts +2 -2
- package/dist/vapi.js +2 -1
- package/package.json +6 -6
- package/update.sh +1 -1
- package/vapi.ts +6 -2
- package/dist/example.d.ts +0 -1
- package/dist/example.js +0 -26
package/dist/api.js
CHANGED
|
@@ -10,7 +10,30 @@
|
|
|
10
10
|
* ---------------------------------------------------------------
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.Api = exports.HttpClient = exports.ContentType = void 0;
|
|
13
|
+
exports.Api = exports.HttpClient = exports.ContentType = exports.CreateWebCallDTO = void 0;
|
|
14
|
+
class CreateWebCallDTO {
|
|
15
|
+
/**
|
|
16
|
+
* This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead.
|
|
17
|
+
*/
|
|
18
|
+
assistantId;
|
|
19
|
+
/**
|
|
20
|
+
* Overrides for the assistant's settings and template variables.
|
|
21
|
+
*/
|
|
22
|
+
assistantOverrides;
|
|
23
|
+
/**
|
|
24
|
+
* This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead.
|
|
25
|
+
*/
|
|
26
|
+
assistant;
|
|
27
|
+
/**
|
|
28
|
+
* This will expose SIP URI you can use to connect to the call. Disabled by default.
|
|
29
|
+
*/
|
|
30
|
+
sipEnabled;
|
|
31
|
+
/**
|
|
32
|
+
* This is the metadata associated with the call.
|
|
33
|
+
*/
|
|
34
|
+
metadata;
|
|
35
|
+
}
|
|
36
|
+
exports.CreateWebCallDTO = CreateWebCallDTO;
|
|
14
37
|
var ContentType;
|
|
15
38
|
(function (ContentType) {
|
|
16
39
|
ContentType["Json"] = "application/json";
|
|
@@ -19,7 +42,7 @@ var ContentType;
|
|
|
19
42
|
ContentType["Text"] = "text/plain";
|
|
20
43
|
})(ContentType || (exports.ContentType = ContentType = {}));
|
|
21
44
|
class HttpClient {
|
|
22
|
-
baseUrl = 'https://
|
|
45
|
+
baseUrl = 'https://api.vapi.ai';
|
|
23
46
|
securityData = null;
|
|
24
47
|
securityWorker;
|
|
25
48
|
abortControllers = new Map();
|
|
@@ -157,7 +180,7 @@ exports.HttpClient = HttpClient;
|
|
|
157
180
|
/**
|
|
158
181
|
* @title Vapi API
|
|
159
182
|
* @version 1.0
|
|
160
|
-
* @baseUrl https://
|
|
183
|
+
* @baseUrl https://api.vapi.ai
|
|
161
184
|
* @contact
|
|
162
185
|
*
|
|
163
186
|
* API for building voice assistants
|
|
@@ -568,5 +591,58 @@ class Api extends HttpClient {
|
|
|
568
591
|
...params,
|
|
569
592
|
}),
|
|
570
593
|
};
|
|
594
|
+
voiceLibrary = {
|
|
595
|
+
/**
|
|
596
|
+
* No description
|
|
597
|
+
*
|
|
598
|
+
* @tags Voice Library
|
|
599
|
+
* @name VoiceLibraryControllerVoiceGetByProvider
|
|
600
|
+
* @summary Get voices in Voice Library by Providers
|
|
601
|
+
* @request GET:/voice-library/{provider}
|
|
602
|
+
* @secure
|
|
603
|
+
*/
|
|
604
|
+
voiceLibraryControllerVoiceGetByProvider: (provider, params = {}) => this.request({
|
|
605
|
+
path: `/voice-library/${provider}`,
|
|
606
|
+
method: 'GET',
|
|
607
|
+
secure: true,
|
|
608
|
+
format: 'json',
|
|
609
|
+
...params,
|
|
610
|
+
}),
|
|
611
|
+
/**
|
|
612
|
+
* No description
|
|
613
|
+
*
|
|
614
|
+
* @tags Voice Library
|
|
615
|
+
* @name VoiceLibraryControllerVoiceLibrarySyncByProvider
|
|
616
|
+
* @summary Sync voices in Voice Library by Providers
|
|
617
|
+
* @request POST:/voice-library/sync/{provider}
|
|
618
|
+
* @secure
|
|
619
|
+
*/
|
|
620
|
+
voiceLibraryControllerVoiceLibrarySyncByProvider: (provider, params = {}) => this.request({
|
|
621
|
+
path: `/voice-library/sync/${provider}`,
|
|
622
|
+
method: 'POST',
|
|
623
|
+
secure: true,
|
|
624
|
+
format: 'json',
|
|
625
|
+
...params,
|
|
626
|
+
}),
|
|
627
|
+
};
|
|
628
|
+
logging = {
|
|
629
|
+
/**
|
|
630
|
+
* No description
|
|
631
|
+
*
|
|
632
|
+
* @tags Logging
|
|
633
|
+
* @name LoggingControllerGetLogs
|
|
634
|
+
* @summary Get Logging Logs
|
|
635
|
+
* @request GET:/logging
|
|
636
|
+
* @secure
|
|
637
|
+
*/
|
|
638
|
+
loggingControllerGetLogs: (query, params = {}) => this.request({
|
|
639
|
+
path: `/logging`,
|
|
640
|
+
method: 'GET',
|
|
641
|
+
query: query,
|
|
642
|
+
secure: true,
|
|
643
|
+
format: 'json',
|
|
644
|
+
...params,
|
|
645
|
+
}),
|
|
646
|
+
};
|
|
571
647
|
}
|
|
572
648
|
exports.Api = Api;
|
package/dist/vapi.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { Call, CreateAssistantDTO } from './api';
|
|
2
|
+
import { Call, CreateAssistantDTO, OverrideAssistantDTO } from './api';
|
|
3
3
|
import type { ChatCompletionMessageParam } from 'openai/resources';
|
|
4
4
|
import EventEmitter from 'events';
|
|
5
5
|
export interface AddMessageMessage {
|
|
@@ -35,7 +35,7 @@ export default class Vapi extends VapiEventEmitter {
|
|
|
35
35
|
private averageSpeechLevel;
|
|
36
36
|
constructor(apiToken: string, apiBaseUrl?: string);
|
|
37
37
|
private cleanup;
|
|
38
|
-
start(assistant: CreateAssistantDTO | string): Promise<Call | null>;
|
|
38
|
+
start(assistant: CreateAssistantDTO | string, assistantOverrides?: OverrideAssistantDTO): Promise<Call | null>;
|
|
39
39
|
private onAppMessage;
|
|
40
40
|
private handleRemoteParticipantsAudioLevel;
|
|
41
41
|
stop(): void;
|
package/dist/vapi.js
CHANGED
|
@@ -72,7 +72,7 @@ class Vapi extends VapiEventEmitter {
|
|
|
72
72
|
this.call = null;
|
|
73
73
|
this.speakingTimeout = null;
|
|
74
74
|
}
|
|
75
|
-
async start(assistant) {
|
|
75
|
+
async start(assistant, assistantOverrides) {
|
|
76
76
|
if (this.started) {
|
|
77
77
|
return null;
|
|
78
78
|
}
|
|
@@ -81,6 +81,7 @@ class Vapi extends VapiEventEmitter {
|
|
|
81
81
|
const webCall = (await client_1.client.call.callControllerCreateWebCall({
|
|
82
82
|
assistant: typeof assistant === 'string' ? undefined : assistant,
|
|
83
83
|
assistantId: typeof assistant === 'string' ? assistant : undefined,
|
|
84
|
+
assistantOverrides,
|
|
84
85
|
})).data;
|
|
85
86
|
if (this.call) {
|
|
86
87
|
this.cleanup();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vapi-ai/web",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/vapi.js",
|
|
6
6
|
"types": "dist/vapi.d.ts",
|
|
@@ -13,16 +13,16 @@
|
|
|
13
13
|
},
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
|
-
"url": "git+https://github.com/VapiAI/
|
|
16
|
+
"url": "git+https://github.com/VapiAI/web.git"
|
|
17
17
|
},
|
|
18
18
|
"author": "vapi",
|
|
19
|
-
"license": "
|
|
19
|
+
"license": "MIT",
|
|
20
20
|
"bugs": {
|
|
21
|
-
"url": "https://github.com/VapiAI/
|
|
21
|
+
"url": "https://github.com/VapiAI/web/issues"
|
|
22
22
|
},
|
|
23
|
-
"homepage": "https://github.com/VapiAI/
|
|
23
|
+
"homepage": "https://github.com/VapiAI/web#readme",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@daily-co/daily-js": "^0.
|
|
25
|
+
"@daily-co/daily-js": "^0.58.0",
|
|
26
26
|
"@vapi-ai/web": "^1.0.263",
|
|
27
27
|
"events": "^3.3.0"
|
|
28
28
|
},
|
package/update.sh
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
npm version patch && npm run build && npm publish && cd ../landing && npm install @vapi-ai/web@latest && cd -
|
|
1
|
+
npm version patch && npm run build && npm publish && cd ../landing && npm install @vapi-ai/web@latest && cd -
|
package/vapi.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Call, CreateAssistantDTO } from './api';
|
|
1
|
+
import { Call, CreateAssistantDTO, OverrideAssistantDTO } from './api';
|
|
2
2
|
import DailyIframe, {
|
|
3
3
|
DailyCall,
|
|
4
4
|
DailyEventObjectAppMessage,
|
|
@@ -112,7 +112,10 @@ export default class Vapi extends VapiEventEmitter {
|
|
|
112
112
|
this.speakingTimeout = null;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
async start(
|
|
115
|
+
async start(
|
|
116
|
+
assistant: CreateAssistantDTO | string,
|
|
117
|
+
assistantOverrides?: OverrideAssistantDTO,
|
|
118
|
+
): Promise<Call | null> {
|
|
116
119
|
if (this.started) {
|
|
117
120
|
return null;
|
|
118
121
|
}
|
|
@@ -124,6 +127,7 @@ export default class Vapi extends VapiEventEmitter {
|
|
|
124
127
|
await client.call.callControllerCreateWebCall({
|
|
125
128
|
assistant: typeof assistant === 'string' ? undefined : assistant,
|
|
126
129
|
assistantId: typeof assistant === 'string' ? assistant : undefined,
|
|
130
|
+
assistantOverrides,
|
|
127
131
|
})
|
|
128
132
|
).data;
|
|
129
133
|
|
package/dist/example.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/example.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
// require('dotenv').config();
|
|
7
|
-
const vapi_1 = __importDefault(require("./vapi"));
|
|
8
|
-
// const VAPI_PUBLIC_KEY = process.env.VAPI_PUBLIC_KEY;
|
|
9
|
-
// if (!VAPI_PUBLIC_KEY) throw new Error('VAPI_PUBLIC_KEY is required');
|
|
10
|
-
const vapi = new vapi_1.default('812437de-42ce-4bca-a9e7-e62cd170e882');
|
|
11
|
-
vapi.start({
|
|
12
|
-
model: {
|
|
13
|
-
provider: 'openai',
|
|
14
|
-
model: 'gpt-4',
|
|
15
|
-
messages: [
|
|
16
|
-
{
|
|
17
|
-
content: 'you are an assistant',
|
|
18
|
-
role: 'assistant',
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
},
|
|
22
|
-
voice: {
|
|
23
|
-
provider: '11labs',
|
|
24
|
-
voiceId: 'burt',
|
|
25
|
-
},
|
|
26
|
-
});
|