@wildix/wim-voicebots-client 1.0.4 → 1.0.6

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VoiceSessionNotFoundException = exports.VoiceBotNotFoundException = exports.VoiceBotCommandType = exports.BotEndpoint = exports.VoiceBotEventType = exports.ForbiddenException = exports.ValidationException = void 0;
3
+ exports.VoiceSessionNotFoundException = exports.VoiceBotNotFoundException = exports.VoiceBotCommandType = exports.VoiceBotEndpoint = exports.VoiceBotToolType = exports.VoiceBotEmbeddedToolType = exports.VoiceBotEventType = exports.ForbiddenException = exports.ValidationException = void 0;
4
4
  const VoiceBotsServiceException_1 = require("./VoiceBotsServiceException");
5
5
  class ValidationException extends VoiceBotsServiceException_1.VoiceBotsServiceException {
6
6
  constructor(opts) {
@@ -32,13 +32,23 @@ exports.VoiceBotEventType = {
32
32
  COMPLETE: "complete",
33
33
  ENDED: "ended",
34
34
  INTERRUPTION: "interruption",
35
+ PLAYBACK: "playback",
35
36
  REPLY: "reply",
36
37
  STARTED: "started",
37
38
  TRANSCRIPTION: "transcription",
38
39
  };
39
- var BotEndpoint;
40
- (function (BotEndpoint) {
41
- BotEndpoint.visit = (value, visitor) => {
40
+ exports.VoiceBotEmbeddedToolType = {
41
+ HANGUP: "HANGUP",
42
+ TRANSFER: "TRANSFER",
43
+ };
44
+ exports.VoiceBotToolType = {
45
+ FUNCTION: "function",
46
+ };
47
+ var VoiceBotEndpoint;
48
+ (function (VoiceBotEndpoint) {
49
+ VoiceBotEndpoint.visit = (value, visitor) => {
50
+ if (value.llm !== undefined)
51
+ return visitor.llm(value.llm);
42
52
  if (value.dialogflowCx !== undefined)
43
53
  return visitor.dialogflowCx(value.dialogflowCx);
44
54
  if (value.openAiAssistant !== undefined)
@@ -49,7 +59,7 @@ var BotEndpoint;
49
59
  return visitor.sqs(value.sqs);
50
60
  return visitor._(value.$unknown[0], value.$unknown[1]);
51
61
  };
52
- })(BotEndpoint = exports.BotEndpoint || (exports.BotEndpoint = {}));
62
+ })(VoiceBotEndpoint = exports.VoiceBotEndpoint || (exports.VoiceBotEndpoint = {}));
53
63
  exports.VoiceBotCommandType = {
54
64
  HANGUP: "hangup",
55
65
  SAY: "say",
@@ -16,7 +16,7 @@ const se_CreateVoiceBotCommand = async (input, context) => {
16
16
  });
17
17
  let body;
18
18
  body = JSON.stringify((0, smithy_client_1.take)(input, {
19
- 'endpoint': _ => se_BotEndpoint(_, context),
19
+ 'endpoint': _ => se_VoiceBotEndpoint(_, context),
20
20
  'message': [],
21
21
  'name': [],
22
22
  'pipeline': _ => (0, smithy_client_1._json)(_),
@@ -170,7 +170,7 @@ const se_UpdateVoiceBotCommand = async (input, context) => {
170
170
  });
171
171
  let body;
172
172
  body = JSON.stringify((0, smithy_client_1.take)(input, {
173
- 'endpoint': _ => se_BotEndpoint(_, context),
173
+ 'endpoint': _ => se_VoiceBotEndpoint(_, context),
174
174
  'message': [],
175
175
  'name': [],
176
176
  'pipeline': _ => (0, smithy_client_1._json)(_),
@@ -222,6 +222,8 @@ const de_DescribeEventCommand = async (output, context) => {
222
222
  'HangupWebsocketCommand': smithy_client_1._json,
223
223
  'InterruptionWebhookEvent': smithy_client_1._json,
224
224
  'InterruptionWebsocketEvent': smithy_client_1._json,
225
+ 'PlaybackWebhookEvent': smithy_client_1._json,
226
+ 'PlaybackWebsocketEvent': smithy_client_1._json,
225
227
  'ReplyWebhookEvent': smithy_client_1._json,
226
228
  'ReplyWebsocketEvent': smithy_client_1._json,
227
229
  'SayWebsocketCommand': smithy_client_1._json,
@@ -414,30 +416,68 @@ const de_VoiceSessionNotFoundExceptionRes = async (parsedOutput, context) => {
414
416
  const se_Document = (input, context) => {
415
417
  return input;
416
418
  };
417
- const se_BotDialogflowCxEndpoint = (input, context) => {
419
+ const se_VoiceBotEmbeddedTool = (input, context) => {
418
420
  return (0, smithy_client_1.take)(input, {
419
- 'agent': [],
420
- 'credentials': _ => se_Document(_, context),
421
- 'language': [],
422
- 'location': [],
421
+ 'name': [],
422
+ 'parameters': _ => se_Document(_, context),
423
+ 'type': [],
424
+ });
425
+ };
426
+ const se_VoiceBotEmbeddedToolsList = (input, context) => {
427
+ return input.filter((e) => e != null).map(entry => {
428
+ return se_VoiceBotEmbeddedTool(entry, context);
423
429
  });
424
430
  };
425
- const se_BotEndpoint = (input, context) => {
426
- return models_0_1.BotEndpoint.visit(input, {
431
+ const se_VoiceBotEndpoint = (input, context) => {
432
+ return models_0_1.VoiceBotEndpoint.visit(input, {
427
433
  dialogflowCx: value => ({ "dialogflowCx": se_BotDialogflowCxEndpoint(value, context) }),
434
+ llm: value => ({ "llm": se_VoiceBotLlmEndpoint(value, context) }),
428
435
  openAiAssistant: value => ({ "openAiAssistant": (0, smithy_client_1._json)(value) }),
429
436
  sqs: value => ({ "sqs": (0, smithy_client_1._json)(value) }),
430
437
  webhook: value => ({ "webhook": (0, smithy_client_1._json)(value) }),
431
438
  _: (name, value) => ({ name: value })
432
439
  });
433
440
  };
441
+ const se_VoiceBotFunctionDefinition = (input, context) => {
442
+ return (0, smithy_client_1.take)(input, {
443
+ 'description': [],
444
+ 'name': [],
445
+ 'parameters': _ => se_Document(_, context),
446
+ });
447
+ };
448
+ const se_VoiceBotLlmEndpoint = (input, context) => {
449
+ return (0, smithy_client_1.take)(input, {
450
+ 'embeddedTools': _ => se_VoiceBotEmbeddedToolsList(_, context),
451
+ 'prompt': [],
452
+ 'tools': _ => se_VoiceBotToolsList(_, context),
453
+ });
454
+ };
455
+ const se_VoiceBotTool = (input, context) => {
456
+ return (0, smithy_client_1.take)(input, {
457
+ 'function': _ => se_VoiceBotFunctionDefinition(_, context),
458
+ 'type': [],
459
+ });
460
+ };
461
+ const se_VoiceBotToolsList = (input, context) => {
462
+ return input.filter((e) => e != null).map(entry => {
463
+ return se_VoiceBotTool(entry, context);
464
+ });
465
+ };
466
+ const se_BotDialogflowCxEndpoint = (input, context) => {
467
+ return (0, smithy_client_1.take)(input, {
468
+ 'agent': [],
469
+ 'credentials': _ => se_Document(_, context),
470
+ 'language': [],
471
+ 'location': [],
472
+ });
473
+ };
434
474
  const de_Document = (output, context) => {
435
475
  return output;
436
476
  };
437
477
  const de_VoiceBot = (output, context) => {
438
478
  return (0, smithy_client_1.take)(output, {
439
479
  'createdAt': smithy_client_1.expectString,
440
- 'endpoint': (_) => de_BotEndpoint((0, smithy_client_1.expectUnion)(_), context),
480
+ 'endpoint': (_) => de_VoiceBotEndpoint((0, smithy_client_1.expectUnion)(_), context),
441
481
  'id': smithy_client_1.expectString,
442
482
  'message': smithy_client_1.expectString,
443
483
  'name': smithy_client_1.expectString,
@@ -445,26 +485,30 @@ const de_VoiceBot = (output, context) => {
445
485
  'updatedAt': smithy_client_1.expectString,
446
486
  });
447
487
  };
448
- const de_VoiceBotsList = (output, context) => {
449
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
450
- return de_VoiceBot(entry, context);
488
+ const de_VoiceBotEmbeddedTool = (output, context) => {
489
+ return (0, smithy_client_1.take)(output, {
490
+ 'name': smithy_client_1.expectString,
491
+ 'parameters': (_) => de_Document(_, context),
492
+ 'type': smithy_client_1.expectString,
451
493
  });
452
- return retVal;
453
494
  };
454
- const de_BotDialogflowCxEndpoint = (output, context) => {
455
- return (0, smithy_client_1.take)(output, {
456
- 'agent': smithy_client_1.expectString,
457
- 'credentials': (_) => de_Document(_, context),
458
- 'language': smithy_client_1.expectString,
459
- 'location': smithy_client_1.expectString,
495
+ const de_VoiceBotEmbeddedToolsList = (output, context) => {
496
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
497
+ return de_VoiceBotEmbeddedTool(entry, context);
460
498
  });
499
+ return retVal;
461
500
  };
462
- const de_BotEndpoint = (output, context) => {
501
+ const de_VoiceBotEndpoint = (output, context) => {
463
502
  if (output.dialogflowCx != null) {
464
503
  return {
465
504
  dialogflowCx: de_BotDialogflowCxEndpoint(output.dialogflowCx, context)
466
505
  };
467
506
  }
507
+ if (output.llm != null) {
508
+ return {
509
+ llm: de_VoiceBotLlmEndpoint(output.llm, context)
510
+ };
511
+ }
468
512
  if (output.openAiAssistant != null) {
469
513
  return {
470
514
  openAiAssistant: (0, smithy_client_1._json)(output.openAiAssistant)
@@ -482,6 +526,46 @@ const de_BotEndpoint = (output, context) => {
482
526
  }
483
527
  return { $unknown: Object.entries(output)[0] };
484
528
  };
529
+ const de_VoiceBotFunctionDefinition = (output, context) => {
530
+ return (0, smithy_client_1.take)(output, {
531
+ 'description': smithy_client_1.expectString,
532
+ 'name': smithy_client_1.expectString,
533
+ 'parameters': (_) => de_Document(_, context),
534
+ });
535
+ };
536
+ const de_VoiceBotLlmEndpoint = (output, context) => {
537
+ return (0, smithy_client_1.take)(output, {
538
+ 'embeddedTools': (_) => de_VoiceBotEmbeddedToolsList(_, context),
539
+ 'prompt': smithy_client_1.expectString,
540
+ 'tools': (_) => de_VoiceBotToolsList(_, context),
541
+ });
542
+ };
543
+ const de_VoiceBotsList = (output, context) => {
544
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
545
+ return de_VoiceBot(entry, context);
546
+ });
547
+ return retVal;
548
+ };
549
+ const de_VoiceBotTool = (output, context) => {
550
+ return (0, smithy_client_1.take)(output, {
551
+ 'function': (_) => de_VoiceBotFunctionDefinition(_, context),
552
+ 'type': smithy_client_1.expectString,
553
+ });
554
+ };
555
+ const de_VoiceBotToolsList = (output, context) => {
556
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
557
+ return de_VoiceBotTool(entry, context);
558
+ });
559
+ return retVal;
560
+ };
561
+ const de_BotDialogflowCxEndpoint = (output, context) => {
562
+ return (0, smithy_client_1.take)(output, {
563
+ 'agent': smithy_client_1.expectString,
564
+ 'credentials': (_) => de_Document(_, context),
565
+ 'language': smithy_client_1.expectString,
566
+ 'location': smithy_client_1.expectString,
567
+ });
568
+ };
485
569
  const deserializeMetadata = (output) => ({
486
570
  httpStatusCode: output.statusCode,
487
571
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -27,13 +27,23 @@ export const VoiceBotEventType = {
27
27
  COMPLETE: "complete",
28
28
  ENDED: "ended",
29
29
  INTERRUPTION: "interruption",
30
+ PLAYBACK: "playback",
30
31
  REPLY: "reply",
31
32
  STARTED: "started",
32
33
  TRANSCRIPTION: "transcription",
33
34
  };
34
- export var BotEndpoint;
35
- (function (BotEndpoint) {
36
- BotEndpoint.visit = (value, visitor) => {
35
+ export const VoiceBotEmbeddedToolType = {
36
+ HANGUP: "HANGUP",
37
+ TRANSFER: "TRANSFER",
38
+ };
39
+ export const VoiceBotToolType = {
40
+ FUNCTION: "function",
41
+ };
42
+ export var VoiceBotEndpoint;
43
+ (function (VoiceBotEndpoint) {
44
+ VoiceBotEndpoint.visit = (value, visitor) => {
45
+ if (value.llm !== undefined)
46
+ return visitor.llm(value.llm);
37
47
  if (value.dialogflowCx !== undefined)
38
48
  return visitor.dialogflowCx(value.dialogflowCx);
39
49
  if (value.openAiAssistant !== undefined)
@@ -44,7 +54,7 @@ export var BotEndpoint;
44
54
  return visitor.sqs(value.sqs);
45
55
  return visitor._(value.$unknown[0], value.$unknown[1]);
46
56
  };
47
- })(BotEndpoint || (BotEndpoint = {}));
57
+ })(VoiceBotEndpoint || (VoiceBotEndpoint = {}));
48
58
  export const VoiceBotCommandType = {
49
59
  HANGUP: "hangup",
50
60
  SAY: "say",
@@ -1,5 +1,5 @@
1
1
  import { VoiceBotsServiceException as __BaseException } from "../models/VoiceBotsServiceException";
2
- import { BotEndpoint, ForbiddenException, ValidationException, VoiceBotNotFoundException, VoiceSessionNotFoundException, } from "../models/models_0";
2
+ import { ForbiddenException, ValidationException, VoiceBotEndpoint, VoiceBotNotFoundException, VoiceSessionNotFoundException, } from "../models/models_0";
3
3
  import { requestBuilder as rb } from "@smithy/core";
4
4
  import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, _json, collectBody, map, take, withBaseException, } from "@smithy/smithy-client";
5
5
  export const se_CreateVoiceBotCommand = async (input, context) => {
@@ -13,7 +13,7 @@ export const se_CreateVoiceBotCommand = async (input, context) => {
13
13
  });
14
14
  let body;
15
15
  body = JSON.stringify(take(input, {
16
- 'endpoint': _ => se_BotEndpoint(_, context),
16
+ 'endpoint': _ => se_VoiceBotEndpoint(_, context),
17
17
  'message': [],
18
18
  'name': [],
19
19
  'pipeline': _ => _json(_),
@@ -158,7 +158,7 @@ export const se_UpdateVoiceBotCommand = async (input, context) => {
158
158
  });
159
159
  let body;
160
160
  body = JSON.stringify(take(input, {
161
- 'endpoint': _ => se_BotEndpoint(_, context),
161
+ 'endpoint': _ => se_VoiceBotEndpoint(_, context),
162
162
  'message': [],
163
163
  'name': [],
164
164
  'pipeline': _ => _json(_),
@@ -207,6 +207,8 @@ export const de_DescribeEventCommand = async (output, context) => {
207
207
  'HangupWebsocketCommand': _json,
208
208
  'InterruptionWebhookEvent': _json,
209
209
  'InterruptionWebsocketEvent': _json,
210
+ 'PlaybackWebhookEvent': _json,
211
+ 'PlaybackWebsocketEvent': _json,
210
212
  'ReplyWebhookEvent': _json,
211
213
  'ReplyWebsocketEvent': _json,
212
214
  'SayWebsocketCommand': _json,
@@ -391,30 +393,68 @@ const de_VoiceSessionNotFoundExceptionRes = async (parsedOutput, context) => {
391
393
  const se_Document = (input, context) => {
392
394
  return input;
393
395
  };
394
- const se_BotDialogflowCxEndpoint = (input, context) => {
396
+ const se_VoiceBotEmbeddedTool = (input, context) => {
395
397
  return take(input, {
396
- 'agent': [],
397
- 'credentials': _ => se_Document(_, context),
398
- 'language': [],
399
- 'location': [],
398
+ 'name': [],
399
+ 'parameters': _ => se_Document(_, context),
400
+ 'type': [],
401
+ });
402
+ };
403
+ const se_VoiceBotEmbeddedToolsList = (input, context) => {
404
+ return input.filter((e) => e != null).map(entry => {
405
+ return se_VoiceBotEmbeddedTool(entry, context);
400
406
  });
401
407
  };
402
- const se_BotEndpoint = (input, context) => {
403
- return BotEndpoint.visit(input, {
408
+ const se_VoiceBotEndpoint = (input, context) => {
409
+ return VoiceBotEndpoint.visit(input, {
404
410
  dialogflowCx: value => ({ "dialogflowCx": se_BotDialogflowCxEndpoint(value, context) }),
411
+ llm: value => ({ "llm": se_VoiceBotLlmEndpoint(value, context) }),
405
412
  openAiAssistant: value => ({ "openAiAssistant": _json(value) }),
406
413
  sqs: value => ({ "sqs": _json(value) }),
407
414
  webhook: value => ({ "webhook": _json(value) }),
408
415
  _: (name, value) => ({ name: value })
409
416
  });
410
417
  };
418
+ const se_VoiceBotFunctionDefinition = (input, context) => {
419
+ return take(input, {
420
+ 'description': [],
421
+ 'name': [],
422
+ 'parameters': _ => se_Document(_, context),
423
+ });
424
+ };
425
+ const se_VoiceBotLlmEndpoint = (input, context) => {
426
+ return take(input, {
427
+ 'embeddedTools': _ => se_VoiceBotEmbeddedToolsList(_, context),
428
+ 'prompt': [],
429
+ 'tools': _ => se_VoiceBotToolsList(_, context),
430
+ });
431
+ };
432
+ const se_VoiceBotTool = (input, context) => {
433
+ return take(input, {
434
+ 'function': _ => se_VoiceBotFunctionDefinition(_, context),
435
+ 'type': [],
436
+ });
437
+ };
438
+ const se_VoiceBotToolsList = (input, context) => {
439
+ return input.filter((e) => e != null).map(entry => {
440
+ return se_VoiceBotTool(entry, context);
441
+ });
442
+ };
443
+ const se_BotDialogflowCxEndpoint = (input, context) => {
444
+ return take(input, {
445
+ 'agent': [],
446
+ 'credentials': _ => se_Document(_, context),
447
+ 'language': [],
448
+ 'location': [],
449
+ });
450
+ };
411
451
  const de_Document = (output, context) => {
412
452
  return output;
413
453
  };
414
454
  const de_VoiceBot = (output, context) => {
415
455
  return take(output, {
416
456
  'createdAt': __expectString,
417
- 'endpoint': (_) => de_BotEndpoint(__expectUnion(_), context),
457
+ 'endpoint': (_) => de_VoiceBotEndpoint(__expectUnion(_), context),
418
458
  'id': __expectString,
419
459
  'message': __expectString,
420
460
  'name': __expectString,
@@ -422,26 +462,30 @@ const de_VoiceBot = (output, context) => {
422
462
  'updatedAt': __expectString,
423
463
  });
424
464
  };
425
- const de_VoiceBotsList = (output, context) => {
426
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
427
- return de_VoiceBot(entry, context);
465
+ const de_VoiceBotEmbeddedTool = (output, context) => {
466
+ return take(output, {
467
+ 'name': __expectString,
468
+ 'parameters': (_) => de_Document(_, context),
469
+ 'type': __expectString,
428
470
  });
429
- return retVal;
430
471
  };
431
- const de_BotDialogflowCxEndpoint = (output, context) => {
432
- return take(output, {
433
- 'agent': __expectString,
434
- 'credentials': (_) => de_Document(_, context),
435
- 'language': __expectString,
436
- 'location': __expectString,
472
+ const de_VoiceBotEmbeddedToolsList = (output, context) => {
473
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
474
+ return de_VoiceBotEmbeddedTool(entry, context);
437
475
  });
476
+ return retVal;
438
477
  };
439
- const de_BotEndpoint = (output, context) => {
478
+ const de_VoiceBotEndpoint = (output, context) => {
440
479
  if (output.dialogflowCx != null) {
441
480
  return {
442
481
  dialogflowCx: de_BotDialogflowCxEndpoint(output.dialogflowCx, context)
443
482
  };
444
483
  }
484
+ if (output.llm != null) {
485
+ return {
486
+ llm: de_VoiceBotLlmEndpoint(output.llm, context)
487
+ };
488
+ }
445
489
  if (output.openAiAssistant != null) {
446
490
  return {
447
491
  openAiAssistant: _json(output.openAiAssistant)
@@ -459,6 +503,46 @@ const de_BotEndpoint = (output, context) => {
459
503
  }
460
504
  return { $unknown: Object.entries(output)[0] };
461
505
  };
506
+ const de_VoiceBotFunctionDefinition = (output, context) => {
507
+ return take(output, {
508
+ 'description': __expectString,
509
+ 'name': __expectString,
510
+ 'parameters': (_) => de_Document(_, context),
511
+ });
512
+ };
513
+ const de_VoiceBotLlmEndpoint = (output, context) => {
514
+ return take(output, {
515
+ 'embeddedTools': (_) => de_VoiceBotEmbeddedToolsList(_, context),
516
+ 'prompt': __expectString,
517
+ 'tools': (_) => de_VoiceBotToolsList(_, context),
518
+ });
519
+ };
520
+ const de_VoiceBotsList = (output, context) => {
521
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
522
+ return de_VoiceBot(entry, context);
523
+ });
524
+ return retVal;
525
+ };
526
+ const de_VoiceBotTool = (output, context) => {
527
+ return take(output, {
528
+ 'function': (_) => de_VoiceBotFunctionDefinition(_, context),
529
+ 'type': __expectString,
530
+ });
531
+ };
532
+ const de_VoiceBotToolsList = (output, context) => {
533
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
534
+ return de_VoiceBotTool(entry, context);
535
+ });
536
+ return retVal;
537
+ };
538
+ const de_BotDialogflowCxEndpoint = (output, context) => {
539
+ return take(output, {
540
+ 'agent': __expectString,
541
+ 'credentials': (_) => de_Document(_, context),
542
+ 'language': __expectString,
543
+ 'location': __expectString,
544
+ });
545
+ };
462
546
  const deserializeMetadata = (output) => ({
463
547
  httpStatusCode: output.statusCode,
464
548
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -45,7 +45,27 @@ declare const CreateVoiceBotCommand_base: {
45
45
  * endCallEnabled: true || false,
46
46
  * endCallPhases: "STRING_VALUE",
47
47
  * },
48
- * endpoint: { // BotEndpoint Union: only one key present
48
+ * endpoint: { // VoiceBotEndpoint Union: only one key present
49
+ * llm: { // VoiceBotLlmEndpoint
50
+ * prompt: "STRING_VALUE", // required
51
+ * embeddedTools: [ // VoiceBotEmbeddedToolsList
52
+ * { // VoiceBotEmbeddedTool
53
+ * type: "HANGUP" || "TRANSFER", // required
54
+ * name: "STRING_VALUE", // required
55
+ * parameters: "DOCUMENT_VALUE",
56
+ * },
57
+ * ],
58
+ * tools: [ // VoiceBotToolsList
59
+ * { // VoiceBotTool
60
+ * type: "function", // required
61
+ * function: { // VoiceBotFunctionDefinition
62
+ * name: "STRING_VALUE", // required
63
+ * description: "STRING_VALUE",
64
+ * parameters: "DOCUMENT_VALUE",
65
+ * },
66
+ * },
67
+ * ],
68
+ * },
49
69
  * dialogflowCx: { // BotDialogflowCxEndpoint
50
70
  * credentials: "DOCUMENT_VALUE", // required
51
71
  * agent: "STRING_VALUE", // required
@@ -81,7 +101,27 @@ declare const CreateVoiceBotCommand_base: {
81
101
  * // endCallEnabled: true || false,
82
102
  * // endCallPhases: "STRING_VALUE",
83
103
  * // },
84
- * // endpoint: { // BotEndpoint Union: only one key present
104
+ * // endpoint: { // VoiceBotEndpoint Union: only one key present
105
+ * // llm: { // VoiceBotLlmEndpoint
106
+ * // prompt: "STRING_VALUE", // required
107
+ * // embeddedTools: [ // VoiceBotEmbeddedToolsList
108
+ * // { // VoiceBotEmbeddedTool
109
+ * // type: "HANGUP" || "TRANSFER", // required
110
+ * // name: "STRING_VALUE", // required
111
+ * // parameters: "DOCUMENT_VALUE",
112
+ * // },
113
+ * // ],
114
+ * // tools: [ // VoiceBotToolsList
115
+ * // { // VoiceBotTool
116
+ * // type: "function", // required
117
+ * // function: { // VoiceBotFunctionDefinition
118
+ * // name: "STRING_VALUE", // required
119
+ * // description: "STRING_VALUE",
120
+ * // parameters: "DOCUMENT_VALUE",
121
+ * // },
122
+ * // },
123
+ * // ],
124
+ * // },
85
125
  * // dialogflowCx: { // BotDialogflowCxEndpoint
86
126
  * // credentials: "DOCUMENT_VALUE", // required
87
127
  * // agent: "STRING_VALUE", // required
@@ -42,7 +42,7 @@ declare const DescribeEventCommand_base: {
42
42
  * // TranscriptionWebsocketEvent: { // TranscriptionWebsocketEvent
43
43
  * // type: "STRING_VALUE", // required
44
44
  * // event: { // TranscriptionEvent
45
- * // type: "started" || "ended" || "reply" || "transcription" || "interruption" || "complete", // required
45
+ * // type: "started" || "ended" || "reply" || "playback" || "transcription" || "interruption" || "complete", // required
46
46
  * // id: "STRING_VALUE", // required
47
47
  * // text: "STRING_VALUE", // required
48
48
  * // time: Number("long"), // required
@@ -51,17 +51,28 @@ declare const DescribeEventCommand_base: {
51
51
  * // ReplyWebsocketEvent: { // ReplyWebsocketEvent
52
52
  * // type: "STRING_VALUE", // required
53
53
  * // event: { // ReplyEvent
54
- * // type: "started" || "ended" || "reply" || "transcription" || "interruption" || "complete", // required
54
+ * // type: "started" || "ended" || "reply" || "playback" || "transcription" || "interruption" || "complete", // required
55
55
  * // id: "STRING_VALUE", // required
56
56
  * // text: "STRING_VALUE", // required
57
57
  * // startTime: Number("long"), // required
58
58
  * // endTime: Number("long"), // required
59
59
  * // },
60
60
  * // },
61
+ * // PlaybackWebsocketEvent: { // PlaybackWebsocketEvent
62
+ * // type: "STRING_VALUE", // required
63
+ * // event: { // PlaybackEvent
64
+ * // type: "started" || "ended" || "reply" || "playback" || "transcription" || "interruption" || "complete", // required
65
+ * // replyId: "STRING_VALUE", // required
66
+ * // text: "STRING_VALUE", // required
67
+ * // complete: true || false, // required
68
+ * // startTime: Number("long"), // required
69
+ * // endTime: Number("long"),
70
+ * // },
71
+ * // },
61
72
  * // InterruptionWebsocketEvent: { // InterruptionWebsocketEvent
62
73
  * // type: "STRING_VALUE", // required
63
74
  * // event: { // InterruptionEvent
64
- * // type: "started" || "ended" || "reply" || "transcription" || "interruption" || "complete", // required
75
+ * // type: "started" || "ended" || "reply" || "playback" || "transcription" || "interruption" || "complete", // required
65
76
  * // replyId: "STRING_VALUE", // required
66
77
  * // playedText: "STRING_VALUE", // required
67
78
  * // originalText: "STRING_VALUE", // required
@@ -71,7 +82,7 @@ declare const DescribeEventCommand_base: {
71
82
  * // CompleteWebsocketEvent: { // CompleteWebsocketEvent
72
83
  * // type: "STRING_VALUE", // required
73
84
  * // event: { // CompleteEvent
74
- * // type: "started" || "ended" || "reply" || "transcription" || "interruption" || "complete", // required
85
+ * // type: "started" || "ended" || "reply" || "playback" || "transcription" || "interruption" || "complete", // required
75
86
  * // reason: "STRING_VALUE", // required
76
87
  * // time: Number("long"), // required
77
88
  * // },
@@ -106,7 +117,7 @@ declare const DescribeEventCommand_base: {
106
117
  * // callId: "STRING_VALUE", // required
107
118
  * // flowIndex: Number("int"), // required
108
119
  * // event: { // SessionStartedEvent
109
- * // type: "started" || "ended" || "reply" || "transcription" || "interruption" || "complete", // required
120
+ * // type: "started" || "ended" || "reply" || "playback" || "transcription" || "interruption" || "complete", // required
110
121
  * // language: "STRING_VALUE", // required
111
122
  * // time: Number("long"), // required
112
123
  * // },
@@ -117,7 +128,7 @@ declare const DescribeEventCommand_base: {
117
128
  * // callId: "STRING_VALUE", // required
118
129
  * // flowIndex: Number("int"), // required
119
130
  * // event: { // SessionEndedEvent
120
- * // type: "started" || "ended" || "reply" || "transcription" || "interruption" || "complete", // required
131
+ * // type: "started" || "ended" || "reply" || "playback" || "transcription" || "interruption" || "complete", // required
121
132
  * // error: "STRING_VALUE",
122
133
  * // time: Number("long"), // required
123
134
  * // },
@@ -128,7 +139,7 @@ declare const DescribeEventCommand_base: {
128
139
  * // callId: "STRING_VALUE", // required
129
140
  * // flowIndex: Number("int"), // required
130
141
  * // event: {
131
- * // type: "started" || "ended" || "reply" || "transcription" || "interruption" || "complete", // required
142
+ * // type: "started" || "ended" || "reply" || "playback" || "transcription" || "interruption" || "complete", // required
132
143
  * // id: "STRING_VALUE", // required
133
144
  * // text: "STRING_VALUE", // required
134
145
  * // time: Number("long"), // required
@@ -140,20 +151,34 @@ declare const DescribeEventCommand_base: {
140
151
  * // callId: "STRING_VALUE", // required
141
152
  * // flowIndex: Number("int"), // required
142
153
  * // event: {
143
- * // type: "started" || "ended" || "reply" || "transcription" || "interruption" || "complete", // required
154
+ * // type: "started" || "ended" || "reply" || "playback" || "transcription" || "interruption" || "complete", // required
144
155
  * // id: "STRING_VALUE", // required
145
156
  * // text: "STRING_VALUE", // required
146
157
  * // startTime: Number("long"), // required
147
158
  * // endTime: Number("long"), // required
148
159
  * // },
149
160
  * // },
161
+ * // PlaybackWebhookEvent: { // PlaybackWebhookEvent
162
+ * // sessionId: "STRING_VALUE", // required
163
+ * // botId: "STRING_VALUE", // required
164
+ * // callId: "STRING_VALUE", // required
165
+ * // flowIndex: Number("int"), // required
166
+ * // event: {
167
+ * // type: "started" || "ended" || "reply" || "playback" || "transcription" || "interruption" || "complete", // required
168
+ * // replyId: "STRING_VALUE", // required
169
+ * // text: "STRING_VALUE", // required
170
+ * // complete: true || false, // required
171
+ * // startTime: Number("long"), // required
172
+ * // endTime: Number("long"),
173
+ * // },
174
+ * // },
150
175
  * // InterruptionWebhookEvent: { // InterruptionWebhookEvent
151
176
  * // sessionId: "STRING_VALUE", // required
152
177
  * // botId: "STRING_VALUE", // required
153
178
  * // callId: "STRING_VALUE", // required
154
179
  * // flowIndex: Number("int"), // required
155
180
  * // event: {
156
- * // type: "started" || "ended" || "reply" || "transcription" || "interruption" || "complete", // required
181
+ * // type: "started" || "ended" || "reply" || "playback" || "transcription" || "interruption" || "complete", // required
157
182
  * // replyId: "STRING_VALUE", // required
158
183
  * // playedText: "STRING_VALUE", // required
159
184
  * // originalText: "STRING_VALUE", // required
@@ -52,7 +52,27 @@ declare const GetVoiceBotCommand_base: {
52
52
  * // endCallEnabled: true || false,
53
53
  * // endCallPhases: "STRING_VALUE",
54
54
  * // },
55
- * // endpoint: { // BotEndpoint Union: only one key present
55
+ * // endpoint: { // VoiceBotEndpoint Union: only one key present
56
+ * // llm: { // VoiceBotLlmEndpoint
57
+ * // prompt: "STRING_VALUE", // required
58
+ * // embeddedTools: [ // VoiceBotEmbeddedToolsList
59
+ * // { // VoiceBotEmbeddedTool
60
+ * // type: "HANGUP" || "TRANSFER", // required
61
+ * // name: "STRING_VALUE", // required
62
+ * // parameters: "DOCUMENT_VALUE",
63
+ * // },
64
+ * // ],
65
+ * // tools: [ // VoiceBotToolsList
66
+ * // { // VoiceBotTool
67
+ * // type: "function", // required
68
+ * // function: { // VoiceBotFunctionDefinition
69
+ * // name: "STRING_VALUE", // required
70
+ * // description: "STRING_VALUE",
71
+ * // parameters: "DOCUMENT_VALUE",
72
+ * // },
73
+ * // },
74
+ * // ],
75
+ * // },
56
76
  * // dialogflowCx: { // BotDialogflowCxEndpoint
57
77
  * // credentials: "DOCUMENT_VALUE", // required
58
78
  * // agent: "STRING_VALUE", // required
@@ -52,7 +52,27 @@ declare const ListVoiceBotsCommand_base: {
52
52
  * // endCallEnabled: true || false,
53
53
  * // endCallPhases: "STRING_VALUE",
54
54
  * // },
55
- * // endpoint: { // BotEndpoint Union: only one key present
55
+ * // endpoint: { // VoiceBotEndpoint Union: only one key present
56
+ * // llm: { // VoiceBotLlmEndpoint
57
+ * // prompt: "STRING_VALUE", // required
58
+ * // embeddedTools: [ // VoiceBotEmbeddedToolsList
59
+ * // { // VoiceBotEmbeddedTool
60
+ * // type: "HANGUP" || "TRANSFER", // required
61
+ * // name: "STRING_VALUE", // required
62
+ * // parameters: "DOCUMENT_VALUE",
63
+ * // },
64
+ * // ],
65
+ * // tools: [ // VoiceBotToolsList
66
+ * // { // VoiceBotTool
67
+ * // type: "function", // required
68
+ * // function: { // VoiceBotFunctionDefinition
69
+ * // name: "STRING_VALUE", // required
70
+ * // description: "STRING_VALUE",
71
+ * // parameters: "DOCUMENT_VALUE",
72
+ * // },
73
+ * // },
74
+ * // ],
75
+ * // },
56
76
  * // dialogflowCx: { // BotDialogflowCxEndpoint
57
77
  * // credentials: "DOCUMENT_VALUE", // required
58
78
  * // agent: "STRING_VALUE", // required
@@ -45,7 +45,27 @@ declare const UpdateVoiceBotCommand_base: {
45
45
  * endCallEnabled: true || false,
46
46
  * endCallPhases: "STRING_VALUE",
47
47
  * },
48
- * endpoint: { // BotEndpoint Union: only one key present
48
+ * endpoint: { // VoiceBotEndpoint Union: only one key present
49
+ * llm: { // VoiceBotLlmEndpoint
50
+ * prompt: "STRING_VALUE", // required
51
+ * embeddedTools: [ // VoiceBotEmbeddedToolsList
52
+ * { // VoiceBotEmbeddedTool
53
+ * type: "HANGUP" || "TRANSFER", // required
54
+ * name: "STRING_VALUE", // required
55
+ * parameters: "DOCUMENT_VALUE",
56
+ * },
57
+ * ],
58
+ * tools: [ // VoiceBotToolsList
59
+ * { // VoiceBotTool
60
+ * type: "function", // required
61
+ * function: { // VoiceBotFunctionDefinition
62
+ * name: "STRING_VALUE", // required
63
+ * description: "STRING_VALUE",
64
+ * parameters: "DOCUMENT_VALUE",
65
+ * },
66
+ * },
67
+ * ],
68
+ * },
49
69
  * dialogflowCx: { // BotDialogflowCxEndpoint
50
70
  * credentials: "DOCUMENT_VALUE", // required
51
71
  * agent: "STRING_VALUE", // required
@@ -82,7 +102,27 @@ declare const UpdateVoiceBotCommand_base: {
82
102
  * // endCallEnabled: true || false,
83
103
  * // endCallPhases: "STRING_VALUE",
84
104
  * // },
85
- * // endpoint: { // BotEndpoint Union: only one key present
105
+ * // endpoint: { // VoiceBotEndpoint Union: only one key present
106
+ * // llm: { // VoiceBotLlmEndpoint
107
+ * // prompt: "STRING_VALUE", // required
108
+ * // embeddedTools: [ // VoiceBotEmbeddedToolsList
109
+ * // { // VoiceBotEmbeddedTool
110
+ * // type: "HANGUP" || "TRANSFER", // required
111
+ * // name: "STRING_VALUE", // required
112
+ * // parameters: "DOCUMENT_VALUE",
113
+ * // },
114
+ * // ],
115
+ * // tools: [ // VoiceBotToolsList
116
+ * // { // VoiceBotTool
117
+ * // type: "function", // required
118
+ * // function: { // VoiceBotFunctionDefinition
119
+ * // name: "STRING_VALUE", // required
120
+ * // description: "STRING_VALUE",
121
+ * // parameters: "DOCUMENT_VALUE",
122
+ * // },
123
+ * // },
124
+ * // ],
125
+ * // },
86
126
  * // dialogflowCx: { // BotDialogflowCxEndpoint
87
127
  * // credentials: "DOCUMENT_VALUE", // required
88
128
  * // agent: "STRING_VALUE", // required
@@ -31,6 +31,7 @@ export declare const VoiceBotEventType: {
31
31
  readonly COMPLETE: "complete";
32
32
  readonly ENDED: "ended";
33
33
  readonly INTERRUPTION: "interruption";
34
+ readonly PLAYBACK: "playback";
34
35
  readonly REPLY: "reply";
35
36
  readonly STARTED: "started";
36
37
  readonly TRANSCRIPTION: "transcription";
@@ -88,6 +89,84 @@ export interface BotDialogflowCxEndpoint {
88
89
  */
89
90
  language: string;
90
91
  }
92
+ /**
93
+ * @public
94
+ * @enum
95
+ */
96
+ export declare const VoiceBotEmbeddedToolType: {
97
+ readonly HANGUP: "HANGUP";
98
+ readonly TRANSFER: "TRANSFER";
99
+ };
100
+ /**
101
+ * @public
102
+ */
103
+ export type VoiceBotEmbeddedToolType = typeof VoiceBotEmbeddedToolType[keyof typeof VoiceBotEmbeddedToolType];
104
+ /**
105
+ * @public
106
+ */
107
+ export interface VoiceBotEmbeddedTool {
108
+ type: VoiceBotEmbeddedToolType;
109
+ name: string;
110
+ /**
111
+ * The parameters the functions accepts.
112
+ * @public
113
+ */
114
+ parameters?: __DocumentType;
115
+ }
116
+ /**
117
+ * @public
118
+ */
119
+ export interface VoiceBotFunctionDefinition {
120
+ /**
121
+ * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
122
+ * @public
123
+ */
124
+ name: string;
125
+ /**
126
+ * A description of what the function does, used by the model to choose when and how to call the function.
127
+ * @public
128
+ */
129
+ description?: string;
130
+ /**
131
+ * The parameters the functions accepts, described as a JSON Schema object.
132
+ * @public
133
+ */
134
+ parameters?: __DocumentType;
135
+ }
136
+ /**
137
+ * @public
138
+ * @enum
139
+ */
140
+ export declare const VoiceBotToolType: {
141
+ readonly FUNCTION: "function";
142
+ };
143
+ /**
144
+ * @public
145
+ */
146
+ export type VoiceBotToolType = typeof VoiceBotToolType[keyof typeof VoiceBotToolType];
147
+ /**
148
+ * @public
149
+ */
150
+ export interface VoiceBotTool {
151
+ type: VoiceBotToolType;
152
+ function?: VoiceBotFunctionDefinition;
153
+ }
154
+ /**
155
+ * @public
156
+ */
157
+ export interface VoiceBotLlmEndpoint {
158
+ prompt: string;
159
+ /**
160
+ * Embedded functions to use within voice session.
161
+ * @public
162
+ */
163
+ embeddedTools?: (VoiceBotEmbeddedTool)[];
164
+ /**
165
+ * Custom tools to be used within voice session.
166
+ * @public
167
+ */
168
+ tools?: (VoiceBotTool)[];
169
+ }
91
170
  /**
92
171
  * @public
93
172
  */
@@ -113,12 +192,21 @@ export interface BotWebhookEndpoint {
113
192
  /**
114
193
  * @public
115
194
  */
116
- export type BotEndpoint = BotEndpoint.DialogflowCxMember | BotEndpoint.OpenAiAssistantMember | BotEndpoint.SqsMember | BotEndpoint.WebhookMember | BotEndpoint.$UnknownMember;
195
+ export type VoiceBotEndpoint = VoiceBotEndpoint.DialogflowCxMember | VoiceBotEndpoint.LlmMember | VoiceBotEndpoint.OpenAiAssistantMember | VoiceBotEndpoint.SqsMember | VoiceBotEndpoint.WebhookMember | VoiceBotEndpoint.$UnknownMember;
117
196
  /**
118
197
  * @public
119
198
  */
120
- export declare namespace BotEndpoint {
199
+ export declare namespace VoiceBotEndpoint {
200
+ interface LlmMember {
201
+ llm: VoiceBotLlmEndpoint;
202
+ dialogflowCx?: never;
203
+ openAiAssistant?: never;
204
+ webhook?: never;
205
+ sqs?: never;
206
+ $unknown?: never;
207
+ }
121
208
  interface DialogflowCxMember {
209
+ llm?: never;
122
210
  dialogflowCx: BotDialogflowCxEndpoint;
123
211
  openAiAssistant?: never;
124
212
  webhook?: never;
@@ -126,6 +214,7 @@ export declare namespace BotEndpoint {
126
214
  $unknown?: never;
127
215
  }
128
216
  interface OpenAiAssistantMember {
217
+ llm?: never;
129
218
  dialogflowCx?: never;
130
219
  openAiAssistant: BotOpenAiAssistantEndpoint;
131
220
  webhook?: never;
@@ -133,6 +222,7 @@ export declare namespace BotEndpoint {
133
222
  $unknown?: never;
134
223
  }
135
224
  interface WebhookMember {
225
+ llm?: never;
136
226
  dialogflowCx?: never;
137
227
  openAiAssistant?: never;
138
228
  webhook: BotWebhookEndpoint;
@@ -140,6 +230,7 @@ export declare namespace BotEndpoint {
140
230
  $unknown?: never;
141
231
  }
142
232
  interface SqsMember {
233
+ llm?: never;
143
234
  dialogflowCx?: never;
144
235
  openAiAssistant?: never;
145
236
  webhook?: never;
@@ -150,6 +241,7 @@ export declare namespace BotEndpoint {
150
241
  * @public
151
242
  */
152
243
  interface $UnknownMember {
244
+ llm?: never;
153
245
  dialogflowCx?: never;
154
246
  openAiAssistant?: never;
155
247
  webhook?: never;
@@ -157,13 +249,14 @@ export declare namespace BotEndpoint {
157
249
  $unknown: [string, any];
158
250
  }
159
251
  interface Visitor<T> {
252
+ llm: (value: VoiceBotLlmEndpoint) => T;
160
253
  dialogflowCx: (value: BotDialogflowCxEndpoint) => T;
161
254
  openAiAssistant: (value: BotOpenAiAssistantEndpoint) => T;
162
255
  webhook: (value: BotWebhookEndpoint) => T;
163
256
  sqs: (value: BotSqsEndpoint) => T;
164
257
  _: (name: string, value: any) => T;
165
258
  }
166
- const visit: <T>(value: BotEndpoint, visitor: Visitor<T>) => T;
259
+ const visit: <T>(value: VoiceBotEndpoint, visitor: Visitor<T>) => T;
167
260
  }
168
261
  /**
169
262
  * @public
@@ -210,7 +303,7 @@ export interface CreateVoiceBotInput {
210
303
  * An endpoint to use to generate replies during voice bot session.
211
304
  * @public
212
305
  */
213
- endpoint: BotEndpoint;
306
+ endpoint: VoiceBotEndpoint;
214
307
  company?: string;
215
308
  }
216
309
  /**
@@ -228,7 +321,7 @@ export interface VoiceBot {
228
321
  * An endpoint to use to generate replies during voice bot session.
229
322
  * @public
230
323
  */
231
- endpoint: BotEndpoint;
324
+ endpoint: VoiceBotEndpoint;
232
325
  id: string;
233
326
  createdAt: string;
234
327
  updatedAt?: string;
@@ -310,6 +403,34 @@ export interface InterruptionWebsocketEvent {
310
403
  type: string;
311
404
  event: InterruptionEvent;
312
405
  }
406
+ /**
407
+ * @public
408
+ */
409
+ export interface PlaybackEvent {
410
+ type: VoiceBotEventType;
411
+ replyId: string;
412
+ text: string;
413
+ complete: boolean;
414
+ startTime: number;
415
+ endTime?: number;
416
+ }
417
+ /**
418
+ * @public
419
+ */
420
+ export interface PlaybackWebhookEvent {
421
+ sessionId: string;
422
+ botId: string;
423
+ callId: string;
424
+ flowIndex: number;
425
+ event: PlaybackEvent;
426
+ }
427
+ /**
428
+ * @public
429
+ */
430
+ export interface PlaybackWebsocketEvent {
431
+ type: string;
432
+ event: PlaybackEvent;
433
+ }
313
434
  /**
314
435
  * @public
315
436
  */
@@ -440,6 +561,7 @@ export interface TransferWebsocketCommand {
440
561
  export interface DescribeEventOutput {
441
562
  TranscriptionWebsocketEvent?: TranscriptionWebsocketEvent;
442
563
  ReplyWebsocketEvent?: ReplyWebsocketEvent;
564
+ PlaybackWebsocketEvent?: PlaybackWebsocketEvent;
443
565
  InterruptionWebsocketEvent?: InterruptionWebsocketEvent;
444
566
  CompleteWebsocketEvent?: CompleteWebsocketEvent;
445
567
  SayWebsocketCommand?: SayWebsocketCommand;
@@ -449,6 +571,7 @@ export interface DescribeEventOutput {
449
571
  SessionEndedWebhookEvent?: SessionEndedWebhookEvent;
450
572
  TranscriptionWebhookEvent?: TranscriptionWebhookEvent;
451
573
  ReplyWebhookEvent?: ReplyWebhookEvent;
574
+ PlaybackWebhookEvent?: PlaybackWebhookEvent;
452
575
  InterruptionWebhookEvent?: InterruptionWebhookEvent;
453
576
  CompleteWebhookEvent?: CompleteWebhookEvent;
454
577
  }
@@ -574,7 +697,7 @@ export interface UpdateVoiceBotInput {
574
697
  * An endpoint to use to generate replies during voice bot session.
575
698
  * @public
576
699
  */
577
- endpoint: BotEndpoint;
700
+ endpoint: VoiceBotEndpoint;
578
701
  company?: string;
579
702
  botId: string;
580
703
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wildix/wim-voicebots-client",
3
3
  "description": "@wildix/wim-voicebots-client client",
4
- "version": "1.0.4",
4
+ "version": "1.0.6",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",