Table of Contents
LexRuntimeService.Client¶A low-level client representing Amazon Lex Runtime Service:
client = session.create_client('lex-runtime')
These are the available methods:
can_paginate(operation_name)¶Check if an operation can be paginated.
| Parameters: | operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you’d normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo"). |
|---|---|
| Returns: | True if the operation can be paginated,
False otherwise. |
generate_presigned_url(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)¶Generate a presigned url given a client, its method, and arguments
| Parameters: |
|
|---|---|
| Returns: | The presigned url |
get_paginator(operation_name)¶Create a paginator for an operation.
| Parameters: | operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you’d normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo"). |
|---|---|
| Raises: | OperationNotPageableError – Raised if the operation is not
pageable. You can use the client.can_paginate method to
check if an operation is pageable. |
| Return type: | L{botocore.paginate.Paginator} |
| Returns: | A paginator object. |
get_waiter(waiter_name)¶post_content(**kwargs)¶Sends user input (text or speech) to Amazon Lex. Clients use this API to send requests to Amazon Lex at runtime. Amazon Lex interprets the user input using the machine learning model that it built for the bot.
In response, Amazon Lex returns the next message to convey to the user. Consider the following example messages:
PizzaSize ): “What size pizza would you like?”.Not all Amazon Lex messages require a response from the user. For example, conclusion statements do not require a response. Some messages require only a yes or no response. In addition to the message , Amazon Lex provides additional context about the message in the response that you can use to enhance client behavior, such as displaying the appropriate client user interface. Consider the following examples:
x-amz-lex-dialog-state header set to ElicitSlotx-amz-lex-intent-name header set to the intent name in the current contextx-amz-lex-slot-to-elicit header set to the slot name for which the message is eliciting informationx-amz-lex-slots header set to a map of slots configured for the intent with their current valuesx-amz-lex-dialog-state header is set to Confirmation and the x-amz-lex-slot-to-elicit header is omitted.x-amz-dialog-state header is set to ElicitIntent and the x-amz-slot-to-elicit header is omitted.In addition, Amazon Lex also returns your application-specific sessionAttributes . For more information, see Managing Conversation Context .
See also: AWS API Documentation
Request Syntax
response = client.post_content(
botName='string',
botAlias='string',
userId='string',
sessionAttributes={...}|[...]|123|123.4|'string'|True|None,
contentType='string',
accept='string',
inputStream=b'bytes'|file
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'contentType': 'string',
'intentName': 'string',
'slots': {...}|[...]|123|123.4|'string'|True|None,
'sessionAttributes': {...}|[...]|123|123.4|'string'|True|None,
'message': 'string',
'dialogState': 'ElicitIntent'|'ConfirmIntent'|'ElicitSlot'|'Fulfilled'|'ReadyForFulfillment'|'Failed',
'slotToElicit': 'string',
'inputTranscript': 'string',
'audioStream': StreamingBody()
}
Response Structure
|
post_text(**kwargs)¶Sends user input (text-only) to Amazon Lex. Client applications can use this API to send requests to Amazon Lex at runtime. Amazon Lex then interprets the user input using the machine learning model it built for the bot.
In response, Amazon Lex returns the next message to convey to the user an optional responseCard to display. Consider the following example messages:
Not all Amazon Lex messages require a user response. For example, a conclusion statement does not require a response. Some messages require only a “yes” or “no” user response. In addition to the message , Amazon Lex provides additional context about the message in the response that you might use to enhance client behavior, for example, to display the appropriate client user interface. These are the slotToElicit , dialogState , intentName , and slots fields in the response. Consider the following examples:
dialogState set to ElicitSlotintentName set to the intent name in the current contextslotToElicit set to the slot name for which the message is eliciting informationslots set to a map of slots, configured for the intent, with currently known valuesdialogState is set to ConfirmIntent and SlotToElicit is set to null.dialogState is set to ElicitIntent and slotToElicit is set to null.In addition, Amazon Lex also returns your application-specific sessionAttributes . For more information, see Managing Conversation Context .
See also: AWS API Documentation
Request Syntax
response = client.post_text(
botName='string',
botAlias='string',
userId='string',
sessionAttributes={
'string': 'string'
},
inputText='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'intentName': 'string',
'slots': {
'string': 'string'
},
'sessionAttributes': {
'string': 'string'
},
'message': 'string',
'dialogState': 'ElicitIntent'|'ConfirmIntent'|'ElicitSlot'|'Fulfilled'|'ReadyForFulfillment'|'Failed',
'slotToElicit': 'string',
'responseCard': {
'version': 'string',
'contentType': 'application/vnd.amazonaws.card.generic',
'genericAttachments': [
{
'title': 'string',
'subTitle': 'string',
'attachmentLinkUrl': 'string',
'imageUrl': 'string',
'buttons': [
{
'text': 'string',
'value': 'string'
},
]
},
]
}
}
Response Structure
|
The available paginators are: