Juicifer
12/09/2024, 8:51 AMVapi
12/09/2024, 8:53 AMassistantOverrides feature with variableValues to pass the customer data. This allows you to personalize the conversation by setting variables that the blocks agent can use in the first conversation block.
Here's how you can do it:
1. Define the variables you want to set in your conversation blocks. For example, you might have a variable called {{customerName}} that you want to populate with the customer's name.
2. When starting the call, pass the assistantOverrides object along with variableValues to the API or SDK. Include the variables you want to set with their corresponding values.
For example, if you want to set the customer's name to "John", you would pass the following object:
json
{
"variableValues": {
"customerName": "John"
}
}
This would replace {{customerName}} with "John" in the first conversation block where the variable is used.
If you need to set multiple variables, you can add them to the variableValues object, like so:
json
{
"variableValues": {
"customerName": "John",
"customerAccountNumber": "123456789",
"lastInteractionDate": "2023-03-15"
}
}
Each key in the variableValues object corresponds to a variable in your conversation blocks, and the value is what you want to set the variable to for the current call.
Remember to ensure that the variables you are setting are defined in your conversation blocks and are used appropriately to personalize the conversation. If you need further assistance with setting up dynamic variables or have any other questions, please feel free to ask.Vapi
12/09/2024, 8:53 AMJuicifer
12/09/2024, 9:26 AMJuicifer
12/09/2024, 9:27 AMVapi
12/09/2024, 9:27 AM{{ input.propertyName }} for accessing input properties.
- {{ stepName.input.propertyName }} or {{ stepName.output.propertyName }} for accessing properties from specific steps.
- {{ workflow.input.propertyName }} for accessing workflow-level input properties.
- {{ global.propertyName }} for accessing global properties.
To set a global variable dynamically for use in the first conversation block, you should ensure that you are using the global prefix. For example, if you want to set a global variable named customerName, you would reference it in the blocks graph as {{ global.customerName }}.
When you start a call and want to set this global variable, you would pass the customer data in the variableValues object with the key corresponding to the variable name, like so:
json
{
"variableValues": {
"global.customerName": "John"
}
}
This will set the global variable customerName to "John", which you can then use in your conversation blocks as {{ global.customerName }}.
If you need further clarification or assistance with setting global variables in your blocks graph, please let me know, and I'll be happy to help!Juicifer
12/09/2024, 9:54 AMJuicifer
12/09/2024, 9:54 AMJuicifer
12/09/2024, 9:54 AMJuicifer
12/09/2024, 9:54 AMJuicifer
12/09/2024, 10:04 AMJuicifer
12/10/2024, 10:02 AMShubham Bajaj
12/10/2024, 11:08 PMJuicifer
12/12/2024, 8:57 PMShubham Bajaj
12/13/2024, 8:16 PM