@wildix/wim-voicebots-client 1.0.5 → 1.0.7
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/dist-cjs/models/models_0.js +22 -5
- package/dist-cjs/protocols/Aws_restJson1.js +137 -21
- package/dist-es/models/models_0.js +21 -4
- package/dist-es/protocols/Aws_restJson1.js +139 -23
- package/dist-types/commands/CreateVoiceBotCommand.d.ts +70 -2
- package/dist-types/commands/GetVoiceBotCommand.d.ts +35 -1
- package/dist-types/commands/ListVoiceBotsCommand.d.ts +35 -1
- package/dist-types/commands/UpdateVoiceBotCommand.d.ts +70 -2
- package/dist-types/models/models_0.d.ts +141 -6
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VoiceSessionNotFoundException = exports.VoiceBotNotFoundException = exports.VoiceBotCommandType = exports.
|
|
3
|
+
exports.VoiceSessionNotFoundException = exports.VoiceBotNotFoundException = exports.VoiceBotCommandType = exports.VoiceBotEndpoint = exports.VoiceBotToolType = exports.VoiceBotFunctionIntegration = 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,26 @@ exports.VoiceBotEventType = {
|
|
|
37
37
|
STARTED: "started",
|
|
38
38
|
TRANSCRIPTION: "transcription",
|
|
39
39
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
exports.VoiceBotEmbeddedToolType = {
|
|
41
|
+
HANGUP: "HANGUP",
|
|
42
|
+
TRANSFER: "TRANSFER",
|
|
43
|
+
};
|
|
44
|
+
var VoiceBotFunctionIntegration;
|
|
45
|
+
(function (VoiceBotFunctionIntegration) {
|
|
46
|
+
VoiceBotFunctionIntegration.visit = (value, visitor) => {
|
|
47
|
+
if (value.webhook !== undefined)
|
|
48
|
+
return visitor.webhook(value.webhook);
|
|
49
|
+
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
50
|
+
};
|
|
51
|
+
})(VoiceBotFunctionIntegration = exports.VoiceBotFunctionIntegration || (exports.VoiceBotFunctionIntegration = {}));
|
|
52
|
+
exports.VoiceBotToolType = {
|
|
53
|
+
FUNCTION: "function",
|
|
54
|
+
};
|
|
55
|
+
var VoiceBotEndpoint;
|
|
56
|
+
(function (VoiceBotEndpoint) {
|
|
57
|
+
VoiceBotEndpoint.visit = (value, visitor) => {
|
|
58
|
+
if (value.llm !== undefined)
|
|
59
|
+
return visitor.llm(value.llm);
|
|
43
60
|
if (value.dialogflowCx !== undefined)
|
|
44
61
|
return visitor.dialogflowCx(value.dialogflowCx);
|
|
45
62
|
if (value.openAiAssistant !== undefined)
|
|
@@ -50,7 +67,7 @@ var BotEndpoint;
|
|
|
50
67
|
return visitor.sqs(value.sqs);
|
|
51
68
|
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
52
69
|
};
|
|
53
|
-
})(
|
|
70
|
+
})(VoiceBotEndpoint = exports.VoiceBotEndpoint || (exports.VoiceBotEndpoint = {}));
|
|
54
71
|
exports.VoiceBotCommandType = {
|
|
55
72
|
HANGUP: "hangup",
|
|
56
73
|
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': _ =>
|
|
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': _ =>
|
|
173
|
+
'endpoint': _ => se_VoiceBotEndpoint(_, context),
|
|
174
174
|
'message': [],
|
|
175
175
|
'name': [],
|
|
176
176
|
'pipeline': _ => (0, smithy_client_1._json)(_),
|
|
@@ -416,30 +416,84 @@ const de_VoiceSessionNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
|
416
416
|
const se_Document = (input, context) => {
|
|
417
417
|
return input;
|
|
418
418
|
};
|
|
419
|
-
const
|
|
419
|
+
const se_VoiceBotEmbeddedTool = (input, context) => {
|
|
420
420
|
return (0, smithy_client_1.take)(input, {
|
|
421
|
-
'
|
|
422
|
-
'
|
|
423
|
-
'
|
|
424
|
-
'location': [],
|
|
421
|
+
'name': [],
|
|
422
|
+
'parameters': _ => se_Document(_, context),
|
|
423
|
+
'type': [],
|
|
425
424
|
});
|
|
426
425
|
};
|
|
427
|
-
const
|
|
428
|
-
return
|
|
426
|
+
const se_VoiceBotEmbeddedToolsList = (input, context) => {
|
|
427
|
+
return input.filter((e) => e != null).map(entry => {
|
|
428
|
+
return se_VoiceBotEmbeddedTool(entry, context);
|
|
429
|
+
});
|
|
430
|
+
};
|
|
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
|
+
'integration': _ => se_VoiceBotFunctionIntegration(_, context),
|
|
445
|
+
'name': [],
|
|
446
|
+
'parameters': _ => se_Document(_, context),
|
|
447
|
+
});
|
|
448
|
+
};
|
|
449
|
+
const se_VoiceBotFunctionIntegration = (input, context) => {
|
|
450
|
+
return models_0_1.VoiceBotFunctionIntegration.visit(input, {
|
|
451
|
+
webhook: value => ({ "webhook": se_VoiceBotFunctionIntegrationWebhook(value, context) }),
|
|
452
|
+
_: (name, value) => ({ name: value })
|
|
453
|
+
});
|
|
454
|
+
};
|
|
455
|
+
const se_VoiceBotFunctionIntegrationWebhook = (input, context) => {
|
|
456
|
+
return (0, smithy_client_1.take)(input, {
|
|
457
|
+
'async': [],
|
|
458
|
+
'authorization': _ => se_Document(_, context),
|
|
459
|
+
'headers': smithy_client_1._json,
|
|
460
|
+
'timeout': [],
|
|
461
|
+
'url': [],
|
|
462
|
+
});
|
|
463
|
+
};
|
|
464
|
+
const se_VoiceBotLlmEndpoint = (input, context) => {
|
|
465
|
+
return (0, smithy_client_1.take)(input, {
|
|
466
|
+
'embeddedTools': _ => se_VoiceBotEmbeddedToolsList(_, context),
|
|
467
|
+
'prompt': [],
|
|
468
|
+
'tools': _ => se_VoiceBotToolsList(_, context),
|
|
469
|
+
});
|
|
470
|
+
};
|
|
471
|
+
const se_VoiceBotTool = (input, context) => {
|
|
472
|
+
return (0, smithy_client_1.take)(input, {
|
|
473
|
+
'function': _ => se_VoiceBotFunctionDefinition(_, context),
|
|
474
|
+
'type': [],
|
|
475
|
+
});
|
|
476
|
+
};
|
|
477
|
+
const se_VoiceBotToolsList = (input, context) => {
|
|
478
|
+
return input.filter((e) => e != null).map(entry => {
|
|
479
|
+
return se_VoiceBotTool(entry, context);
|
|
480
|
+
});
|
|
481
|
+
};
|
|
482
|
+
const se_BotDialogflowCxEndpoint = (input, context) => {
|
|
483
|
+
return (0, smithy_client_1.take)(input, {
|
|
484
|
+
'agent': [],
|
|
485
|
+
'credentials': _ => se_Document(_, context),
|
|
486
|
+
'language': [],
|
|
487
|
+
'location': [],
|
|
488
|
+
});
|
|
489
|
+
};
|
|
436
490
|
const de_Document = (output, context) => {
|
|
437
491
|
return output;
|
|
438
492
|
};
|
|
439
493
|
const de_VoiceBot = (output, context) => {
|
|
440
494
|
return (0, smithy_client_1.take)(output, {
|
|
441
495
|
'createdAt': smithy_client_1.expectString,
|
|
442
|
-
'endpoint': (_) =>
|
|
496
|
+
'endpoint': (_) => de_VoiceBotEndpoint((0, smithy_client_1.expectUnion)(_), context),
|
|
443
497
|
'id': smithy_client_1.expectString,
|
|
444
498
|
'message': smithy_client_1.expectString,
|
|
445
499
|
'name': smithy_client_1.expectString,
|
|
@@ -447,26 +501,30 @@ const de_VoiceBot = (output, context) => {
|
|
|
447
501
|
'updatedAt': smithy_client_1.expectString,
|
|
448
502
|
});
|
|
449
503
|
};
|
|
450
|
-
const
|
|
451
|
-
|
|
452
|
-
|
|
504
|
+
const de_VoiceBotEmbeddedTool = (output, context) => {
|
|
505
|
+
return (0, smithy_client_1.take)(output, {
|
|
506
|
+
'name': smithy_client_1.expectString,
|
|
507
|
+
'parameters': (_) => de_Document(_, context),
|
|
508
|
+
'type': smithy_client_1.expectString,
|
|
453
509
|
});
|
|
454
|
-
return retVal;
|
|
455
510
|
};
|
|
456
|
-
const
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
'credentials': (_) => de_Document(_, context),
|
|
460
|
-
'language': smithy_client_1.expectString,
|
|
461
|
-
'location': smithy_client_1.expectString,
|
|
511
|
+
const de_VoiceBotEmbeddedToolsList = (output, context) => {
|
|
512
|
+
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
513
|
+
return de_VoiceBotEmbeddedTool(entry, context);
|
|
462
514
|
});
|
|
515
|
+
return retVal;
|
|
463
516
|
};
|
|
464
|
-
const
|
|
517
|
+
const de_VoiceBotEndpoint = (output, context) => {
|
|
465
518
|
if (output.dialogflowCx != null) {
|
|
466
519
|
return {
|
|
467
520
|
dialogflowCx: de_BotDialogflowCxEndpoint(output.dialogflowCx, context)
|
|
468
521
|
};
|
|
469
522
|
}
|
|
523
|
+
if (output.llm != null) {
|
|
524
|
+
return {
|
|
525
|
+
llm: de_VoiceBotLlmEndpoint(output.llm, context)
|
|
526
|
+
};
|
|
527
|
+
}
|
|
470
528
|
if (output.openAiAssistant != null) {
|
|
471
529
|
return {
|
|
472
530
|
openAiAssistant: (0, smithy_client_1._json)(output.openAiAssistant)
|
|
@@ -484,6 +542,64 @@ const de_BotEndpoint = (output, context) => {
|
|
|
484
542
|
}
|
|
485
543
|
return { $unknown: Object.entries(output)[0] };
|
|
486
544
|
};
|
|
545
|
+
const de_VoiceBotFunctionDefinition = (output, context) => {
|
|
546
|
+
return (0, smithy_client_1.take)(output, {
|
|
547
|
+
'description': smithy_client_1.expectString,
|
|
548
|
+
'integration': (_) => de_VoiceBotFunctionIntegration((0, smithy_client_1.expectUnion)(_), context),
|
|
549
|
+
'name': smithy_client_1.expectString,
|
|
550
|
+
'parameters': (_) => de_Document(_, context),
|
|
551
|
+
});
|
|
552
|
+
};
|
|
553
|
+
const de_VoiceBotFunctionIntegration = (output, context) => {
|
|
554
|
+
if (output.webhook != null) {
|
|
555
|
+
return {
|
|
556
|
+
webhook: de_VoiceBotFunctionIntegrationWebhook(output.webhook, context)
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
return { $unknown: Object.entries(output)[0] };
|
|
560
|
+
};
|
|
561
|
+
const de_VoiceBotFunctionIntegrationWebhook = (output, context) => {
|
|
562
|
+
return (0, smithy_client_1.take)(output, {
|
|
563
|
+
'async': smithy_client_1.expectBoolean,
|
|
564
|
+
'authorization': (_) => de_Document(_, context),
|
|
565
|
+
'headers': smithy_client_1._json,
|
|
566
|
+
'timeout': smithy_client_1.expectInt32,
|
|
567
|
+
'url': smithy_client_1.expectString,
|
|
568
|
+
});
|
|
569
|
+
};
|
|
570
|
+
const de_VoiceBotLlmEndpoint = (output, context) => {
|
|
571
|
+
return (0, smithy_client_1.take)(output, {
|
|
572
|
+
'embeddedTools': (_) => de_VoiceBotEmbeddedToolsList(_, context),
|
|
573
|
+
'prompt': smithy_client_1.expectString,
|
|
574
|
+
'tools': (_) => de_VoiceBotToolsList(_, context),
|
|
575
|
+
});
|
|
576
|
+
};
|
|
577
|
+
const de_VoiceBotsList = (output, context) => {
|
|
578
|
+
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
579
|
+
return de_VoiceBot(entry, context);
|
|
580
|
+
});
|
|
581
|
+
return retVal;
|
|
582
|
+
};
|
|
583
|
+
const de_VoiceBotTool = (output, context) => {
|
|
584
|
+
return (0, smithy_client_1.take)(output, {
|
|
585
|
+
'function': (_) => de_VoiceBotFunctionDefinition(_, context),
|
|
586
|
+
'type': smithy_client_1.expectString,
|
|
587
|
+
});
|
|
588
|
+
};
|
|
589
|
+
const de_VoiceBotToolsList = (output, context) => {
|
|
590
|
+
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
591
|
+
return de_VoiceBotTool(entry, context);
|
|
592
|
+
});
|
|
593
|
+
return retVal;
|
|
594
|
+
};
|
|
595
|
+
const de_BotDialogflowCxEndpoint = (output, context) => {
|
|
596
|
+
return (0, smithy_client_1.take)(output, {
|
|
597
|
+
'agent': smithy_client_1.expectString,
|
|
598
|
+
'credentials': (_) => de_Document(_, context),
|
|
599
|
+
'language': smithy_client_1.expectString,
|
|
600
|
+
'location': smithy_client_1.expectString,
|
|
601
|
+
});
|
|
602
|
+
};
|
|
487
603
|
const deserializeMetadata = (output) => ({
|
|
488
604
|
httpStatusCode: output.statusCode,
|
|
489
605
|
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
@@ -32,9 +32,26 @@ export const VoiceBotEventType = {
|
|
|
32
32
|
STARTED: "started",
|
|
33
33
|
TRANSCRIPTION: "transcription",
|
|
34
34
|
};
|
|
35
|
-
export
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
export const VoiceBotEmbeddedToolType = {
|
|
36
|
+
HANGUP: "HANGUP",
|
|
37
|
+
TRANSFER: "TRANSFER",
|
|
38
|
+
};
|
|
39
|
+
export var VoiceBotFunctionIntegration;
|
|
40
|
+
(function (VoiceBotFunctionIntegration) {
|
|
41
|
+
VoiceBotFunctionIntegration.visit = (value, visitor) => {
|
|
42
|
+
if (value.webhook !== undefined)
|
|
43
|
+
return visitor.webhook(value.webhook);
|
|
44
|
+
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
45
|
+
};
|
|
46
|
+
})(VoiceBotFunctionIntegration || (VoiceBotFunctionIntegration = {}));
|
|
47
|
+
export const VoiceBotToolType = {
|
|
48
|
+
FUNCTION: "function",
|
|
49
|
+
};
|
|
50
|
+
export var VoiceBotEndpoint;
|
|
51
|
+
(function (VoiceBotEndpoint) {
|
|
52
|
+
VoiceBotEndpoint.visit = (value, visitor) => {
|
|
53
|
+
if (value.llm !== undefined)
|
|
54
|
+
return visitor.llm(value.llm);
|
|
38
55
|
if (value.dialogflowCx !== undefined)
|
|
39
56
|
return visitor.dialogflowCx(value.dialogflowCx);
|
|
40
57
|
if (value.openAiAssistant !== undefined)
|
|
@@ -45,7 +62,7 @@ export var BotEndpoint;
|
|
|
45
62
|
return visitor.sqs(value.sqs);
|
|
46
63
|
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
47
64
|
};
|
|
48
|
-
})(
|
|
65
|
+
})(VoiceBotEndpoint || (VoiceBotEndpoint = {}));
|
|
49
66
|
export const VoiceBotCommandType = {
|
|
50
67
|
HANGUP: "hangup",
|
|
51
68
|
SAY: "say",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VoiceBotsServiceException as __BaseException } from "../models/VoiceBotsServiceException";
|
|
2
|
-
import {
|
|
2
|
+
import { ForbiddenException, ValidationException, VoiceBotEndpoint, VoiceBotFunctionIntegration, VoiceBotNotFoundException, VoiceSessionNotFoundException, } from "../models/models_0";
|
|
3
3
|
import { requestBuilder as rb } from "@smithy/core";
|
|
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";
|
|
4
|
+
import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, 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) => {
|
|
6
6
|
const b = rb(input, context);
|
|
7
7
|
const headers = {
|
|
@@ -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': _ =>
|
|
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': _ =>
|
|
161
|
+
'endpoint': _ => se_VoiceBotEndpoint(_, context),
|
|
162
162
|
'message': [],
|
|
163
163
|
'name': [],
|
|
164
164
|
'pipeline': _ => _json(_),
|
|
@@ -393,30 +393,84 @@ const de_VoiceSessionNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
|
393
393
|
const se_Document = (input, context) => {
|
|
394
394
|
return input;
|
|
395
395
|
};
|
|
396
|
-
const
|
|
396
|
+
const se_VoiceBotEmbeddedTool = (input, context) => {
|
|
397
397
|
return take(input, {
|
|
398
|
-
'
|
|
399
|
-
'
|
|
400
|
-
'
|
|
401
|
-
'location': [],
|
|
398
|
+
'name': [],
|
|
399
|
+
'parameters': _ => se_Document(_, context),
|
|
400
|
+
'type': [],
|
|
402
401
|
});
|
|
403
402
|
};
|
|
404
|
-
const
|
|
405
|
-
return
|
|
403
|
+
const se_VoiceBotEmbeddedToolsList = (input, context) => {
|
|
404
|
+
return input.filter((e) => e != null).map(entry => {
|
|
405
|
+
return se_VoiceBotEmbeddedTool(entry, context);
|
|
406
|
+
});
|
|
407
|
+
};
|
|
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
|
+
'integration': _ => se_VoiceBotFunctionIntegration(_, context),
|
|
422
|
+
'name': [],
|
|
423
|
+
'parameters': _ => se_Document(_, context),
|
|
424
|
+
});
|
|
425
|
+
};
|
|
426
|
+
const se_VoiceBotFunctionIntegration = (input, context) => {
|
|
427
|
+
return VoiceBotFunctionIntegration.visit(input, {
|
|
428
|
+
webhook: value => ({ "webhook": se_VoiceBotFunctionIntegrationWebhook(value, context) }),
|
|
429
|
+
_: (name, value) => ({ name: value })
|
|
430
|
+
});
|
|
431
|
+
};
|
|
432
|
+
const se_VoiceBotFunctionIntegrationWebhook = (input, context) => {
|
|
433
|
+
return take(input, {
|
|
434
|
+
'async': [],
|
|
435
|
+
'authorization': _ => se_Document(_, context),
|
|
436
|
+
'headers': _json,
|
|
437
|
+
'timeout': [],
|
|
438
|
+
'url': [],
|
|
439
|
+
});
|
|
440
|
+
};
|
|
441
|
+
const se_VoiceBotLlmEndpoint = (input, context) => {
|
|
442
|
+
return take(input, {
|
|
443
|
+
'embeddedTools': _ => se_VoiceBotEmbeddedToolsList(_, context),
|
|
444
|
+
'prompt': [],
|
|
445
|
+
'tools': _ => se_VoiceBotToolsList(_, context),
|
|
446
|
+
});
|
|
447
|
+
};
|
|
448
|
+
const se_VoiceBotTool = (input, context) => {
|
|
449
|
+
return take(input, {
|
|
450
|
+
'function': _ => se_VoiceBotFunctionDefinition(_, context),
|
|
451
|
+
'type': [],
|
|
452
|
+
});
|
|
453
|
+
};
|
|
454
|
+
const se_VoiceBotToolsList = (input, context) => {
|
|
455
|
+
return input.filter((e) => e != null).map(entry => {
|
|
456
|
+
return se_VoiceBotTool(entry, context);
|
|
457
|
+
});
|
|
458
|
+
};
|
|
459
|
+
const se_BotDialogflowCxEndpoint = (input, context) => {
|
|
460
|
+
return take(input, {
|
|
461
|
+
'agent': [],
|
|
462
|
+
'credentials': _ => se_Document(_, context),
|
|
463
|
+
'language': [],
|
|
464
|
+
'location': [],
|
|
465
|
+
});
|
|
466
|
+
};
|
|
413
467
|
const de_Document = (output, context) => {
|
|
414
468
|
return output;
|
|
415
469
|
};
|
|
416
470
|
const de_VoiceBot = (output, context) => {
|
|
417
471
|
return take(output, {
|
|
418
472
|
'createdAt': __expectString,
|
|
419
|
-
'endpoint': (_) =>
|
|
473
|
+
'endpoint': (_) => de_VoiceBotEndpoint(__expectUnion(_), context),
|
|
420
474
|
'id': __expectString,
|
|
421
475
|
'message': __expectString,
|
|
422
476
|
'name': __expectString,
|
|
@@ -424,26 +478,30 @@ const de_VoiceBot = (output, context) => {
|
|
|
424
478
|
'updatedAt': __expectString,
|
|
425
479
|
});
|
|
426
480
|
};
|
|
427
|
-
const
|
|
428
|
-
|
|
429
|
-
|
|
481
|
+
const de_VoiceBotEmbeddedTool = (output, context) => {
|
|
482
|
+
return take(output, {
|
|
483
|
+
'name': __expectString,
|
|
484
|
+
'parameters': (_) => de_Document(_, context),
|
|
485
|
+
'type': __expectString,
|
|
430
486
|
});
|
|
431
|
-
return retVal;
|
|
432
487
|
};
|
|
433
|
-
const
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
'credentials': (_) => de_Document(_, context),
|
|
437
|
-
'language': __expectString,
|
|
438
|
-
'location': __expectString,
|
|
488
|
+
const de_VoiceBotEmbeddedToolsList = (output, context) => {
|
|
489
|
+
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
490
|
+
return de_VoiceBotEmbeddedTool(entry, context);
|
|
439
491
|
});
|
|
492
|
+
return retVal;
|
|
440
493
|
};
|
|
441
|
-
const
|
|
494
|
+
const de_VoiceBotEndpoint = (output, context) => {
|
|
442
495
|
if (output.dialogflowCx != null) {
|
|
443
496
|
return {
|
|
444
497
|
dialogflowCx: de_BotDialogflowCxEndpoint(output.dialogflowCx, context)
|
|
445
498
|
};
|
|
446
499
|
}
|
|
500
|
+
if (output.llm != null) {
|
|
501
|
+
return {
|
|
502
|
+
llm: de_VoiceBotLlmEndpoint(output.llm, context)
|
|
503
|
+
};
|
|
504
|
+
}
|
|
447
505
|
if (output.openAiAssistant != null) {
|
|
448
506
|
return {
|
|
449
507
|
openAiAssistant: _json(output.openAiAssistant)
|
|
@@ -461,6 +519,64 @@ const de_BotEndpoint = (output, context) => {
|
|
|
461
519
|
}
|
|
462
520
|
return { $unknown: Object.entries(output)[0] };
|
|
463
521
|
};
|
|
522
|
+
const de_VoiceBotFunctionDefinition = (output, context) => {
|
|
523
|
+
return take(output, {
|
|
524
|
+
'description': __expectString,
|
|
525
|
+
'integration': (_) => de_VoiceBotFunctionIntegration(__expectUnion(_), context),
|
|
526
|
+
'name': __expectString,
|
|
527
|
+
'parameters': (_) => de_Document(_, context),
|
|
528
|
+
});
|
|
529
|
+
};
|
|
530
|
+
const de_VoiceBotFunctionIntegration = (output, context) => {
|
|
531
|
+
if (output.webhook != null) {
|
|
532
|
+
return {
|
|
533
|
+
webhook: de_VoiceBotFunctionIntegrationWebhook(output.webhook, context)
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
return { $unknown: Object.entries(output)[0] };
|
|
537
|
+
};
|
|
538
|
+
const de_VoiceBotFunctionIntegrationWebhook = (output, context) => {
|
|
539
|
+
return take(output, {
|
|
540
|
+
'async': __expectBoolean,
|
|
541
|
+
'authorization': (_) => de_Document(_, context),
|
|
542
|
+
'headers': _json,
|
|
543
|
+
'timeout': __expectInt32,
|
|
544
|
+
'url': __expectString,
|
|
545
|
+
});
|
|
546
|
+
};
|
|
547
|
+
const de_VoiceBotLlmEndpoint = (output, context) => {
|
|
548
|
+
return take(output, {
|
|
549
|
+
'embeddedTools': (_) => de_VoiceBotEmbeddedToolsList(_, context),
|
|
550
|
+
'prompt': __expectString,
|
|
551
|
+
'tools': (_) => de_VoiceBotToolsList(_, context),
|
|
552
|
+
});
|
|
553
|
+
};
|
|
554
|
+
const de_VoiceBotsList = (output, context) => {
|
|
555
|
+
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
556
|
+
return de_VoiceBot(entry, context);
|
|
557
|
+
});
|
|
558
|
+
return retVal;
|
|
559
|
+
};
|
|
560
|
+
const de_VoiceBotTool = (output, context) => {
|
|
561
|
+
return take(output, {
|
|
562
|
+
'function': (_) => de_VoiceBotFunctionDefinition(_, context),
|
|
563
|
+
'type': __expectString,
|
|
564
|
+
});
|
|
565
|
+
};
|
|
566
|
+
const de_VoiceBotToolsList = (output, context) => {
|
|
567
|
+
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
568
|
+
return de_VoiceBotTool(entry, context);
|
|
569
|
+
});
|
|
570
|
+
return retVal;
|
|
571
|
+
};
|
|
572
|
+
const de_BotDialogflowCxEndpoint = (output, context) => {
|
|
573
|
+
return take(output, {
|
|
574
|
+
'agent': __expectString,
|
|
575
|
+
'credentials': (_) => de_Document(_, context),
|
|
576
|
+
'language': __expectString,
|
|
577
|
+
'location': __expectString,
|
|
578
|
+
});
|
|
579
|
+
};
|
|
464
580
|
const deserializeMetadata = (output) => ({
|
|
465
581
|
httpStatusCode: output.statusCode,
|
|
466
582
|
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
@@ -45,7 +45,41 @@ declare const CreateVoiceBotCommand_base: {
|
|
|
45
45
|
* endCallEnabled: true || false,
|
|
46
46
|
* endCallPhases: "STRING_VALUE",
|
|
47
47
|
* },
|
|
48
|
-
* endpoint: { //
|
|
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
|
+
* integration: { // VoiceBotFunctionIntegration Union: only one key present
|
|
66
|
+
* webhook: { // VoiceBotFunctionIntegrationWebhook
|
|
67
|
+
* url: "STRING_VALUE", // required
|
|
68
|
+
* async: true || false,
|
|
69
|
+
* timeout: Number("int"),
|
|
70
|
+
* authorization: "DOCUMENT_VALUE",
|
|
71
|
+
* headers: [ // VoiceBotFunctionIntegrationWebhookHeadersList
|
|
72
|
+
* { // VoiceBotFunctionIntegrationWebhookHeader
|
|
73
|
+
* key: "STRING_VALUE", // required
|
|
74
|
+
* value: "STRING_VALUE", // required
|
|
75
|
+
* },
|
|
76
|
+
* ],
|
|
77
|
+
* },
|
|
78
|
+
* },
|
|
79
|
+
* },
|
|
80
|
+
* },
|
|
81
|
+
* ],
|
|
82
|
+
* },
|
|
49
83
|
* dialogflowCx: { // BotDialogflowCxEndpoint
|
|
50
84
|
* credentials: "DOCUMENT_VALUE", // required
|
|
51
85
|
* agent: "STRING_VALUE", // required
|
|
@@ -81,7 +115,41 @@ declare const CreateVoiceBotCommand_base: {
|
|
|
81
115
|
* // endCallEnabled: true || false,
|
|
82
116
|
* // endCallPhases: "STRING_VALUE",
|
|
83
117
|
* // },
|
|
84
|
-
* // endpoint: { //
|
|
118
|
+
* // endpoint: { // VoiceBotEndpoint Union: only one key present
|
|
119
|
+
* // llm: { // VoiceBotLlmEndpoint
|
|
120
|
+
* // prompt: "STRING_VALUE", // required
|
|
121
|
+
* // embeddedTools: [ // VoiceBotEmbeddedToolsList
|
|
122
|
+
* // { // VoiceBotEmbeddedTool
|
|
123
|
+
* // type: "HANGUP" || "TRANSFER", // required
|
|
124
|
+
* // name: "STRING_VALUE", // required
|
|
125
|
+
* // parameters: "DOCUMENT_VALUE",
|
|
126
|
+
* // },
|
|
127
|
+
* // ],
|
|
128
|
+
* // tools: [ // VoiceBotToolsList
|
|
129
|
+
* // { // VoiceBotTool
|
|
130
|
+
* // type: "function", // required
|
|
131
|
+
* // function: { // VoiceBotFunctionDefinition
|
|
132
|
+
* // name: "STRING_VALUE", // required
|
|
133
|
+
* // description: "STRING_VALUE",
|
|
134
|
+
* // parameters: "DOCUMENT_VALUE",
|
|
135
|
+
* // integration: { // VoiceBotFunctionIntegration Union: only one key present
|
|
136
|
+
* // webhook: { // VoiceBotFunctionIntegrationWebhook
|
|
137
|
+
* // url: "STRING_VALUE", // required
|
|
138
|
+
* // async: true || false,
|
|
139
|
+
* // timeout: Number("int"),
|
|
140
|
+
* // authorization: "DOCUMENT_VALUE",
|
|
141
|
+
* // headers: [ // VoiceBotFunctionIntegrationWebhookHeadersList
|
|
142
|
+
* // { // VoiceBotFunctionIntegrationWebhookHeader
|
|
143
|
+
* // key: "STRING_VALUE", // required
|
|
144
|
+
* // value: "STRING_VALUE", // required
|
|
145
|
+
* // },
|
|
146
|
+
* // ],
|
|
147
|
+
* // },
|
|
148
|
+
* // },
|
|
149
|
+
* // },
|
|
150
|
+
* // },
|
|
151
|
+
* // ],
|
|
152
|
+
* // },
|
|
85
153
|
* // dialogflowCx: { // BotDialogflowCxEndpoint
|
|
86
154
|
* // credentials: "DOCUMENT_VALUE", // required
|
|
87
155
|
* // agent: "STRING_VALUE", // required
|
|
@@ -52,7 +52,41 @@ declare const GetVoiceBotCommand_base: {
|
|
|
52
52
|
* // endCallEnabled: true || false,
|
|
53
53
|
* // endCallPhases: "STRING_VALUE",
|
|
54
54
|
* // },
|
|
55
|
-
* // endpoint: { //
|
|
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
|
+
* // integration: { // VoiceBotFunctionIntegration Union: only one key present
|
|
73
|
+
* // webhook: { // VoiceBotFunctionIntegrationWebhook
|
|
74
|
+
* // url: "STRING_VALUE", // required
|
|
75
|
+
* // async: true || false,
|
|
76
|
+
* // timeout: Number("int"),
|
|
77
|
+
* // authorization: "DOCUMENT_VALUE",
|
|
78
|
+
* // headers: [ // VoiceBotFunctionIntegrationWebhookHeadersList
|
|
79
|
+
* // { // VoiceBotFunctionIntegrationWebhookHeader
|
|
80
|
+
* // key: "STRING_VALUE", // required
|
|
81
|
+
* // value: "STRING_VALUE", // required
|
|
82
|
+
* // },
|
|
83
|
+
* // ],
|
|
84
|
+
* // },
|
|
85
|
+
* // },
|
|
86
|
+
* // },
|
|
87
|
+
* // },
|
|
88
|
+
* // ],
|
|
89
|
+
* // },
|
|
56
90
|
* // dialogflowCx: { // BotDialogflowCxEndpoint
|
|
57
91
|
* // credentials: "DOCUMENT_VALUE", // required
|
|
58
92
|
* // agent: "STRING_VALUE", // required
|
|
@@ -52,7 +52,41 @@ declare const ListVoiceBotsCommand_base: {
|
|
|
52
52
|
* // endCallEnabled: true || false,
|
|
53
53
|
* // endCallPhases: "STRING_VALUE",
|
|
54
54
|
* // },
|
|
55
|
-
* // endpoint: { //
|
|
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
|
+
* // integration: { // VoiceBotFunctionIntegration Union: only one key present
|
|
73
|
+
* // webhook: { // VoiceBotFunctionIntegrationWebhook
|
|
74
|
+
* // url: "STRING_VALUE", // required
|
|
75
|
+
* // async: true || false,
|
|
76
|
+
* // timeout: Number("int"),
|
|
77
|
+
* // authorization: "DOCUMENT_VALUE",
|
|
78
|
+
* // headers: [ // VoiceBotFunctionIntegrationWebhookHeadersList
|
|
79
|
+
* // { // VoiceBotFunctionIntegrationWebhookHeader
|
|
80
|
+
* // key: "STRING_VALUE", // required
|
|
81
|
+
* // value: "STRING_VALUE", // required
|
|
82
|
+
* // },
|
|
83
|
+
* // ],
|
|
84
|
+
* // },
|
|
85
|
+
* // },
|
|
86
|
+
* // },
|
|
87
|
+
* // },
|
|
88
|
+
* // ],
|
|
89
|
+
* // },
|
|
56
90
|
* // dialogflowCx: { // BotDialogflowCxEndpoint
|
|
57
91
|
* // credentials: "DOCUMENT_VALUE", // required
|
|
58
92
|
* // agent: "STRING_VALUE", // required
|
|
@@ -45,7 +45,41 @@ declare const UpdateVoiceBotCommand_base: {
|
|
|
45
45
|
* endCallEnabled: true || false,
|
|
46
46
|
* endCallPhases: "STRING_VALUE",
|
|
47
47
|
* },
|
|
48
|
-
* endpoint: { //
|
|
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
|
+
* integration: { // VoiceBotFunctionIntegration Union: only one key present
|
|
66
|
+
* webhook: { // VoiceBotFunctionIntegrationWebhook
|
|
67
|
+
* url: "STRING_VALUE", // required
|
|
68
|
+
* async: true || false,
|
|
69
|
+
* timeout: Number("int"),
|
|
70
|
+
* authorization: "DOCUMENT_VALUE",
|
|
71
|
+
* headers: [ // VoiceBotFunctionIntegrationWebhookHeadersList
|
|
72
|
+
* { // VoiceBotFunctionIntegrationWebhookHeader
|
|
73
|
+
* key: "STRING_VALUE", // required
|
|
74
|
+
* value: "STRING_VALUE", // required
|
|
75
|
+
* },
|
|
76
|
+
* ],
|
|
77
|
+
* },
|
|
78
|
+
* },
|
|
79
|
+
* },
|
|
80
|
+
* },
|
|
81
|
+
* ],
|
|
82
|
+
* },
|
|
49
83
|
* dialogflowCx: { // BotDialogflowCxEndpoint
|
|
50
84
|
* credentials: "DOCUMENT_VALUE", // required
|
|
51
85
|
* agent: "STRING_VALUE", // required
|
|
@@ -82,7 +116,41 @@ declare const UpdateVoiceBotCommand_base: {
|
|
|
82
116
|
* // endCallEnabled: true || false,
|
|
83
117
|
* // endCallPhases: "STRING_VALUE",
|
|
84
118
|
* // },
|
|
85
|
-
* // endpoint: { //
|
|
119
|
+
* // endpoint: { // VoiceBotEndpoint Union: only one key present
|
|
120
|
+
* // llm: { // VoiceBotLlmEndpoint
|
|
121
|
+
* // prompt: "STRING_VALUE", // required
|
|
122
|
+
* // embeddedTools: [ // VoiceBotEmbeddedToolsList
|
|
123
|
+
* // { // VoiceBotEmbeddedTool
|
|
124
|
+
* // type: "HANGUP" || "TRANSFER", // required
|
|
125
|
+
* // name: "STRING_VALUE", // required
|
|
126
|
+
* // parameters: "DOCUMENT_VALUE",
|
|
127
|
+
* // },
|
|
128
|
+
* // ],
|
|
129
|
+
* // tools: [ // VoiceBotToolsList
|
|
130
|
+
* // { // VoiceBotTool
|
|
131
|
+
* // type: "function", // required
|
|
132
|
+
* // function: { // VoiceBotFunctionDefinition
|
|
133
|
+
* // name: "STRING_VALUE", // required
|
|
134
|
+
* // description: "STRING_VALUE",
|
|
135
|
+
* // parameters: "DOCUMENT_VALUE",
|
|
136
|
+
* // integration: { // VoiceBotFunctionIntegration Union: only one key present
|
|
137
|
+
* // webhook: { // VoiceBotFunctionIntegrationWebhook
|
|
138
|
+
* // url: "STRING_VALUE", // required
|
|
139
|
+
* // async: true || false,
|
|
140
|
+
* // timeout: Number("int"),
|
|
141
|
+
* // authorization: "DOCUMENT_VALUE",
|
|
142
|
+
* // headers: [ // VoiceBotFunctionIntegrationWebhookHeadersList
|
|
143
|
+
* // { // VoiceBotFunctionIntegrationWebhookHeader
|
|
144
|
+
* // key: "STRING_VALUE", // required
|
|
145
|
+
* // value: "STRING_VALUE", // required
|
|
146
|
+
* // },
|
|
147
|
+
* // ],
|
|
148
|
+
* // },
|
|
149
|
+
* // },
|
|
150
|
+
* // },
|
|
151
|
+
* // },
|
|
152
|
+
* // ],
|
|
153
|
+
* // },
|
|
86
154
|
* // dialogflowCx: { // BotDialogflowCxEndpoint
|
|
87
155
|
* // credentials: "DOCUMENT_VALUE", // required
|
|
88
156
|
* // agent: "STRING_VALUE", // required
|
|
@@ -89,6 +89,127 @@ 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 VoiceBotFunctionIntegrationWebhookHeader {
|
|
120
|
+
key: string;
|
|
121
|
+
value: string;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* @public
|
|
125
|
+
*/
|
|
126
|
+
export interface VoiceBotFunctionIntegrationWebhook {
|
|
127
|
+
url: string;
|
|
128
|
+
async?: boolean;
|
|
129
|
+
timeout?: number;
|
|
130
|
+
authorization?: __DocumentType;
|
|
131
|
+
headers?: (VoiceBotFunctionIntegrationWebhookHeader)[];
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* @public
|
|
135
|
+
*/
|
|
136
|
+
export type VoiceBotFunctionIntegration = VoiceBotFunctionIntegration.WebhookMember | VoiceBotFunctionIntegration.$UnknownMember;
|
|
137
|
+
/**
|
|
138
|
+
* @public
|
|
139
|
+
*/
|
|
140
|
+
export declare namespace VoiceBotFunctionIntegration {
|
|
141
|
+
interface WebhookMember {
|
|
142
|
+
webhook: VoiceBotFunctionIntegrationWebhook;
|
|
143
|
+
$unknown?: never;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* @public
|
|
147
|
+
*/
|
|
148
|
+
interface $UnknownMember {
|
|
149
|
+
webhook?: never;
|
|
150
|
+
$unknown: [string, any];
|
|
151
|
+
}
|
|
152
|
+
interface Visitor<T> {
|
|
153
|
+
webhook: (value: VoiceBotFunctionIntegrationWebhook) => T;
|
|
154
|
+
_: (name: string, value: any) => T;
|
|
155
|
+
}
|
|
156
|
+
const visit: <T>(value: VoiceBotFunctionIntegration, visitor: Visitor<T>) => T;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* @public
|
|
160
|
+
*/
|
|
161
|
+
export interface VoiceBotFunctionDefinition {
|
|
162
|
+
/**
|
|
163
|
+
* 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.
|
|
164
|
+
* @public
|
|
165
|
+
*/
|
|
166
|
+
name: string;
|
|
167
|
+
/**
|
|
168
|
+
* A description of what the function does, used by the model to choose when and how to call the function.
|
|
169
|
+
* @public
|
|
170
|
+
*/
|
|
171
|
+
description?: string;
|
|
172
|
+
/**
|
|
173
|
+
* The parameters the functions accepts, described as a JSON Schema object.
|
|
174
|
+
* @public
|
|
175
|
+
*/
|
|
176
|
+
parameters?: __DocumentType;
|
|
177
|
+
integration?: VoiceBotFunctionIntegration;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* @public
|
|
181
|
+
* @enum
|
|
182
|
+
*/
|
|
183
|
+
export declare const VoiceBotToolType: {
|
|
184
|
+
readonly FUNCTION: "function";
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* @public
|
|
188
|
+
*/
|
|
189
|
+
export type VoiceBotToolType = typeof VoiceBotToolType[keyof typeof VoiceBotToolType];
|
|
190
|
+
/**
|
|
191
|
+
* @public
|
|
192
|
+
*/
|
|
193
|
+
export interface VoiceBotTool {
|
|
194
|
+
type: VoiceBotToolType;
|
|
195
|
+
function?: VoiceBotFunctionDefinition;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* @public
|
|
199
|
+
*/
|
|
200
|
+
export interface VoiceBotLlmEndpoint {
|
|
201
|
+
prompt: string;
|
|
202
|
+
/**
|
|
203
|
+
* Embedded functions to use within voice session.
|
|
204
|
+
* @public
|
|
205
|
+
*/
|
|
206
|
+
embeddedTools?: (VoiceBotEmbeddedTool)[];
|
|
207
|
+
/**
|
|
208
|
+
* Custom tools to be used within voice session.
|
|
209
|
+
* @public
|
|
210
|
+
*/
|
|
211
|
+
tools?: (VoiceBotTool)[];
|
|
212
|
+
}
|
|
92
213
|
/**
|
|
93
214
|
* @public
|
|
94
215
|
*/
|
|
@@ -114,12 +235,21 @@ export interface BotWebhookEndpoint {
|
|
|
114
235
|
/**
|
|
115
236
|
* @public
|
|
116
237
|
*/
|
|
117
|
-
export type
|
|
238
|
+
export type VoiceBotEndpoint = VoiceBotEndpoint.DialogflowCxMember | VoiceBotEndpoint.LlmMember | VoiceBotEndpoint.OpenAiAssistantMember | VoiceBotEndpoint.SqsMember | VoiceBotEndpoint.WebhookMember | VoiceBotEndpoint.$UnknownMember;
|
|
118
239
|
/**
|
|
119
240
|
* @public
|
|
120
241
|
*/
|
|
121
|
-
export declare namespace
|
|
242
|
+
export declare namespace VoiceBotEndpoint {
|
|
243
|
+
interface LlmMember {
|
|
244
|
+
llm: VoiceBotLlmEndpoint;
|
|
245
|
+
dialogflowCx?: never;
|
|
246
|
+
openAiAssistant?: never;
|
|
247
|
+
webhook?: never;
|
|
248
|
+
sqs?: never;
|
|
249
|
+
$unknown?: never;
|
|
250
|
+
}
|
|
122
251
|
interface DialogflowCxMember {
|
|
252
|
+
llm?: never;
|
|
123
253
|
dialogflowCx: BotDialogflowCxEndpoint;
|
|
124
254
|
openAiAssistant?: never;
|
|
125
255
|
webhook?: never;
|
|
@@ -127,6 +257,7 @@ export declare namespace BotEndpoint {
|
|
|
127
257
|
$unknown?: never;
|
|
128
258
|
}
|
|
129
259
|
interface OpenAiAssistantMember {
|
|
260
|
+
llm?: never;
|
|
130
261
|
dialogflowCx?: never;
|
|
131
262
|
openAiAssistant: BotOpenAiAssistantEndpoint;
|
|
132
263
|
webhook?: never;
|
|
@@ -134,6 +265,7 @@ export declare namespace BotEndpoint {
|
|
|
134
265
|
$unknown?: never;
|
|
135
266
|
}
|
|
136
267
|
interface WebhookMember {
|
|
268
|
+
llm?: never;
|
|
137
269
|
dialogflowCx?: never;
|
|
138
270
|
openAiAssistant?: never;
|
|
139
271
|
webhook: BotWebhookEndpoint;
|
|
@@ -141,6 +273,7 @@ export declare namespace BotEndpoint {
|
|
|
141
273
|
$unknown?: never;
|
|
142
274
|
}
|
|
143
275
|
interface SqsMember {
|
|
276
|
+
llm?: never;
|
|
144
277
|
dialogflowCx?: never;
|
|
145
278
|
openAiAssistant?: never;
|
|
146
279
|
webhook?: never;
|
|
@@ -151,6 +284,7 @@ export declare namespace BotEndpoint {
|
|
|
151
284
|
* @public
|
|
152
285
|
*/
|
|
153
286
|
interface $UnknownMember {
|
|
287
|
+
llm?: never;
|
|
154
288
|
dialogflowCx?: never;
|
|
155
289
|
openAiAssistant?: never;
|
|
156
290
|
webhook?: never;
|
|
@@ -158,13 +292,14 @@ export declare namespace BotEndpoint {
|
|
|
158
292
|
$unknown: [string, any];
|
|
159
293
|
}
|
|
160
294
|
interface Visitor<T> {
|
|
295
|
+
llm: (value: VoiceBotLlmEndpoint) => T;
|
|
161
296
|
dialogflowCx: (value: BotDialogflowCxEndpoint) => T;
|
|
162
297
|
openAiAssistant: (value: BotOpenAiAssistantEndpoint) => T;
|
|
163
298
|
webhook: (value: BotWebhookEndpoint) => T;
|
|
164
299
|
sqs: (value: BotSqsEndpoint) => T;
|
|
165
300
|
_: (name: string, value: any) => T;
|
|
166
301
|
}
|
|
167
|
-
const visit: <T>(value:
|
|
302
|
+
const visit: <T>(value: VoiceBotEndpoint, visitor: Visitor<T>) => T;
|
|
168
303
|
}
|
|
169
304
|
/**
|
|
170
305
|
* @public
|
|
@@ -211,7 +346,7 @@ export interface CreateVoiceBotInput {
|
|
|
211
346
|
* An endpoint to use to generate replies during voice bot session.
|
|
212
347
|
* @public
|
|
213
348
|
*/
|
|
214
|
-
endpoint:
|
|
349
|
+
endpoint: VoiceBotEndpoint;
|
|
215
350
|
company?: string;
|
|
216
351
|
}
|
|
217
352
|
/**
|
|
@@ -229,7 +364,7 @@ export interface VoiceBot {
|
|
|
229
364
|
* An endpoint to use to generate replies during voice bot session.
|
|
230
365
|
* @public
|
|
231
366
|
*/
|
|
232
|
-
endpoint:
|
|
367
|
+
endpoint: VoiceBotEndpoint;
|
|
233
368
|
id: string;
|
|
234
369
|
createdAt: string;
|
|
235
370
|
updatedAt?: string;
|
|
@@ -605,7 +740,7 @@ export interface UpdateVoiceBotInput {
|
|
|
605
740
|
* An endpoint to use to generate replies during voice bot session.
|
|
606
741
|
* @public
|
|
607
742
|
*/
|
|
608
|
-
endpoint:
|
|
743
|
+
endpoint: VoiceBotEndpoint;
|
|
609
744
|
company?: string;
|
|
610
745
|
botId: string;
|
|
611
746
|
}
|
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
|
+
"version": "1.0.7",
|
|
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",
|