When your agent is deployed, your own app or website often already knows who the customer is: they signed in, so you have their verified customer ID. Your system sends that context with each message through the API, and the agent can rely on it instead of asking. These values are called agent variables. In the Playground you set them yourself, so the agent behaves the way it will in production.
Test callers save you typing them. A test caller is a saved customer defined with the agent, such as "Alex Morgan, Gold member", together with the agent variables your system would send for them. Pick one, and its values are filled in.
#When you need agent variables
The agent's program says which values it expects from your system at the start of a conversation. If a required value is missing, a red dot appears on Agent variables ({ }) in the message box, and its tooltip names the missing value, for example session.customer_id. A green dot means variables are set for this conversation.
Common uses:
- A verified customer ID, so the agent can look up the customer's own trips without asking who they are.
- A loyalty tier or account type that changes which rules apply.
- The channel or market the conversation comes from.
#Set agent variables
- In the message box, click Agent variables (
{ }). - If the agent has test callers, pick one under Caller ("Pick a test caller…"). Its values fill the rows below, and you can still edit them.
- To add a value by hand, type its name in key and its value in value. Click + Add variable for another row, or the × at the end of a row to remove it.
- To paste several values at once, click Edit as JSON and paste an object such as
{"session.customer_id": "C1001"}. You can also pastekey: valuelines into a key field. - Click Save.
The values are sent with every message in this conversation from then on, as your system would send them. They also apply to a simulated caller run in the same thread.
To see what a particular turn received, open it in the Reasoning pane: the Turn tab's Request section lists what was sent with the request under Advanced.
#Test callers
Test callers are part of the agent's definition, so everyone who works on the agent sees the same ones. You find them in two places:
- The Agent panel. The Overview tab lists every test caller with who they are and the value they send, such as their customer ID, with a button to copy it. See The Agent panel.
- The Caller list in Agent variables, described above.
A new thread starts with the first test caller already selected. In Simulated caller mode, the simulated customer plays the selected test caller and knows their details. See Simulate a caller.
The same test callers are used in the agent's worked examples and scripted cases, so a regression plays the same customers you test with.
To add a test caller or change one, ask the builder in Build mode, for example: "Add a test caller: Jordan Lee, Platinum member, customer ID C1003, traveling with two children on booking DEF456." The new caller appears once the change is in your unsaved changes, and is saved for everyone when you push. A test caller's values should match a customer that exists in the data the agent reads, such as the sandbox database.