# Outputs

### TextGenerationOutput

The TextGenerationOutput component is designed to store and manage text extracted from Document Loaders, images/speech outputs from Multimodal components, and output generated by Chains. It includes a Query field that allows users to input a query. This component's primary function is to ensure that the generated output is made readily accessible to users.

#### Parameters

* **Chain:** Users can connect any chain component as an input to the TextGenerationOutput.
* **Documents:** Users can connect any component that returns a list of documents, such as the PyPdfLoader, TextSplitters, etc.
* **Multimodal:** Users can connect any Multimodal component that returns an object like an image or a speech.
* **Query:** A Query is a special field that lets users input a query in case a stack doesn't have a prompt and memory component.

#### Example Usage

In the below example, the LLMChain acts as an input to the Output component (with no query). Since we have a prompt and memory, we are mentioning the inputs in the prompt and memory itself.

<figure><img src="https://3489179498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjlRjmrZThWiLNO9xTu9d%2Fuploads%2F9NwaUB8rXvPAh0pkhYzq%2FScreenshot%202024-05-22%20at%204.15.07%E2%80%AFPM.png?alt=media&#x26;token=13831132-1d89-43ec-8ed4-a19e3ee0d0e7" alt=""><figcaption><p>TextGenerationOutput with no query</p></figcaption></figure>

Since there is no prompt and memory, we are adding the query in the Output component to invoke a chain for generating the output.

<figure><img src="https://3489179498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjlRjmrZThWiLNO9xTu9d%2Fuploads%2FQS9EjipARKwDz88BkRTb%2Fimage.png?alt=media&#x26;token=c949954c-3fae-430b-b480-0bf714511203" alt=""><figcaption><p>TextGenerationOutput with query</p></figcaption></figure>

In the example below, the Multimodal output is connected to the text generation output to invoke the speech generation process.&#x20;

<figure><img src="https://3489179498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjlRjmrZThWiLNO9xTu9d%2Fuploads%2FzZlCsAhHcZVJjecyXlbG%2FScreenshot%202024-05-21%20at%205.09.39%E2%80%AFPM.png?alt=media&#x26;token=a941a488-b105-4b47-a376-6b6ce5390e09" alt=""><figcaption><p>TextGenerationOutput with Multimodal (OpenAITextToSpeech) as an input</p></figcaption></figure>

The Output component can take `Chains` as an input. It can also take any component that returns `Documents`. Additionally, it takes `Multimodal` outputs and a `Query` in case a stack doesn't have a prompt and memory component.
