Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Conversational Agents - syntax for parameters when creating playbook examples

When creating examples in playbooks, I'm noticing some console errors for input and output parameters I try to add. 

Lets say I want to configure a parameter for location:

Joe_McFadden_0-1742582210152.png

I initially tried just putting the value in double quotes in the parameter value field, e.g. "Essex"
I notice however that if I go back into the parameter the console has stripped off the double quotes and shows an error that the value is not valid JSON.

I then tried following advice from Google Support to repeat the whole JSON field in the value 
e.g. {"location":"Essex"} as shown in screenshot. It doesn't now alter the value if I edit it again, but I instead get pop ups of parameters appearing when I exit or enter a specific example. 

What is the correct syntax to use here?

 

0 2 148
2 REPLIES 2

Hi @Joe_McFadden,

Welcome to Google Cloud Community!

The issue possibly stems from how the parameter values are being handled within the playbook configuration. For example and guide reference on how to configure a parameter for location or category by geography, you can refer on below documentations:

When you expect a JSON object and use system entities like @sys.location or other category under geography, instead of using a general object or duplicated name from parameter like {"location": "Essex"}, try replacing the location with specific category such as city, country, street names, etc.

Also double-check your parameter type to ensure that the intent and playbook parameter you're working with matches the data type you expect for the parameter. Mismatched data types can lead to unexpected behavior. You may consider setting the parameter's data type as a string in your playbook's parameter settings. Additionally, ensure that the playbook examples consistently provide a JSON object if your intent anticipates receiving one.

For overall playbook best practices, you can read through this documentation.

Just to add, Playbook parameters is currently in Preview, which means it is still under development, may not yet offer the expected quality and might have limited support. Preview features often come with certain limitations and might not provide the full range of quality or functionality available in the final product. It may have bugs or unexpected behaviors. You can expect the quality to improve as the feature matures.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.

Thanks for the reply @marckevin 

While the example I quoted was a location field, I have the same issue with other parameters that are plain strings. I have double checked the intent and playbook parameters have matching data types. My playbook examples consistently show the JSON objects being passed, and yes, I've read through and put into practice the recommended best practices for playbooks. Just to note, I'm getting these console errors both on routine playbooks basing parameters to task (child) playbooks, and when passing back to a matching intent parameter on a flow.

I do understand this feature is still in Preview and may have bugs.

I'm just looking for a clear answer on what is the expected syntax to use when including an input or output parameter in a playbook example. Do you know this? If not, where can I find out as it is not in the documentation, which I have read through multiple times now.