# Output Parsers

Output parsers are used to transform the output of a language model into a more suitable format, particularly when generating structured data.

### Response Schema

ResponseSchema is used to define the structure of the response returned by an output parser. You can use ResponseSchema to create custom schemas for your output parser, which can help validate and parse the output more effectively.

Parameters:

* Name: The name of the schema.
* &#x20;Description: A brief description of the schema, including its purpose and any relevant details. This field helps others understand the schema's intended use.&#x20;
* &#x20;Type: The type of the schema. For example, "object", "array", "string", "number", etc. This field indicates the top-level type of the schema.

### Structured Output Parsers

StructuredOutputParser in Langchain is an output parser used to transform the raw output from a language model (LLM) into a more structured format. The primary responsibility of a structured output parser is to provide methods for getting format instructions and parsing the output from an LLM into a structured format. When using a StructuredOutputParser, you need to specify the response\_schemas parameter, which should contain one or more ResponseSchema instances. The response\_schemas parameter is used to define the expected structure of the output, and it helps the parser validate and transform the raw output from a language model into a more structured format.

Parameters

* Response Schema

Example usage:

<figure><img src="/files/slXJHGFMFCana0IHsGoD" alt=""><figcaption></figcaption></figure>


---

# 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/output-parsers.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.
