# 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="/files/8fjvCuXryTQr7jV6nX7r" 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="/files/jjE1iT6sQZkxfSCSIl2Q" 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="/files/umQDY0DjM8HRKVUQXLBc" 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.


---

# 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.aiplanet.com/genai-stack-1/components/outputs.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.
