Google Actions Builder Many Slot Required - actions-on-google

Hello guys i need some help/understand how required slot filling works.
Looking inside the documentation:
https://developers.google.com/assistant/conversational/scenes
I would be able to add as many as much required slots but when I try to test it in Google Actions Builder Simulator (Test) I'm getting this error when I fill only one slot:
{
"insertId": "---",
"jsonPayload": {
"timestamp": "2021-06-22T11:46:48.872626Z",
"endConversation": {},
"status": {
"message": "There is no prompt message nor helper instruction in the response.",
"code": 13
},
"executionState": {
"sessionParameters": {},
"currentSceneId": "Success",
"slots": {
"status": "COLLECTING",
"slots": {
"goal": {
"status": "FILLED",
"mode": "REQUIRED",
"updated": true,
"value": "goal1"
},
"level": {
"status": "EMPTY",
"mode": "REQUIRED"
}
}
}
}
},
"resource": {
"type": "assistant_action",
"labels": {
"project_id": "---",
"version_id": "",
"action_id": "---"
}
},
"timestamp": "2021-06-22T11:46:48.872626Z",
"severity": "CRITICAL",
"labels": {
"channel": "preview"
},
"logName": "---",
"trace": "---",
"receiveTimestamp": "2021-06-22T11:46:48.912102599Z"
}
For some context I'm using two required slot filling:

You can include as many required slots as you like. Once all required slots are filled, scene.slots.status will be set to "FINAL", and the pre-populated condition will be met.
For each slot you can mark it as required by selecting This slot is required. If you need access to the value, you can write it to a session parameter by selecting Customize slot value writeback and providing a name for the session parameter key.
The error you are receiving says "There is no prompt message nor helper instruction in the response.".
When configuring each slot, you can add a customized prompt (dependent on slot type) for when you first prompt the user to fill the slot. If this isn't configured, you will receive the above error message.
To add a prompt, under the slot configuration, select Send prompt and add what you want to say to the user.
For example:
candidates:
- first_simple:
variants:
- speech: What is your favorite number?

Related

Sonarqube REST API : What is the structure of "metrics" in "GET api/measures/component" WS

