@@ -79,6 +79,8 @@ These variables are automatically filled based on the current (UTC) time, so you
7979| ` {{year}} ` | Current year (UTC) | 2024 |
8080| ` {{customer.number}} ` | Customer's phone number | +1xxxxxxxxxx |
8181| ` {{customer.X}} ` | Any other customer property | |
82+ | ` {{transport.conversationType}} ` | Whether the conversation is over ` chat ` or ` voice ` | ` chat ` |
83+ | ` {{transport.X}} ` | Any other transport-related property | |
8284
8385## Advanced date and time usage
8486
@@ -116,13 +118,13 @@ Outputs: `Monday, January 01, 2024, 03:45 PM`
116118| ` %H:%M ` | 15:45 | 24-hour time |
117119| ` %A ` | Monday | Day of week |
118120| ` %b %d, %Y ` | Jan 01, 2024 | Abbrev. Month Day |
119- ```
121+
120122
121123## Using dynamic variables in the dashboard
122124
123125To use dynamic variables in the dashboard, include them in your prompts or messages using double curly braces. For example:
124126
125- ```
127+ ``` liquid
126128Hello, {{name}}!
127129```
128130
@@ -131,4 +133,22 @@ When you start a call, you must provide a value for each variable (like `name`)
131133<Note >
132134Always use double curly braces (` {{variableName}} ` ) to reference dynamic variables in your prompts and messages.
133135</Note >
134- </rewritten_file>
136+
137+ ## Setting assistant prompt using conversation type
138+
139+ Using the ` transport.conversationType ` variable in your assistant's system prompt, you can modify how it behaves in chats or calls:
140+
141+ ``` liquid
142+ [Identity]
143+ You are a helpful assistant, talking with a customer via {{transport.conversationType}}.
144+
145+ [Response Guidelines]
146+ {% if transport.conversationType == "chat" -%}
147+ - Format numbers naturally; eg, a US phone number could be +1 (555) 123-4567
148+ - Use Markdown formatting for lists (both unordered and ordered)
149+ {%- elsif transport.conversationType == "voice" -%}
150+ - Always spell numbers in words; eg, 256 should be 'two hundred and fifty six'
151+ - Only ask one question at a time
152+ - Never use Markdown format; write everything as if it is being said aloud
153+ {%- endif -%}
154+ ```
0 commit comments