Service node - Configure a global service invocation

更新时间:
复制 MD 格式

Service invocation nodes allow you to call third-party service APIs, which makes your conversation flows more flexible.

This guide uses checking the weather as an example.

To configure the API service, see API services (including Short Message Service).

1. Create a conversation flow named Check Weather

image

2. Click Edit to open the conversation flow

image

3. Click the start node, create a new intent, and configure the start intent with initial questions

Set the intent name to Start and click Create.

Set the initial questions and click Add.

Click Save to finish.

Then, associate the new intent with a branch.

4. Add a slot filling node and set the node name

Open the slot filling node and create a global slot.

Set the slot name and select a built-in detection method. This method uses built-in Named Entity Recognition. For more information, see Entity management.

Click OK. Then, set a follow-up question to ask the user for the city whose weather they want to check.

After you set the follow-up question, click Save.

5. Add a service node and select a global service to call

Open the service invocation node and select the global service that you created.

In the request parameters for the service, enter "$" to reference the city slot.

After you make the selection, click Save.

6. Add a response node and reference the information returned by the API

Open the response node. In the text response box, enter "$" and select the service return parameter to retrieve the weather information for the city from the API.

Select the return parameter name that you configured.

After you make the selection, click Save.

7. After you configure the conversation flow, click the Save button in the upper-right corner. After the flow is saved, click Voice Test to validate it