Dialogflow to Actions on Google: Request contains an invalid argument - action

Request contains an invalid argument.
The query pattern '$SchemaOrg_Date:date' contains an undefined parameter (name: 'date' type: 'SchemaOrg_Date')
No idea what happened to my dialogflow.It gives me the error and no idea where to look for SchemaOrg_Date and date
Any help is appreciated.

Found it within one of 200 Intents!
The intent had a parameter #date-period
As User says, we had Yesterday which dialogflow did not select it as #date-period but #date
Do not look on your Json(s), you need to manually find it on your Intents.

I was setting an entity slot to a 'required' value, which caused it to fail, if I didn't provide a hard coded Response in Dialogflow for the required value.

This might help sombody :
In your dialogflow, if you have different langages, be careful to chose the good one in your api and for this problem, to check the intents of the other langages versions, the intents you created are not the same everywhere !
for exemple : if you created intents in the langage en-us and en-gb, you need to check the intents on both.
Took the night to find that out. and i don't agree with user2793508, you can find the entity by doing a research on your json files, that's how i knew where to look and when i didn't see it, i checked the other langages just per curiosity, that saved me, lol.
Hope i was clear, see ya

I had the same problem but it is resolved now.
There was a problem in the intent as the Training phrases was not assigned to the given
Action and parameters
there the multiple copies of the same Parameter was created.
Example : John wants a flower
name - "John"
name - " "
two parameters with same name will create the error
remove the one without any use or self created one and the error will be removed.
or assign the keyword by double clicking them to the preferred parameter in Training phrases .

Related

Dialogflow: Respond based on values and other conditional responses

