Skip to content

Commit 55587de

Browse files
committed
docs
1 parent 29372a4 commit 55587de

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
node_modules/
44
dist/
55
.env
6-
.DS_Store
6+
.DS_Store
7+
.tool-versions

fern/assistants/dynamic-variables.mdx

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

123125
To use dynamic variables in the dashboard, include them in your prompts or messages using double curly braces. For example:
124126

125-
```
127+
```liquid
126128
Hello, {{name}}!
127129
```
128130

@@ -131,4 +133,22 @@ When you start a call, you must provide a value for each variable (like `name`)
131133
<Note>
132134
Always 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

Comments
 (0)