> ## Documentation Index
> Fetch the complete documentation index at: https://dev.writer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Text generation

Agents with the text generation capability can generate text based on specific inputs. These no-code agents are ideal for long- or short-form structured content, such as blog posts, FAQs, press releases, and newsletters.

<img src="https://mintcdn.com/writer/kYaX1Myslb-BtXRR/images/no-code/text-generation-agent.png?fit=max&auto=format&n=kYaX1Myslb-BtXRR&q=85&s=cb6aa42340b0a5cb7eb35176a9ce5639" alt="Agent with text generation" width="3826" height="1786" data-path="images/no-code/text-generation-agent.png" />

## Building an agent with text generation

To build an agent with text generation capabilities, choose the **Text generation** option after clicking **Build an agent** in AI Studio.

<img src="https://mintcdn.com/writer/EtzIGhya5-RmdX2Q/images/no-code/build-options.png?fit=max&auto=format&n=EtzIGhya5-RmdX2Q&q=85&s=9bdf96574dc8e8ab1e5158413be185ca" alt="Create a text generation agent" width="1878" height="592" data-path="images/no-code/build-options.png" />

An agent with text generation capabilities consists of:

* [Adding inputs](/no-code/text-generation#inputs)
* [Writing prompts](/no-code/text-generation#prompts)
* [Formatting outputs](/no-code/text-generation#output-formatting)
* [Choosing a voice](/no-code/text-generation#voice)

## Inputs

An input is content information for your text generation. It generates the desired output—the content your text generation will produce.

For example, if you're building a blog post, the input would include the blog post topic, outline, keywords, reference materials, research sources, and existing knowledge about the topic.

### Types of inputs

There are four types of inputs:

1. Text input: A text input allows users to enter text directly into the text generation.
2. Dropdown: A dropdown input allows users to select one option from a list.
3. File upload: A file upload input allows users to upload a file, such as an image or PDF.
4. Image upload: An image upload input allows users to drag-and-drop or choose an image.

### Adding an input

Once you've decided what type of input you want to add, you'll need to:

<Steps>
  <Step title="Add an input">
    Click **Add input** and select the type of input you want to add.

    <img src="https://mintcdn.com/writer/kYaX1Myslb-BtXRR/images/no-code/text-input.png?fit=max&auto=format&n=kYaX1Myslb-BtXRR&q=85&s=7d793226132d79647873628149c4e5f5" alt="Adding an input" width="1808" height="292" data-path="images/no-code/text-input.png" />
  </Step>

  <Step title="Name your input">
    Give your input a name that clearly communicates its purpose to users. This
    will help them understand what information they need to provide.

    <img src="https://mintcdn.com/writer/EtzIGhya5-RmdX2Q/images/no-code/adding-input.png?fit=max&auto=format&n=EtzIGhya5-RmdX2Q&q=85&s=f145daf8d81061544e3a2517ad544cdd" alt="Adding an input" width="1592" height="1246" data-path="images/no-code/adding-input.png" />
  </Step>

  <Step title="Decide whether the input is required or optional">
    If it's required, users must enter information in that field in order to use
    the text generation. If it's optional, they can skip it.
  </Step>

  <Step title="Add placeholder text or descriptions">
    Provide placeholder text or descriptions to clarify what information is required. This ensures that users fully understand what they need to enter.
  </Step>

  <Step title="Control what users can upload">
    If you selected a file upload input, you can restrict the type of file users can upload. For example, if your agent expects a specific type of an .XLSX file, restrict other file types from being allowed. This will guide users to use the agent as intended.
  </Step>
</Steps>

## Prompts

A prompt is a message that you send to the model. It can be a single prompt consisting of a few lines, or a complex prompt consisting of multiple steps—each with its own prompt that relies on multiple inputs. You can even use prompting techniques such as chain-of-thought (CoT) prompting, where one prompt output becomes an input to the next prompt, and so on—creating a chain of thought.

<Tip>Check out our [prompting guide](/home/prompting) for strategies on how to write effective prompts.</Tip>

### Adding prompts

You can add multiple prompts to your text generation.

<Steps>
  <Step title="Add a prompt">
    Click **Add prompt** and select the type of prompt you want to add.

    <img src="https://mintcdn.com/writer/EtzIGhya5-RmdX2Q/images/no-code/add-prompt.png?fit=max&auto=format&n=EtzIGhya5-RmdX2Q&q=85&s=10e2ad643f2d9e7329de6a0cf4fe3d86" alt="Adding a prompt" width="1802" height="652" data-path="images/no-code/add-prompt.png" />
  </Step>

  <Step title="Choose a model">
    Select the [model](/home/models) you want to use for your prompt, as well as any parameters like temperature, top P, and max length.

    <img src="https://mintcdn.com/writer/EtzIGhya5-RmdX2Q/images/no-code/model-params.png?fit=max&auto=format&n=EtzIGhya5-RmdX2Q&q=85&s=a2d52bfec058bb8e5a54154881000a56" alt="Choosing a model" width="611" height="739" data-path="images/no-code/model-params.png" />
  </Step>

  <Step title="Write your prompt">
    Write your prompt using the guidelines below and our [prompting guide](/home/prompting).
  </Step>
</Steps>

### How to use prompts effectively

You can ask the model to perform various tasks, but it's best to break down your prompts into smaller, more specific "asks." This is especially important for complex, multi-step text generation. Otherwise, you risk overwhelming the model by asking it to perform too many tasks at once.

For example, instead of asking it to create an entire blog post at once, you might write one prompt asking it to create a title, another to create an opening paragraph, and so on.

Follow these [strategies](/home/prompting) to write good prompts.

<img src="https://mintcdn.com/writer/EtzIGhya5-RmdX2Q/images/no-code/post-version-a.png?fit=max&auto=format&n=EtzIGhya5-RmdX2Q&q=85&s=9fe16ac3d0150514d29a8e3da4ffafcb" alt="post-version-a" width="1588" height="1093" data-path="images/no-code/post-version-a.png" />

### Renaming prompts

You can rename prompts from generic names like "Prompt 1" and "Prompt 2" to any custom name.

This will help you to:

1. Stay organized and keep track of your prompts
2. Know exactly what each prompt accomplishes
3. Write your prompts
4. Format your output

<img src="https://mintcdn.com/writer/EtzIGhya5-RmdX2Q/images/no-code/renaming-prompts.png?fit=max&auto=format&n=EtzIGhya5-RmdX2Q&q=85&s=026c8ab6d92b5b0ec2f68ba01f88fab4" alt="Renaming prompts" width="1722" height="802" data-path="images/no-code/renaming-prompts.png" />

### Referencing inputs

To reference your input, `@` it within the prompt.

For example, if you're writing a prompt to generate social posts based on a blog post, do the following:

1. **Input:** `Blog post`
2. **Prompt 1:** instructions for creating a social post

In your prompt, reference `@Blog post` so that Writer understands that the social post should be based on the blog input.

<img src="https://mintcdn.com/writer/EtzIGhya5-RmdX2Q/images/no-code/reference-inputs.png?fit=max&auto=format&n=EtzIGhya5-RmdX2Q&q=85&s=a778b3427c9636a42d50fa8f94d319c1" alt="Reference an input" width="1708" height="664" data-path="images/no-code/reference-inputs.png" />

<Tip>
  If you have more than one input, you can `@` each one within a single
  prompt.
</Tip>

### Prompt chaining

You can reference other prompts within a prompt by using the `@` symbol, a feature known as prompt chaining.

For example, if you have a long blog post, you might want to summarize it in your first prompt, and use that summary to generate a social media post in your second prompt:

<Steps>
  <Step title="Input">`Long blog`</Step>

  <Step title="Prompt 1">
    Instructions for generating a summary of the `@Long blog` post.
  </Step>

  <Step title="Prompt 2">
    Instructions for generating a social media post based on `Prompt 1`.
  </Step>
</Steps>

In the second prompt, you'd reference `@Prompt 1` to indicate that you want the social media post to be based on the blog summary.

<img src="https://mintcdn.com/writer/EtzIGhya5-RmdX2Q/images/no-code/prompt-chaining.png?fit=max&auto=format&n=EtzIGhya5-RmdX2Q&q=85&s=64ba1a232d2cffee6f767a5bc351101a" alt="Referencing a prompt" width="1722" height="960" data-path="images/no-code/prompt-chaining.png" />

## Output formatting

Next, format your output—the final assembled text generation. To do this, take all your prompt outputs (if you have more than one), format their style, add any static text such as a disclaimer, and combine them together.

You can use Markdown or HTML to specify how you'd like your output to be formatted.

For example, you can use the following formatting:

<CardGroup cols={2}>
  <Card title="Heading Tags" icon="heading">
    Use `<h1>`, `</h1>`, `<h2>`, `</h2>`, and `<h3>`, `</h3>` to denote heading
    text.
  </Card>

  <Card title="Bold Text" icon="bold">
    Use `<strong>` and `</strong>` to denote bolded text.
  </Card>
</CardGroup>

<img src="https://mintcdn.com/writer/EtzIGhya5-RmdX2Q/images/no-code/output-formatting.png?fit=max&auto=format&n=EtzIGhya5-RmdX2Q&q=85&s=e98be2a261acd2f1f6b7d0109b07f90e" alt="Output formatting" width="1816" height="698" data-path="images/no-code/output-formatting.png" />

You don't have to include every prompt in your output formatting. For example, a prompt might be used only to summarize and then to create a LinkedIn post (based on the summary). If you don't want to include the summary in your output, you don't have to.

<Tip>
  Because you don't need to reference every prompt in your final output, you can leave interim prompts in your text generation for A/B testing or to get feedback. Combined with the `Rerun` option, this is a great way to efficiently iterate on your text generation.
</Tip>

The simplest text generation will have only one prompt. A more complex text generation might have multiple section headers, each with its own prompt output.

Before adding even more prompts to your text generation, ask yourself:

1. Does the user want this content?
2. Do I need these inputs to generate this output?

## Voice

With voice calibration, you can create outputs that sound just like you, faster. Voice allows you to build your different voices in Writer, and see them in action across the platform in the content you generate. To learn more about voice calibration, see [how to calibrate voice](https://support.writer.com/article/250-how-to-calibrate-voice-for-your-content).

<Note>
  At this time, only English is supported in Writer voice profiles.
</Note>

For an agent with text generation capabilities, you can choose to:

* Automatically generate all outputs using a voice selected by you
* Allow user to choose which voice to apply to their output
* Generate all outputs using Writer's default voice
* Allow users to choose from any voice in their team

<img src="https://mintcdn.com/writer/kYaX1Myslb-BtXRR/images/no-code/voice.png?fit=max&auto=format&n=kYaX1Myslb-BtXRR&q=85&s=d11af5b3e553ac3a7d8379b5c2ef1a9e" alt="Voice" width="1824" height="538" data-path="images/no-code/voice.png" />
