# Set Pipeline Output Type

You can explicitly set the pipeline output type in YAML. This helps the Playground adjust its behavior to better support your pipeline.

## About This Task

By setting the pipeline output type, you make sure the Playground displays results in the most relevant way. The platform can auto-detect the type, but this may not always be accurate. To avoid issues, we recommend setting it explicitly in YAML.

If you set a type manually, it overrides the auto-detected one. For example, if your pipeline is generative but you set `pipeline_output_type: "chat"`, the Playground will use the chat view.

### Available Types

You can set `pipeline_output_type` to one of these values:

- `generative`: For pipelines where an LLM generates new text as a response.
- `chat`: For conversational pipelines.
- `extractive`: For pipelines that extract answers directly from documents.
- `document`: For pipelines that return full documents or multiple documents as results.

### How Playground Adapts

Expand each section to check how the Playground interface changes for each pipeline output type:

<details>

<summary>Generative pipelines</summary>

For generative pipelines, the query input field is at the top of the page and the generated answers show below it:

<ClickableImage
  src="/img/how-tos/generative_playground.png"
  alt="The Playground for a generative pipeline. The query input field is at the top and the answers are displayed below it."
  size="standard"
/>

</details>

<details>

<summary>Chat pipelines</summary>

Playground adjusts to the chat view:

<ClickableImage
  src="/img/how-tos/chat_playground.png"
  alt="Playground for a chat pipeline. The query input field is at the bottom of the screen."
  size="standard"
/>

When the user starts the conversation, it keeps previous questions and answers in view:

<ClickableImage
  src="/img/how-tos/chat_playground_conversation.png"
  alt="Chat pipeline in Playground with a conversation ongoing. The whole conversation shows on the screen and the query input field is at the bottom."
  size="standard"
/>

</details>

<details>

<summary>Extractive pipelines</summary>

For extractive pipelines, the query input field is at the top and the extracted answers appear below it:

<ClickableImage
  src="/img/how-tos/extractive_playground.png"
  alt="Playground for an extractive pipeline. The query input field is at the top and the extracted answers show below it"
  size="standard"
/>

</details>

<details>

<summary>Document search pipelines</summary>

For document search pipelines, the query input field is at the top:

<ClickableImage
  src="/img/how-tos/document_search_playground.png"
  alt="An empty Playground for a document search pipeline. The query input field is at the top."
  size="standard"
/>

Once the user asks a query, the related documents are displayed on the page:

<ClickableImage
  src="/img/how-tos/document_search_playground_results.png"
  alt="Playground for a document search pipeline with results displayed below the query field."
  size="standard"
/>

</details>

## Set the Pipeline Output Type

1. Log in to <a href="https://cloud.deepset.ai/" target="_blank"><ProductName /></a> and go to **Pipelines**.
2. Find the pipeline you want to run async, click More Actions next to it, and choose _Edit_.
    <ClickableImage
      src="/img/how-tos/edit_pipeline.png"
      alt="The Edit option expanded from the More Actions menu."
      size="standard"
    />

3. When the pipeline opens in Pipeline Builder, switch to the YAML view.
    <ClickableImage
      src="/img/how-tos/code_switch.png"
      alt="The YAML switch in Pipeline Builder"
      size="large"
    />

4. Add the following line at the beginning of your pipeline YAML:

    ```yaml
    pipeline_output_type: "<PIPELINE_TYPE>"
    # Choose one of these options:
    # pipeline_output_type: "generative"
    # pipeline_output_type: "extractive"
    # pipeline_output_type: "chat"
    # pipeline_output_type: "document"
    ```

5. Save your pipeline.

## What To Do Next

You can [deploy](/docs/how-to-guides/designing-your-pipeline/deploy-a-pipeline.mdx) your pipeline and [try it out in Playground](/docs/how-to-guides/searching-with-your-pipeline/run-a-search.mdx).
