[−][src]Struct rusoto_lex_runtime::LexRuntimeClient
A client for the Amazon Lex Runtime Service API.
Methods
impl LexRuntimeClient[src]
pub fn new(region: Region) -> LexRuntimeClient[src]
Creates a client backed by the default tokio event loop.
The client will use the default credentials provider and tls client.
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: Region
) -> LexRuntimeClient where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send, [src]
request_dispatcher: D,
credentials_provider: P,
region: Region
) -> LexRuntimeClient where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
Trait Implementations
impl LexRuntime for LexRuntimeClient[src]
fn post_content(
&self,
input: PostContentRequest
) -> RusotoFuture<PostContentResponse, PostContentError>[src]
&self,
input: PostContentRequest
) -> RusotoFuture<PostContentResponse, PostContentError>
Sends user input (text or speech) to Amazon Lex. Clients use this API to send text and audio requests to Amazon Lex at runtime. Amazon Lex interprets the user input using the machine learning model that it built for the bot.
The PostContent operation supports audio input at 8kHz and 16kHz. You can use 8kHz audio to achieve higher speech recognition accuracy in telephone audio applications.
In response, Amazon Lex returns the next message to convey to the user. Consider the following example messages:
-
For a user input "I would like a pizza," Amazon Lex might return a response with a message eliciting slot data (for example,
PizzaSize): "What size pizza would you like?". -
After the user provides all of the pizza order information, Amazon Lex might return a response with a message to get user confirmation: "Order the pizza?".
-
After the user replies "Yes" to the confirmation prompt, Amazon Lex might return a conclusion statement: "Thank you, your cheese pizza has been ordered.".
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:
-
If the message is to elicit slot data, Amazon Lex returns the following context information:
-
x-amz-lex-dialog-stateheader set toElicitSlot -
x-amz-lex-intent-nameheader set to the intent name in the current context -
x-amz-lex-slot-to-elicitheader set to the slot name for which themessageis eliciting information -
x-amz-lex-slotsheader set to a map of slots configured for the intent with their current values
-
-
If the message is a confirmation prompt, the
x-amz-lex-dialog-stateheader is set toConfirmationand thex-amz-lex-slot-to-elicitheader is omitted. -
If the message is a clarification prompt configured for the intent, indicating that the user intent is not understood, the
x-amz-dialog-stateheader is set toElicitIntentand thex-amz-slot-to-elicitheader is omitted.
In addition, Amazon Lex also returns your application-specific sessionAttributes. For more information, see Managing Conversation Context.
fn post_text(
&self,
input: PostTextRequest
) -> RusotoFuture<PostTextResponse, PostTextError>[src]
&self,
input: PostTextRequest
) -> RusotoFuture<PostTextResponse, PostTextError>
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:
-
For a user input "I would like a pizza", Amazon Lex might return a response with a message eliciting slot data (for example, PizzaSize): "What size pizza would you like?"
-
After the user provides all of the pizza order information, Amazon Lex might return a response with a message to obtain user confirmation "Proceed with the pizza order?".
-
After the user replies to a confirmation prompt with a "yes", Amazon Lex might return a conclusion statement: "Thank you, your cheese pizza has been ordered.".
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:
-
If the message is to elicit slot data, Amazon Lex returns the following context information:
-
dialogStateset to ElicitSlot -
intentNameset to the intent name in the current context -
slotToElicitset to the slot name for which themessageis eliciting information -
slotsset to a map of slots, configured for the intent, with currently known values
-
-
If the message is a confirmation prompt, the
dialogStateis set to ConfirmIntent andSlotToElicitis set to null. -
If the message is a clarification prompt (configured for the intent) that indicates that user intent is not understood, the
dialogStateis set to ElicitIntent andslotToElicitis set to null.
In addition, Amazon Lex also returns your application-specific sessionAttributes. For more information, see Managing Conversation Context.
impl Clone for LexRuntimeClient[src]
fn clone(&self) -> LexRuntimeClient[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
Auto Trait Implementations
impl Send for LexRuntimeClient
impl Sync for LexRuntimeClient
Blanket Implementations
impl<T> From for T[src]
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
impl<T, U> TryFrom for T where
T: From<U>, [src]
T: From<U>,
type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId[src]
impl<T> Erased for T
impl<T> Same for T
type Output = T
Should always be Self