@vapi-ai/web 1.0.249 → 1.0.251

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
@@ -28,8 +28,12 @@ You can start a new call by calling the `start` method and passing an `assistant
28
28
 
29
29
  ```javascript
30
30
  vapi.start({
31
- context: "You are a shopping assistant...",
32
- voice: "steve",
31
+ model: {
32
+ provider: "openai",
33
+ model: "gpt-3.5-turbo",
34
+ systemPrompt: "You're an assistant..."
35
+ },
36
+ voice: "jennifer-playht",
33
37
  ...
34
38
  });
35
39
  ```
package/api.ts CHANGED
@@ -440,11 +440,10 @@ export interface CreateAssistantDTO {
440
440
  * @default null
441
441
  */
442
442
  fillersEnabled?: boolean;
443
- /**
444
- * This sets whether the assistant will send live transcriptions to the Server URL and/or Vapi clients.
445
- * @default null
446
- */
447
- liveTranscriptsEnabled?: boolean;
443
+ /** These are the messages that will be sent to the Client SDKs. Default is ['transcript', 'hang', 'function-call'] */
444
+ clientMessages?: "function-call" | "transcript" | "hang";
445
+ /** These are the messages that will be sent to your Server URL. Default is ['end-of-call-report', 'status-update', 'hang', 'function-call'] */
446
+ serverMessages?: "end-of-call-report" | "function-call" | "status-update" | "transcript" | "hang";
448
447
  /**
449
448
  * How many seconds of silence to wait before ending the call. Defaults to 30.
450
449
  * @min 10
@@ -452,6 +451,13 @@ export interface CreateAssistantDTO {
452
451
  * @default null
453
452
  */
454
453
  silenceTimeoutSeconds?: number;
454
+ /**
455
+ * The minimum number of seconds after user speech to wait before the assistant starts speaking. Defaults to 0.4.
456
+ * @min 0
457
+ * @max 10
458
+ * @default null
459
+ */
460
+ responseDelaySeconds?: number;
455
461
  }
456
462
 
457
463
  export interface Assistant {
@@ -547,11 +553,10 @@ export interface Assistant {
547
553
  * @default null
548
554
  */
549
555
  fillersEnabled?: boolean;
550
- /**
551
- * This sets whether the assistant will send live transcriptions to the Server URL and/or Vapi clients.
552
- * @default null
553
- */
554
- liveTranscriptsEnabled?: boolean;
556
+ /** These are the messages that will be sent to the Client SDKs. Default is ['transcript', 'hang', 'function-call'] */
557
+ clientMessages?: "function-call" | "transcript" | "hang";
558
+ /** These are the messages that will be sent to your Server URL. Default is ['end-of-call-report', 'status-update', 'hang', 'function-call'] */
559
+ serverMessages?: "end-of-call-report" | "function-call" | "status-update" | "transcript" | "hang";
555
560
  /**
556
561
  * How many seconds of silence to wait before ending the call. Defaults to 30.
557
562
  * @min 10
@@ -559,6 +564,13 @@ export interface Assistant {
559
564
  * @default null
560
565
  */
561
566
  silenceTimeoutSeconds?: number;
567
+ /**
568
+ * The minimum number of seconds after user speech to wait before the assistant starts speaking. Defaults to 0.4.
569
+ * @min 0
570
+ * @max 10
571
+ * @default null
572
+ */
573
+ responseDelaySeconds?: number;
562
574
  /** This is the unique identifier for the assistant. */
563
575
  id: string;
564
576
  /** This is the unique identifier for the org that this assistant belongs to. */
@@ -668,11 +680,10 @@ export interface UpdateAssistantDTO {
668
680
  * @default null
669
681
  */
670
682
  fillersEnabled?: boolean;
671
- /**
672
- * This sets whether the assistant will send live transcriptions to the Server URL and/or Vapi clients.
673
- * @default null
674
- */
675
- liveTranscriptsEnabled?: boolean;
683
+ /** These are the messages that will be sent to the Client SDKs. Default is ['transcript', 'hang', 'function-call'] */
684
+ clientMessages?: "function-call" | "transcript" | "hang";
685
+ /** These are the messages that will be sent to your Server URL. Default is ['end-of-call-report', 'status-update', 'hang', 'function-call'] */
686
+ serverMessages?: "end-of-call-report" | "function-call" | "status-update" | "transcript" | "hang";
676
687
  /**
677
688
  * How many seconds of silence to wait before ending the call. Defaults to 30.
678
689
  * @min 10
@@ -680,6 +691,13 @@ export interface UpdateAssistantDTO {
680
691
  * @default null
681
692
  */
682
693
  silenceTimeoutSeconds?: number;
694
+ /**
695
+ * The minimum number of seconds after user speech to wait before the assistant starts speaking. Defaults to 0.4.
696
+ * @min 0
697
+ * @max 10
698
+ * @default null
699
+ */
700
+ responseDelaySeconds?: number;
683
701
  }
684
702
 
685
703
  export interface CreateCustomerDTO {
@@ -751,6 +769,13 @@ export interface Call {
751
769
  | "twilio-closed-websocket"
752
770
  | "unknown-error"
753
771
  | "voicemail";
772
+ /**
773
+ * This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended.
774
+ * @min 10
775
+ * @max 3600
776
+ * @default null
777
+ */
778
+ maxDurationSeconds?: number;
754
779
  /** This is the unique identifier for the call. */
755
780
  id: string;
756
781
  /** This is the unique identifier for the org that this call belongs to. */
@@ -828,6 +853,13 @@ export interface Call {
828
853
  }
829
854
 
830
855
  export interface CreateOutboundCallDTO {
856
+ /**
857
+ * This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended.
858
+ * @min 10
859
+ * @max 3600
860
+ * @default null
861
+ */
862
+ maxDurationSeconds?: number;
831
863
  /** This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. */
832
864
  assistantId?: string;
833
865
  /** This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. */
@@ -1107,6 +1139,26 @@ export interface CustomLLMCredential {
1107
1139
  updatedAt: string;
1108
1140
  }
1109
1141
 
1142
+ export interface RunpodCredential {
1143
+ provider: "runpod";
1144
+ /** This is not returned in the API. */
1145
+ apiKey: string;
1146
+ /** This is the unique identifier for the credential. */
1147
+ id: string;
1148
+ /** This is the unique identifier for the org that this credential belongs to. */
1149
+ orgId: string;
1150
+ /**
1151
+ * This is the ISO 8601 date-time string of when the credential was created.
1152
+ * @format date-time
1153
+ */
1154
+ createdAt: string;
1155
+ /**
1156
+ * This is the ISO 8601 date-time string of when the assistant was last updated.
1157
+ * @format date-time
1158
+ */
1159
+ updatedAt: string;
1160
+ }
1161
+
1110
1162
  export interface CreateTwilioCredentialDTO {
1111
1163
  provider: "twilio";
1112
1164
  /** This is not returned in the API. */
@@ -1181,6 +1233,12 @@ export interface CreateRimeAICredentialDTO {
1181
1233
  apiKey: string;
1182
1234
  }
1183
1235
 
1236
+ export interface CreateRunpodCredentialDTO {
1237
+ provider: "runpod";
1238
+ /** This is not returned in the API. */
1239
+ apiKey: string;
1240
+ }
1241
+
1184
1242
  export interface UpdateTwilioCredentialDTO {
1185
1243
  provider: "twilio";
1186
1244
  /** This is not returned in the API. */
@@ -1255,6 +1313,12 @@ export interface UpdateRimeAICredentialDTO {
1255
1313
  apiKey: string;
1256
1314
  }
1257
1315
 
1316
+ export interface UpdateRunpodCredentialDTO {
1317
+ provider: "runpod";
1318
+ /** This is not returned in the API. */
1319
+ apiKey: string;
1320
+ }
1321
+
1258
1322
  export interface BuyPhoneNumberDTO {
1259
1323
  /**
1260
1324
  * This is the area code of the phone number to purchase.
@@ -1636,6 +1700,26 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
1636
1700
  ...params,
1637
1701
  }),
1638
1702
 
1703
+ /**
1704
+ * No description
1705
+ *
1706
+ * @tags Assistants
1707
+ * @name AssistantControllerReplace
1708
+ * @summary Replace Assistant
1709
+ * @request PUT:/assistant/{id}
1710
+ * @secure
1711
+ */
1712
+ assistantControllerReplace: (id: string, data: UpdateAssistantDTO, params: RequestParams = {}) =>
1713
+ this.request<Assistant, any>({
1714
+ path: `/assistant/${id}`,
1715
+ method: "PUT",
1716
+ body: data,
1717
+ secure: true,
1718
+ type: ContentType.Json,
1719
+ format: "json",
1720
+ ...params,
1721
+ }),
1722
+
1639
1723
  /**
1640
1724
  * No description
1641
1725
  *
@@ -1778,7 +1862,10 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
1778
1862
  } & CreatePlayHTCredentialDTO)
1779
1863
  | ({
1780
1864
  provider: "rime-ai";
1781
- } & CreateRimeAICredentialDTO),
1865
+ } & CreateRimeAICredentialDTO)
1866
+ | ({
1867
+ provider: "runpod";
1868
+ } & CreateRunpodCredentialDTO),
1782
1869
  params: RequestParams = {},
1783
1870
  ) =>
1784
1871
  this.request<
@@ -1817,7 +1904,10 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
1817
1904
  } & PlayHTCredential)
1818
1905
  | ({
1819
1906
  provider: "rime-ai";
1820
- } & RimeAICredential),
1907
+ } & RimeAICredential)
1908
+ | ({
1909
+ provider: "runpod";
1910
+ } & RunpodCredential),
1821
1911
  any
1822
1912
  >({
1823
1913
  path: `/credential`,
@@ -1877,6 +1967,9 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
1877
1967
  | ({
1878
1968
  provider: "rime-ai";
1879
1969
  } & RimeAICredential)
1970
+ | ({
1971
+ provider: "runpod";
1972
+ } & RunpodCredential)
1880
1973
  )[],
1881
1974
  any
1882
1975
  >({
@@ -1933,7 +2026,10 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
1933
2026
  } & PlayHTCredential)
1934
2027
  | ({
1935
2028
  provider: "rime-ai";
1936
- } & RimeAICredential),
2029
+ } & RimeAICredential)
2030
+ | ({
2031
+ provider: "runpod";
2032
+ } & RunpodCredential),
1937
2033
  any
1938
2034
  >({
1939
2035
  path: `/credential/${id}`,
@@ -1990,7 +2086,10 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
1990
2086
  } & UpdatePlayHTCredentialDTO)
1991
2087
  | ({
1992
2088
  provider: "rime-ai";
1993
- } & UpdateRimeAICredentialDTO),
2089
+ } & UpdateRimeAICredentialDTO)
2090
+ | ({
2091
+ provider: "runpod";
2092
+ } & UpdateRunpodCredentialDTO),
1994
2093
  params: RequestParams = {},
1995
2094
  ) =>
1996
2095
  this.request<
@@ -2029,7 +2128,10 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
2029
2128
  } & PlayHTCredential)
2030
2129
  | ({
2031
2130
  provider: "rime-ai";
2032
- } & RimeAICredential),
2131
+ } & RimeAICredential)
2132
+ | ({
2133
+ provider: "runpod";
2134
+ } & RunpodCredential),
2033
2135
  any
2034
2136
  >({
2035
2137
  path: `/credential/${id}`,
@@ -2087,7 +2189,10 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
2087
2189
  } & PlayHTCredential)
2088
2190
  | ({
2089
2191
  provider: "rime-ai";
2090
- } & RimeAICredential),
2192
+ } & RimeAICredential)
2193
+ | ({
2194
+ provider: "runpod";
2195
+ } & RunpodCredential),
2091
2196
  any
2092
2197
  >({
2093
2198
  path: `/credential/${id}`,
package/dist/api.d.ts CHANGED
@@ -344,11 +344,10 @@ export interface CreateAssistantDTO {
344
344
  * @default null
345
345
  */
346
346
  fillersEnabled?: boolean;
347
- /**
348
- * This sets whether the assistant will send live transcriptions to the Server URL and/or Vapi clients.
349
- * @default null
350
- */
351
- liveTranscriptsEnabled?: boolean;
347
+ /** These are the messages that will be sent to the Client SDKs. Default is ['transcript', 'hang', 'function-call'] */
348
+ clientMessages?: "function-call" | "transcript" | "hang";
349
+ /** These are the messages that will be sent to your Server URL. Default is ['end-of-call-report', 'status-update', 'hang', 'function-call'] */
350
+ serverMessages?: "end-of-call-report" | "function-call" | "status-update" | "transcript" | "hang";
352
351
  /**
353
352
  * How many seconds of silence to wait before ending the call. Defaults to 30.
354
353
  * @min 10
@@ -356,6 +355,13 @@ export interface CreateAssistantDTO {
356
355
  * @default null
357
356
  */
358
357
  silenceTimeoutSeconds?: number;
358
+ /**
359
+ * The minimum number of seconds after user speech to wait before the assistant starts speaking. Defaults to 0.4.
360
+ * @min 0
361
+ * @max 10
362
+ * @default null
363
+ */
364
+ responseDelaySeconds?: number;
359
365
  }
360
366
  export interface Assistant {
361
367
  /**
@@ -428,11 +434,10 @@ export interface Assistant {
428
434
  * @default null
429
435
  */
430
436
  fillersEnabled?: boolean;
431
- /**
432
- * This sets whether the assistant will send live transcriptions to the Server URL and/or Vapi clients.
433
- * @default null
434
- */
435
- liveTranscriptsEnabled?: boolean;
437
+ /** These are the messages that will be sent to the Client SDKs. Default is ['transcript', 'hang', 'function-call'] */
438
+ clientMessages?: "function-call" | "transcript" | "hang";
439
+ /** These are the messages that will be sent to your Server URL. Default is ['end-of-call-report', 'status-update', 'hang', 'function-call'] */
440
+ serverMessages?: "end-of-call-report" | "function-call" | "status-update" | "transcript" | "hang";
436
441
  /**
437
442
  * How many seconds of silence to wait before ending the call. Defaults to 30.
438
443
  * @min 10
@@ -440,6 +445,13 @@ export interface Assistant {
440
445
  * @default null
441
446
  */
442
447
  silenceTimeoutSeconds?: number;
448
+ /**
449
+ * The minimum number of seconds after user speech to wait before the assistant starts speaking. Defaults to 0.4.
450
+ * @min 0
451
+ * @max 10
452
+ * @default null
453
+ */
454
+ responseDelaySeconds?: number;
443
455
  /** This is the unique identifier for the assistant. */
444
456
  id: string;
445
457
  /** This is the unique identifier for the org that this assistant belongs to. */
@@ -526,11 +538,10 @@ export interface UpdateAssistantDTO {
526
538
  * @default null
527
539
  */
528
540
  fillersEnabled?: boolean;
529
- /**
530
- * This sets whether the assistant will send live transcriptions to the Server URL and/or Vapi clients.
531
- * @default null
532
- */
533
- liveTranscriptsEnabled?: boolean;
541
+ /** These are the messages that will be sent to the Client SDKs. Default is ['transcript', 'hang', 'function-call'] */
542
+ clientMessages?: "function-call" | "transcript" | "hang";
543
+ /** These are the messages that will be sent to your Server URL. Default is ['end-of-call-report', 'status-update', 'hang', 'function-call'] */
544
+ serverMessages?: "end-of-call-report" | "function-call" | "status-update" | "transcript" | "hang";
534
545
  /**
535
546
  * How many seconds of silence to wait before ending the call. Defaults to 30.
536
547
  * @min 10
@@ -538,6 +549,13 @@ export interface UpdateAssistantDTO {
538
549
  * @default null
539
550
  */
540
551
  silenceTimeoutSeconds?: number;
552
+ /**
553
+ * The minimum number of seconds after user speech to wait before the assistant starts speaking. Defaults to 0.4.
554
+ * @min 0
555
+ * @max 10
556
+ * @default null
557
+ */
558
+ responseDelaySeconds?: number;
541
559
  }
542
560
  export interface CreateCustomerDTO {
543
561
  /** This is the number of the customer. */
@@ -574,6 +592,13 @@ export interface Call {
574
592
  status?: "queued" | "ringing" | "in-progress" | "forwarding" | "ended";
575
593
  /** This is the explanation for how the call ended. */
576
594
  endedReason?: "assistant-ended-call" | "assistant-error" | "assistant-forwarded-call" | "assistant-join-timed-out" | "assistant-not-found" | "customer-busy" | "customer-ended-call" | "customer-did-not-answer" | "db-error" | "exceeded-max-duration" | "manually-canceled" | "no-server-available" | "pipeline-error-custom-llm-response-was-invalid" | "pipeline-error-custom-llm-request-failed" | "pipeline-error-extra-function-failed" | "pipeline-error-first-message-failed" | "pipeline-error-function-filler-failed" | "pipeline-error-function-failed" | "pipeline-error-llm-failed" | "pipeline-error-openai-voice-failed" | "pipeline-error-deepgram-transcriber-failed" | "pipeline-error-deepgram-voice-failed" | "pipeline-error-eleven-labs-voice-failed" | "pipeline-error-eleven-labs-voice-not-found" | "pipeline-error-playht-voice-failed" | "pipeline-error-rime-ai-voice-failed" | "server-shutdown" | "silence-timed-out" | "twilio-failed-to-connect-call" | "twilio-closed-websocket" | "unknown-error" | "voicemail";
595
+ /**
596
+ * This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended.
597
+ * @min 10
598
+ * @max 3600
599
+ * @default null
600
+ */
601
+ maxDurationSeconds?: number;
577
602
  /** This is the unique identifier for the call. */
578
603
  id: string;
579
604
  /** This is the unique identifier for the org that this call belongs to. */
@@ -650,6 +675,13 @@ export interface Call {
650
675
  phoneNumber?: ImportTwilioPhoneNumberDTO;
651
676
  }
652
677
  export interface CreateOutboundCallDTO {
678
+ /**
679
+ * This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended.
680
+ * @min 10
681
+ * @max 3600
682
+ * @default null
683
+ */
684
+ maxDurationSeconds?: number;
653
685
  /** This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. */
654
686
  assistantId?: string;
655
687
  /** This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. */
@@ -915,6 +947,25 @@ export interface CustomLLMCredential {
915
947
  */
916
948
  updatedAt: string;
917
949
  }
950
+ export interface RunpodCredential {
951
+ provider: "runpod";
952
+ /** This is not returned in the API. */
953
+ apiKey: string;
954
+ /** This is the unique identifier for the credential. */
955
+ id: string;
956
+ /** This is the unique identifier for the org that this credential belongs to. */
957
+ orgId: string;
958
+ /**
959
+ * This is the ISO 8601 date-time string of when the credential was created.
960
+ * @format date-time
961
+ */
962
+ createdAt: string;
963
+ /**
964
+ * This is the ISO 8601 date-time string of when the assistant was last updated.
965
+ * @format date-time
966
+ */
967
+ updatedAt: string;
968
+ }
918
969
  export interface CreateTwilioCredentialDTO {
919
970
  provider: "twilio";
920
971
  /** This is not returned in the API. */
@@ -977,6 +1028,11 @@ export interface CreateRimeAICredentialDTO {
977
1028
  /** This is not returned in the API. */
978
1029
  apiKey: string;
979
1030
  }
1031
+ export interface CreateRunpodCredentialDTO {
1032
+ provider: "runpod";
1033
+ /** This is not returned in the API. */
1034
+ apiKey: string;
1035
+ }
980
1036
  export interface UpdateTwilioCredentialDTO {
981
1037
  provider: "twilio";
982
1038
  /** This is not returned in the API. */
@@ -1039,6 +1095,11 @@ export interface UpdateRimeAICredentialDTO {
1039
1095
  /** This is not returned in the API. */
1040
1096
  apiKey: string;
1041
1097
  }
1098
+ export interface UpdateRunpodCredentialDTO {
1099
+ provider: "runpod";
1100
+ /** This is not returned in the API. */
1101
+ apiKey: string;
1102
+ }
1042
1103
  export interface BuyPhoneNumberDTO {
1043
1104
  /**
1044
1105
  * This is the area code of the phone number to purchase.
@@ -1229,6 +1290,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1229
1290
  * @secure
1230
1291
  */
1231
1292
  assistantControllerUpdate: (id: string, data: UpdateAssistantDTO, params?: RequestParams) => Promise<HttpResponse<Assistant, any>>;
1293
+ /**
1294
+ * No description
1295
+ *
1296
+ * @tags Assistants
1297
+ * @name AssistantControllerReplace
1298
+ * @summary Replace Assistant
1299
+ * @request PUT:/assistant/{id}
1300
+ * @secure
1301
+ */
1302
+ assistantControllerReplace: (id: string, data: UpdateAssistantDTO, params?: RequestParams) => Promise<HttpResponse<Assistant, any>>;
1232
1303
  /**
1233
1304
  * No description
1234
1305
  *
@@ -1316,7 +1387,9 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1316
1387
  provider: "playht";
1317
1388
  } & CreatePlayHTCredentialDTO) | ({
1318
1389
  provider: "rime-ai";
1319
- } & CreateRimeAICredentialDTO), params?: RequestParams) => Promise<HttpResponse<({
1390
+ } & CreateRimeAICredentialDTO) | ({
1391
+ provider: "runpod";
1392
+ } & CreateRunpodCredentialDTO), params?: RequestParams) => Promise<HttpResponse<({
1320
1393
  provider: "twilio";
1321
1394
  } & TwilioCredential) | ({
1322
1395
  provider: "deepgram";
@@ -1340,7 +1413,9 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1340
1413
  provider: "playht";
1341
1414
  } & PlayHTCredential) | ({
1342
1415
  provider: "rime-ai";
1343
- } & RimeAICredential), any>>;
1416
+ } & RimeAICredential) | ({
1417
+ provider: "runpod";
1418
+ } & RunpodCredential), any>>;
1344
1419
  /**
1345
1420
  * No description
1346
1421
  *
@@ -1374,7 +1449,9 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1374
1449
  provider: "playht";
1375
1450
  } & PlayHTCredential) | ({
1376
1451
  provider: "rime-ai";
1377
- } & RimeAICredential))[], any>>;
1452
+ } & RimeAICredential) | ({
1453
+ provider: "runpod";
1454
+ } & RunpodCredential))[], any>>;
1378
1455
  /**
1379
1456
  * No description
1380
1457
  *
@@ -1408,7 +1485,9 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1408
1485
  provider: "playht";
1409
1486
  } & PlayHTCredential) | ({
1410
1487
  provider: "rime-ai";
1411
- } & RimeAICredential), any>>;
1488
+ } & RimeAICredential) | ({
1489
+ provider: "runpod";
1490
+ } & RunpodCredential), any>>;
1412
1491
  /**
1413
1492
  * No description
1414
1493
  *
@@ -1442,7 +1521,9 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1442
1521
  provider: "playht";
1443
1522
  } & UpdatePlayHTCredentialDTO) | ({
1444
1523
  provider: "rime-ai";
1445
- } & UpdateRimeAICredentialDTO), params?: RequestParams) => Promise<HttpResponse<({
1524
+ } & UpdateRimeAICredentialDTO) | ({
1525
+ provider: "runpod";
1526
+ } & UpdateRunpodCredentialDTO), params?: RequestParams) => Promise<HttpResponse<({
1446
1527
  provider: "twilio";
1447
1528
  } & TwilioCredential) | ({
1448
1529
  provider: "deepgram";
@@ -1466,7 +1547,9 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1466
1547
  provider: "playht";
1467
1548
  } & PlayHTCredential) | ({
1468
1549
  provider: "rime-ai";
1469
- } & RimeAICredential), any>>;
1550
+ } & RimeAICredential) | ({
1551
+ provider: "runpod";
1552
+ } & RunpodCredential), any>>;
1470
1553
  /**
1471
1554
  * No description
1472
1555
  *
@@ -1500,7 +1583,9 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1500
1583
  provider: "playht";
1501
1584
  } & PlayHTCredential) | ({
1502
1585
  provider: "rime-ai";
1503
- } & RimeAICredential), any>>;
1586
+ } & RimeAICredential) | ({
1587
+ provider: "runpod";
1588
+ } & RunpodCredential), any>>;
1504
1589
  };
1505
1590
  phoneNumber: {
1506
1591
  /**
package/dist/api.js CHANGED
@@ -205,6 +205,16 @@ class Api extends HttpClient {
205
205
  * @secure
206
206
  */
207
207
  assistantControllerUpdate: (id, data, params = {}) => this.request(Object.assign({ path: `/assistant/${id}`, method: "PATCH", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
208
+ /**
209
+ * No description
210
+ *
211
+ * @tags Assistants
212
+ * @name AssistantControllerReplace
213
+ * @summary Replace Assistant
214
+ * @request PUT:/assistant/{id}
215
+ * @secure
216
+ */
217
+ assistantControllerReplace: (id, data, params = {}) => this.request(Object.assign({ path: `/assistant/${id}`, method: "PUT", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
208
218
  /**
209
219
  * No description
210
220
  *
package/dist/vapi.d.ts CHANGED
@@ -1,6 +1,12 @@
1
1
  /// <reference types="node" />
2
2
  import { Call, CreateAssistantDTO } from "./api";
3
+ import type { ChatCompletionMessageParam } from "openai/resources";
3
4
  import EventEmitter from "events";
5
+ export interface AddMessageMessage {
6
+ type: "add-message";
7
+ message: ChatCompletionMessageParam;
8
+ }
9
+ type VapiClientToServerMessage = AddMessageMessage;
4
10
  type VapiEventNames = "call-end" | "call-start" | "volume-level" | "speech-start" | "speech-end" | "message" | "error";
5
11
  type VapiEventListeners = {
6
12
  "call-end": () => void;
@@ -29,6 +35,6 @@ export default class Vapi extends VapiEventEmitter {
29
35
  private onAppMessage;
30
36
  private handleRemoteParticipantsAudioLevel;
31
37
  stop(): void;
32
- send(message: any): void;
38
+ sendMessage(message: VapiClientToServerMessage): void;
33
39
  }
34
40
  export {};
package/dist/vapi.js CHANGED
@@ -193,7 +193,7 @@ class Vapi extends VapiEventEmitter {
193
193
  (_a = this.call) === null || _a === void 0 ? void 0 : _a.destroy();
194
194
  this.call = null;
195
195
  }
196
- send(message) {
196
+ sendMessage(message) {
197
197
  var _a;
198
198
  (_a = this.call) === null || _a === void 0 ? void 0 : _a.sendAppMessage(JSON.stringify(message));
199
199
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vapi-ai/web",
3
- "version": "1.0.249",
3
+ "version": "1.0.251",
4
4
  "description": "",
5
5
  "main": "dist/vapi.js",
6
6
  "types": "dist/vapi.d.ts",
@@ -27,6 +27,7 @@
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/node": "^20.6.0",
30
+ "openai": "^4.24.1",
30
31
  "swagger-typescript-api": "^13.0.3"
31
32
  }
32
33
  }
package/vapi.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import { Call, CreateAssistantDTO } from "./api";
2
2
  import DailyIframe, {
3
3
  DailyCall,
4
- DailyEventObjectActiveSpeakerChange,
5
4
  DailyEventObjectAppMessage,
6
5
  DailyEventObjectParticipant,
7
6
  DailyEventObjectRemoteParticipantsAudioLevel,
8
7
  } from "@daily-co/daily-js";
9
8
 
9
+ import type { ChatCompletionMessageParam } from "openai/resources";
10
10
  import EventEmitter from "events";
11
11
  import { client } from "./client";
12
12
 
@@ -42,6 +42,13 @@ function subscribeToTracks(e: DailyEventObjectParticipant, call: DailyCall) {
42
42
  });
43
43
  }
44
44
 
45
+ export interface AddMessageMessage {
46
+ type: "add-message";
47
+ message: ChatCompletionMessageParam;
48
+ }
49
+
50
+ type VapiClientToServerMessage = AddMessageMessage;
51
+
45
52
  type VapiEventNames =
46
53
  | "call-end"
47
54
  | "call-start"
@@ -237,7 +244,7 @@ export default class Vapi extends VapiEventEmitter {
237
244
  this.call = null;
238
245
  }
239
246
 
240
- send(message: any): void {
247
+ sendMessage(message: VapiClientToServerMessage): void {
241
248
  this.call?.sendAppMessage(JSON.stringify(message));
242
249
  }
243
250
  }