Giter Club home page Giter Club logo

Comments (13)

taycaldwell avatar taycaldwell commented on July 21, 2024

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.

spenc53 avatar spenc53 commented on July 21, 2024

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.

spenc53 avatar spenc53 commented on July 21, 2024

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.

Fleker avatar Fleker commented on July 21, 2024

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.

spenc53 avatar spenc53 commented on July 21, 2024

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.

Fleker avatar Fleker commented on July 21, 2024

You mean between "category" and "category.original"?

from actions-on-google-java.

spenc53 avatar spenc53 commented on July 21, 2024

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.

Fleker avatar Fleker commented on July 21, 2024

You mean the parameter names, or the names of the context?

from actions-on-google-java.

spenc53 avatar spenc53 commented on July 21, 2024

from actions-on-google-java.

Fleker avatar Fleker commented on July 21, 2024

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.

spenc53 avatar spenc53 commented on July 21, 2024

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.

Fleker avatar Fleker commented on July 21, 2024

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.

cbeaujoin avatar cbeaujoin commented on July 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.