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

Can you reference input parameters in a playbook example (Conversational Agents)

In a Conversational Agents playbook that is called from a flow with input parameters including age and location, I want to create examples that show how the agent should incorporate these input parameters into its generated responses.

For example, rather than asking the user again for their location, can I give a mnaual response in the example that references the input parameter location that has been passed to the playbook.

I've read through the documentation page:
https://cloud.google.com/dialogflow/cx/docs/concept/playbook/example

I've configured an input parameter called location, with JSON as follows

{
"city_location": "London"
}

In an agent response example, I've tried referencing this as $city_location.
This doesn't work. I also tried @city_location.

How do I actually use the input paramters in a playbook example? Or indeed in the instructions for the playbook?



Solved Solved
1 5 1,247
2 ACCEPTED SOLUTIONS

Hi @Joe_McFadden,

Welcome to Google Cloud Community!

The $city_location and @city_location syntaxes are not the correct way to reference input parameters within Dialogflow CX playbook examples. Dialogflow CX playbooks don't directly support variable substitution within responses using those symbols. Instead, you need to demonstrate the desired behavior using example conversations. Here's a breakdown of how you can use input parameters like location in your playbook responses:

  1. Structured Examples: Create multiple examples in your playbook, each with a different value for the city_location input parameter. In each example, the agent's response should explicitly use the provided city_location value.
  2. Clear Instructions (Optional but Helpful): While not strictly required, adding instructions to your playbook can further guide the LLM. These instructions should clearly explain how the city_location parameter should be used in the agent's responses.
  3. Contextual Understanding: The LLM learns the relationship between the input parameter and the desired response through these examples. The more examples you provide with diverse city names, the better the LLM will understand and apply the parameter in various contexts.

Important Considerations:

  • Data Type: Ensure your city_location parameter is defined as a string type in your playbook's parameter settings.
  • Example Quantity: Aim for a sufficient number of diverse examples to cover different scenarios and potential variations in phrasing.
  • Testing: Thoroughly test your playbook with various input values to ensure the LLM correctly incorporates the city_location parameter into its responses.

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.

View solution in original post

Hi @mauriciobarrev - it works for me, but only after having my project whitelisted for the input parameters feature, which is a private preview feature at present.

I started the request process by contacting Google Cloud Support. I should say that it took some time (over a week) and being passed to other Google teams before I was given access to the preview feature. Once the whitelist is enabled then the above method does work.

View solution in original post

5 REPLIES 5

try to use postman to check the server resopnce

Hi @Joe_McFadden,

Welcome to Google Cloud Community!

The $city_location and @city_location syntaxes are not the correct way to reference input parameters within Dialogflow CX playbook examples. Dialogflow CX playbooks don't directly support variable substitution within responses using those symbols. Instead, you need to demonstrate the desired behavior using example conversations. Here's a breakdown of how you can use input parameters like location in your playbook responses:

  1. Structured Examples: Create multiple examples in your playbook, each with a different value for the city_location input parameter. In each example, the agent's response should explicitly use the provided city_location value.
  2. Clear Instructions (Optional but Helpful): While not strictly required, adding instructions to your playbook can further guide the LLM. These instructions should clearly explain how the city_location parameter should be used in the agent's responses.
  3. Contextual Understanding: The LLM learns the relationship between the input parameter and the desired response through these examples. The more examples you provide with diverse city names, the better the LLM will understand and apply the parameter in various contexts.

Important Considerations:

  • Data Type: Ensure your city_location parameter is defined as a string type in your playbook's parameter settings.
  • Example Quantity: Aim for a sufficient number of diverse examples to cover different scenarios and potential variations in phrasing.
  • Testing: Thoroughly test your playbook with various input values to ensure the LLM correctly incorporates the city_location parameter into its responses.

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.

Thank you @dawnberdan your answer was very clear and comprehensive. I have this working though I will continue to add more diverse examples to improve the response from the LLM

Hey @Joe_McFadden. Could you resolve finally your problem with this method? For me wasn't helpful 😕 

Hi @mauriciobarrev - it works for me, but only after having my project whitelisted for the input parameters feature, which is a private preview feature at present.

I started the request process by contacting Google Cloud Support. I should say that it took some time (over a week) and being passed to other Google teams before I was given access to the preview feature. Once the whitelist is enabled then the above method does work.