diff --git a/.gitignore b/.gitignore index 74231d1ff..a2eb222c9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ node_modules/ dist/ .env -.DS_Store \ No newline at end of file +.DS_Store +.tool-versions diff --git a/fern/assistants/dynamic-variables.mdx b/fern/assistants/dynamic-variables.mdx index 29606af9e..6ca1103cc 100644 --- a/fern/assistants/dynamic-variables.mdx +++ b/fern/assistants/dynamic-variables.mdx @@ -79,6 +79,8 @@ These variables are automatically filled based on the current (UTC) time, so you | `{{year}}` | Current year (UTC) | 2024 | | `{{customer.number}}` | Customer's phone number | +1xxxxxxxxxx | | `{{customer.X}}` | Any other customer property | | +| `{{transport.conversationType}}` | Whether the conversation is over `chat` or `voice` | `chat` | +| `{{transport.X}}` | Any other transport-related property | | ## Advanced date and time usage @@ -116,13 +118,13 @@ Outputs: `Monday, January 01, 2024, 03:45 PM` | `%H:%M` | 15:45 | 24-hour time | | `%A` | Monday | Day of week | | `%b %d, %Y` | Jan 01, 2024 | Abbrev. Month Day | -``` + ## Using dynamic variables in the dashboard To use dynamic variables in the dashboard, include them in your prompts or messages using double curly braces. For example: -``` +```liquid Hello, {{name}}! ``` @@ -131,4 +133,22 @@ When you start a call, you must provide a value for each variable (like `name`) Always use double curly braces (`{{variableName}}`) to reference dynamic variables in your prompts and messages. - \ No newline at end of file + +## Setting assistant prompt using conversation type + +Using the `transport.conversationType` variable in your assistant's system prompt, you can modify how it behaves in chats or calls: + +```liquid +[Identity] +You are a helpful assistant, talking with a customer via {{transport.conversationType}}. + +[Response Guidelines] +{% if transport.conversationType == "chat" -%} +- Format numbers naturally; eg, a US phone number could be +1 (555) 123-4567 +- Use Markdown formatting for lists (both unordered and ordered) +{%- elsif transport.conversationType == "voice" -%} +- Always spell numbers in words; eg, 256 should be 'two hundred and fifty six' +- Only ask one question at a time +- Never use Markdown format; write everything as if it is being said aloud +{%- endif -%} +``` \ No newline at end of file