Input Variables
Learn how to pass information from your application to GenerativeAgent.
Input Variables allow you to provide contextual information to GenerativeAgent when analyzing a conversation. This is the main way to pass information from your application to GenerativeAgent. These variables can then be referenced in the task instructions and functions.
Use Input Variables provide GenerativeAgent with context information like:
- Entities extracted from a previous system or API call
- Relevant customer metadata
- Conversation context, like a summary of previous interactions
- Instructions on the next steps for a given task
Add Input Variables to a conversation
To add input variables to a conversation, you needs to:
Add Input Variables with /analyze
Call analyze
, adding the inputVariables
attributes. inputVariables
is an untyped JSON object and you can pass any key-value pairs. You need to ensure you are consistent in the key names you use between /analyze
and the task instructions.
With each call, any new input variable is added to the conversation context.
Reference Input Variables in Task Instructions
Once the Input Variables are added to the conversation, they are made part of GenerativeAgents’ Context. GenerativeAgent will consider them when interacting with your users.
You can also reference them directly in the task instructions.
Input variables can be used as part of Conditional Templates.
Add Input Variables in the Previewer
While you are iterating on your tasks, you simulate how GenerativeAgent responds with added Input Variables in the Previewer
You can also simulate directly launching the customer into a specific task, instead of allowing GenerativeAgent to choose a task.
In a scenario where a IVR has already gathered information, you can ensure GenerativeAgent picks up from where the IVR left off.
Was this page helpful?