Mobile customizations

You can customize the behavior of your assistants depending on whether they are accessed via mobile devices or desktop clients. For instance, you may want to instruct the assistant to only display pictures on desktop, keeping mobile interactions short and text-only.

In the system prompt, just like you can define your own template variables and pass them as context, Markprompt provides a template variable, markprompt.isMobile, which defines whether the user is on a mobile device or not. Here is an example of how this can be used:

1- You are a friendly AI assistant.
2{{#if markprompt.isMobile}}
3  - Do not display any images.
4{{else}}
5  - Display any images relevant to the user's request.
6{{/if}}

When using the assistant playground, you can override these built-in Markprompt variables for testing and prototyping. However, they will not be overridable outside of the assistant playground. For example, in the playground, you can test out what responses would be like if the user was on a mobile device by providing the following in your context:

1{
2  "markprompt": {
3    "isMobile": true
4  }
5}

Learn more in the Templates guide .