Create a bot flow and use third-party ASR grammar quick start guide
- Genesys Cloud CX 1, Genesys Cloud CX 2, or Genesys Cloud CX 3 license.
- A valid Genesys Dialog Engine Bot Flow subscription. For more information, contact Genesys Cloud Sales.
- If you have a Nuance Mix account, the Nuance OAuth Client ID and Client secret credentials. For more information, see the Nuance Mix documentation.
- If you do not have a Nuance Mix account, complete one of the following steps:
- Based on your preferred Nuance region, navigate to the corresponding Nuance Mix home page to create a free account for testing purposes. For more information about the available regions, see Geographies in the Nuance Mix documentation. It is important to note that the free account has limitations and cannot be used for production traffic.
- Contact your Nuance representative directly to place your service order and create your production account.
You can create an Architect bot and incorporate third-party ASR grammars for use with call flows. Create the bot from within the call flow, or create it separately and then call it from the call flow.
Language | Region | Language tag |
---|---|---|
Basque | European Union | eu-ES |
Catalan | Spain | ca-ES |
Dutch | Netherlands | nl-NL |
Chinese | Simplified - People's Republic of China | zh-CN |
Traditional - Hong Kong S.A.R. | cn-HK | |
English | Australia | en-AU |
Great Britain | en-GB | |
India | en-IN | |
United States | en-US | |
French | Belgium | fr-BE |
Canada | fr-CA | |
France | fr-FR | |
German | Germany | de-DE |
Switzerland | de-CH | |
Galician | Spain | gl-ES |
Italian | Italy | it-IT |
Japanese | Japan | ja-JP |
Korean | Korea | ko-KR |
Portuguese | Brazil | pt-BR |
Portugal | pt-PT | |
Russian | Russia | ru-RU |
Spanish | Spain | es-ES |
United States and Latin America | es-US | |
Valencian | Spain | va-ES |
Step 1: Add and activate your third-party ASR engine integration
Add your third-party ASR engine integration. The example in this article uses the Nuance Recognizer as a Service integration.
- Click Admin.
- Under Integrations, click Integrations.
- Click Integrations.
- In the Search box, type Nuance Recognizer as a Service. The card for Nuance Recognizer as a Service appears.
- Click Install.
To configure the Nuance Recognizer as a Service integration for one Nuance language group, perform the following steps:
- Open the Nuance Recognizer as a Service integration:
- If you did not previously installed the integration into your Genesys Cloud organization, install it now.
- If you installed the integration, open the Genesys Cloud Admin menu and under Integrations, click Integrations. Then, search for and open the Nuance Recognizer as a Service integration.
- On the Nuance Recognizer as a Service integration page, click the Configuration tab.
- Under Properties, locate the Recognizer Endpoint URL section.
- In the Value field, enter the regional endpoint for the Nuance language group that your bot supports:
- For example, if you want to use Nuance Recognizer as a Service for en-US, ja-JP, and zh-CN, use
nr-apac4.api.nuance.com
. - If your bot only supports one language, use the URI of a language group that includes the language and is closest to your organization’s location. For example, if your bot supports fr-FR by default and your organization exists in Switzerland, use
nr-wu2.api.nuance.eu
. For more information, see Language groups by region in the Nuance Recognizer documentation.
- For example, if you want to use Nuance Recognizer as a Service for en-US, ja-JP, and zh-CN, use
- Click the Credentials tab. Genesys Cloud lists the credentials for all authorization endpoint URLs that you can use to authenticate to endpoints associated with the various Nuance language groups. Configure the credentials for the default recognizer endpoint only.Note: To determine what credentials to configure for a specific language group, check what Nuance region the language group belongs to based on its corresponding endpoint URL. For more information, see Geographies in the Nuance Mix documentation.Click the image to enlarge.
- Click Configure for the Nuance Recognizer Credentials for the Default Recognizer Endpoint URL. The Configure Credentials dialog box opens.
- Copy the “client_id” value from your OAuth configuration into the Nuance Client ID field. Use your AU, EU, or US client ID depending on whether your bot uses languages from the AU, EU, or US Nuance region.Note: For example, if the regional endpoint URI you specified in step 4 ends inClick the image to enlarge.
nuance.eu
, use the client ID of your mix.nuance.eu credentials. If the URI ends innuance.com
, use the client ID of your mix.nuance.com credentials. - Copy the “client_secret” value from your OAuth configuration into the Nuance Client Secret field. Use your AU, EU, or US client secret depending on whether your bot uses languages from the AU, EU, or US Nuance region.
- Copy the “private_key_id” from the JSON file into the Nuance Private Key ID field.
- Copy the “private_key” value from the JSON file into the Nuance Private Key field.
- Click OK.
- Click Save.
- To activate the Nuance Recognizer as a Service status, in the Status column click Inactive. The Change Status dialog box opens.
- Click Yes. The Nuance Recognizer as a Service integration status changes to Active.
- Open the Nuance Recognizer as a Service integration:
- If you did not previously installed the integration into your Genesys Cloud organization, install it now.
- If you installed the integration, open the Genesys Cloud Admin menu and under Integrations, click Integrations. Then, search for and open the Nuance Recognizer as a Service integration.
- On the Nuance Recognizer as a Service integration page, click the Configuration tab.
- Under Properties, locate the Recognizer Endpoint URL section.
- In the Value field, enter a regional endpoint based on the following criteria:
- If a language group includes all the languages that your bot supports, use its corresponding URI. For example, if you want to use Nuance Recognizer as a Service for en-US, ja-JP, and zh-CN, use
nr-apac4.api.nuance.com
. If your bot only supports one language, use the URI of a language group that includes the language and is closest to your organization’s location. For example, if your bot supports fr-FR by default and your organization is based in Switzerland, usenr-wu2.api.nuance.eu
. For more information, see Language groups by region in the Nuance Recognizer documentation. - If the languages that your bot supports and you want to use Nuance Recognizer as a Service for belong to multiple language groups, use a URI of a language group that includes a language that your bot supports by default. Specify the URIs of the other language groups under the Advanced tab. For more information, see Language groups by region in the Nuance Recognizer documentation.
- If a language group includes all the languages that your bot supports, use its corresponding URI. For example, if you want to use Nuance Recognizer as a Service for en-US, ja-JP, and zh-CN, use
- Click the Advanced tab.
- To configure mappings for the languages that Nuance does not serve through the default endpoint you previously specified in the Recognizer Endpoint URL section, follow these steps: Notes:
- Except for the languages that the default regional endpoint covers, be sure to map all the languages to an appropriate Nuance endpoint.
- If you map a language to a regional Nuance endpoint, then you must set the credentials for that language region under Credentials, even if the default regional endpoint and its corresponding credentials would cover that language.
- If a language does not have a mapped value in the Advanced Configuration section, then Genesys Cloud attempts to use the default regional endpoint with the default credentials.
- (Optional) To download and inspect the JSON schema that Genesys Cloud validates your advanced configuration against, click Download Schema.
- Add a property named “endpointMappings” as an object.
- Add the language tags of your supported languages and the corresponding Nuance endpoints as key-value pairs to the object: You can copy and paste the following example into the Advanced Configuration editor and modify it according to your needs:
{ "endpointMappings": { "ca-ES": "nr-wu1.api.nuance.eu", "es-ES": "nr-wu1.api.nuance.eu", "es-US": "nr-na1.api.nuance.com", "gl-ES": "nr-wu1.api.nuance.eu", "va-ES": "nr-wu1.api.nuance.eu", "fr-FR": "nr-wu5.api.nuance.eu", "en-GB": "nr-wu1.api.nuance.eu", "eu-ES": "nr-wu1.api.nuance.eu" } }
Note: The user interface validates the object against the expected JSON schema and informs you if the object does not comply.
- Click the Credentials tab. Genesys Cloud lists the credentials for all authorization endpoint URLs that you can use to authenticate to endpoints associated with the various Nuance language groups.Note: To determine what credentials to configure for a specific language group, check what Nuance region the language group belongs to based on its corresponding endpoint URL. For more information, see Geographies in the Nuance Mix documentation.Click the image to enlarge.
- Click Configure. The Configure Credentials dialog box opens.
- Copy the “client_id” value from your OAuth configuration into the Nuance Client ID field. Use your AU, EU, or US client ID depending on whether your bot uses languages from the AU, EU, or US Nuance region.Note: For example, if the URI of the regional endpoint you want to configure credentials for ends inClick the image to enlarge.
nuance.eu
, use the client ID of your mix.nuance.eu credentials. If the URI ends innuance.com
, use the client ID of your mix.nuance.com credentials. - Copy the “client_secret” value from your OAuth configuration into the Nuance Client Secret field. Use your AU, EU, or US client secret depending on whether your bot uses languages from the AU, EU, or US Nuance region.
- Copy the “private_key_id” from the JSON file into the Nuance Private Key ID field.
- Copy the “private_key” value from the JSON file into the Nuance Private Key field.
- Click OK.
- Repeat step 8 for all other credentials that you must configure.Notes:
- If you configured an endpoint mapping for a language in the Advanced tab, then you must configure the credentials for the specific Nuance authorization endpoint URL that the language’s group is associated with.
- If you have not configured any endpoint mapping for the language in the Advanced tab, then you must configure the credentials for the default regional endpoint that you previously specified under the Properties tab.
- Click Save.
- To activate the Nuance Recognizer as a Service status, in the Status column click Inactive. The Change Status dialog box opens.
- Click Yes. The Nuance Recognizer as a Service integration status changes to Active.
Step 2: Add grammar from your third-party ASR engine to Architect’s grammar page
Add grammar from your third-party engine to Architect.
<?xml version="1.0"?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xml:lang="en-US" version="1.0" root="fruits"> <rule id="fruits" scope="public"> <one-of> <item>apple</item> <item>banana</item> <item>blueberry</item> <item>cherry</item> <item>grape</item> <item>peach</item> <item>pear</item> <item>pineapple</item> <item>strawberry</item> <item>watermelon</item> </one-of> </rule> </grammar>
- Click Admin.
- Under Architect, click Architect. Architect opens in a new tab.
- Click Grammars.
- Click Add. The Create New Grammar dialog box opens.
- Name the grammar Fruit.
- Under Grammar Description, add descriptive details about the grammar. For example, “list of fruit for sale.”
- Click the Starting Language and select the initial language that you want the grammar to use.
- Click Create. The Grammar Editor opens.
- Depending on the type of grammar that you want to add, click one of the following tabs:
- Voice
- DTMF
- To manually add GRXML content from the Nuance Recognizer ASR grammar, enter the syntax into the editor.Note: If the grammar passes XML validation, then a green message appears, letting you know that the grammar is free of errors. If a red message appears, then Architect lets you know the location in the GRXML that the error or errors exist.
- To upload a grammar file with the .gram extension, follow these steps:Note: If you switch from the .grxml file type to the .gram file type, then Architect removes existing .grxml file.
- Click .grxml and select .gram.
- Click Select File. The Add A Grammar File dialog box opens.
- Click Select .gram file and upload the appropriate file.
- Click Add File. Architect uploads the file but does not check for errors.
- Click Save.
Grammar Editor for DTMF
The example in this article uses DTMF grammar. For details and an example of voice grammar, see Add a grammar for a bot flow in Architect.
Click the image to enlarge.
Step 3: Create a bot for an inbound flow and add intents, slots, and slot types
This procedure describes how to create a bot for an inbound call flow. In this example, build the bot flow to ask users what they want to do. They can pay their outstanding bill or order fruit.
- Create a new bot flow:
- From the Architect home page, click or hover over the Flows menu and select Bot Flow.
- Click Add. The Create Flow dialog box opens.
- In the Name field, enter a unique name for the flow.
- (Optional) In the Description field, add a short sentence or phrase to describe this flow.
- Click the Default Language list and select the flow’s default supported language.
- Click the Divisions list and select the division in which to place the flow.
- Click Create Flow. The flow’s configuration page opens.
- Under Natural Language Understanding, click Intents.
- Add the first intent:
- Click Add Intent.
- Name the intent Pay my outstanding bill.
- Click Add Utterance.
- On the Utterances page, add an utterance. For example, “payment.”
- Click Add.
- Repeat steps a-e to add another utterance. Best practice recommends that you add five or more utterances.
- Add the second intent:
- Click Add Intent.
- Name the intent Fruit order.
- Click Add Utterance.
- On the Utterances page, add an utterance. For example, “place order.”
- Click Add.
- Repeat steps a-e to add more utterances. Best practice recommends that you add five or more utterances.
- Add slots:
- Under the Natural Language Understanding menu, click Slots.
- Click Add Slot. the Add Slot dialog box opens.
- Name the slot PickFruit.
- Under Associated Slot Type, select New List.
- Click Engine and select the third-party ASR engine. In this example, select Nuance Recognizer as a Service.
- Click Grammar and select the grammar that you added in the Step 2 section above, Fruit.
- Click Save.
- Repeat steps a-g to add a slot for Payment and associate it with the builtin:amountOfMoney existing slot type.
- Repeat steps a-c to add a slot for CustomerAccountNumber and associate it with a New RegEx slot type.
- Add a slot type for the fruit example:
- Under the Natural Language Understanding menu, click Slot Types.
- Click Add Slot Type. The Add Slot Type dialog box opens.
- Name the slot Pick Fruit Type and then click Save.
- Add various slot type values, such as strawberry, pineapple, pear, peach, grape, cherry, blueberry, banana, apple, and watermelon.Note: The Payment slot is already related to a built-in slot type.
- Configure the RegEx slot type that you created for the CustomerAccountNumber slot. Specify regular expressions that can identify a valid account number.
- Save your bot flow and continue with Step 4.
Step 4: Configure the bot flow’s starting bot task
Complete the bot configuration, then save and publish it.
- Under Starting Bot, click Default Bot.
- Under Toolbox, expand the Ask menu and add an Ask for Intent action below start in the task editor.
- From the Ask menu add an Ask for Slot action below the Fruit order path and configure the action:
- Click the Slot list and select PickFruit.
- Click the Question, change the text to ask “What type of fruit would you like to order?“, and click Save. Notice that the Grammar for this action uses the slot’s grammar.
- From the Ask menu add another Ask for Slot action below the Fruit order path and configure the action:
- Click the Slot list and select CustomerAccountNumber.
- Click the Question, change the text to ask “What is your account number?“, and click Save.
- To verify whether the customer enters a valid account number, add a Decision action from the Logical menu below the actions in the Fruit order path and configure the action using a custom expression based on your needs.
- From the Communicate menu add Communicate actions below the Decision action’s Yes and No paths to inform the customer whether the account number is valid or not.
- Under Toolbox, expand the Transfer menu and add a Transfer to ACD action below the Pay my outstanding bill path.
- Add your preferred action below the Pay my bill’s failure path. For example, a Communicate action.
- Save and publish your flow.
Step 5: Create an inbound call flow
Create an inbound call flow that calls your new bot flow.
The following example flow illustrates a scenario where a customer calls a fruit company and the call transfers to the bot flow that you created in Section 3. If the bot detects that the customer wants to reach an agent, the call transfers to an appropriate queue. If the bot detects that the customer intends to place an order, the call transfers the customer to a secure call flow to complete the order, and passes information to the secure call flow about the customer’s fruit of choice and account number.
- From the Architect home page, click or hover over the Flows menu and select Inbound Call.
- Click Add. The Create Flow dialog box opens.
- In the Name field, type a unique name for the inbound call flow.
- (Optional) In the Description field, add a short sentence or phrase to describe this flow.
- Click the Divisions list and select the division in which to place the flow.
- Click Create Flow. The flow’s configuration page opens.
- Under Reusable Tasks, click Tasks.
- In the flow design area, click the task’s name and type a distinctive name for the task.
- From the Toolbox, expand the Bot menu and add and configure a Call Bot Flow action below Start in the task editor:
- Under Bot Flow, search for and select the bot that you created in Section 3.
- Under Outputs, add an output variable for the Pickfruit slot that you configured in Section 3.
- Under Outputs, add another output variable for the CustomerAccountNumber slot that you configured in Section 3.
- Under Execution Results, add variables to store the Exit Reason and the Intent.
- From the Toolbox, expand the Logical menu and add and configure a Decision action below the Call Bot Flow action:
- To determine whether the invoked bot flow exited because the customer requested agent assistance, add the expression
Task.ExitReason == "AgentRequestedByUser"
in the Decision action’s Expression field.
- To determine whether the invoked bot flow exited because the customer requested agent assistance, add the expression
- Under the Decision action’s Yes path, add and configure a Transfer to ACD action. From the Toolbox, expand the Transfer menu and drag a Transfer to ACD action into the task editor:
- Under Queue, select a queue to which to transfer the interaction.
- Under the Decision action’s No path, add and configure another Decision action to configure actions based on the intent that the bot flow returned:
- To determine whether Architect detected the intent to place an order, add the expression
Task.Intent == "Fruit order"
in the Decision action’s Expression field.
- To determine whether Architect detected the intent to place an order, add the expression
- Under the From the Toolbox, expand the Transfer menu and drag a Transfer to Secure flow action into the task editor:
- Under Secure Call Flow, select the secure call flow to which to transfer the interaction.
- Under Invocation Data, add the variables you configured for the Pickfruit and CustomerAccountNumber slots to pass the information these variables contain to the secure flow that you want to use for the order. You can use the Append function to append the two strings together:
Append(Task.FruitToOrder, ",", Task.CustomerAccountNumber)
and then in the secure call flow, you can use the following to access them separately:Split(Flow.InvocationData, ",")[0] -> Fruit Type Split(Flow.InvocationData, ",")[1] -> Account Number
Note: You can add and configure a Call Data Action to do a lookup in the secure call flow based on the customer’s account number to determine who is doing the ordering.
- On the Reusable Tasks design area, click and click Set this as the starting task. Notice that the reusable task moves up to become the Starting Task, and the Initial Greeting now appears in the Starting Task area. Also, the Main Menu moves to the bottom of the page to Reusable Menus. As the menu is not used, you can delete it.
- Save and publish your flow.
Now you can test and implement a bot flow that uses your third-party ASR grammar in an Architect inbound call flow.