> For the complete documentation index, see [llms.txt](https://docs.sprinthub.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sprinthub.com/en/topics/convert/chatbot/chatbot-common-questions/chatbot-using-the-copilot-token.md).

# Chatbot - Using the Copilot Token

{% hint style="info" %}
To use this feature, you need to have a configured key and a selected model in "*System Settings*" > "*Artificial Intelligence APIs*" > "*Assistant Model*".
{% endhint %}

## Saving the lead's response

In this example, I created a scenario in which, when the lead informs the number of days they intend to rent a car, they will receive the total rental cost.

For this, you can start by asking the lead how many days they want to rent the vehicle. In the question block, configure it to save the answer in the variable `number_of_days`.

<figure><img src="/files/491b03bb50d4568e231acd2b46d74b258155ad02" alt=""><figcaption><p><em>Send Question block.</em></p></figcaption></figure>

## Configuring the response message

By using the token `{copilot=...}`, we can insert line breaks within the content to make the prompt more organized and readable. It is worth noting that the token can be used anywhere in the "Send Message" block, according to your preference.

In addition, it is possible to define the **level of creativity of the AI's response** directly in the token, using the prefixes:

* `temp__creative` – for more creative responses with greater variation (more "random").
* `temp__deterministic` – for more direct and predictable responses (more "objective").

Token used in the message:

```
{copilot=temp__creative
The customer stated that they want to rent the car for {var=number_of_days} days. Consider the following pricing rule:

Up to 3 days: R$100 per day.
From 4 to 7 days: R$90 per day.
More than 7 days: R$80 per day.

Return the total rental amount based on the number of days, explaining the reason for the applied amount.
}
```

<figure><img src="/files/cb7666681556caca84924949a8b5fd21900e7147" alt=""><figcaption><p><em>Send Message block.</em></p></figcaption></figure>

## Testing the AI behavior.

As shown in the image below, the token was correctly interpreted and calculated the total rental amount based on the defined rates.

In addition, it is possible to include other tokens within the `{copilot=...}`, such as the lead's name (`{contactfield=firstname}`) or any other value, allowing the AI to access this information and further personalize the response.

<figure><img src="/files/9998250b29f0411f592b1e0725c625854396a0e0" alt=""><figcaption><p><em>Chatbot Support.</em></p></figcaption></figure>

{% hint style="info" %}
If you want to add a fallback to identify possible errors when using the token `copilot`, just insert a `|` before closing the braces and then add an error message. For example: `{copilot=Your prompt here|Error identified, AI configuration problem.}`
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sprinthub.com/en/topics/convert/chatbot/chatbot-common-questions/chatbot-using-the-copilot-token.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
