@wildix/wilma-voice-client 0.0.24 → 0.0.26
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/WilmaVoice.js +4 -0
- package/dist-cjs/commands/ListSpeechVoicesCommand.js +20 -0
- package/dist-cjs/commands/PreviewSpeechCommand.js +20 -0
- package/dist-cjs/commands/index.js +2 -0
- package/dist-cjs/models/enums.js +13 -1
- package/dist-cjs/schemas/schemas_0.js +169 -68
- package/dist-es/WilmaVoice.js +4 -0
- package/dist-es/commands/ListSpeechVoicesCommand.js +16 -0
- package/dist-es/commands/PreviewSpeechCommand.js +16 -0
- package/dist-es/commands/index.js +2 -0
- package/dist-es/models/enums.js +12 -0
- package/dist-es/schemas/schemas_0.js +167 -66
- package/dist-types/WilmaVoice.d.ts +14 -0
- package/dist-types/WilmaVoiceClient.d.ts +4 -2
- package/dist-types/commands/DescribeVoiceProtocolCommand.d.ts +12 -0
- package/dist-types/commands/ListSpeechVoicesCommand.d.ts +101 -0
- package/dist-types/commands/PreviewSpeechCommand.d.ts +119 -0
- package/dist-types/commands/SendSayCommand.d.ts +1 -0
- package/dist-types/commands/index.d.ts +2 -0
- package/dist-types/models/enums.d.ts +42 -0
- package/dist-types/models/models_0.d.ts +285 -2
- package/dist-types/schemas/schemas_0.d.ts +10 -0
- package/package.json +2 -2
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { Command as $Command } from "@smithy/core/client";
|
|
2
|
+
import type { MetadataBearer as __MetadataBearer } from "@smithy/types";
|
|
3
|
+
import type { ListSpeechVoicesInput, ListSpeechVoicesOutput } from "../models/models_0";
|
|
4
|
+
import type { ServiceInputTypes, ServiceOutputTypes, WilmaVoiceClientResolvedConfig } from "../WilmaVoiceClient";
|
|
5
|
+
/**
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export type { __MetadataBearer };
|
|
9
|
+
export { $Command };
|
|
10
|
+
/**
|
|
11
|
+
* @public
|
|
12
|
+
*
|
|
13
|
+
* The input for {@link ListSpeechVoicesCommand}.
|
|
14
|
+
*/
|
|
15
|
+
export interface ListSpeechVoicesCommandInput extends ListSpeechVoicesInput {
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*
|
|
20
|
+
* The output of {@link ListSpeechVoicesCommand}.
|
|
21
|
+
*/
|
|
22
|
+
export interface ListSpeechVoicesCommandOutput extends ListSpeechVoicesOutput, __MetadataBearer {
|
|
23
|
+
}
|
|
24
|
+
declare const ListSpeechVoicesCommand_base: {
|
|
25
|
+
new (input: ListSpeechVoicesCommandInput): import("@smithy/core/client").CommandImpl<ListSpeechVoicesCommandInput, ListSpeechVoicesCommandOutput, WilmaVoiceClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
26
|
+
new (input: ListSpeechVoicesCommandInput): import("@smithy/core/client").CommandImpl<ListSpeechVoicesCommandInput, ListSpeechVoicesCommandOutput, WilmaVoiceClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
27
|
+
getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Lists the voices a synthesis provider offers, from the provider's own API, cached per company, provider, credential and language.
|
|
31
|
+
* @example
|
|
32
|
+
* Use a bare-bones client and the command you need to make an API call.
|
|
33
|
+
* ```javascript
|
|
34
|
+
* import { WilmaVoiceClient, ListSpeechVoicesCommand } from "@wildix/wilma-voice-client"; // ES Modules import
|
|
35
|
+
* // const { WilmaVoiceClient, ListSpeechVoicesCommand } = require("@wildix/wilma-voice-client"); // CommonJS import
|
|
36
|
+
* // import type { WilmaVoiceClientConfig } from "@wildix/wilma-voice-client";
|
|
37
|
+
* const config = {}; // type is WilmaVoiceClientConfig
|
|
38
|
+
* const client = new WilmaVoiceClient(config);
|
|
39
|
+
* const input = { // ListSpeechVoicesInput
|
|
40
|
+
* provider: "elevenlabs" || "google" || "amazon_polly", // required
|
|
41
|
+
* language: "STRING_VALUE",
|
|
42
|
+
* search: "STRING_VALUE",
|
|
43
|
+
* credential: "STRING_VALUE",
|
|
44
|
+
* };
|
|
45
|
+
* const command = new ListSpeechVoicesCommand(input);
|
|
46
|
+
* const response = await client.send(command);
|
|
47
|
+
* // { // ListSpeechVoicesOutput
|
|
48
|
+
* // voices: [ // SpeechVoiceList // required
|
|
49
|
+
* // { // SpeechVoice
|
|
50
|
+
* // id: "STRING_VALUE", // required
|
|
51
|
+
* // name: "STRING_VALUE", // required
|
|
52
|
+
* // languages: [ // ProviderLanguageTagList
|
|
53
|
+
* // "STRING_VALUE",
|
|
54
|
+
* // ],
|
|
55
|
+
* // gender: "STRING_VALUE",
|
|
56
|
+
* // accent: "STRING_VALUE",
|
|
57
|
+
* // category: "STRING_VALUE",
|
|
58
|
+
* // previewUrl: "STRING_VALUE",
|
|
59
|
+
* // models: [ // SpeechVoiceModelList
|
|
60
|
+
* // "STRING_VALUE",
|
|
61
|
+
* // ],
|
|
62
|
+
* // },
|
|
63
|
+
* // ],
|
|
64
|
+
* // languages: [
|
|
65
|
+
* // "STRING_VALUE",
|
|
66
|
+
* // ],
|
|
67
|
+
* // refreshedAt: "STRING_VALUE", // required
|
|
68
|
+
* // stale: true || false,
|
|
69
|
+
* // };
|
|
70
|
+
*
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* @param ListSpeechVoicesCommandInput - {@link ListSpeechVoicesCommandInput}
|
|
74
|
+
* @returns {@link ListSpeechVoicesCommandOutput}
|
|
75
|
+
* @see {@link ListSpeechVoicesCommandInput} for command's `input` shape.
|
|
76
|
+
* @see {@link ListSpeechVoicesCommandOutput} for command's `response` shape.
|
|
77
|
+
* @see {@link WilmaVoiceClientResolvedConfig | config} for WilmaVoiceClient's `config` shape.
|
|
78
|
+
*
|
|
79
|
+
* @throws {@link ValidationException} (client fault)
|
|
80
|
+
*
|
|
81
|
+
* @throws {@link ForbiddenException} (client fault)
|
|
82
|
+
*
|
|
83
|
+
* @throws {@link WilmaVoiceServiceException}
|
|
84
|
+
* <p>Base exception class for all service exceptions from WilmaVoice service.</p>
|
|
85
|
+
*
|
|
86
|
+
*
|
|
87
|
+
* @public
|
|
88
|
+
*/
|
|
89
|
+
export declare class ListSpeechVoicesCommand extends ListSpeechVoicesCommand_base {
|
|
90
|
+
/** @internal type navigation helper, not in runtime. */
|
|
91
|
+
protected static __types: {
|
|
92
|
+
api: {
|
|
93
|
+
input: ListSpeechVoicesInput;
|
|
94
|
+
output: ListSpeechVoicesOutput;
|
|
95
|
+
};
|
|
96
|
+
sdk: {
|
|
97
|
+
input: ListSpeechVoicesCommandInput;
|
|
98
|
+
output: ListSpeechVoicesCommandOutput;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { Command as $Command } from "@smithy/core/client";
|
|
2
|
+
import { Uint8ArrayBlobAdapter } from "@smithy/core/serde";
|
|
3
|
+
import type { MetadataBearer as __MetadataBearer } from "@smithy/types";
|
|
4
|
+
import type { PreviewSpeechInput, PreviewSpeechOutput } from "../models/models_0";
|
|
5
|
+
import type { ServiceInputTypes, ServiceOutputTypes, WilmaVoiceClientResolvedConfig } from "../WilmaVoiceClient";
|
|
6
|
+
/**
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export type { __MetadataBearer };
|
|
10
|
+
export { $Command };
|
|
11
|
+
/**
|
|
12
|
+
* @public
|
|
13
|
+
*
|
|
14
|
+
* The input for {@link PreviewSpeechCommand}.
|
|
15
|
+
*/
|
|
16
|
+
export interface PreviewSpeechCommandInput extends PreviewSpeechInput {
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export type PreviewSpeechCommandOutputType = Omit<PreviewSpeechOutput, "audio"> & {
|
|
22
|
+
audio: Uint8ArrayBlobAdapter;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* @public
|
|
26
|
+
*
|
|
27
|
+
* The output of {@link PreviewSpeechCommand}.
|
|
28
|
+
*/
|
|
29
|
+
export interface PreviewSpeechCommandOutput extends PreviewSpeechCommandOutputType, __MetadataBearer {
|
|
30
|
+
}
|
|
31
|
+
declare const PreviewSpeechCommand_base: {
|
|
32
|
+
new (input: PreviewSpeechCommandInput): import("@smithy/core/client").CommandImpl<PreviewSpeechCommandInput, PreviewSpeechCommandOutput, WilmaVoiceClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
33
|
+
new (input: PreviewSpeechCommandInput): import("@smithy/core/client").CommandImpl<PreviewSpeechCommandInput, PreviewSpeechCommandOutput, WilmaVoiceClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
34
|
+
getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Synthesizes one phrase with the supplied settings and returns MP3. Everything about the AGENT travels in the request because the settings being previewed are normally unsaved form state; the operation reads no stored agent. It does read the company's pronunciation dictionary for `language` — that is stored configuration rather than draft state, and it must be exactly what a call would use.
|
|
38
|
+
* @example
|
|
39
|
+
* Use a bare-bones client and the command you need to make an API call.
|
|
40
|
+
* ```javascript
|
|
41
|
+
* import { WilmaVoiceClient, PreviewSpeechCommand } from "@wildix/wilma-voice-client"; // ES Modules import
|
|
42
|
+
* // const { WilmaVoiceClient, PreviewSpeechCommand } = require("@wildix/wilma-voice-client"); // CommonJS import
|
|
43
|
+
* // import type { WilmaVoiceClientConfig } from "@wildix/wilma-voice-client";
|
|
44
|
+
* const config = {}; // type is WilmaVoiceClientConfig
|
|
45
|
+
* const client = new WilmaVoiceClient(config);
|
|
46
|
+
* const input = { // PreviewSpeechInput
|
|
47
|
+
* provider: "elevenlabs" || "google" || "amazon_polly", // required
|
|
48
|
+
* voice: "STRING_VALUE", // required
|
|
49
|
+
* language: "STRING_VALUE", // required
|
|
50
|
+
* text: "STRING_VALUE", // required
|
|
51
|
+
* synthesis: { // VoiceSynthesisOptions
|
|
52
|
+
* model: "STRING_VALUE",
|
|
53
|
+
* speed: Number("float"),
|
|
54
|
+
* stability: Number("float"),
|
|
55
|
+
* similarity: Number("float"),
|
|
56
|
+
* style: Number("float"),
|
|
57
|
+
* speakerBoost: true || false,
|
|
58
|
+
* pitch: Number("float"),
|
|
59
|
+
* volumeGain: Number("float"),
|
|
60
|
+
* },
|
|
61
|
+
* languageSynthesis: {
|
|
62
|
+
* model: "STRING_VALUE",
|
|
63
|
+
* speed: Number("float"),
|
|
64
|
+
* stability: Number("float"),
|
|
65
|
+
* similarity: Number("float"),
|
|
66
|
+
* style: Number("float"),
|
|
67
|
+
* speakerBoost: true || false,
|
|
68
|
+
* pitch: Number("float"),
|
|
69
|
+
* volumeGain: Number("float"),
|
|
70
|
+
* },
|
|
71
|
+
* pronunciations: [ // VoicePronunciationList
|
|
72
|
+
* { // VoicePronunciation
|
|
73
|
+
* phrase: "STRING_VALUE", // required
|
|
74
|
+
* as: "STRING_VALUE", // required
|
|
75
|
+
* encoding: "alias" || "ipa",
|
|
76
|
+
* },
|
|
77
|
+
* ],
|
|
78
|
+
* suppressions: [ // VoicePronunciationSuppressionList
|
|
79
|
+
* "STRING_VALUE",
|
|
80
|
+
* ],
|
|
81
|
+
* credential: "STRING_VALUE",
|
|
82
|
+
* };
|
|
83
|
+
* const command = new PreviewSpeechCommand(input);
|
|
84
|
+
* const response = await client.send(command);
|
|
85
|
+
* // { // PreviewSpeechOutput
|
|
86
|
+
* // audio: new Uint8Array(), // required
|
|
87
|
+
* // };
|
|
88
|
+
*
|
|
89
|
+
* ```
|
|
90
|
+
*
|
|
91
|
+
* @param PreviewSpeechCommandInput - {@link PreviewSpeechCommandInput}
|
|
92
|
+
* @returns {@link PreviewSpeechCommandOutput}
|
|
93
|
+
* @see {@link PreviewSpeechCommandInput} for command's `input` shape.
|
|
94
|
+
* @see {@link PreviewSpeechCommandOutput} for command's `response` shape.
|
|
95
|
+
* @see {@link WilmaVoiceClientResolvedConfig | config} for WilmaVoiceClient's `config` shape.
|
|
96
|
+
*
|
|
97
|
+
* @throws {@link ValidationException} (client fault)
|
|
98
|
+
*
|
|
99
|
+
* @throws {@link ForbiddenException} (client fault)
|
|
100
|
+
*
|
|
101
|
+
* @throws {@link WilmaVoiceServiceException}
|
|
102
|
+
* <p>Base exception class for all service exceptions from WilmaVoice service.</p>
|
|
103
|
+
*
|
|
104
|
+
*
|
|
105
|
+
* @public
|
|
106
|
+
*/
|
|
107
|
+
export declare class PreviewSpeechCommand extends PreviewSpeechCommand_base {
|
|
108
|
+
/** @internal type navigation helper, not in runtime. */
|
|
109
|
+
protected static __types: {
|
|
110
|
+
api: {
|
|
111
|
+
input: PreviewSpeechInput;
|
|
112
|
+
output: PreviewSpeechOutput;
|
|
113
|
+
};
|
|
114
|
+
sdk: {
|
|
115
|
+
input: PreviewSpeechCommandInput;
|
|
116
|
+
output: PreviewSpeechCommandOutput;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
}
|
|
@@ -40,6 +40,7 @@ declare const SendSayCommand_base: {
|
|
|
40
40
|
* text: "STRING_VALUE", // required
|
|
41
41
|
* replyId: "STRING_VALUE", // required
|
|
42
42
|
* interruptible: true || false,
|
|
43
|
+
* voice: "STRING_VALUE",
|
|
43
44
|
* audio: { // SayCommandAudioOptions
|
|
44
45
|
* streamId: "STRING_VALUE", // required
|
|
45
46
|
* sampleRate: Number("int"), // required
|
|
@@ -1,3 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @public
|
|
3
|
+
* @enum
|
|
4
|
+
*/
|
|
5
|
+
export declare const VoicePronunciationEncoding: {
|
|
6
|
+
/**
|
|
7
|
+
* A respelling substituted into the text before it reaches the provider. The only encoding version 1 applies.
|
|
8
|
+
*/
|
|
9
|
+
readonly ALIAS: "alias";
|
|
10
|
+
/**
|
|
11
|
+
* Phonetic transcription. Declared so IPA can be enabled per provider later; ignored by the runtime today.
|
|
12
|
+
*/
|
|
13
|
+
readonly IPA: "ipa";
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
export type VoicePronunciationEncoding = (typeof VoicePronunciationEncoding)[keyof typeof VoicePronunciationEncoding];
|
|
19
|
+
/**
|
|
20
|
+
* @public
|
|
21
|
+
* @enum
|
|
22
|
+
*/
|
|
23
|
+
export declare const VoiceSpeechProvider: {
|
|
24
|
+
readonly AMAZON_POLLY: "amazon_polly";
|
|
25
|
+
readonly ELEVENLABS: "elevenlabs";
|
|
26
|
+
readonly GOOGLE: "google";
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
export type VoiceSpeechProvider = (typeof VoiceSpeechProvider)[keyof typeof VoiceSpeechProvider];
|
|
32
|
+
/**
|
|
33
|
+
* @public
|
|
34
|
+
* @enum
|
|
35
|
+
*/
|
|
36
|
+
export declare const VoiceTranscriptionVendor: {
|
|
37
|
+
readonly AWS: "aws";
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
export type VoiceTranscriptionVendor = (typeof VoiceTranscriptionVendor)[keyof typeof VoiceTranscriptionVendor];
|
|
1
43
|
/**
|
|
2
44
|
* @public
|
|
3
45
|
* @enum
|
|
@@ -1,4 +1,79 @@
|
|
|
1
|
-
import type { VoiceAudioEncoding, VoiceCommandType, VoiceControlAction, VoiceEventType, VoiceInputMode } from "./enums";
|
|
1
|
+
import type { VoiceAudioEncoding, VoiceCommandType, VoiceControlAction, VoiceEventType, VoiceInputMode, VoicePronunciationEncoding, VoiceSpeechProvider, VoiceTranscriptionVendor } from "./enums";
|
|
2
|
+
/**
|
|
3
|
+
* A pronunciation rule for one phrase. Belongs to a LANGUAGE, not to the agent: 'Wildix' is
|
|
4
|
+
* respelled differently for an Italian and a German voice. A dictionary shared ACROSS languages
|
|
5
|
+
* would fight itself, which is why the company dictionary is keyed by language too — see
|
|
6
|
+
* PronunciationDictionary.
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export interface VoicePronunciation {
|
|
10
|
+
/**
|
|
11
|
+
* The phrase as it appears in the text, e.g. 'Wildix'. Bounded because every rule is compiled into ONE regular expression — see the list below.
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
phrase: string;
|
|
15
|
+
/**
|
|
16
|
+
* Respelling (ALIAS) or phonetic transcription (IPA), e.g. 'Wil-dix'.
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
as: string;
|
|
20
|
+
/**
|
|
21
|
+
* Defaults to ALIAS.
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
encoding?: VoicePronunciationEncoding | undefined;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Synthesis options, used at two levels: as provider-level defaults on VoiceSpeechSettings and as
|
|
28
|
+
* per-language overrides on VoiceLanguage. Absent means inherit; there is no way to express
|
|
29
|
+
* 'explicitly the same as the parent', which is the intended simplification — the merged result is
|
|
30
|
+
* identical either way. Which members apply is a property of the provider AND the model (Chirp 3:
|
|
31
|
+
* HD documents only speakingRate; eleven_v3 carries no stability, similarity or speaker boost), so
|
|
32
|
+
* the console renders them from a catalog rather than unconditionally.
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export interface VoiceSynthesisOptions {
|
|
36
|
+
/**
|
|
37
|
+
* Provider model id, e.g. 'eleven_flash_v2_5'.
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
40
|
+
model?: string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Speaking rate. ElevenLabs 0.7-1.2 (default 1.0); Google 0.25-2.0 (default 1.0).
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
speed?: number | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* ElevenLabs stability, 0-1 (default 0.5). Our clamp, not a vendor-stated bound.
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
50
|
+
stability?: number | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* ElevenLabs similarity boost, 0-1 (default 0.75). Our clamp.
|
|
53
|
+
* @public
|
|
54
|
+
*/
|
|
55
|
+
similarity?: number | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* ElevenLabs style exaggeration, 0-1 (default 0). Our clamp.
|
|
58
|
+
* @public
|
|
59
|
+
*/
|
|
60
|
+
style?: number | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* ElevenLabs speaker boost (default true).
|
|
63
|
+
* @public
|
|
64
|
+
*/
|
|
65
|
+
speakerBoost?: boolean | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Google pitch in semitones, -20 to 20. Not offered for Chirp 3: HD voices.
|
|
68
|
+
* @public
|
|
69
|
+
*/
|
|
70
|
+
pitch?: number | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Google volume gain in dB, -96 to 16 (default 0); the vendor recommends staying under +10. Not offered for Chirp 3: HD voices.
|
|
73
|
+
* @public
|
|
74
|
+
*/
|
|
75
|
+
volumeGain?: number | undefined;
|
|
76
|
+
}
|
|
2
77
|
/**
|
|
3
78
|
* A chunk of raw caller audio, base64-encoded in the session's negotiated input format
|
|
4
79
|
* (inputAudio from the connect handshake). Used by web/app clients in AUDIO input mode; the
|
|
@@ -117,7 +192,7 @@ export interface VoiceAudioFormat {
|
|
|
117
192
|
*/
|
|
118
193
|
export interface VoiceConnectParams {
|
|
119
194
|
/**
|
|
120
|
-
* Protocol version advertised by the client (query parameter `v`). 0 (or absent) is the legacy PBX protocol; >= 1 enables the sessionStarted event.
|
|
195
|
+
* Protocol version advertised by the client (query parameter `v`). 0 (or absent) is the legacy PBX protocol; >= 1 enables the sessionStarted event; >= 2 additionally means the client WAITS for `started` before opening its recognition stream and honours the `speech` payload on it.
|
|
121
196
|
* @public
|
|
122
197
|
*/
|
|
123
198
|
protocolVersion?: number | undefined;
|
|
@@ -361,6 +436,11 @@ export interface ReplyEvent {
|
|
|
361
436
|
*/
|
|
362
437
|
id: string;
|
|
363
438
|
text: string;
|
|
439
|
+
/**
|
|
440
|
+
* Language the recogniser identified for this completed utterance. THIS is the one that drives the language switch. When the recogniser reports several languages inside one utterance, the PBX sends the LAST labelled segment's language — it is the one the caller is speaking now.
|
|
441
|
+
* @public
|
|
442
|
+
*/
|
|
443
|
+
language?: string | undefined;
|
|
364
444
|
startTime: number;
|
|
365
445
|
endTime: number;
|
|
366
446
|
}
|
|
@@ -404,6 +484,11 @@ export interface SayCommandData {
|
|
|
404
484
|
* @public
|
|
405
485
|
*/
|
|
406
486
|
interruptible?: boolean | undefined;
|
|
487
|
+
/**
|
|
488
|
+
* Polly voice the PBX should synthesize with. Set only for provider AMAZON_POLLY, whose synthesis runs on the PBX; ElevenLabs and Google stream PCM through `play` instead and leave this absent.
|
|
489
|
+
* @public
|
|
490
|
+
*/
|
|
491
|
+
voice?: string | undefined;
|
|
407
492
|
/**
|
|
408
493
|
* Audio-stream parameters when the server synthesizes the reply itself (TTS provider configured on the agent): the `say` is followed by a stream of `play` frames on this stream id.
|
|
409
494
|
* @public
|
|
@@ -457,6 +542,41 @@ export interface SessionEndedWebsocketEvent {
|
|
|
457
542
|
*/
|
|
458
543
|
event: SessionEndedEvent;
|
|
459
544
|
}
|
|
545
|
+
/**
|
|
546
|
+
* Recognition intent for the call, sent on `started` at protocolVersion >= 2. NOT recogniser
|
|
547
|
+
* parameters: the PBX translates it into its vendor's API. Against Amazon Transcribe with
|
|
548
|
+
* autoDetect true that is identify-multiple-languages plus language-options and
|
|
549
|
+
* preferred-language; with autoDetect false, a single-language stream on preferredLanguage.
|
|
550
|
+
*
|
|
551
|
+
* Both members the server can get wrong are resolved here rather than forwarded: `vendor` is
|
|
552
|
+
* always concrete (an absent one would let the PBX apply a different default than the console
|
|
553
|
+
* built its language list for), and `autoDetect` is clamped to false whenever the language count
|
|
554
|
+
* is below the vendor's minimum or the vendor cannot identify languages at all (forwarding true
|
|
555
|
+
* with one candidate makes Amazon reject the stream outright — a dead call).
|
|
556
|
+
* @public
|
|
557
|
+
*/
|
|
558
|
+
export interface VoiceSpeechPayload {
|
|
559
|
+
/**
|
|
560
|
+
* Concrete transcription vendor; never absent.
|
|
561
|
+
* @public
|
|
562
|
+
*/
|
|
563
|
+
vendor: VoiceTranscriptionVendor;
|
|
564
|
+
/**
|
|
565
|
+
* Every configured language, as candidates for identification.
|
|
566
|
+
* @public
|
|
567
|
+
*/
|
|
568
|
+
languages: string[];
|
|
569
|
+
/**
|
|
570
|
+
* The language the call starts in, resolved from the channel. Always a member of `languages`.
|
|
571
|
+
* @public
|
|
572
|
+
*/
|
|
573
|
+
preferredLanguage: string;
|
|
574
|
+
/**
|
|
575
|
+
* Whether to identify the spoken language per utterance. Already clamped by the server.
|
|
576
|
+
* @public
|
|
577
|
+
*/
|
|
578
|
+
autoDetect: boolean;
|
|
579
|
+
}
|
|
460
580
|
/**
|
|
461
581
|
* Emitted once right after the handshake to confirm the session and the agent it is bound to. Sent only when the client advertises protocol version >= 1.
|
|
462
582
|
* @public
|
|
@@ -509,6 +629,24 @@ export interface SessionStartedEvent {
|
|
|
509
629
|
* @public
|
|
510
630
|
*/
|
|
511
631
|
groupId?: string | undefined;
|
|
632
|
+
/**
|
|
633
|
+
* Recognition intent for the call. Sent only at protocolVersion >= 2 and only when the agent has `speech` configured. A v2 client that receives `started` WITHOUT this member falls back to exactly its pre-v2 behavior: a single-language stream on the channel's own `language`.
|
|
634
|
+
* @public
|
|
635
|
+
*/
|
|
636
|
+
speech?: VoiceSpeechPayload | undefined;
|
|
637
|
+
/**
|
|
638
|
+
* Music-on-hold class the PBX should play under the call as ambient background.
|
|
639
|
+
*
|
|
640
|
+
* TOP LEVEL, NOT INSIDE `speech`, because it is not recognition intent and must not inherit
|
|
641
|
+
* `speech`'s conditions: a call with no configured languages carries no `speech` payload and can
|
|
642
|
+
* still have background audio.
|
|
643
|
+
*
|
|
644
|
+
* ABSENT MEANS OFF, and absence is the only way to say it — there is no value for 'none'. A bot
|
|
645
|
+
* whose administrator never touched the setting sends nothing here, which is exactly what every
|
|
646
|
+
* call sent before it existed, so the PBX needs no new case.
|
|
647
|
+
* @public
|
|
648
|
+
*/
|
|
649
|
+
backgroundSound?: string | undefined;
|
|
512
650
|
/**
|
|
513
651
|
* Negotiated format of caller `audio` chunks the client should send (AUDIO mode).
|
|
514
652
|
* @public
|
|
@@ -576,6 +714,11 @@ export interface TranscriptionEvent {
|
|
|
576
714
|
* @public
|
|
577
715
|
*/
|
|
578
716
|
final?: boolean | undefined;
|
|
717
|
+
/**
|
|
718
|
+
* Language the recogniser identified for this chunk. Recorded in the trace only — it drives no behavior, so an operator can see what the recogniser thought during an utterance that never became a turn.
|
|
719
|
+
* @public
|
|
720
|
+
*/
|
|
721
|
+
language?: string | undefined;
|
|
579
722
|
time: number;
|
|
580
723
|
}
|
|
581
724
|
/**
|
|
@@ -700,6 +843,141 @@ export interface DescribeVoiceProtocolOutput {
|
|
|
700
843
|
*/
|
|
701
844
|
transferWebsocketCommand?: TransferWebsocketCommand | undefined;
|
|
702
845
|
}
|
|
846
|
+
/**
|
|
847
|
+
* @public
|
|
848
|
+
*/
|
|
849
|
+
export interface ListSpeechVoicesInput {
|
|
850
|
+
/**
|
|
851
|
+
* Text-to-speech provider used to synthesize the agent's replies.
|
|
852
|
+
* @public
|
|
853
|
+
*/
|
|
854
|
+
provider: VoiceSpeechProvider;
|
|
855
|
+
/**
|
|
856
|
+
* Server-side filter for language-bound providers: only voices whose language SET CONTAINS this code. Ignored for ElevenLabs, whose voices are not language bound.
|
|
857
|
+
* @public
|
|
858
|
+
*/
|
|
859
|
+
language?: string | undefined;
|
|
860
|
+
search?: string | undefined;
|
|
861
|
+
/**
|
|
862
|
+
* Id of the company's own provider credential, so the picker lists that account's voices including cloned ones. Resolved under the CALLER's company; an id that does not resolve there is rejected. Absent means the platform key.
|
|
863
|
+
* @public
|
|
864
|
+
*/
|
|
865
|
+
credential?: string | undefined;
|
|
866
|
+
}
|
|
867
|
+
/**
|
|
868
|
+
* One voice offered by a synthesis provider.
|
|
869
|
+
* @public
|
|
870
|
+
*/
|
|
871
|
+
export interface SpeechVoice {
|
|
872
|
+
/**
|
|
873
|
+
* ElevenLabs voice_id, Google name, or Polly Id.
|
|
874
|
+
* @public
|
|
875
|
+
*/
|
|
876
|
+
id: string;
|
|
877
|
+
name: string;
|
|
878
|
+
/**
|
|
879
|
+
* ElevenLabs verified_languages, Google languageCodes, or Polly LanguageCode plus AdditionalLanguageCodes. For an unbound provider this is metadata, not a constraint.
|
|
880
|
+
* @public
|
|
881
|
+
*/
|
|
882
|
+
languages?: string[] | undefined;
|
|
883
|
+
gender?: string | undefined;
|
|
884
|
+
accent?: string | undefined;
|
|
885
|
+
/**
|
|
886
|
+
* ElevenLabs category, Google tier, or the Polly engines the voice supports.
|
|
887
|
+
* @public
|
|
888
|
+
*/
|
|
889
|
+
category?: string | undefined;
|
|
890
|
+
/**
|
|
891
|
+
* Playable sample published by the provider. ElevenLabs only; the others publish none.
|
|
892
|
+
* @public
|
|
893
|
+
*/
|
|
894
|
+
previewUrl?: string | undefined;
|
|
895
|
+
/**
|
|
896
|
+
* ElevenLabs high_quality_base_model_ids — which models support this voice.
|
|
897
|
+
* @public
|
|
898
|
+
*/
|
|
899
|
+
models?: string[] | undefined;
|
|
900
|
+
}
|
|
901
|
+
/**
|
|
902
|
+
* @public
|
|
903
|
+
*/
|
|
904
|
+
export interface ListSpeechVoicesOutput {
|
|
905
|
+
voices: SpeechVoice[];
|
|
906
|
+
/**
|
|
907
|
+
* The provider's FULL language set, independent of the `language` filter — this is what a form intersects with the transcription vendor's set to populate its language select. Empty when voices are not language bound, which means 'imposes no restriction'.
|
|
908
|
+
* @public
|
|
909
|
+
*/
|
|
910
|
+
languages?: string[] | undefined;
|
|
911
|
+
/**
|
|
912
|
+
* When this catalog was last read from the provider. `IsoTimestamp` rather than a bare `Timestamp`: restJson1 serialises the latter as epoch-seconds, which would make this the only Wilma operation answering with a numeric timestamp.
|
|
913
|
+
* @public
|
|
914
|
+
*/
|
|
915
|
+
refreshedAt: string;
|
|
916
|
+
/**
|
|
917
|
+
* True when the provider failed and an expired cache entry was served.
|
|
918
|
+
* @public
|
|
919
|
+
*/
|
|
920
|
+
stale?: boolean | undefined;
|
|
921
|
+
}
|
|
922
|
+
/**
|
|
923
|
+
* @public
|
|
924
|
+
*/
|
|
925
|
+
export interface PreviewSpeechInput {
|
|
926
|
+
/**
|
|
927
|
+
* Text-to-speech provider used to synthesize the agent's replies.
|
|
928
|
+
* @public
|
|
929
|
+
*/
|
|
930
|
+
provider: VoiceSpeechProvider;
|
|
931
|
+
voice: string;
|
|
932
|
+
/**
|
|
933
|
+
* BCP-47 language tag, optionally with a region subtag: 'en', 'en-US', 'pt-BR'. Deliberately a
|
|
934
|
+
* constrained string rather than an enum: the offerable set is a property of the selected
|
|
935
|
+
* transcription vendor and changes with it, so an enumeration here would cap the set at whatever
|
|
936
|
+
* was known when the model was released.
|
|
937
|
+
* @public
|
|
938
|
+
*/
|
|
939
|
+
language: string;
|
|
940
|
+
/**
|
|
941
|
+
* Text to speak, BEFORE pronunciation rules are applied.
|
|
942
|
+
* @public
|
|
943
|
+
*/
|
|
944
|
+
text: string;
|
|
945
|
+
/**
|
|
946
|
+
* Provider-level defaults. Merged SERVER-SIDE with the overrides below, by the same helper the call path uses — never pre-merged by the caller, or the form reimplements a rule the server owns and the preview can silently diverge from the call.
|
|
947
|
+
* @public
|
|
948
|
+
*/
|
|
949
|
+
synthesis?: VoiceSynthesisOptions | undefined;
|
|
950
|
+
/**
|
|
951
|
+
* The selected language's overrides of the above.
|
|
952
|
+
* @public
|
|
953
|
+
*/
|
|
954
|
+
languageSynthesis?: VoiceSynthesisOptions | undefined;
|
|
955
|
+
/**
|
|
956
|
+
* The agent's OWN rules for this language, unmerged. The company dictionary for `language` is applied server-side, for the reason given on `synthesis`.
|
|
957
|
+
* @public
|
|
958
|
+
*/
|
|
959
|
+
pronunciations?: VoicePronunciation[] | undefined;
|
|
960
|
+
/**
|
|
961
|
+
* Company-dictionary phrases this language declines. Applied SERVER-SIDE with the rules above, by the same helper the call path uses.
|
|
962
|
+
* @public
|
|
963
|
+
*/
|
|
964
|
+
suppressions?: string[] | undefined;
|
|
965
|
+
/**
|
|
966
|
+
* Credential id, resolved under the CALLER's company. Absent means the platform key.
|
|
967
|
+
* @public
|
|
968
|
+
*/
|
|
969
|
+
credential?: string | undefined;
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
* @public
|
|
973
|
+
*/
|
|
974
|
+
export interface PreviewSpeechOutput {
|
|
975
|
+
/**
|
|
976
|
+
* audio/mpeg. The call path streams raw PCM to the PBX; the preview returns MP3 so a browser <audio> element plays it with no client-side decoding.
|
|
977
|
+
* @public
|
|
978
|
+
*/
|
|
979
|
+
audio: Uint8Array;
|
|
980
|
+
}
|
|
703
981
|
/**
|
|
704
982
|
* Terminate the session and hang up the call.
|
|
705
983
|
* @public
|
|
@@ -760,6 +1038,11 @@ export interface SendSayInput {
|
|
|
760
1038
|
* @public
|
|
761
1039
|
*/
|
|
762
1040
|
interruptible?: boolean | undefined;
|
|
1041
|
+
/**
|
|
1042
|
+
* Polly voice the PBX should synthesize with. Set only for provider AMAZON_POLLY, whose synthesis runs on the PBX; ElevenLabs and Google stream PCM through `play` instead and leave this absent.
|
|
1043
|
+
* @public
|
|
1044
|
+
*/
|
|
1045
|
+
voice?: string | undefined;
|
|
763
1046
|
/**
|
|
764
1047
|
* Audio-stream parameters when the server synthesizes the reply itself (TTS provider configured on the agent): the `say` is followed by a stream of `play` frames on this stream id.
|
|
765
1048
|
* @public
|
|
@@ -10,6 +10,8 @@ export declare var ValidationException$: StaticErrorSchema;
|
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
12
|
export declare const errorTypeRegistries: TypeRegistry[];
|
|
13
|
+
export declare var VoicePronunciation$: StaticStructureSchema;
|
|
14
|
+
export declare var VoiceSynthesisOptions$: StaticStructureSchema;
|
|
13
15
|
export declare var AudioEvent$: StaticStructureSchema;
|
|
14
16
|
export declare var AudioWebsocketEvent$: StaticStructureSchema;
|
|
15
17
|
export declare var CompleteEvent$: StaticStructureSchema;
|
|
@@ -23,10 +25,14 @@ export declare var HangupCommandData$: StaticStructureSchema;
|
|
|
23
25
|
export declare var HangupWebsocketCommand$: StaticStructureSchema;
|
|
24
26
|
export declare var InterruptionEvent$: StaticStructureSchema;
|
|
25
27
|
export declare var InterruptionWebsocketEvent$: StaticStructureSchema;
|
|
28
|
+
export declare var ListSpeechVoicesInput$: StaticStructureSchema;
|
|
29
|
+
export declare var ListSpeechVoicesOutput$: StaticStructureSchema;
|
|
26
30
|
export declare var PlaybackEvent$: StaticStructureSchema;
|
|
27
31
|
export declare var PlaybackWebsocketEvent$: StaticStructureSchema;
|
|
28
32
|
export declare var PlayCommandData$: StaticStructureSchema;
|
|
29
33
|
export declare var PlayWebsocketCommand$: StaticStructureSchema;
|
|
34
|
+
export declare var PreviewSpeechInput$: StaticStructureSchema;
|
|
35
|
+
export declare var PreviewSpeechOutput$: StaticStructureSchema;
|
|
30
36
|
export declare var ReplyEvent$: StaticStructureSchema;
|
|
31
37
|
export declare var ReplyWebsocketEvent$: StaticStructureSchema;
|
|
32
38
|
export declare var SayCommandAudioOptions$: StaticStructureSchema;
|
|
@@ -46,6 +52,7 @@ export declare var SessionEndedEvent$: StaticStructureSchema;
|
|
|
46
52
|
export declare var SessionEndedWebsocketEvent$: StaticStructureSchema;
|
|
47
53
|
export declare var SessionStartedEvent$: StaticStructureSchema;
|
|
48
54
|
export declare var SessionStartedWebsocketEvent$: StaticStructureSchema;
|
|
55
|
+
export declare var SpeechVoice$: StaticStructureSchema;
|
|
49
56
|
export declare var StopCommandData$: StaticStructureSchema;
|
|
50
57
|
export declare var StopWebsocketCommand$: StaticStructureSchema;
|
|
51
58
|
export declare var TranscriptionEvent$: StaticStructureSchema;
|
|
@@ -55,7 +62,10 @@ export declare var TransferWebsocketCommand$: StaticStructureSchema;
|
|
|
55
62
|
export declare var VoiceAudioFormat$: StaticStructureSchema;
|
|
56
63
|
export declare var VoiceConnectParams$: StaticStructureSchema;
|
|
57
64
|
export declare var VoiceErrorEvent$: StaticStructureSchema;
|
|
65
|
+
export declare var VoiceSpeechPayload$: StaticStructureSchema;
|
|
58
66
|
export declare var DescribeVoiceProtocol$: StaticOperationSchema;
|
|
67
|
+
export declare var ListSpeechVoices$: StaticOperationSchema;
|
|
68
|
+
export declare var PreviewSpeech$: StaticOperationSchema;
|
|
59
69
|
export declare var SendHangup$: StaticOperationSchema;
|
|
60
70
|
export declare var SendPlay$: StaticOperationSchema;
|
|
61
71
|
export declare var SendSay$: StaticOperationSchema;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/wilma-voice-client",
|
|
3
3
|
"description": "@wildix/wilma-voice-client client",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.26",
|
|
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",
|
|
@@ -56,4 +56,4 @@
|
|
|
56
56
|
"browser": {
|
|
57
57
|
"./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser"
|
|
58
58
|
}
|
|
59
|
-
}
|
|
59
|
+
}
|