I am working through a course Getting Started with Building Bots on the Microsoft Bot Framework and using some code from the course.
When I type "Hi" in the bot emulator, Luis realises that it is a Greeting Intent however the Bot catches it as a None Intent and says " I'm sorry I don't know what you mean"
[Serializable]
public class LUISDialog : LuisDialog<BugReport>
{
private readonly BuildFormDelegate<BugReport> NewBugReport;
public LUISDialog(BuildFormDelegate<BugReport> newBugReport)
{
this.NewBugReport = newBugReport;
}
[LuisIntent("Greeting")]
public async Task Greeting(IDialogContext context, LuisResult result)
{
context.Call(new GreetingDialog(), Callback);
}
[LuisIntent("")]
public async Task None(IDialogContext context, LuisResult result)
{
await context.PostAsync("I'm sorry I don't know what you mean.");
context.Wait(MessageReceived);
}
I have not set up any utterances for the None intent.
Below shows that the result is a Greeting Intent in the debugger:
The exported .json is as follows
{
"luis_schema_version": "3.0.0",
"versionId": "0.1",
"name": "sbdbotapp",
"desc": "",
"culture": "en-us",
"intents": [
{
"name": "GreetingIntent"
},
{
"name": "NewBugReportIntent"
},
{
"name": "None"
},
{
"name": "QueryBugType"
}
],
"entities": [
{
"name": "BugType",
"roles": []
}
],
"composites": [],
"closedLists": [],
"patternAnyEntities": [],
"regex_entities": [],
"prebuiltEntities": [
{
"name": "email",
"roles": []
}
],
"model_features": [],
"regex_features": [],
"patterns": [],
"utterances": [
{
"text": "bug report",
"intent": "NewBugReportIntent",
"entities": []
},
{
"text": "can you check whether foo is a bugtype?",
"intent": "QueryBugType",
"entities": [
{
"entity": "BugType",
"startPos": 22,
"endPos": 24
}
]
},
{
"text": "create bug",
"intent": "NewBugReportIntent",
"entities": []
},
{
"text": "good afternoon",
"intent": "GreetingIntent",
"entities": []
},
{
"text": "good evening",
"intent": "GreetingIntent",
"entities": []
},
{
"text": "good morning",
"intent": "GreetingIntent",
"entities": []
},
{
"text": "hello",
"intent": "GreetingIntent",
"entities": []
},
{
"text": "hey",
"intent": "GreetingIntent",
"entities": []
},
{
"text": "hi",
"intent": "GreetingIntent",
"entities": []
},
{
"text": "hi there",
"intent": "GreetingIntent",
"entities": []
},
{
"text": "i have a problem",
"intent": "NewBugReportIntent",
"entities": []
},
{
"text": "is security a bug type?",
"intent": "QueryBugType",
"entities": [
{
"entity": "BugType",
"startPos": 3,
"endPos": 10
}
]
},
{
"text": "something doesnt work",
"intent": "NewBugReportIntent",
"entities": []
},
{
"text": "yo",
"intent": "GreetingIntent",
"entities": []
}
]
}
[Update]
From DFBerry's help and re-looking at the course, I see the course is using the SDK, where as the Doc's tutorial uses a Web App Bot.
it's because the name of your intent is "greetingIntent" and in your code you have it labeled as just "greeting". Change your code to be "greetingIntent" and it should work.
Related
Is there any way to create a new task within a Planner (Task) tab within a channel by using webhooks?
Either directly or having a button on the incoming message that then creates the task once the end user presses it?
I'm new to webhooks but having a look on Google, Power Automate is a way of doing it but not sure we have access to that.
I think I went down the wrong rabbit hole of task modules as I want to use what's already configured within the Planner tab and not create something bespoke. The button also doesn't work, comes up with an error message saying "This card action is disabled because it is not supported for Connectors". But this is what I have at the moment:
{
"type":"message",
"attachments":[
{
"contentType":"application/vnd.microsoft.card.adaptive",
"contentUrl":null,
"content":{
"$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
"type":"AdaptiveCard",
"version":"1.2",
"body":[
{
"type": "Container",
"id": "066de76b-17da-e6f7-8ab3-81d36d8a6162",
"padding": "None",
"items": [
{
"type": "FactSet",
"id": "10eebecd-851c-2080-24f4-9b6044821d90",
"facts": [
{
"title": "**ID**",
"value": "EXAMPLE ID"
},
{
"title": "**Name**",
"value": "EXAMPLE NAME"
}
]
}
]
},
{
"type": "Container",
"id": "879303cd-81de-618a-8e99-e66be9f22ac1",
"padding": "None",
"items": [
{
"type": "TextBlock",
"id": "0833d313-657b-b587-d4d3-f4a961e6434a",
"text": "EXAMPLE ERROR MESSAGE.",
"wrap": true
},
{
"type": "Container",
"id": "de1d9a46-b8d4-443a-5afc-8843c445cf7b",
"padding": "None",
"items": [
{
"type": "ActionSet",
"id": "3b0c8763-dba8-3d88-98f5-7189ced1fe60",
"actions": [
{
"type": "Action.Submit",
"id": "btnCreateTask",
"title": "Create Task",
"card": {
"type": "AdaptiveCard",
"padding": "None",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}
}
]
}
]
}
]
}
]
}
}
]
}
Thanks in advance for any help/suggestions
I have an array object like this:
{
"Items":[
{
"ShortName":"Product short name",
"Image":"https://www.andrew.cmu.edu/user/cfperron/cats/images/cat8.jpg",
"ManufacturerName":"MMM",
"CatalogName":"cats"
},
{
"ShortName":"Product2 short name",
"Image":"https://www.andrew.cmu.edu/user/cfperron/cats/images/cat7.jpg",
"ManufacturerName":"SSS",
"CatalogName":"Dogs"
}
]
}
how to get Images in ImageSet dynamically in adaptive cards? I was able to get rest of the values in FactSet. But stuck with images.
Ok I figured it out.
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"size": "medium",
"weight": "bolder",
"text": "Search Results"
},
{
"type": "Container",
"items": [
{
"type": "ImageSet",
"imageSize": "medium",
"images": [
{
"type": "Image",
"url": "${Image}",
"size": "Medium"
}
]
},
{
"type": "FactSet",
"facts": [
{
"title": "Short Name",
"value": "${ShortName}"
},
{
"title": "Supplier Name",
"value": "${SupplierName} "
},
{
"title": "Price ",
"value": "${PriceAmount} "
}
]
}
],
"$data": "${$root['Items']}"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.2"
}
But next issue I am facing is if image url is empty, it throws an error "Adaptive Card Rendered error:
{
"message": "Cannot read property 'style' of null"
}"
How can we give a null check inside adaptive card for Image property?
When testing out my skill using the Test Simulator for Alexa I am getting the following error:
There was a problem with the There was a problem with the requested skill's response
I tried looking at solutions, but I could not find anything.
If anyone can help, I'd very much appreciate it!
Thanks!
This is what is being sent to Lambda
Code Editor
{
"languageModel": {
"intents": [
{
"name": "AMAZON.CancelIntent",
"samples": []
},
{
"name": "AMAZON.HelpIntent",
"samples": []
},
{
"name": "AMAZON.NoIntent",
"samples": []
},
{
"name": "AMAZON.RepeatIntent",
"samples": []
},
{
"name": "AMAZON.StartOverIntent",
"samples": []
},
{
"name": "AMAZON.StopIntent",
"samples": []
},
{
"name": "AMAZON.YesIntent",
"samples": []
},
{
"name": "AnswerIntent",
"samples": [
"the answer is {Answer}",
"my answer is {Answer}",
"is it {Answer}",
"{Answer} is my answer",
"{Answer}"
],
"slots": [
{
"name": "Answer",
"type": "AMAZON.NUMBER"
}
]
},
{
"name": "DontKnowIntent",
"samples": [
"i don't know",
"don't know",
"i don't know that one",
"dunno",
"skip",
"i don't know that",
"who knows",
"i don't know this question"
],
"slots": []
}
],
"invocationName": "geo trivia"
}
}
I am trying to built a sample using LUIS intents to call my API, but the intent score for "CharacterSearch" is something I am not able to understand.
Could anyone please look into below response and advise how the intent score is more than 1 or I am missing something here, intent score for "SearchSigil" is perfect.
My main concern is this a normal score ?
If needed I can post my intents and entities.
{
"query": "Which sigil displays three headed dragon",
"topScoringIntent": {
"intent": "SearchSigil",
"score": 0.9916578
},
"intents": [
{
"intent": "SearchSigil",
"score": 0.9916578
},
{
"intent": "SearchHouses",
"score": 0.0689159855
},
{
"intent": "None",
"score": 0.0170753412
},
{
"intent": "Help",
"score": 0.005770977
},
{
"intent": "Cancel",
"score": 0.00406856835
},
{
"intent": "Greeting",
"score": 0.00150005356
},
{
"intent": "CharacterSearch",
"score": 3.12414272E-08
}
],
"entities": [
{
"entity": "three headed dragon",
"type": "Sigil",
"startIndex": 21,
"endIndex": 39,
"resolution": {
"values": [
"three headed dragon"
]
}
}
]
}
Your score is not higher than 1.
The score 3.12414272E-08 equals 0.000000031241427
See: https://www.wolframalpha.com/input/?i=3.12414272E-08
I am facing a weird issue with LUIS. I have a keyword "infopedia" which should fall in some other Intent but JSON is showing the Top Score for "None" Intent.
I tried to add the utterance, it's showing me fine when I am adding in utterance. But whenever I am querying that word, it's showing me "None" intent for the same.
Could you please help me how I can update the Score for particular intent? in order to get the correct result.
New utterances
Review labels
Query
Suggest:
{
"query": "infopedia",
"topScoringIntent": {
"intent": "None",
"score": 0.36293143
},
"intents": [
{
"intent": "None",
"score": 0.36293143
},
{
"intent": "TrendingItems",
"score": 0.262885571
},
{
"intent": "Thanks",
"score": 0.258188784
},
{
"intent": "Hi",
"score": 0.1920927
},
{
"intent": "WhatsUp",
"score": 0.08811139
},
{
"intent": "Bye",
"score": 0.006096343
}
],
"entities": [
{
"entity": "infopedia",
"type": "Keyword",
"startIndex": 0,
"endIndex": 8,
"score": 0.659655631
}
]
}