amazon-lex

How do I build an Amazon Lex Bot using the rest API?

让人想犯罪 __ 提交于 2019-12-11 03:21:43
问题 According to http://docs.aws.amazon.com/lex/latest/dg/API_Operations_Amazon_Lex_Model_Building_Service.html you can create or update bots and intents/slots (Put{Bot|Intend|Slot}, Create{Bot|Intend|Slot}Version). So by using Put* I can configure a bot and with Create*Version I can publish one, but in order to publish it, first you need to build it and I can't find an API method for that. 回答1: When using PutBot you can supply the --process-behavior flag with value BUILD to force a build. From

Custom slot types in amazon lex without enumeration values

天大地大妈咪最大 提交于 2019-12-11 00:08:41
问题 I'm trying to build a bot to change userinfo stored in a database. My first thought was to create two slot types like {toChange} and {newValue} where the user could say "Change my name to Peter Griffin" or "My new email is user@mail.com". Turns out Lex can't handle these custom string inputs. I had to create a slot type for each value the user can have: {name} with AMAZON.Person , {address} with AMAZON.PostalAddress and so on and let Lambda handle the correct slots to elicit. The problem is

Send Recorded Twilio Audio To Lex

安稳与你 提交于 2019-12-10 19:04:54
问题 Currently I am able to record user input, pass the recording URL to the needed function, and download the audio file locally. What I am trying to do with the audio file is either get a buffer of it to send to Lex or convert it to the format Lex needs. Per AWS Documentation the following values are accepted for the input stream param value: var params = { botAlias: 'STRING_VALUE', /* required */ botName: 'STRING_VALUE', /* required */ contentType: 'STRING_VALUE', /* required */ inputStream:

How to call Intent B from intent A in AWS lex? [duplicate]

僤鯓⒐⒋嵵緔 提交于 2019-12-08 08:04:04
问题 This question already has answers here : How to call another intent without prompting to user in Lex? (2 answers) Closed last year . I am working on aws lex I have an intent-A. I named it welcomeMsg . I want to call another intent(B) from intent-A . In welcome msg(intent-A) , it will say: > `"Hi, I am a xxx-BOT. i can help you with following:` A B C If I Say B, it should go to intent-B . This is what I want to do but I am unable to achieve this. Any help in python code will be appreciated .

Custom Slot Type with AWS Lambda hook for Amazon Lex

安稳与你 提交于 2019-12-04 21:36:29
The Amazon Lex chatbot framework offers to use custom slot types. However, the mechanism is to provide an array of values that will be validated. But I want a custom validator that e.g. checks if the input is in a database. Ideally, I want to develop an AWS lambda hook that receives the input parameter and then executes some program that returns the either well-formated slot type or gives an error if the input was not valid. Anyone an idea? AWS exposes an API to dynamically create slot types, and updating the LEX bot. (see: http://docs.aws.amazon.com/lex/latest/dg/API_PutSlotType.html , and

How to give response based on user response in Amazon Lex?

心不动则不痛 提交于 2019-12-02 16:31:51
问题 How do I give response to a user in Amazon Lex based on the choice that the user have made? For example: If user is married then system should ask how many children do you have, if user is not married the system should ask when are you getting married. Is there any way to do this? 回答1: If it's purpose is simply responding to the user without any elicit slot or chaining intents then it can be done simply in Lambda function with an if condition . def close(message): return { "dialogAction":{

How to give response based on user response in Amazon Lex?

☆樱花仙子☆ 提交于 2019-12-02 11:03:57
How do I give response to a user in Amazon Lex based on the choice that the user have made? For example: If user is married then system should ask how many children do you have, if user is not married the system should ask when are you getting married. Is there any way to do this? If it's purpose is simply responding to the user without any elicit slot or chaining intents then it can be done simply in Lambda function with an if condition . def close(message): return { "dialogAction":{ "type":"Close", "fulfillmentState":"Fulfilled", "message":{ "contentType":"PlainText", "content":message } } }

LexResponse output does not understand HTML data

痴心易碎 提交于 2019-12-02 10:06:31
问题 I'm having a problem trying to get my AWS Lambda function to successfully output a series of HTML links when its running a SQL Query. private string GetEventSearchResults(ILambdaContext context, List<Event> events, string CustomerNumber) { var result = string.Empty; var link = string.Empty; if (events.Count > 0) { result = $"Events for {CustomerNumber}:"; foreach (var evt in events) { link = "http://localhost/event/" + $"{evt.ID}"; result += $"<br><a href=\"{link}\">Event: {evt.ID} - Status:

Amazon Lex not prompting for missing variables when using CodeHook Validation

非 Y 不嫁゛ 提交于 2019-12-02 07:29:19
问题 I am building an agent in Amazon Lex with around 3 intents. All the 3 intents have a variable which has been ticked as 'required', meaning the agent has to prompt for those variables when the user query is missing it. However when I am using a lambda function as codehook validation the , function gets triggered without prompting for the missing variable. For example: Intent which describes call notes from a call with a specific person: The prompt is " Specify the name of the person whose

Amazon Lex not prompting for missing variables when using CodeHook Validation

梦想的初衷 提交于 2019-12-02 06:53:23
I am building an agent in Amazon Lex with around 3 intents. All the 3 intents have a variable which has been ticked as 'required', meaning the agent has to prompt for those variables when the user query is missing it. However when I am using a lambda function as codehook validation the , function gets triggered without prompting for the missing variable. For example: Intent which describes call notes from a call with a specific person: The prompt is " Specify the name of the person whose notes you want to see' The objective of the lambda function is to print out "Call notes for the person is