I have $dinetype variable obtained from the user.
But I would like to give response based on what value has been set in $dinetype variable. In addition to giving responses, I also need to set relevant context. How do I do this in DialogFlow?
if($Dinetype=='dineout')
ask ('which restaurant would you like to go to?')
set_context ('awaiting-restaurant')
if($Dinetype=='takeaway')
ask ('When would you like to take away?')
set_context ('awaiting-takeaway-time')
Is it programmable at all? Or is it possible to achieve something equivalent to the above in the UI?
Edit: A much easier way has been added to handle this issue directly in Dialogflow
(Updated Solution) Follow-up Intents:
After creating an intent, you can add follow-up intents now.
Intents -> Create Intent >
[Response=Prompt For Conditional Response]
Intents -> Add Follow-up Intent -> Custom/Yes/No
Then set the training praise to a matching entity you want to conditionally respond to
  
 
OLD HACKY SOLUTION:
Late reply, but maybe someone will find this useful.
If the conditional response only needs to reference a single parameter
value, then I figured out what you can do is utilize the Entity's
"Reference Value" as the response you want to give for a particular
set of Synonyms.
So you'd have an entity that looked like this:
Then, setup your intent like this, with a response of $Dinetype:
Then the end result will look like this:
And you can make whatever follow-up intent you need from there.
Down-side is Dinetype won't be as reusable. But I still think it
beats writing a fulfillment webhook every time you need a simple
conditional response.
You can't do this in the Response section directly. The Response section is meant for fairly simple responses that don't require significant logic to process. Although you can use parameters in the response, you can't give a different response based on the value of the parameter. So you can set a response to something like
I think $Dinetype is great food.
but not
{{#if $Dinetype == "Thai"}}I think Thai food is too hot{{/if}}
or anything like that
However, you can add code that sends conditional responses and contexts by implementing a Fulfillment webhook. Although you can't do this for each Intent as part of the Intent editor screen, the Fulfillment screen includes a built-in code editor.
I found a solution to my similar problem using composite entities, which may or may not be overkill for your agent. The value assigned to a parameter associated with the (composite) entity will contain a JSON structure, if a synonym in that entity was matched.
Using the "Dot" notation, you can assign the matched sub-entity's property (similar to the reference value of a normal entity) to another parameter in the Actions and Parameters section. You can have one parameter for each sub-entity and hence, you can evaluate these parameters in your response section to select each response variants:
$Parameter_A ResponseA
$Parameter_B ResonseB
....
etc.
Clunky but works. Just have to be careful to reference the property exactly as it is defined in the composite entity.

Viewstate Replacing error. [ViewStateException: Invalid viewstate. ]

Tried with JMeter: How to know why my regular expression extractor in JMeter is not extracting the data but still not able to replace my view-state, its throwing [ViewStateException: Invalid viewstate. ] error . Please check the attachment , an my script has not _EVENTVALIDATION .
enter image description hereViewstate
viwstate2
As i am observing from your attached image
You need to pass same `Reference name` as a value of __VIEWSTATE in Next request
First Cross verify, Is your correaltion is correct or not? (you can use debug sampler to check the correlation)
If yes, then first mistake is, you had given reference name as "VIEWSTATE" in below shown snapshot
But you are passing ${jsfViewState} in other snapshot, so correct it and pass same reference name i.e. ${VIEWSTATE}
It'll resolve your issue, if issue still persists then click on encode button beside Name-Value pair because sometimes there is some mismatch in encoding format between the response which we capture and the value which we have to pass
Don't be confused with ASP.NET ViewState and JSF Viewstate, they have similar nature but different underlying technologies and different parameter names
Given you correctly correlated the value, I believe you need to change __VIEWSTATE parameter name to javax.faces.ViewState and it should work.
See Testing a JSF Application with JMeter guide for a little bit more detailed explanation on the topic and How to debug your Apache JMeter script guide for some troubleshooting techniques.

Parameter not supported by web service

I want to validate an opinion with you.
I have to design a web service that searches into a database of restaurants affiliated to a discount program in a specific country around a given address.
The REST call to such a webservice will look like http://server/search?country=<countryCode>&language=<languageCode>&address=<address>&zipcode=<zipcode>
The problem is that some countries do not have zipcodes or do not have them in the entire country.
Now, what would you do if the user passes such a parameter for a country that does not have zipcodes, but he/she passes a valid address?
Return 400 Bad request.
Simply igonre the zipcode parameter and return results based on the valid address
Return an error message in a specific format (e.g. JSON) stating that zipcodes are not supported for that country
Some colleagues are also favoring the following option
4. Simply return no results. And state in the documentation that the zipcode parameter is not supported. Also we have to create a webservice method which returns what fields should be displayed in the user interface.
What option do you think is best and why?
Thanks!
Well the OpenStreetMap Nomination Server returns results even if you dont know the ZIP Code and you can look at the results anyway. What if the user doesnt know the zip code but wants to find hist object?
I would try to search for that specific object anyway, especially because you said that some countries have zip codes partially.
If you simply return nothing te user doesnt know what went wrong and he wont know what to do.
That would depend on the use case. How easy is it for a user of the API to trigger that case? Is it a severe error which the user really should know how to avoid? Or is it something that is not entirely clear, where a user may know (or think he knows) a zipcode where officially there shouldn't be one? Does it come down to trial and error for the user how to retrieve correct results from your API? Is it a bad enough error that the user needs to be informed about it and that he needs to handle this on his side?
If you place this restriction in your API, consider that it will have to be clearly documented when this case is triggered, every user of the API will have to read and understand that documentation, it needs to be clear how to avoid the problem, it needs to be possible for the user to avoid the problem and every user will have to correctly implement extra code on his side to avoid this problem. Is it possible for the user to easily know which areas have zipcodes and which don't?
I think the mantra of "be flexible in what you accept, strict in what you output" applies...

How do I add comment lines to a business rule authored in Business Action Language

I am using JRules to author business rules. I want to add comments to the rules as shown in the very simple example below. I realise there is a documentation section for the rule but that is not what I require
// comments needed here
definitions
set 'an existing customer' to a customer
where the category of 'an existing customer' is "gold"
if
the city of 'an existing customer' is "London"
then
give a 5% discount to 'an existing customer'
else
// and more comments needed here
give a 10% discount to 'an existing customer'
Clearly, using the usual c++ and c# double forwardslash // will not work in the example above, so my question is how are comments added to rules in BAL.
Unfortunately you cannot add comments in rules. The rules are supposed to be self explanatory if the verbalization is good.
But you can use the documentation feature,if you want to document the business justification for each of the rules.
There is a simple workaround:
You can create 2 static virtual methods in your BOM: one commenting the conditions and one for the actions.
In the case of conditions:
Create a static method that takes a parameter String and return a boolean
Verbalize it like this "// {0}" (without quotes)
In the B2X, make it return true
Then, you can comment a condition with //"your_condition" and ...
In the previous example:
if
the city of 'an existing customer' is "London" and
// "blablabla" and
the age of 'an existing customer' is greater than 18
then ...
Since the method returns true, it won't affect the test. It has to be surrounded by "and", not "or".
In the case of actions:
Create a static method that takes a parameter String and return void
Verbalize it like this "// {0}" (without quotes)
In the B2X, add "return;"
Then, you can comment an action with //"your_action" ;
In the previous example:
else
// "and more comments needed here" ;
give a 10% discount to 'an existing customer' ;
You can do it but it means a hell lot of customization. So forget it
And it would be feasible only via browser interface, not Eclipse.
Just because you will be cheating.
How to do it:
Ready?... Steady?...
You need to recreate your own RTS (teamserver) web interface! if it sounds like too much effort then stop reading :)
Using the API, you can retrieve the rules from RTS (database) the there is (as mention in Tito's answer) a documentation attached to any rule.
So you can handle the display of your rule and add the comment accordingly.
Of course you need to find a way to position the comment correctly in the rule Line number could do the trick.
This is for the display...
Ten when you save the rule (by clicking a lovely button that you will have coded to do the actual saving) you need to remove the comments (and know where they are for the next time you want to display the rule) and save both the rule body and the documentation attached.
Sounds crazy? One client done it and I was working on this :) but we didn't modify the rule body. Almost everything but the rule body.
This will take you months, inpependently to the number of people working on it, I'm afraid.
To sum up: Can you do it, yes!
Does the implementation worth the effort? NO WAY!!!
Will this feature be available in the next version? NO! As Tito mentioned a rule should be self-explainatory.
Sorry :(

Vtiger: I can't add a To Do event

If I got to calendar, click on To Do, then try to add an event, the form pops up, I fill it out, press save, but no Event gets added.
In the SQL error log's I see an error like this:
2011-09-29 14:57:07 EDT ERROR: null value in column "visibility" violates not-null constraint
2011-09-29 14:57:07 EDT STATEMENT: insert into
vtiger_activity(activityid,subject,date_start,time_start,time_end,due_date,status,eventstatus,priority,sendnotification,activitytype,visibility,duration_hours,duration_minutes,location,recurringtype,notime)
values('235','Testing','2011-09-29','19:50',NULL,'2011-09-29','Not Started',NULL,'High','0','Task',NULL,NULL,NULL,NULL,NULL,'0')
So, for some reason, it is trying to add a To-Do while inserting null values. My biggest problem is that I cannot locate the origin of the query. So, basically, the most important thing I am asking is what file takes the data that was input into the todosave form and turns it into a query.
I don't know if many people on here use Vtiger, but I couldn't figure this out so I went ahead and posted anyway. The official documentation is not very helpful in my opinion.
Thanks for everything, have a good day.
This might be an isolated case, but was any of the modules modified recently? In this case, I would assume that it would be the Calendar module. I've tested this on the demo website and on my vTiger installation and it works fine..
Perhaps you can download a fresh copy of vTiger and replace the modules/Calendar all its content.
By the way, another place to ask if you have any questions, is the vTiger forums.
http://forums.vtiger.com/index.php
Usually you can ask it in the Help - 5.2.1 section. Hope this helps!