> For the complete documentation index, see [llms.txt](https://guide.tiledesk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.tiledesk.com/chatgpt-hacks/learn-how-to-prioritize-inbound-requests-thanks-to-chatgpt.md).

# Learn how to prioritize Inbound Requests thanks to ChatGPT

#### **Intro** <a href="#intro" id="intro"></a>

In this tutorial, we'll dive into the powerful world of customer support optimization by harnessing the synergy of Tiledesk Generative AI Chatbot Development and the integration capabilities of ChatGPT by OpenAI. Learn how to tag inbound customer requests and define their priority levels, all with the help of cutting-edge AI technology. Let's begin!

#### **Step 1: Prepare Your Use Case and Attributes and create a GPT Task block** <a href="#step-1-prepare-your-use-case-and-attributes-and-create-a-gpt-task-block" id="step-1-prepare-your-use-case-and-attributes-and-create-a-gpt-task-block"></a>

* To generate pertinent responses using GPT, you need to define a prompt that instructs GPT on how to generate an answer based on the customer's feedback. Before you start, it's essential to have a clear use case in mind. For example, let's say you want to create a bot that handles support requests based on their urgency or priority.&#x20;
* In ythe DefaultFallback block, choose the GPT Task action; therein assign an attribute to the gpt response as well as the last user’s text. You can create a custom attribute (e.g., "gpt\_reply”, “last\_user\_text”) to intercept the generated response by ChatGPT based on what the user has told you last.
* Consider the context of your chatbot. If your use case involves support requests, you might use a prompt like: "Analyse an incoming customer request via live chat ot determine its priority. If the priority is high, you can answer “high”, otherwise “low”

#### **Step 2: Set the Max Number of Tokens** <a href="#step-2-set-the-max-number-of-tokens" id="step-2-set-the-max-number-of-tokens"></a>

* Decide the maximum number of tokens you want the GPT response to have. Tokens are chunks of text, and limiting their number can help control the length of the generated responses.
* For example, if you want concise responses, you might set the max number of tokens to 50. If you want more detailed responses, you can set it to a higher value, like 150.

#### **Step 3: Set up a condition with GPT Attribute** <a href="#step-3-set-up-a-condition-with-gpt-attribute" id="step-3-set-up-a-condition-with-gpt-attribute"></a>

* Once configured your GPT Task block, add a “Condition" action below to generate the response based on the set condition.
* To set the "Condition", configure the "gpt\_reply" attribute to: “contains Ignore Case” and in the value filed insert the word “high”.
* This way if the GPT answer is high, it won’t text it to the user.

#### **Step 4: Configure the Urgent + Not Urgent blocks** <a href="#step-4-configure-the-urgent-not-urgent-blocks" id="step-4-configure-the-urgent-not-urgent-blocks"></a>

* Create a new block called “Urgent” where you can customize your customer service by connecting immediately a human agent, for example.
* Create another block for Low Urgency where instead you can connect your user’s data and inform them that you’ll look into the issue ASAP.
* If the condition set up in Step 3 is met - the priority is indeed found to be high by GPT Task - the block called “Urgent will be actioned.
* Conversely - or “else” - the conversation will continue to the “Not Urgent” block.

#### **Step 5: Test Your Chatbot** <a href="#step-5-test-your-chatbot" id="step-5-test-your-chatbot"></a>

* Test your chatbot to ensure it generates pertinent responses based on customer feedback.
* Provide feedback in the chat to see how the GPT-generated response is handled.
* Verify that the response is captured in the "gpt\_reply" attribute and displayed correctly to the user.

\
That's it! You've successfully created a chatbot with Tiledesk Design Studio that uses the GPT Task feature to analyze the support requests based on user's feedback. This can greatly enhance your chatbot's ability to tag inbound support request an prioritize the support needed.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://guide.tiledesk.com/chatgpt-hacks/learn-how-to-prioritize-inbound-requests-thanks-to-chatgpt.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
