1 | import { AbstractInteractionsProvider } from './InteractionsProvider';
|
2 | import { InteractionsOptions, AWSLexV2ProviderOptions, InteractionsResponse, InteractionsMessage } from '../types';
|
3 | export declare class AWSLexV2Provider extends AbstractInteractionsProvider {
|
4 | private _lexRuntimeServiceV2Client;
|
5 | private _botsCompleteCallback;
|
6 | /**
|
7 | * Initialize Interactions with AWS configurations
|
8 | * @param {InteractionsOptions} options - Configuration object for Interactions
|
9 | */
|
10 | constructor(options?: InteractionsOptions);
|
11 | /**
|
12 | * get provider name of the plugin
|
13 | * @returns {string} name of the provider
|
14 | */
|
15 | getProviderName(): string;
|
16 | /**
|
17 | * Configure Interactions part with aws configuration
|
18 | * @param {AWSLexV2ProviderOptions} config - Configuration of the Interactions
|
19 | * @return {AWSLexV2ProviderOptions} - Current configuration
|
20 | */
|
21 | configure(config?: AWSLexV2ProviderOptions): AWSLexV2ProviderOptions;
|
22 | /**
|
23 | * Send a message to a bot
|
24 | * @async
|
25 | * @param {string} botname - Bot name to send the message
|
26 | * @param {string | InteractionsMessage} message - message to send to the bot
|
27 | * @return {Promise<InteractionsResponse>} A promise resolves to the response from the bot
|
28 | */
|
29 | sendMessage(botname: string, message: string | InteractionsMessage): Promise<InteractionsResponse>;
|
30 | /**
|
31 | * Attach a onComplete callback function to a bot.
|
32 | * The callback is called once the bot's intent is fulfilled
|
33 | * @param {string} botname - Bot name to attach the onComplete callback
|
34 | * @param {(err: Error | null, confirmation: InteractionsResponse) => void} callback - called when Intent Fulfilled
|
35 | */
|
36 | onComplete(botname: string, callback: (err: Error | null, confirmation: InteractionsResponse) => void): void;
|
37 | /**
|
38 | * @private
|
39 | * call onComplete callback for a bot if configured
|
40 | */
|
41 | private _reportBotStatus;
|
42 | /**
|
43 | * Format UtteranceCommandOutput's response
|
44 | * decompress attributes
|
45 | * update audioStream format
|
46 | */
|
47 | private _formatUtteranceCommandOutput;
|
48 | /**
|
49 | * handle client's `RecognizeTextCommand`
|
50 | * used for sending simple text message
|
51 | */
|
52 | private _handleRecognizeTextCommand;
|
53 | /**
|
54 | * handle client's `RecognizeUtteranceCommand`
|
55 | * used for obj text or obj voice message
|
56 | */
|
57 | private _handleRecognizeUtteranceCommand;
|
58 | }
|