I'm seeming to have a little trouble with the <srai> tag. Can I have some other examples of to use it better please?
First of all, you need to create your main category. In this case, the bot will respond to "I know"
<category>
<pattern>I KNOW</pattern>
<template>Great. Glad you understand it.</template>
</category>
Now you can create other ways of saying "I know", like "ik" or "I kno" and use <srai> to activate your main category
<category>
<pattern>IK</pattern>
<template><srai>I know</srai></template>
</category>
<category>
<pattern>I KNO</pattern>
<template><srai>I know</srai></template>
</category>
This will allow the following conversation:
Human: ik
Bot: Great. Glad you understand it.
Related
I'm creating a dialogflow agent integrated with Google Assistant.
What I'd like to do is to open an app (my app) when a proper intent is matched. I've seen that actions like Youtube, Spotify etc. are able to do that, for example I can tell the Youtube action "search for cats video" and the Youtube app will open with a list of cats videos.
I tried to use the DeepLink class but I then noticed it's deprecated.
DeepLink class
Is there any way you can suggest me to do this?
Thanks in advance
I think you are looking for App Actions. Here are the steps you need to follow:
Find the right built-in intent. actions.intent.OPEN_APP_FEATURE should be the right one for you.
Create and update actions.xml. It should look like
<?xml version="1.0" encoding="UTF-8"?>
<!-- This is a sample actions.xml -->
<actions>
<action intentName="actions.intent.OPEN_APP_FEATURE">
<!-- Use url from inventory match for deep link fulfillment -->
<fulfillment urlTemplate="{#url}" />
<!-- Define parameters with inventories here -->
<parameter name="feature">
<entity-set-reference entitySetId="featureParamEntitySet" />
</parameter>
</action>
<entity-set entitySetId="featureParamEntitySet">
<!-- Provide a URL per entity -->
<entity url="myapp://deeplink/one" name="featureParam_one" alternateName="#array/featureParam_one_synonyms" />
<entity url="myapp://deeplink/two" name="featureParam_two" alternateName="#array/featureParam_two_synonyms" />
</entity-set>
</actions>
I am having problems making my aiml chatbot respond on a particular day of the month.
I make chatbots on botlibre.
I tried this code in my aiml chatbot but it did not work.
<pattern>date</pattern>
<template>
<think><set name="day of the month"><date format="%B %d"/></set></think>
<condition name="day of the month">
<li value="December 29">it's the twenty ninth.</li>
<li value="November 06">it's the sixth. How are you?</li>
</condition>
The expected result is the twenty ninth.
In actuality the aiml chatbot does not respond.
This is valid AIML and should work. It works fine on Pandorabots.com
Amend your category (as below) so it displays your predicate and you can see what "day of the month" is set to. My advice is to miss out the spaces in the predicate name and set it to "dayofthemonth" or even just "day", as it's possible Botlibre doesn't like predicates with spaces.
<category>
<pattern>date</pattern>
<template>
<set name="day of the month"><date format="%B %d"/></set>
<condition name="day of the month">
<li value="December 29">it's the twenty ninth.</li>
<li value="November 07">it's the seventh. How are you?</li>
<li>day of the month = <get name="day of the month"/></li>
</condition>
</template>
</category>
An AIML tip I would advise you do with <condition> is to always include a catchall <li> as I've done above. That way, your bot will at least respond with something if nothing matches rather than leaving the user hanging.
I am writing the below AIML code.
<aiml>
<category>
<pattern>test</pattern>
<template>This is a test to try the third possible input. Yes / No ? </br>
</template>
</category>
<category>
<pattern>Yes</pattern>
<that>This is a test to try the third possible *</that>
<template>Hey!. You have typed YES!</template>
</category>
<category>
<pattern>No</pattern>
<that>This is a test to try the third possible *</that>
<template>Hey!. You have typed No!</template>
</category>
<category>
<pattern>*</pattern>
<that>This is a test to try the third possible *</that>
<template>BINGO!!!!</template>
</category>
</aiml>
I would like to see "Bingo!!!" as a response when a user enters anything apart from Yes or No.
<pattern>*</pattern>
works fine when I use it separately, but not here. Where am I doing the mistake?
Some AIML libraries require the pattern value to be uppercase (this is good practice even for implementations which not force it). So for me the following code works as expected (tested under PyAIML):
<aiml>
<category>
<pattern>TEST</pattern>
<template>This is a test to try the third possible input. Yes / No ? <br /></template>
</category>
<category>
<pattern>YES</pattern>
<that>THIS IS A TEST TO TRY THE THIRD POSSIBLE *</that>
<template>Hey!. You have typed YES!</template>
</category>
<category>
<pattern>NO</pattern>
<that>THIS IS A TEST TO TRY THE THIRD POSSIBLE *</that>
<template>Hey!. You have typed No!</template>
</category>
<category>
<pattern>*</pattern>
<that>THIS IS A TEST TO TRY THE THIRD POSSIBLE *</that>
<template>BINGO!!!!</template>
</category>
</aiml>
Output:
> test
This is a test to try the third possible input. Yes / No ?
> yes
Hey!. You have typed YES!
> test
This is a test to try the third possible input. Yes / No ?
> no
Hey!. You have typed No!
> test
This is a test to try the third possible input. Yes / No ?
> Foo
BINGO!!!!
>
Instead of <that> tags you can also try to use <topic>, e.g.:
<aiml>
<category>
<pattern>TEST</pattern>
<template>
This is a test to try the third possible input. Yes / No ? <br />
<think><set name="topic">THREE OPTIONS</set></think>
</template>
</category>
<topic name="THREE OPTIONS">
<category>
<pattern>YES</pattern>
<template>Hey!. You have typed YES!</template>
</category>
<category>
<pattern>NO</pattern>
<template>Hey!. You have typed No!</template>
</category>
<category>
<pattern>*</pattern>
<template>BINGO!!!!</template>
</category>
</topic>
</aiml>
I'd like to create a auto-completion definition file to my domain specific language so that the I get parameter hints for predefined class methods.
In the doc I have the following example:
<?xml version="1.0" encoding="Windows-1252" ?>
<NotepadPlus>
<AutoComplete language="C++">
<Environment ignoreCase="no" startFunc="(" stopFunc=")" paramSeparator="," terminal=";" additionalWordChar = "."/>
<KeyWord name="abs" func="yes">
<Overload retVal="int" descr="Returns absolute value of given integer">
<Param name="int number" />
</Overload>
</KeyWord>
That works like a charm for function calls such as:
abs(-12)
That is, I hit "a" and Notepad++ suggests the function abs and hints to its parameters.
However what if abs is a method of a class? For instance:
MyObject.abs(-12)
I would expect that once I hit the key "." and "a" Notepad++ would propose me the abs method and all the parameter hints. However, with the xml definition listed above it does not work.
Does anybody know how to deal with this issue? Is there a regular expression mode that we can use?
Thanks in advance.
I just found out solution. Posting here to leave a trace and help others out.
If I remove additionalWordChar = "." it wokrs!
I have tried lot of the time in Submit Feed (product) in Amazon Marketplace. There is a lack of clear information and the reference document is also not good as much. It is have only the basic feed submission.
I need to create new product with size and color information. Please the code below,
<MessageType>Product</MessageType>
<Message>
<MessageID>1</MessageID>
<OperationType>Update</OperationType>
<Product>
<SKU>5000-***-**-*</SKU>
<StandardProductID>
<Type>UPC</Type>
<Value>YSjsjs899ss</Value>
</StandardProductID>
<Condition>
<ConditionType>New</ConditionType>
</Condition>
<DescriptionData>
<Title>Backout T-Shirt Light Pink Medium</Title>
<Brand>Blackout T-Shirt</Brand>
<Description>This is an sample product added by bala.</Description>
<BulletPoint>Made in Italy</BulletPoint>
<MSRP currency="USD">2.19</MSRP>
<Manufacturer>Peacock Alley</Manufacturer>
<ItemType>Novelty T-Shirts</ItemType>
</DescriptionData>
<ProductData>
<Clothing>
<VariationData>
<Parentage>child</Parentage>
<VariationTheme>SizeColor</VariationTheme>
<Size>M</Size>
</VariationData>
<SizeMap>Medium</SizeMap>
<ColorName>Light Pink</ColorName>
<ColorMap>pink</ColorMap>
<ClassificationData>
<ClothingType>Underwear</ClothingType>
<Department>mens</Department>
<ModelNumber>CM203</ModelNumber>
</ClassificationData>
</Clothing>
</ProductData>
</Product>
</Message>
But it is not working. Please guide me to do this.
Regards,
Balaganesh
I'm aware that this answer is late, but I just had another question today that led me here, and while this didn't help me, I believe I can answer this question anyway. So here goes:
You can find the XSD -- which is the xml schema file -- here: https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/ProductClothing.xsd
The special thing about this, which is different from JSON is that this has the :sequence attribut. This means that it is important which order the elements go into the xml file.
In the ColorSize variation theme, the VariationTheme block should look like this:
<VariationData>
<Parentage>child</Parentage>
<Size>S</Size>
<Color>White</Color>
<VariationTheme>SizeColor</VariationTheme>
</VariationData>