Digital Developer Conference: a FREE half-day online conference focused on AI & Cloud – North America: Nov 2 – India: Nov 9 – Europe: Nov 14 – Asia Nov 23 Register now

Close outline
  • United States
IBM?
  • Site map
IBM?
  • Marketplace

  • Close
    Search
  • Sign in
    • Sign in
    • Register
  • IBM Navigation
IBM Developer Answers
  • Spaces
    • Blockchain
    • IBM Cloud platform
    • Internet of Things
    • Predictive Analytics
    • Watson
    • See all spaces
  • Tags
  • Users
  • Badges
  • FAQ
  • Help
Close

Name

Community

  • Learn
  • Develop
  • Connect

Discover IBM

  • ConnectMarketplace
  • Products
  • Services
  • Industries
  • Careers
  • Partners
  • Support
10.190.13.195

Refine your search by using the following advanced search options.

Criteria Usage
Questions with keyword1 or keyword2 keyword1 keyword2
Questions with a mandatory word, e.g. keyword2 keyword1 +keyword2
Questions excluding a word, e.g. keyword2 keyword1 -keyword2
Questions with keyword(s) and a specific tag keyword1 [tag1]
Questions with keyword(s) and either of two or more specific tags keyword1 [tag1] [tag2]
To search for all posts by a user or all posts with a specific tag, start typing and choose from the suggestion list. Do not use a plus or minus sign with a tag, e.g., +[tag1].
  • Ask a question

Watson assistant how to trigger child node using API

550003FPSX gravatar image
Question by Nirav G  (1) | Aug 08 at 03:51 AM watson-assistantdialog-tool

Hello , I've created workspace(Skill) "API Test For Chat". On Watson tool's try it panel and preview chat window everything works well, but when i try to chat using API calling then child dialog node never process. So i want to know that is any thing extra param which need to pass using API. I've referred following document link : https://cloud.ibm.com/apidocs/assistant?code=node#get-response-to-user-input.

Following is my API calling code :

 let params = {
             'workspace_id': workspace,
             'input': {
                 'text': userInput
             },
             'nodes_visited_details': true
         };

First, I'm sending a blank message to Watson using API , so it trigger welcome dialog. After next message i pass extra param in previous param example , i.e. added a conversation id like below :

 let params = {
             'workspace_id': workspace,
             'input': {
                 'text': userInput
             },
             'nodes_visited_details': true,
             'context':{
                      'conversation_id' : conversation_id
                 }
         };


Here is step of user input :

1) About mellow

2) Advertiser

On first user input it trigger dialog About mellow jane and return response based on it. But after next user input advertiser, it trigger the fallback dialog. So i do not understand why it trigger fallback dialog. If user directly type advertiser then its OK, Watson can trigger fallback dialog as there is no root level dialog set for advertiser.

So can you please help me that what I'm missing when calling user input using API.

Also, here I'm attaching a screenshot of try it panel and preview link screenshot and workspace json.

I want that child node should trigger after its parents based on condition using API calling.

[1]: /answers/storage/temp/29116-skill-test-api-chat.txt

preview-link.png (63.1 kB)
try-it-panel.png (92.4 kB)
skill-test-api-chat.txt (8.3 kB)

People who like this

  0
Comment
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster

1 reply

  • Sort: 
110000PNBC gravatar image
Accepted answer

Answer by @chughts (12979) | Aug 08 at 04:33 AM

You are using the V1 API. In that you must send the full context object that is returned to you as part of the response. You can modify the context, to control the flow, but the context allows the dialog to continue from its last point. If you don't pass in the full context then the dialog will always start from the top.

You can avoid having to return the context in this way by using the V2 API - https://cloud.ibm.com/apidocs/assistant-v2 . The context is saved as part of the session, so you still need to establish and return a session id. You can start a fresh dialog by not sending a session id.

Comment

People who like this

  0   Show 2   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
550003FPSX gravatar image Nirav G (1)   Aug 08 at 07:42 AM 0
Share

Hello @chughts, thanks for your reply. As per your suggestion I've passed the whole context with next user input using V1 API. And child dialog execute perfectly. But I've one concern on that when user first type invalid input and then type correct input in this case Watson also goes to fallback. So how can i make user on track.

As per my case user first type About mellow and Watson trigger parent level dialog after that if user type any invalid input then it goes to fallback and then if user type advertiser in this user also goes to fallback. But i want to trigger child advertiser dialog after getting advertiser input from user. So is that possible or not?

And for V2 API we need assistant id and right now i think Watson not providing API to create an assistant, so i can not able to use V2 API.

110000PNBC gravatar image @chughts (12979) ♦   Aug 09 at 09:09 AM 0
Share

If you want to capture fall out conditions like this, you will need to add clauses or nodes that trigger on true to handle any condition that you were not expecting. You can then route the dialog to the appropriate response.

Follow this question

182 people are following this question.

Answers

Answers & comments

Related questions

Disambiguation does not work on WordPress plugin website 1 Answer

In Watson assistant what is the maximum no of responses per dialog 0 Answers

Watson assistant how can we set Standard and Frame type node in single dialog 1 Answer

Watson Assistant : How to call child node more than one time in a flow 1 Answer

Test for an empty JSON object? 1 Answer

  • Contact
  • Privacy
  • IBM Developer Terms of use
  • Accessibility
  • Report Abuse
  • Cookie Preferences

Powered by AnswerHub

Authentication check. Please ignore.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • API Connect
  • Analytic Hybrid Cloud Core
  • Application Performance Management
  • Appsecdev
  • BPM
  • Blockchain
  • Business Transaction Intelligence
  • CAPI
  • CAPI SNAP
  • CICS
  • Cloud Analytics
  • Cloud Automation
  • Cloud Object Storage
  • Cloud marketplace
  • Collaboration
  • Content Services (ECM)
  • Continuous Testing
  • Courses
  • Customer Experience Analytics
  • DB2 LUW
  • Data and AI
  • DataPower
  • Decision Optimization
  • DevOps Build
  • DevOps Services
  • Developers IBM MX
  • Digital Commerce
  • Digital Experience
  • Finance
  • Global Entrepreneur Program
  • Hadoop
  • Hybrid Cloud Core
  • Hyper Protect
  • IBM Cloud platform
  • IBM Design
  • IBM Forms Experience Builder
  • IBM Maximo Developer
  • IBM StoredIQ
  • IBM StoredIQ-Cartridges
  • IIDR
  • ITOA
  • InformationServer
  • Integration Bus
  • Internet of Things
  • Kenexa
  • Linux on Power
  • LinuxONE
  • MDM
  • Mainframe
  • Messaging
  • Node.js
  • ODM
  • Open
  • PartnerWorld Developer Support
  • PowerAI
  • PowerVC
  • Predictive Analytics
  • Product Insights
  • PureData for Analytics
  • Push
  • QRadar App Development
  • Run Book Automation
  • Search Insights
  • Security Core
  • Storage
  • Storage Core
  • Streamsdev
  • Supply Chain Business Network
  • Supply Chain Insights
  • Swift
  • UBX Capture
  • Universal Behavior Exchange
  • UrbanCode
  • WASdev
  • WSRR
  • Watson
  • Watson Campaign Automation
  • Watson Content Hub
  • Watson Marketing Insights
  • dW Answers Help
  • dW Premium
  • developerWorks Sandbox
  • developerWorks Team
  • Watson Health
  • More
  • Tags
  • Questions
  • Users
  • Badges