@datafire/amazonaws_runtime_lex v5.0.0
@datafire/amazonaws_runtime_lex
Client library for Amazon Lex Runtime Service
Installation and Usage
npm install --save @datafire/amazonaws_runtime_lex
let amazonaws_runtime_lex = require('@datafire/amazonaws_runtime_lex').create({
accessKeyId: "",
secretAccessKey: "",
region: ""
});
amazonaws_runtime_lex.PostContent({
"botName": "",
"botAlias": "",
"userId": "",
"inputStream": ""
}).then(data => {
console.log(data);
});
Description
Amazon Lex provides both build and runtime endpoints. Each endpoint provides a set of operations (API). Your conversational bot uses the runtime API to understand user utterances (user input text or voice). For example, suppose a user says "I want pizza", your bot sends this input to Amazon Lex using the runtime API. Amazon Lex recognizes that the user request is for the OrderPizza intent (one of the intents defined in the bot). Then Amazon Lex engages in user conversation on behalf of the bot to elicit required information (slot values, such as pizza size and crust type), and then performs fulfillment activity (that you configured when you created the bot). You use the build-time API to create and manage your Amazon Lex bot. For a list of build-time operations, see the build-time API, .
Actions
PostContent
amazonaws_runtime_lex.PostContent({
"botName": "",
"botAlias": "",
"userId": "",
"inputStream": ""
}, context)
Input
- input
object
- botName required
string
- botAlias required
string
- userId required
string
- inputStream required BlobStream
- botName required
Output
- output PostContentResponse
PostText
amazonaws_runtime_lex.PostText({
"botName": "",
"botAlias": "",
"userId": "",
"inputText": ""
}, context)
Input
- input
object
Output
- output PostTextResponse
Definitions
Accept
- Accept
string
AttributesString
- AttributesString
string
BadGatewayException
- BadGatewayException
object
: Either the Amazon Lex bot is still building, or one of the dependent services (Amazon Polly, AWS Lambda) failed with an internal service error.- Message ErrorMessage
BadRequestException
- BadRequestException
object
: Request validation failed, there is no usable message in the context, or the bot build failed, is still in progress, or contains unbuilt changes.- message String
BlobStream
- BlobStream
string
BotAlias
- BotAlias
string
BotName
- BotName
string
Button
- Button
object
: Represents an option to be shown on the client platform (Facebook, Slack, etc.)- text required ButtonTextStringWithLength
- value required ButtonValueStringWithLength
ButtonTextStringWithLength
- ButtonTextStringWithLength
string
ButtonValueStringWithLength
- ButtonValueStringWithLength
string
ConflictException
- ConflictException
object
: Two clients are using the same AWS account, Amazon Lex bot, and user ID.- message String
ContentType
- ContentType
string
(values: application/vnd.amazonaws.card.generic)
DependencyFailedException
- DependencyFailedException
object
: One of the dependencies, such as AWS Lambda or Amazon Polly, threw an exception. For example, If Amazon Lex does not have sufficient permissions to call a Lambda function. If a Lambda function takes longer than 30 seconds to execute. If a fulfillment Lambda function returns a Delegate dialog action without removing any slot values.- Message ErrorMessage
DialogState
- DialogState
string
(values: ElicitIntent, ConfirmIntent, ElicitSlot, Fulfilled, ReadyForFulfillment, Failed)
ErrorMessage
- ErrorMessage
string
GenericAttachment
- GenericAttachment
object
: Represents an option rendered to the user when a prompt is shown. It could be an image, a button, a link, or text.- attachmentLinkUrl StringUrlWithLength
- buttons listOfButtons
- imageUrl StringUrlWithLength
- subTitle StringWithLength
- title StringWithLength
HttpContentType
- HttpContentType
string
IntentName
- IntentName
string
InternalFailureException
- InternalFailureException
object
: Internal service error. Retry the call.- message String
LimitExceededException
- LimitExceededException
object
: Exceeded a limit.- message String
LoopDetectedException
- LoopDetectedException
object
: This exception is not used.- Message ErrorMessage
MessageFormatType
- MessageFormatType
string
(values: PlainText, CustomPayload, SSML, Composite)
NotAcceptableException
- NotAcceptableException
object
: The accept header in the request does not have a valid value.- message String
NotFoundException
- NotFoundException
object
: The resource (such as the Amazon Lex bot or an alias) that is referred to is not found.- message String
PostContentRequest
- PostContentRequest
object
- inputStream required BlobStream
PostContentResponse
- PostContentResponse
object
- audioStream BlobStream
PostTextRequest
PostTextResponse
- PostTextResponse
object
- dialogState DialogState
- intentName IntentName
- message Text
- messageFormat MessageFormatType
- responseCard ResponseCard
- sessionAttributes StringMap
- slotToElicit String
- slots StringMap
RequestTimeoutException
- RequestTimeoutException
object
: The input speech is too long.- message String
ResponseCard
- ResponseCard
object
: If you configure a response card when creating your bots, Amazon Lex substitutes the session attributes and slot values that are available, and then returns it. The response card can also come from a Lambda function ( dialogCodeHook and fulfillmentActivity on an intent).- contentType ContentType
- genericAttachments genericAttachmentList
- version String
String
- String
string
StringMap
StringUrlWithLength
- StringUrlWithLength
string
StringWithLength
- StringWithLength
string
Text
- Text
string
UnsupportedMediaTypeException
- UnsupportedMediaTypeException
object
: The Content-Type header (PostContent API) has an invalid value.- message String
UserId
- UserId
string
genericAttachmentList
- genericAttachmentList
array
- items GenericAttachment
listOfButtons
- listOfButtons
array
- items Button