# GPT

Template overview

This bot template is integrated with GPT to generate responses on retail use-cases, to make jokes or just to improvise on anything!

{% hint style="info" %}
This template was made so that you can get an overview of some possible use-cases of a chatbot that uses the [GPT integration](/integrateandcode/app-integrations/openai-gpt-3-chatgpt-and-gpt-4.md). We recommend you to play with it, explore and make it your own!
{% endhint %}

To get more context for the conversation, the bot will ask the user to pretend they bought something on an online shop.

All blocks reside in the `General` flow and the user will get a these options by clicking the buttons:

* Retail example
  * Track package
  * Complain on delivery
  * Tell me a joke
* Ask anything

{% hint style="info" %}
To be able to use this template, you will learn to set up your GPT integration. Learn how to do this [here](https://docs.chatlayer.ai/integrations/app-integrations/gpt-3-beta#how-to-set-up-your-gpt-3-integration).
{% endhint %}

## How to set up this bot

To be able to use this bot, you will need:

1. To set up your GPT integration. Please follow how to do this [here](https://docs.chatlayer.ai/integrations/app-integrations/gpt-3-beta#how-to-set-up-your-gpt-3-integration).
2. Fill in the action fiels in the blocks that use GPT, as we will explain below 👇

### Block: Generate tracking message

This block takes the previous context into account to generate a package tracking message with GPT.

Connect it to your [GPT account](https://www.youtube.com/watch?v=3DxTlIVh-og) and fill the action fields as below:

<figure><img src="/files/0Mlr9bwEfHbcppnH9o7h" alt=""><figcaption></figcaption></figure>

### Block: Generate apology message

This block takes the previous context into account to generate an apology message to a customer who is complaining for his parcel is late for delivery.

Connect it to your [GPT account](https://www.youtube.com/watch?v=3DxTlIVh-og) and fill the action fields as below:

<figure><img src="/files/4f9HZ9lwDjKr3DTCvhMx" alt=""><figcaption></figcaption></figure>

### Block: Generate joke

This block takes the previous context into account to generate a joke based on the item that the customer purchased.

Connect it to your [GPT account](https://www.youtube.com/watch?v=3DxTlIVh-og) and fill the action fields as below:

<figure><img src="/files/rTJ30gnDrlDJahwiwloU" alt=""><figcaption></figcaption></figure>

### Block: Generate response to anything

This block is triggered by the Not Understood block. It generates a GPT response based on what was asked by the customer.

Connect it to your [GPT account](https://www.youtube.com/watch?v=3DxTlIVh-og) and fill the action fields as below:

<figure><img src="/files/xgzANhKHgG1TYYQOD7Ja" alt=""><figcaption></figcaption></figure>

## See also

Our documentation page on the GPT integration:

{% content-ref url="/pages/Mt9WVzPRMl5sG3q8noui" %}
[OpenAI: GPT-3, ChatGPT and GPT-4](/integrateandcode/app-integrations/openai-gpt-3-chatgpt-and-gpt-4.md)
{% endcontent-ref %}


---

# Agent Instructions: 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:

```
GET https://docs.chatlayer.ai/start-quickly/bot-templates/gpt.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
