Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I add a context variable in api.js? #268

Open
Austin-Jones opened this issue Nov 18, 2020 · 0 comments
Open

How can I add a context variable in api.js? #268

Austin-Jones opened this issue Nov 18, 2020 · 0 comments

Comments

@Austin-Jones
Copy link

I can add a context variable by editing the payload in app.js, but I would like to update a context variable when a user submits a message. I tried changing the payload in api.js to look like this:

var payloadToWatson = {
  session_id: sessionId,
  input = {
    message_type: 'text',
    text: text,
    options: {
      return_context: true
    }
   },
   context : {
    skills: {
      "main skill" : {
        user_defined: {
          location : myVar
        }
      }
    }
  }
 };

There is an updateMessage function according to the Watson API but the api.js component does not use this.
Any ideas on how I can update the context variable?
Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant