vania-janet/multiturn-rag-retrieval-data huggingface dataset:
Building a custom client using the API 

If none of the built-in integrations meet your requirements, you can deploy your assistant by developing a custom client application that interacts with your users and communicates with the IBM Watson® Assistant service.

The Watson SDKs help you write code that interacts with Watson Assistant. For more information about the SDKs, see [Watson SDKs](https://cloud.ibm.com/docs/assistant?topic=watson-using-sdks).



 Setting up the assistant 

The example application we will create in this section implements several simple functions to illustrate how a client application interacts with Watson Assistant. The application code will collect input and send it to an assistant, which sends responses the application will display to the user.

If you want to try this example yourself, first you need to set up the simple example assistant that the client will connect to:



1. Download the actions [JSON file](https://watson-developer-cloud.github.io/doc-tutorial-downloads/assistant/assistant-simple-example-actions.json).
2. [Create an assistant](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-assistant-add).
3. In the new assistant, [open the global action settings](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-actions-global-settings). Go to the Upload/Download tab and import the actions from the file you downloaded.



The example actions include a Greet customer action that asks the customer's name, and simple actions for making and canceling appointments.





 Getting service information 

To access the Watson Assistant REST APIs, your application needs to be able to authenticate with IBM Cloud® and connect to the assistant in the environment where it is deployed. You'll need to copy the service credentials and environment ID and paste them into your application code. You'll also need the URL for the location of your service instance (for example, https://api.us-south.assistant.watson.cloud.ibm.com).

To find this information, follow these steps:



1.
Developing applications 

After you install smart contracts (chaincode) and deploy your peer and ordering nodes, you are ready to develop client applications to transact with other members of your IBM Blockchain Platform network. Applications invoke the business logic contained in smart contracts to create, transfer, and update assets on the blockchain ledger. Use this page to learn how to use client applications to interact with networks from the IBM® Blockchain Platform console.

Target audience: This topic is designed for application developers who are interested in developing client apps for an IBM Blockchain Platform network, in Node.js, Go, or Java.



 Using the v2.4 Fabric Gateway peer service 

IBM Blockchain Platform v2.5.4 adds support for the v2.4 Hyperledger Fabric Gateway peer service, which introduces an updated model for developing applications. The v2.4 gateway peer model relocates node connection and transaction processing requirements from the client application to the v2.4 peer nodes. The [v2.4 Fabric Gateway](https://hyperledger-fabric.readthedocs.io/en/release-2.4/gateway.html) method therefore enables developers to focus on business solutions, without having to code gateway connection or transaction processing logic in client applications, as is required for earlier releases.



 Supported app development methods in Fabric v2.4 

To develop new applications for IBM Blockchain Platform v2.5.4, using the latest v2.4 Hyperledger Fabric Gateway peer service and API are recommended, as documented in [Running a Fabric Application](https://hyperledger-fabric.readthedocs.io/en/release-2.4/write_first_app.html). However, for existing applications developed for IBM Blockchain Platform v2.5.2 and earlier, no migration is required— your existing applications will continue to run on v2.5.4.
[Close arrow](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/close_arrow.png) icon to finish adding the about_restaurant intent.



You added an intent and provided examples of utterances that real users might enter to trigger this intent.





 Add a dialog node that is triggered by the about_restaurant intent 

Add a dialog node that recognizes when the user input maps to the intent that you created in the previous step, meaning its condition checks whether your assistant recognized the about_restaurant intent from the user input.



1. Click the Dialog tab.
2. Find the General_Greetings node in the dialog tree.

You will add a node that checks for questions about the restaurant after this initial greeting node to reflect the flow you might expect to encounter in a normal conversation. For example, Hello. then Tell me about yourself.
3. Click the More![More options](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/kabob.png) icon on the General_Greetings node, and then select Add node below.

![Shows the Add node below menu opened from the #General_Greetings dialog node.](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/gs-ass-dialog-add-about-restaurant.png)
4. Start to type about_restaurant into the If assistant recognizes field of this node. Then select the about_restaurant option.
5. Add the following text as the response.



To copy the text, click the copy icon that is associated with the text block ![Indicates you can copy the code block.]
Click the Watson Package group.
5. Click the Speech To Text Package.
6. Click Install.
7. After the package is installed you are redirected to the actions page and can search for your new package, which is named speech-to-text-v1.
8. To use the actions in the speech-to-text-v1 package, you must bind service credentials to the actions.



* To bind service credentials to all actions in the package, follow steps 4 and 5 in the [CLI instructions](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-pkg_speech_to_textspeechtotext_cli).
* To bind service credentials to individual actions, complete the following steps in the console.



You must complete the following steps for each action that you want to use.



1. Click an action from the speech-to-text-v1 package that you want to use. The details page for that action opens.
2. In the left navigation, click the Parameters section.
3. Enter a new parameter. For the key, enter __bx_creds. For the value, paste in the service credentials JSON object from the service instance that you created earlier.









 Using the Speech to Text package 

To use the actions in this package, run commands in the following format.

ibmcloud fn action invoke speech-to-text-v1/<action_name> -b -p <param name> <param>

Try out the list-models action.

ibmcloud fn action invoke speech-to-text-v1/list-models -b
Sample apps 

Learn more about IBM Watson™ Natural Language Understanding from these sample applications and labs.



 Build a cognitive moderator microservice 

Process messages and images exchanged in a chat channel using Watson services to moderate the discussions



* [Learn more ![External link icon](https://cloud.ibm.com/docs-content/v1/content/icons/launch-glyph.svg)](https://developer.ibm.com/patterns/build-a-cognitive-moderator-microservice/)
* [Get the Code ![External link icon](https://cloud.ibm.com/docs-content/v1/content/icons/launch-glyph.svg)](https://github.com/IBM/cognitive-moderator-service)
* [View the Demo ![External link icon](https://cloud.ibm.com/docs-content/v1/content/icons/launch-glyph.svg)](https://www.youtube.com/watch?v=z91RYXgU9CI)
* [Watch the Video ![External link icon](https://cloud.ibm.com/docs-content/v1/content/icons/launch-glyph.svg)](https://www.youtube.com/watch?v=9c7NuamK8JA)







 Get recommendations by linking structured and unstructured data 

Establish a relation with data stored in the structured format



* [Learn more ![External link icon](https://cloud.ibm.com/docs-content/v1/content/icons/launch-glyph.svg)](https://developer.ibm.com/patterns/generate-insights-from-multiple-data-formats-using-watson-services/)
* [Get the Code !
* [Git](https://git-scm.com/)
* Java™ 8 or higher









 Tutorial steps 



1. In the IBM Cloud console (UI), go to your Resource list, select your Event Streams resource, and click the Get started with a sample application tile.
2. Complete the Configure and run starter application steps:

a. Click the Download .JAR from GitHub button to download the latest .JAR release.

b. Click the Generate properties button to generate and download the properties file. The Topic panel opens.

c. Enter a name for a New topic that you want to create. Or, click Existing topic to select an existing topic that you want to use.

If you are on the Lite plan and a topic already exists, the New topic button is disabled.

d. Select the Service credential that you want to use, or select Create new to create a new one.

e. Click the Generate and download button. The kafka.properties file is downloaded to your local machine. It contains the necessary configuration to connect to Event Streams. You can open it in a text editor to see how it works.

f. The panel shows your selected configuration. Clicking the Regenerate button starts the process again. Clicking the Download button downloads the properties file again.
3. Navigate to the folder that contains the downloaded .JAR file by using the command line or a terminal and run the command. Replace the value <path-to-properties> with the file path to the kafka.properties file.
4. When the application starts, click the localhost:8080 link to open the starter app and see messages flowing through the topic.







 Next steps 

Now that you ran the starter application, you can try other [Event Streams samples](https://github.com/ibm-messaging/event-streams-samples).
* Fallback action: The built-in action, Fallback, provides a way to automatically connect customers to a human agent if they need more help. This action helps you to handle errors in the conversation, and is triggered by these conditions:



* Step validation failed: The customer repeatedly gave answers that were not valid for the expected customer response type.
* Agent requested: The customer directly asked to be connected to a human agent.
* No action matches: The customer repeatedly made requests or asked questions that the assistant did not understand.



For more information, see [Set by assistant actions](https://cloud.ibm.com/docs/assistant?topic=assistant-actionsactions-builtin).



Dialog skill "Try it out" improvements
: For dialog skills, the Try it out pane now uses the [React](https://reactjs.org/) UI framework similar to the rest of the Watson Assistant user interface. You shouldn't see any change in behavior or functionality. As a part of the update, dialog skill error handling has been improved within the "Try it out" pane. This update will be implemented incrementally, starting with service instances in the Tokyo and Seoul data centers.





 2 September 2021 

Deploy your assistant on the phone in minutes
: We have partnered with [IntelePeer](https://intelepeer.com/) to enable you to generate a phone number for free within the phone integration. Simply choose to generate a free number when following the prompts to create a phone integration, finish the setup, and a number is assigned to your assistant. These numbers are robust and ready for production.

Connect to your existing service desks
: We have added step-by-step documentation for connecting to [Genesys](https://cloud.ibm.com/docs/assistant?topic=assistant-deploy-phone-genesys) and [Twilio Flex](https://cloud.ibm.com/docs/assistant?topic=assistant-deploy-phone-flex) over the phone. Easily hand off to your live agents when your customers require telephony support from your service team.
[Getting started](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-gettingStarted) offers examples of both the HTTP POST /v1/synthesize and GET /v1/synthesize methods. The [API & SDK reference](https://cloud.ibm.com/apidocs/text-to-speech) shows examples of all interfaces and methods.

There is no graphical user interface for submitting text. See the [Text to Speech demo](https://www.ibm.com/demos/live/tts-demo/self-service/home) to try an example of the service in action. The demo accepts a small amount of your text as input to generate speech with different voices.





 Can I change how the service interprets input text and produces synthesized audio? 

You can use the Speech Synthesis Markup Language (SSML) to control aspects of the synthesis process such as pronunciation, volume, pitch, speed, and other attributes. You can also use the Tune by Example feature to tailor the prosody, intonation, and cadence of custom prompts to better suit your application needs.



* For general information about SSML, see [Understanding SSML](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-ssml).
* For information about the supported SSML elements, see [SSML elements](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-elements).
* For information about the Tune by Example feature, see [Understanding Tune by Example](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-intro).







 What programming languages can I use? 

The service supports SDKs in many popular programming languages and platforms.



* For more information about the SDKs and links to them on GitHub, see [Watson SDKs](https://cloud.ibm.com/docs/text-to-speech?topic=watson-using-sdks).
When your dialog is ready, click Connect now.
2. Click Access Intercom to be redirected to the Intercom site.

Log in to Intercom using the assistant's functional email address and password, not your own. You want to establish the connection to a functional ID that is shared by more than one person in your organization.
3. Click Authorize access.
4. Click Back to overview.



The assistant is now available to receive assignments from Intercom teammates. If you haven't yet, [set up your dialog](https://cloud.ibm.com/docs/assistant?topic=assistant-deploy-intercomdeploy-intercom-dialog-prereq).





 Configuring message routing 

Assign human teammates as backups for the assistant in case the assistant needs to transfer an in-progress conversation to a human. You can choose a different team or teammate to be the backup contact for each dialog branch.

To set up routing assignments for escalations from the assistant to a human, complete the following steps:



1. From the Intercom integration page, click My Dialog Skill is ready to confirm that you have prepared your dialog.

Only click this button if you have completed the [Preparing the dialog](https://cloud.ibm.com/docs/assistant?topic=assistant-deploy-intercomdeploy-intercom-dialog-prereq) procedure.
2. In the Settings section, click Manage rules.

If you make no changes, the backup contact for all of the nodes remains unassigned.
3. Click New rule.
4. From the Choose node drop-down list, choose the node for the dialog branch you want to configure.

Remember, branches are identified by their node name. If you did not specify a node name, then the node's ID is displayed instead.
5. Choose the team or human agent teammate to be the backup contact for this dialog branch.
[Getting started](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-gettingStarted) offers examples of both the HTTP POST /v1/synthesize and GET /v1/synthesize methods. The [API & SDK reference](https://cloud.ibm.com/apidocs/text-to-speech) shows examples of all interfaces and methods.

There is no graphical user interface for submitting text. See the [Text to Speech demo](https://www.ibm.com/demos/live/tts-demo/self-service/home) to try an example of the service in action. The demo accepts a small amount of your text as input to generate speech with different voices.
* Can I change how the service interprets input text and produces synthesized audio?

You can use the Speech Synthesis Markup Language (SSML) to control aspects of the synthesis process such as pronunciation, volume, pitch, speed, and other attributes. You can also use the Tune by Example feature to tailor the prosody, intonation, and cadence of custom prompts to better suit your application needs.



* For general information about SSML, see [Understanding SSML](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-ssml).
* For information about the supported SSML elements, see [SSML elements](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-elements).
* For information about the Tune by Example feature, see [Understanding Tune by Example](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-intro).



* What programming languages can I use?

The service supports SDKs in many popular programming languages and platforms.



* For more information about the SDKs and links to them on GitHub, see [Watson SDKs](https://cloud.ibm.com/docs/text-to-speech?topic=watson-using-sdks).
update-dialog-node Action username, password, iam_access_token, iam_apikey, iam_url, headers, headers[X-Watson-Learning-Opt-Out], url, workspace_id, dialog_node, new_dialog_node, new_description, new_conditions, new_parent, new_previous_sibling, new_output, new_context, new_metadata, new_next_step, new_title, new_type, new_event_name, new_variable, new_actions, new_digress_in, new_digress_out, new_digress_out_slots Update a dialog node. 
 list-all-logs Action username, password, iam_access_token, iam_apikey, iam_url, headers, headers[X-Watson-Learning-Opt-Out], url, filter, sort, page_limit, cursor List log events in all workspaces. 
 list-logs Action username, password, iam_access_token, iam_apikey, iam_url, headers, headers[X-Watson-Learning-Opt-Out], url, workspace_id, sort, filter, page_limit, cursor List log events in a workspace. 
 delete-user-data Action username, password, iam_access_token, iam_apikey, iam_url, headers, headers[X-Watson-Learning-Opt-Out], url, customer_id Delete labeled data. 





 Creating a Watson Assistant service instance 

Before you install the package, you must create a Watson Assistant service instance and service credentials.



1. [Create a Watson Assistant service instance](https://cloud.ibm.com/catalog/services/conversation).
2. When the service instance is created, service credentials are automatically created for you.







 Installing the Watson Assistant package 

After you have a Watson Assistant service instance, install the Watson Assistant package into your namespace.



 Installing from the Cloud Functions CLI 

Install the Watson Assistant package from the CLI.
The editor makes it easy to connect devices, APIs, and online services by using the wide range of nodes that are included in the palette.







 Customizing your Node-RED instance 

You can customize your Node-RED instance for your needs. For example, you can replace the landing page with your own page, add HTTP authentication to the flow editor, or add new nodes to the palette.



1. Download the app code by clicking Start Coding > Download Starter Code on the app's overview page.
2. Ensure that the Cloud Foundry command-line interface (CLI) is installed. See [the instructions for installing the command line interface](https://cloud.ibm.com/docs/cloud-foundry-public?topic=cloud-foundry-public-cf-deploy-cli) for more information.
3. Log in to the IBM Cloud environment.

ibmcloud cf login -a https://api.<ph conref="cloudoeconrefs.ditacloudoeconrefs/domainname"></ph> -u <varname props="keyref(user_ID)"><your user ID></varname> -p <varname></varname> -o <varname props="keyref(org_name)"><your org name></varname> -s <varname
props="keyref(space_name)"><your space name></varname>
4. Modify the app, and deploy it again. The default app landing page describes some of the customization. Nodes and packages can be added to your instance of Node-RED by adding them to the list of dependencies. After you complete your changes, use the CLI to deploy the app to IBM Cloud again.

For example, run the following command in the root directory of the app:

ibmcloud cf push <varname><yourappname></varname>







 Access the VCAP_SERVICES environment 

To access the VCAP_SERVICES environment from a Node-RED flow, you must add the environment variable to the Function node's global context.



1.
Understanding network basics of classic clusters 

When you create a classic cluster, you must choose a networking setup so that certain cluster components can communicate with each other and with networks or services outside of the cluster.



* [Worker-to-worker communication](https://cloud.ibm.com/docs/containers?topic=containers-plan_basicsworker-worker): All worker nodes must be able to communicate with each other on the private network. Often, communication must be permitted across multiple private VLANs to allow workers on different VLANs and in different zones to connect with each other.
* [Worker-to-master and user-to-master communication](https://cloud.ibm.com/docs/containers?topic=containers-plan_basicsworkeruser-master): Your worker nodes and your authorized cluster users can communicate with the Kubernetes master securely over the public network with TLS or over the private network through private cloud service endpoints.
* [Worker communication to other IBM Cloud services or on-premises networks](https://cloud.ibm.com/docs/containers?topic=containers-plan_basicsworker-services-onprem): Allow your worker nodes to securely communicate with other IBM Cloud services, such as IBM Cloud® Container Registry, and to an on-premises network.
* [External communication to apps that run on worker nodes](https://cloud.ibm.com/docs/containers?topic=containers-plan_basicsexternal-workers): Allow public or private requests into the cluster as well as requests out of the cluster to a public endpoint.





 Worker-to-worker communication: classic VLANs and subnets 

When you create a classic cluster, the cluster's worker nodes are connected automatically to a private VLAN and optionally connected to a public VLAN. A VLAN configures a group of worker nodes and pods as if they were attached to the same physical wire and provides a channel for connectivity among the workers.

You can't create classic Red Hat OpenShift on IBM Cloud clusters that are connected to a private VLAN only. Your worker nodes must be connected to both public and private VLANs.



 VLAN connections for worker nodes