In the response example from the web api documentation, I can see metric "ncloc" should be like this in the JSON web response :
"measures": [
{
"metric": "ncloc",
"value": "114",
"periods": [
{
"index": 1,
"value": "3"
}
]
},
But it's not, there is no "periods" for this metric in my response :
"measures":[
{
"metric": "ncloc",
"value": "2943"
},
There are "periods" for some other metrics though, and in this case, there is no metric value, only a value for each period (and there are never multiple periods, only one corresponding to the "new code" period).
So here are my questions about this :
How can I know which structure to expect for a metric ? what would be the metric where "periods" would have a list of periods and not just one corresponding to "new code" ?
I don't think there are multiple periods. API documentation for my version (8.9) only states period, which probably stands for Leak Period as the New Code used to be called. I assume that general value is for overall value and period value is for the new code. Some measures may not make sense or be counted for overall or new code, so I would not make assumptions on whether there will be a metric value for the period or general.
Edit:
The following is the 8.9 documentation:
GET api/measures/component
SINCE 5.4
Return component with specified measures.
Requires the following permission: 'Browse' on the project of specified component.
Parameters
Parameter
Required?
Since
Description
Example value
additionalFields
optional
Comma-separated list of additional fields that can be returned in the response.
Possible values: metrics, period, periods Example value: period,metrics
branch
optional
6.6
Branch key. Not available in the community edition.
Example value: feature/my_branch
component
required
Component key
Example value: my_project
metricKeys
required
Comma-separated list of metric keys
Example value: ncloc,complexity,violations
pullRequest
optional
7.1
Pull request id. Not available in the community edition.
Example value: 5461
Response Example
{
"component": {
"key": "MY_PROJECT:ElementImpl.java",
"name": "ElementImpl.java",
"qualifier": "FIL",
"language": "java",
"path": "src/main/java/com/sonarsource/markdown/impl/ElementImpl.java",
"measures": [
{
"metric": "complexity",
"value": "12",
"period": {
"value": "2",
"bestValue": false
}
},
{
"metric": "new_violations",
"period": {
"value": "25",
"bestValue": false
}
},
{
"metric": "ncloc",
"value": "114",
"period": {
"value": "3",
"bestValue": false
}
}
]
},
"metrics": [
{
"key": "complexity",
"name": "Complexity",
"description": "Cyclomatic complexity",
"domain": "Complexity",
"type": "INT",
"higherValuesAreBetter": false,
"qualitative": false,
"hidden": false,
"custom": false
},
{
"key": "ncloc",
"name": "Lines of code",
"description": "Non Commenting Lines of Code",
"domain": "Size",
"type": "INT",
"higherValuesAreBetter": false,
"qualitative": false,
"hidden": false,
"custom": false
},
{
"key": "new_violations",
"name": "New issues",
"description": "New Issues",
"domain": "Issues",
"type": "INT",
"higherValuesAreBetter": false,
"qualitative": true,
"hidden": false,
"custom": false
}
],
"period": {
"mode": "previous_version",
"date": "2016-01-11T10:49:50+0100",
"parameter": "1.0-SNAPSHOT"
}
}
Changelog
Version
Change
8.8
deprecated response field 'id' has been removed.
8.8
deprecated response field 'refId' has been removed.
8.1
the response field periods under measures field is deprecated. Use period instead.
8.1
the response field periods is deprecated. Use period instead.
7.6
The use of module keys in parameter 'component' is deprecated
6.6
the response field 'id' is deprecated. Use 'key' instead.
6.6
the response field 'refId' is deprecated. Use 'refKey' instead.

JBPM created case and tasks not visible or accessible

I have succesfully integrated Keycloak into JBPM for user management and can login using keycloak into business central and case management. I have also successfully configured the kie-server using keycloak credentials and can deploy a stripped down version of the IT Orders sample application on the running sample-server kie-server. When I perform a GET/kie-server/services/rest/server/containers I can see my container itorders_1.0.0-SNAPSHOT is up and running in business central and also when I call GET /kie-server/services/rest/server/containers which gives the output below
{
"type": "SUCCESS",
"msg": "List of created containers",
"result": {
"kie-containers": {
"kie-container": [
{
"container-id": "itorders_1.0.0-SNAPSHOT",
"release-id": {
"group-id": "itorders",
"artifact-id": "itorders",
"version": "1.0.0-SNAPSHOT"
},
"resolved-release-id": {
"group-id": "itorders",
"artifact-id": "itorders",
"version": "1.0.0-SNAPSHOT"
},
"status": "STARTED",
"scanner": {
"status": "DISPOSED",
"poll-interval": null
},
"config-items": [
{
"itemName": "KBase",
"itemValue": "",
"itemType": "BPM"
},
{
"itemName": "KSession",
"itemValue": "",
"itemType": "BPM"
},
{
"itemName": "MergeMode",
"itemValue": "MERGE_COLLECTIONS",
"itemType": "BPM"
},
{
"itemName": "RuntimeStrategy",
"itemValue": "PER_CASE",
"itemType": "BPM"
}
],
"messages": [
{
"severity": "INFO",
"timestamp": {
"java.util.Date": 1598900747932
},
"content": [
"Release id successfully updated for container itorders_1.0.0-SNAPSHOT"
]
}
],
"container-alias": "itorders"
}
]
}
}
}
I can get the case definitions using GET /kie-server/services/rest/server/queries/cases
{
"definitions": [
{
"name": "Order for IT hardware",
"id": "itorders.orderhardware",
"version": "1.0",
"case-id-prefix": "IT",
"container-id": "itorders_1.0.0-SNAPSHOT",
"adhoc-fragments": [
{
"name": "Prepare hardware spec",
"type": "HumanTaskNode"
}
],
"roles": {
"owner": 1
},
"milestones": [],
"stages": []
}
]
}
I can then do a POST /kie-server/services/rest/server/containers/itorders_1.0.0-SNAPSHOT/cases/itorders.orderhardware/instances which correctly returns the Case ID of the case created e.g. IT-0000000014. The call returns http status code 201
However when I do a GET /kie-server/services/rest/server/queries/cases/instances there are no instances returned as per below
{
"instances": []
}
When I create a case in the JBPM Case Management showcase I get the green prompt to show the case was successfully created however no open cases appear in the grid even if I refresh the screen.
I can see the process instance associated with the case in the process instances view including the diagram which shows that the "Prepare hardware spec" is active and the current activity. However viewing the tasks associated with the process does not show any tasks. Similarly the task inboxes of the user I am expecting to get claim the task is also empty.
Take note that I am using token based authentication with Keycloak and executed the above rest calls using Postman
Why can I not view the case instance I created? Why can I not view the tasks associated with the process instance?
With this query GET /kie-server/services/rest/server/queries/cases/instances you can see only instances on which is your user setup as potential. Make sure that user used in token is setup as potential owner.

Task.Json triggers validation on invisible only fields

I am trying to create a Azure DevOps Pipelines Custom extension. I have a task.json where fields are visible on certain conditions.
For example:
{
"name": "actions",
"type": "picklist",
"label": "Actions",
"defaultValue": "Select",
"required": true,
"helpMarkDown": "Select an Action from the dropdown as per your requirement.",
"options": {
"New": "Add",
"Delete": "Delete"
}
},
{
"name": "backEndIPAddress",
"type": "string",
"label": "IP Address",
"required": true,
"defaultValue": "",
"helpMarkDown": "",
"visibleRule": "actions = New",
"validation": {
"expression": "isMatch(value,'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?){0,15}$','IgnoreCase')",
"message": "Invalid IP Address. Please try again!"
}
}
The issue when the IPAddress field is hidden, the validation is still tried and it fails. How to ensure that the fields are validated only if they are visible?
A few options:
Set a default value for the input
Update the regex to include ^$| at the start to allow empty values ('require':true will take care of the requiredness)
Remember that there should be a default isIpV4Address(value: string) function so you don't have to specify the regex.
From the docs it looks like there is an upcoming when clause which will dictate when the set of rules should trigger, I suppose this may be causing the currently unwanted behavior.
See also:
https://github.com/Microsoft/vsts-tasks/blob/1d75fa8f66aa1cf7a9cb62946939f30f087b2969/docs/taskinputvalidation.md

How to get rid of the json attributes "variant", "annotations", from the response

I have started using the dropwizard to develop a REST server. The Issue as long resource-method return an EntityType (say Enrolment), the out put is as expected but I have decided to send custom status codes using the below code
Response.status(Response.Status.PRECONDITION_FAILED)
.entity(Entity.json(new enrolment, AdapterResponseStatus.FAILURE)))
.build();
Everything is fine but the out put now contains a few more extra extra attributes as shown below.
{
"entity":
{
"id": 1267,
"courseId": "5798890",
"userName": "user#abc.com",
"tenantId": "tenant1",
"status": "approved",
"link": "/enrollments/null"
},
"variant":
{
"language": null,
"mediaType":
{
"type": "application",
"subtype": "json",
"parameters":
{
},
"wildcardType": false,
"wildcardSubtype": false
},
"encoding": null,
"languageString": null
},
"annotations":
[
],
"mediaType":
{
"type": "application",
"subtype": "json",
"parameters":
{
},
"wildcardType": false,
"wildcardSubtype": false
},
"language": null,
"encoding": null
}
I was expecting "entity" property alone but was getting other attributes. Is there any to get rid of them as no one is going to consuming them?
Those tags appear even if I replace my entity object (enrolment) with an empty string.
If you look at the signature of the ResponseBuilder's entity method, it takes the object directly; unlike Jersey client which requires a special Entity object that coincidentally has annotations and variants fields within.
Change your code to this:
Response.status(Response.Status.PRECONDITION_FAILED)
.entity(new Enrolment())
.build();

Loopback - GET model using custom String ID from MongoDB

I'm developing an API with loopback, everything worked fine until I decided to change the ids of my documents in the database. Now I don't want them to be auto generated.
Now that I'm setting the Id myself. I get an "Unknown id" 404, whenever I hit this endpoint: GET properties/{id}
How can I use custom IDs with loopback and mongodb?
Whenever I hit this endpoint: http://localhost:5000/api/properties/20020705171616489678000000
I get this error:
{
"error": {
"name": "Error",
"status": 404,
"message": "Unknown \"Property\" id \"20020705171616489678000000\".",
"statusCode": 404,
"code": "MODEL_NOT_FOUND"
}
}
This is my model.json, just in case...
{
"name": "Property",
"plural": "properties",
"base": "PersistedModel",
"idInjection": false,
"options": {
"validateUpsert": true
},
"properties": {
"id": {"id": true, "type": "string", "generated": false},
"photos": {
"type": [
"string"
]
},
"propertyType": {
"type": "string",
"required": true
},
"internalId": {
"type": "string",
"required": true
},
"flexCode": {
"type": "string",
"required": true
}
},
"validations": [],
"relations": {},
"acls": [],
"methods": []
}
Your model setup (with with idInjection: true or false) did work when I tried it with a PostGreSQL DB setup with a text id field for smaller numbers.
Running a Loopback application with DEBUG=loopback:connector:* node . outputs the database queries being run in the terminal - I tried it with the id value you are trying and the parameter value was [2.002070517161649e+25], so the size of the number is the issue.
You could try raising it as a bug in Loopback, but JS is horrible at dealing with large numbers so you may be better off not using such large numbers as identifiers anyway.
It does work if the ID is an alphanumeric string over 16 characters so there might be a work around for you (use ObjectId?), depending on what you are trying to achieve.