> For the complete documentation index, see [llms.txt](https://docs.drafter.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.drafter.ai/building-blocks/actions/text-generation-gpt.md).

# Text Generation (GPT)

## Overview

GPT3 Text Generation allows you to generate high-quality texts by using input, instructions, and examples. It helps technical writers, content creators, and other professionals who need to produce large volumes of text quickly and efficiently.&#x20;

This AI block is highly customizable, allowing you to adjust the settings to suit their specific needs. Instruct it on the length of the generated text, the level of detail, and the complexity of the language used.

{% hint style="info" %}
Specify the target audience and adjust the tone and style accordingly.
{% endhint %}

## How to setup

Provide the next mandatory info:

1. Data input (text) - variables from other blocks or provided by a user as manual input
2. Data output (text) - result variable, that the block produces. Change its name for ease of further use.
3. Query template - GPT3 prompt template to define, how it goes to AI. Put input variables ({A}, {B}) in the proper places of the prompt template to change its content dynamically.

<figure><img src="/files/5VYSUD3VuCNfmR8f8dvk" alt=""><figcaption><p>How the block looks like</p></figcaption></figure>

## Inputs and Outputs

<table><thead><tr><th width="188">Input</th><th width="163.33333333333331">Output</th><th>Output Description</th></tr></thead><tbody><tr><td>Any Text (many variables)</td><td>Any Text (x1 variable)</td><td>Generates texts using the prompt template and input data variables.</td></tr></tbody></table>

Get some ideas of the prompts:

{% embed url="<https://promptbase.com/gpt3>" %}


---

# 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.drafter.ai/building-blocks/actions/text-generation-gpt.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.
