Skip to content
This repository has been archived by the owner on Jul 8, 2020. It is now read-only.

Configuring the sample application

brian111 edited this page Jun 11, 2018 · 4 revisions

The sample application need a number of the nodes to be configured to communicate with IBM Cloud services. You need to have the services deployed to your IBM Cloud account then enter the service credentials in the appropriate nodes.

The services you need to have deployed in the IBM Cloud are:

  • Watson Assistant
  • Language Translator
  • Speech to Text
  • Text to Speech
  • Weather Company Data

To deploy a service you need to log into your IBM Cloud account then select catalog from the top menu. Use the search bar to find the service in the catalog then select the service. Verify the region, organisation and space the service will be deployed to are correct and the desired price plan is selected - you can usually accept all the pre-populated details, then hit the create button to create an instance of the service.

Once you have all the services created you can see them all in the dashboard, accessible from the side menu of the IBM Cloud console.

To access the credentials for a service select it from the dashboard then select Service credentials from the side menu. In the Service credentials section open the drop down to display the credentials:

Visual Recognition

To configure the Visual Recognition nodes in the sample application you need to enter the API Key from the service credentials in to the Visual Recognition nodes.

To access the configuration simple double click the node in the Node-RED editor. Enter the API Key then select done. This needs to be done for all instances of the Visual Recognition node.

Text to Speech and Text to Speech

To configure the Text to Speech and Speech to Text nodes in the sample application you need to enter the user name and password from the service credentials.

Translation

The translation service need the username and password from the Service Credentials.

Digital Assistant

The Digital assistant node needs some additional configuration, as the service on the IBM Cloud needs to be configured with the conversation details. The conversation configuration is available in the git repo in the conversation folder. You need to download this file to your local system. To load the conversation, select the Digital Assistant instance from the dashboard then select launch tool from the service page. This launches the Digital Assistant console. Select the Workspaces section then select to import a workspace and import the downloaded TobyJnr_conversation_workspace.json file.

Once the workspace has been imported use the workspace menu to access the details:

Then copy the workspace id into the node configuration:

You also need to enter the user and password details from the Service Credentials page of the Digital Assistant service.

Weather

The weather service needs to have the URL modified in the http request nodes. The Service Credentials details shows the host for the service you have provisioned - this changes from region to region. You then need to add the following to create the URL which needs to be enter in the node configuration:

/api/weather/v1/geocode/{{{lat}}}/{{{lon}}}/observations.json?language={{{lang}}}&units={{{units}}}

If the host is : twcservice.eu-gb.mybluemix.net then the URL for the node configuration becomes : https://twcservice.eu-gb.mybluemix.net/api/weather/v1/geocode/{{{lat}}}/{{{lon}}}/observations.json?language={{{lang}}}&units={{{units}}}

You also need to tick to enter basic authentication information then provide the user and password information from the Service Credentials section for the Weather Service.

The node preceding the weather service http request node, labelled Barcelona in the screenshot, configures the location where current weather data is retrieved for you can update the latitude and longitude data as required.

Once all the changes have been made you need to deploy the flow to make the changes live.