File tree Expand file tree Collapse file tree 3 files changed +43
-31
lines changed Expand file tree Collapse file tree 3 files changed +43
-31
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ title : " Dynamic Variables"
3
+ sidebarTitle : " Dynamic Variables"
4
+ description : " Vapi makes it easy to personalize an assistant's messages and prompts using variables, allowing each call to be customized."
5
+ ---
6
+
7
+ Prompts, messages, and other assistant properties can be dynamically set when starting a call based on templates.
8
+ These templates are defined using double curly braces ` {{variableName}} ` .
9
+ This is useful when you want to customize the assistant for a specific call.
10
+
11
+ For example, you could set the assistant's first message to "Hello, ` {{name}} ` !" and then set ` name ` to ` John ` when starting the call
12
+ by passing ` assistantOverrides ` with ` variableValues ` to the API or SDK:
13
+
14
+ ``` json
15
+ {
16
+ "variableValues" : {
17
+ "name" : " John"
18
+ }
19
+ }
20
+ ```
21
+
22
+ ## Default Variables
23
+
24
+ By default, the following variables are automatically filled based on the current (UTC) time,
25
+ meaning that you don't need to set them manually in ` variableValues ` :
26
+
27
+ | Variable | Description | Example |
28
+ | ----------- | --------------------------- | -------------------- |
29
+ | ` {{now}} ` | Current date and time (UTC) | Jan 1, 2024 12:00 PM |
30
+ | ` {{date}} ` | Current date (UTC) | Jan 1, 2024 |
31
+ | ` {{time}} ` | Current time (UTC) | 12:00 PM |
32
+ | ` {{month}} ` | Current month (UTC) | January |
33
+ | ` {{day}} ` | Current day of month (UTC) | 1 |
34
+ | ` {{year}} ` | Current year (UTC) | 2024 |
Original file line number Diff line number Diff line change @@ -14,34 +14,3 @@ The `/assistant` endpoint is there for convenience to save you creating your own
14
14
</Accordion >
15
15
16
16
Otherwise, you can just specify the assistant configuration when starting a call.
17
-
18
- ## Variables
19
-
20
- Prompts, messages, and other assistant properties can be dynamically set when starting a call based on templates.
21
- These templates are defined using double curly braces ` {{variableName}} ` .
22
- This is useful when you want to customize the assistant for a specific call.
23
-
24
- For example, you could set the assistant's first message to "Hello, ` {{name}} ` !" and then set ` name ` to ` John ` when starting the call
25
- by passing ` assistantOverrides ` with ` variableValues ` to the API or SDK:
26
-
27
- ``` json
28
- {
29
- "variableValues" : {
30
- "name" : " John"
31
- }
32
- }
33
- ```
34
-
35
- #### Default variables
36
-
37
- By default, the following variables are automatically filled based on the current (UTC) time,
38
- meaning that you don't need to set them manually in ` variableValues ` :
39
-
40
- | Variable | Description | Example |
41
- | ----------- | ------------------------------ | -------------------- |
42
- | ` {{now}} ` | Current date and time (UTC) | Jan 1, 2024 12:00 PM |
43
- | ` {{date}} ` | Current date (UTC) | Jan 1, 2024 |
44
- | ` {{time}} ` | Current time (UTC) | 12:00 PM |
45
- | ` {{month}} ` | Current month (UTC) | January |
46
- | ` {{day}} ` | Current day of month (UTC) | 1 |
47
- | ` {{year}} ` | Current year (UTC) | 2024 |
Original file line number Diff line number Diff line change 155
155
" assistants/custom-voice" ,
156
156
" assistants/custom-llm" ,
157
157
" assistants/persistent-assistants" ,
158
+ " assistants/dynamic-variables" ,
158
159
" assistants/background-messages"
159
160
]
160
161
},
319
320
"source" : " /persistent-assistants" ,
320
321
"destination" : " /assistants/persistent-assistants"
321
322
},
323
+ {
324
+ "source" : " /dynamic_variables" ,
325
+ "destination" : " /assistants/dynamic-variables"
326
+ },
327
+ {
328
+ "source" : " /dynamic-variables" ,
329
+ "destination" : " /assistants/dynamic-variables"
330
+ },
322
331
{
323
332
"source" : " /text_message" ,
324
333
"destination" : " /assistants/background-messages"
You can’t perform that action at this time.
0 commit comments