Comments (13)
Hi @cbeaujoin,
Thank you for your feature request! We are always looking on ways to improve our client libraries, so we appreciate feedback and suggestions for the community.
from actions-on-google-java.
Should it only check for 1 parameter? Or should it also be able to take in a list of parameters?
from actions-on-google-java.
Also, as a follow up for this, maybe at some point, add another annotation for @Param("paramName") paramName: string
for functions to pass in data? Probably won't be part of this issue, might be out of scope.
from actions-on-google-java.
If you do support a list of parameters, would your annotation support a comma-separated list of args or an array primitive?
@ForIntent("Intent Name", "Param Name 1", "Param Name 2", ...)
or
@ForIntent("Intent Name", ["Param Name 1", "Param Name 2"])
from actions-on-google-java.
It could probably go either way on the array formatting. I think that an actual array would be more explicit. Also, to get which parameters to check,how should we pick which name from the outputContext to choose? Or do we look at the parameters for all of them? I provided the snippet below to show the output contexts and their names.
{
"name": "projects/projectId/agent/sessions/sessionId/contexts/choose_fact-followup",
"lifespanCount": 5,
"parameters": {
"category.original": "",
"category": "history"
}
},
{
"name": "projects/projectId/agent/sessions/sessionId/contexts/_actions_on_google",
"lifespanCount": 98,
"parameters": {
"data": "{\"headquarters\":[\"google_headquarters_fact_1\",\"google_headquarters_fact_2\",\"google_headquarters_fact_3\"],\"cats\":[\"cat_fact_1\",\"cat_fact_2\",\"cat_fact_3\"],\"history\":[],\"test\":\"hello\"}",
"category.original": "",
"category": "history"
}
}
]```
from actions-on-google-java.
You mean between "category" and "category.original"?
from actions-on-google-java.
Oh, sorry, I should've explained better.
The @ForIntent("Intent Name") matches the top level intent name.
For the specific outputContexts, they also have names that are specific, will the parameters be the same for those?
from actions-on-google-java.
You mean the parameter names, or the names of the context?
from actions-on-google-java.
from actions-on-google-java.
I guess choosing either the first (exit early) or the last (replace) would be the primary expected way to do it. Or maybe throw an exception if not specific enough.
There are many different ways to do it which could all be potentially valid.
from actions-on-google-java.
Would the user also need to specify the context type name then (just the last part)? And if they didn't care which it hit, leave it empty and it will default to match the first one that has all the parameters, if any?
from actions-on-google-java.
Well I don't know whether they'd need to specify the context always. Certainly it's something you may need. But what do you think the expected behavior should be if it's empty?
from actions-on-google-java.
Hi,
I don't think we need to support a list of parameters.
A second parameter (a String) is enough.
First let me add my understanding of the contexts names :
With actions we have a context at conversation level :
- "projects//agent/sessions//contexts/_actions_on_google" built by the actions sdk and that should persist until end of conversation, it has an extended lifespan (99)
For a given intent "intent" whatever the number of filled params there is parent context :
- "projects//agent/sessions//contexts/intent_dialog_context" that should persist until the user answer all the required params or leave the intent, its lifespan (1) is renewed by dialogflow
For a given intent "intent" with a required parameter "cellphone" not filled and in first position in the required parameters sorted list. There is a context :
- "projects//agent/sessions//contexts/intent_dialog_params_cellphone"that should persist until the user answer the param or leave the intent, its lifespan (1) is renewed by dialogflow.
It means we have to prompt the user for its cellphone number.
If there is no context that contains "dialog_params" it means we have reach the intent's end.
If we apply this to the annotation :
@ForIntent("Intent Name", "cellphone")
If a context that contains "intent_dialog_params_cellphone" exists :
- it means we have to prompt the user for the cellphone number.
@ForIntent("Intent Name") => with an empty/null second parameters
If there is no context that contains "dialog_params":
- It matchs an intent without parameters
- It matchs an intent where all required parameters are filled, it means we have reach the intent's end.
or there is a dialog_params but it does not match any @ForIntent("Intent Name", "param")
from actions-on-google-java.
Related Issues (20)
- Allow deserializing a request and serializing a response using streams HOT 5
- Support noInputPrompts HOT 3
- vendored googleapis proto cause duplicate-dependency-class issues
- consider dropping JSONObject from the smarthome API surface HOT 1
- SyncResponse.Payload is missing errorCode
- Smarthome integration should expose DisconnectResponse HOT 3
- report state need a Integer value type HOT 4
- Intermittent error while while calling reportState in Java HOT 1
- Smarthome integration should allow setting arbitrary data on ExecuteResponse HOT 1
- Not able play video from hls direact link into chromecast using google smart home action
- Missing features on java AoG library
- Regarding the 'NOT_FOUND: Requested Entity was not Found' error log
- Exception when the server reports the status
- How to enrich messages with content? HOT 4
- ManagedChannelImpl was not shutdown properly HOT 3
- Support for Actions on Google Console HOT 3
- why there is no field `notificationSupportedByAgent` ? HOT 4
- German umlauts (ä, ö and ü) not properly displayed and spoken. HOT 3
- FATAL EXCEPTION: java.lang.AssertionError getResourceResolver after gradle and kotlin version updated in Android project
- Security Policy violation Binary Artifacts HOT 28
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from actions-on-google-java.