amazon-lex

LexResponse output does not understand HTML data

拈花ヽ惹草 提交于 2019-12-02 04:56:37
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: {evt.Status}</a>"; } } else { result = "No Data found matching your query"; } return result; } When

custom payload on amazon lex aws with lambda

泪湿孤枕 提交于 2019-12-02 04:32:16
问题 I have a simple bot for ordering pizza, in a fullfilment function, I would like to display a video instead of a message. Here is what I have so far: 'use strict'; // Close dialog with the customer, reporting fulfillmentState of Failed or Fulfilled ("Thanks, your pizza will arrive in 20 minutes") function close(sessionAttributes, fulfillmentState, message) { return { sessionAttributes, dialogAction: { type: 'Close', fulfillmentState, message, }, }; } // --------------- Events -----------------

How to call another intent without prompting to user in Lex?

柔情痞子 提交于 2019-12-02 04:09:16
问题 Is it possible to trigger intent-B from the lambda function of intent-A without prompting to user? Suppose user typed something and an intent-A is fired, after some processing I want to trigger some other intent i.e intent-B. User can also directly trigger intent-B through specific utterances. Any help is appreciated. 回答1: I ended up doing below to call intent-B from intent-A without prompting anything to user: give access to invoke lambda functions to your calling lambda function i.e lambda

custom payload on amazon lex aws with lambda

偶尔善良 提交于 2019-12-02 02:45:26
I have a simple bot for ordering pizza, in a fullfilment function, I would like to display a video instead of a message. Here is what I have so far: 'use strict'; // Close dialog with the customer, reporting fulfillmentState of Failed or Fulfilled ("Thanks, your pizza will arrive in 20 minutes") function close(sessionAttributes, fulfillmentState, message) { return { sessionAttributes, dialogAction: { type: 'Close', fulfillmentState, message, }, }; } // --------------- Events ----------------------- function dispatch(intentRequest, callback) { console.log(`request received for userId=$

Formatting string output in Amazon Lex

蓝咒 提交于 2019-12-02 00:56:29
I'm trying to print a series of objects in a List using the C# version of AWS Lambda. Its linked to my AWS RDS and my Lex bot. Currently, when I test the bot using the LEX test console, the output that is printed isn't formatted with line breaks even though I'm using the \n line break for C#. Example Code: var result = string.Empty; result = $"Events for {User}:"; foreach (var evt in events) { result += $"\n\n{evt.ID} - {evt.FeedbackType} - {evt.Status} - {evt.OpenedDate.ToString()}"; } return result; Below is the output I am getting on Lex: Can anyone please explain how to fix this or if its

How to create open-ended slot in lex

最后都变了- 提交于 2019-12-01 07:33:56
I'd like to create a notes/feedback field in my Lex bot, but it appears difficult to do. It seems like AMAZON.LITERAL used to do this, and current suggestions are to create a custom slot and pump a bunch of random data into it ( http://docs.aws.amazon.com/lex/latest/dg/gl-guidelines.html - bullet point 3 and other googles). Is this the best way to do it? Does anyone know of any examples or methods to better show how this can be done? In my case, feeding random data to the slot did not work. It used to capture only a part of input for the slot or most of the time it assigns NULL to the slot. To

How to create open-ended slot in lex

Deadly 提交于 2019-12-01 06:00:28
问题 I'd like to create a notes/feedback field in my Lex bot, but it appears difficult to do. It seems like AMAZON.LITERAL used to do this, and current suggestions are to create a custom slot and pump a bunch of random data into it (http://docs.aws.amazon.com/lex/latest/dg/gl-guidelines.html - bullet point 3 and other googles). Is this the best way to do it? Does anyone know of any examples or methods to better show how this can be done? 回答1: In my case, feeding random data to the slot did not

How to troubleshoot this AWS lambda error - An error has occurred: Received error response from Lambda: Unhandled?

江枫思渺然 提交于 2019-11-28 13:59:46
I'm new to AWS. I'm build chatbot using aws lex and aws lambda c#. I'm using sample aws lambda C# program namespace AWSLambda4 { public class Function { /// <summary> /// A simple function that takes a string and does a ToUpper /// </summary> /// <param name="input"></param> /// <param name="context"></param> /// <returns></returns> public string FunctionHandler(string input, ILambdaContext context) { try { return input?.ToUpper(); } catch (Exception e) { return "sorry i could not process your request due to " + e.Message; } } } } I created a slot in aws lex to map first parameter input . But

Lex chatbot C# client with voice

风格不统一 提交于 2019-11-28 05:22:22
问题 I have the chatbot client running with text but would now like to change it to voice but I am unsure of how to get the stream from the mic for post. For recording audio I am using NAudio but when sending the memory stream I get an error stating System.IO.IOException: Cannot close stream until all bytes are written. Here is my code: private void recordAudio() { if (memoryStream == null) memoryStream = new MemoryStream(); sourceStream = new NAudio.Wave.WaveIn(); sourceStream.WaveFormat = new