@wildix/wim-voicebots-client 1.0.5 → 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) {
@@ -37,9 +37,18 @@ exports.VoiceBotEventType = {
37
37
  STARTED: "started",
38
38
  TRANSCRIPTION: "transcription",
39
39
  };
40
- var BotEndpoint;
41
- (function (BotEndpoint) {
42
- 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);
43
52
  if (value.dialogflowCx !== undefined)
44
53
  return visitor.dialogflowCx(value.dialogflowCx);
45
54
  if (value.openAiAssistant !== undefined)
@@ -50,7 +59,7 @@ var BotEndpoint;
50
59
  return visitor.sqs(value.sqs);
51
60
  return visitor._(value.$unknown[0], value.$unknown[1]);
52
61
  };
53
- })(BotEndpoint = exports.BotEndpoint || (exports.BotEndpoint = {}));
62
+ })(VoiceBotEndpoint = exports.VoiceBotEndpoint || (exports.VoiceBotEndpoint = {}));
54
63
  exports.VoiceBotCommandType = {
55
64
  HANGUP: "hangup",
56
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)(_),
@@ -416,30 +416,68 @@ const de_VoiceSessionNotFoundExceptionRes = async (parsedOutput, context) => {
416
416
  const se_Document = (input, context) => {
417
417
  return input;
418
418
  };
419
- const se_BotDialogflowCxEndpoint = (input, context) => {
419
+ const se_VoiceBotEmbeddedTool = (input, context) => {
420
420
  return (0, smithy_client_1.take)(input, {
421
- 'agent': [],
422
- 'credentials': _ => se_Document(_, context),
423
- 'language': [],
424
- '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);
425
429
  });
426
430
  };
427
- const se_BotEndpoint = (input, context) => {
428
- return models_0_1.BotEndpoint.visit(input, {
431
+ const se_VoiceBotEndpoint = (input, context) => {
432
+ return models_0_1.VoiceBotEndpoint.visit(input, {
429
433
  dialogflowCx: value => ({ "dialogflowCx": se_BotDialogflowCxEndpoint(value, context) }),
434
+ llm: value => ({ "llm": se_VoiceBotLlmEndpoint(value, context) }),
430
435
  openAiAssistant: value => ({ "openAiAssistant": (0, smithy_client_1._json)(value) }),
431
436
  sqs: value => ({ "sqs": (0, smithy_client_1._json)(value) }),
432
437
  webhook: value => ({ "webhook": (0, smithy_client_1._json)(value) }),
433
438
  _: (name, value) => ({ name: value })
434
439
  });
435
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
+ };
436
474
  const de_Document = (output, context) => {
437
475
  return output;
438
476
  };
439
477
  const de_VoiceBot = (output, context) => {
440
478
  return (0, smithy_client_1.take)(output, {
441
479
  'createdAt': smithy_client_1.expectString,
442
- 'endpoint': (_) => de_BotEndpoint((0, smithy_client_1.expectUnion)(_), context),
480
+ 'endpoint': (_) => de_VoiceBotEndpoint((0, smithy_client_1.expectUnion)(_), context),
443
481
  'id': smithy_client_1.expectString,
444
482
  'message': smithy_client_1.expectString,
445
483
  'name': smithy_client_1.expectString,
@@ -447,26 +485,30 @@ const de_VoiceBot = (output, context) => {
447
485
  'updatedAt': smithy_client_1.expectString,
448
486
  });
449
487
  };
450
- const de_VoiceBotsList = (output, context) => {
451
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
452
- 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,
453
493
  });
454
- return retVal;
455
494
  };
456
- const de_BotDialogflowCxEndpoint = (output, context) => {
457
- return (0, smithy_client_1.take)(output, {
458
- 'agent': smithy_client_1.expectString,
459
- 'credentials': (_) => de_Document(_, context),
460
- 'language': smithy_client_1.expectString,
461
- '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);
462
498
  });
499
+ return retVal;
463
500
  };
464
- const de_BotEndpoint = (output, context) => {
501
+ const de_VoiceBotEndpoint = (output, context) => {
465
502
  if (output.dialogflowCx != null) {
466
503
  return {
467
504
  dialogflowCx: de_BotDialogflowCxEndpoint(output.dialogflowCx, context)
468
505
  };
469
506
  }
507
+ if (output.llm != null) {
508
+ return {
509
+ llm: de_VoiceBotLlmEndpoint(output.llm, context)
510
+ };
511
+ }
470
512
  if (output.openAiAssistant != null) {
471
513
  return {
472
514
  openAiAssistant: (0, smithy_client_1._json)(output.openAiAssistant)
@@ -484,6 +526,46 @@ const de_BotEndpoint = (output, context) => {
484
526
  }
485
527
  return { $unknown: Object.entries(output)[0] };
486
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
+ };
487
569
  const deserializeMetadata = (output) => ({
488
570
  httpStatusCode: output.statusCode,
489
571
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -32,9 +32,18 @@ export const VoiceBotEventType = {
32
32
  STARTED: "started",
33
33
  TRANSCRIPTION: "transcription",
34
34
  };
35
- export var BotEndpoint;
36
- (function (BotEndpoint) {
37
- 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);
38
47
  if (value.dialogflowCx !== undefined)
39
48
  return visitor.dialogflowCx(value.dialogflowCx);
40
49
  if (value.openAiAssistant !== undefined)
@@ -45,7 +54,7 @@ export var BotEndpoint;
45
54
  return visitor.sqs(value.sqs);
46
55
  return visitor._(value.$unknown[0], value.$unknown[1]);
47
56
  };
48
- })(BotEndpoint || (BotEndpoint = {}));
57
+ })(VoiceBotEndpoint || (VoiceBotEndpoint = {}));
49
58
  export const VoiceBotCommandType = {
50
59
  HANGUP: "hangup",
51
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(_),
@@ -393,30 +393,68 @@ const de_VoiceSessionNotFoundExceptionRes = async (parsedOutput, context) => {
393
393
  const se_Document = (input, context) => {
394
394
  return input;
395
395
  };
396
- const se_BotDialogflowCxEndpoint = (input, context) => {
396
+ const se_VoiceBotEmbeddedTool = (input, context) => {
397
397
  return take(input, {
398
- 'agent': [],
399
- 'credentials': _ => se_Document(_, context),
400
- 'language': [],
401
- '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);
402
406
  });
403
407
  };
404
- const se_BotEndpoint = (input, context) => {
405
- return BotEndpoint.visit(input, {
408
+ const se_VoiceBotEndpoint = (input, context) => {
409
+ return VoiceBotEndpoint.visit(input, {
406
410
  dialogflowCx: value => ({ "dialogflowCx": se_BotDialogflowCxEndpoint(value, context) }),
411
+ llm: value => ({ "llm": se_VoiceBotLlmEndpoint(value, context) }),
407
412
  openAiAssistant: value => ({ "openAiAssistant": _json(value) }),
408
413
  sqs: value => ({ "sqs": _json(value) }),
409
414
  webhook: value => ({ "webhook": _json(value) }),
410
415
  _: (name, value) => ({ name: value })
411
416
  });
412
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
+ };
413
451
  const de_Document = (output, context) => {
414
452
  return output;
415
453
  };
416
454
  const de_VoiceBot = (output, context) => {
417
455
  return take(output, {
418
456
  'createdAt': __expectString,
419
- 'endpoint': (_) => de_BotEndpoint(__expectUnion(_), context),
457
+ 'endpoint': (_) => de_VoiceBotEndpoint(__expectUnion(_), context),
420
458
  'id': __expectString,
421
459
  'message': __expectString,
422
460
  'name': __expectString,
@@ -424,26 +462,30 @@ const de_VoiceBot = (output, context) => {
424
462
  'updatedAt': __expectString,
425
463
  });
426
464
  };
427
- const de_VoiceBotsList = (output, context) => {
428
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
429
- 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,
430
470
  });
431
- return retVal;
432
471
  };
433
- const de_BotDialogflowCxEndpoint = (output, context) => {
434
- return take(output, {
435
- 'agent': __expectString,
436
- 'credentials': (_) => de_Document(_, context),
437
- 'language': __expectString,
438
- 'location': __expectString,
472
+ const de_VoiceBotEmbeddedToolsList = (output, context) => {
473
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
474
+ return de_VoiceBotEmbeddedTool(entry, context);
439
475
  });
476
+ return retVal;
440
477
  };
441
- const de_BotEndpoint = (output, context) => {
478
+ const de_VoiceBotEndpoint = (output, context) => {
442
479
  if (output.dialogflowCx != null) {
443
480
  return {
444
481
  dialogflowCx: de_BotDialogflowCxEndpoint(output.dialogflowCx, context)
445
482
  };
446
483
  }
484
+ if (output.llm != null) {
485
+ return {
486
+ llm: de_VoiceBotLlmEndpoint(output.llm, context)
487
+ };
488
+ }
447
489
  if (output.openAiAssistant != null) {
448
490
  return {
449
491
  openAiAssistant: _json(output.openAiAssistant)
@@ -461,6 +503,46 @@ const de_BotEndpoint = (output, context) => {
461
503
  }
462
504
  return { $unknown: Object.entries(output)[0] };
463
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
+ };
464
546
  const deserializeMetadata = (output) => ({
465
547
  httpStatusCode: output.statusCode,
466
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
@@ -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
@@ -89,6 +89,84 @@ export interface BotDialogflowCxEndpoint {
89
89
  */
90
90
  language: string;
91
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
+ }
92
170
  /**
93
171
  * @public
94
172
  */
@@ -114,12 +192,21 @@ export interface BotWebhookEndpoint {
114
192
  /**
115
193
  * @public
116
194
  */
117
- 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;
118
196
  /**
119
197
  * @public
120
198
  */
121
- 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
+ }
122
208
  interface DialogflowCxMember {
209
+ llm?: never;
123
210
  dialogflowCx: BotDialogflowCxEndpoint;
124
211
  openAiAssistant?: never;
125
212
  webhook?: never;
@@ -127,6 +214,7 @@ export declare namespace BotEndpoint {
127
214
  $unknown?: never;
128
215
  }
129
216
  interface OpenAiAssistantMember {
217
+ llm?: never;
130
218
  dialogflowCx?: never;
131
219
  openAiAssistant: BotOpenAiAssistantEndpoint;
132
220
  webhook?: never;
@@ -134,6 +222,7 @@ export declare namespace BotEndpoint {
134
222
  $unknown?: never;
135
223
  }
136
224
  interface WebhookMember {
225
+ llm?: never;
137
226
  dialogflowCx?: never;
138
227
  openAiAssistant?: never;
139
228
  webhook: BotWebhookEndpoint;
@@ -141,6 +230,7 @@ export declare namespace BotEndpoint {
141
230
  $unknown?: never;
142
231
  }
143
232
  interface SqsMember {
233
+ llm?: never;
144
234
  dialogflowCx?: never;
145
235
  openAiAssistant?: never;
146
236
  webhook?: never;
@@ -151,6 +241,7 @@ export declare namespace BotEndpoint {
151
241
  * @public
152
242
  */
153
243
  interface $UnknownMember {
244
+ llm?: never;
154
245
  dialogflowCx?: never;
155
246
  openAiAssistant?: never;
156
247
  webhook?: never;
@@ -158,13 +249,14 @@ export declare namespace BotEndpoint {
158
249
  $unknown: [string, any];
159
250
  }
160
251
  interface Visitor<T> {
252
+ llm: (value: VoiceBotLlmEndpoint) => T;
161
253
  dialogflowCx: (value: BotDialogflowCxEndpoint) => T;
162
254
  openAiAssistant: (value: BotOpenAiAssistantEndpoint) => T;
163
255
  webhook: (value: BotWebhookEndpoint) => T;
164
256
  sqs: (value: BotSqsEndpoint) => T;
165
257
  _: (name: string, value: any) => T;
166
258
  }
167
- const visit: <T>(value: BotEndpoint, visitor: Visitor<T>) => T;
259
+ const visit: <T>(value: VoiceBotEndpoint, visitor: Visitor<T>) => T;
168
260
  }
169
261
  /**
170
262
  * @public
@@ -211,7 +303,7 @@ export interface CreateVoiceBotInput {
211
303
  * An endpoint to use to generate replies during voice bot session.
212
304
  * @public
213
305
  */
214
- endpoint: BotEndpoint;
306
+ endpoint: VoiceBotEndpoint;
215
307
  company?: string;
216
308
  }
217
309
  /**
@@ -229,7 +321,7 @@ export interface VoiceBot {
229
321
  * An endpoint to use to generate replies during voice bot session.
230
322
  * @public
231
323
  */
232
- endpoint: BotEndpoint;
324
+ endpoint: VoiceBotEndpoint;
233
325
  id: string;
234
326
  createdAt: string;
235
327
  updatedAt?: string;
@@ -605,7 +697,7 @@ export interface UpdateVoiceBotInput {
605
697
  * An endpoint to use to generate replies during voice bot session.
606
698
  * @public
607
699
  */
608
- endpoint: BotEndpoint;
700
+ endpoint: VoiceBotEndpoint;
609
701
  company?: string;
610
702
  botId: string;
611
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.5",
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",