# CH03 Output Parsers

## Output Parser <a href="#output-parser" id="output-parser"></a>

LangChain's output wave is an important component that transforms the output of a language model (LLM) into a more useful and structured form.

### The role of the output wave <a href="#id-1" id="id-1"></a>

* Get the output of LLM and convert it to a more suitable format
* Very useful for generating structured data
* Parse and process various kinds of output data in LangChain framework

### Main features <a href="#id-2" id="id-2"></a>

1. **Diversity** : LangChain offers many kinds of output parsers.
2. **Streaming support** : Many output parsers support streaming.
3. **scalability** : Provides a scalable interface from minimal to complex modules.

### Advantages of output parser <a href="#id-3" id="id-3"></a>

1. **structuring** : Converts LLM's free-form text output to structured data.
2. **consistency** : Keep the output format consistent to facilitate subsequent processing.
3. **flexibility** : Convert to various output formats (JSON, list, dictionary, etc.).

\
When using the output wavecer and not
-------------------------------------

When no output wave

```
**Extract the important content:**

1. **From:** Kim Cheol-su (chulsoo.kim@bikecorporation.me)
2. **Recipient:** Lee Eun-chae(eunchae@teddyinternational.me)
3. **title:** "ZENESIS" Bicycle distribution cooperation and meeting schedule proposal
4. **request:**
   - ZENESIS Request a detailed brochure of the model (including technical specifications, battery performance, and design information)
5. **Meeting suggestion:**
   - Date: Next Tuesday (January 15th)
   - Time: 10:00 AM
   - Location: Your office

6. **Sender Information:**
   - Kim Cheol-su, Managing Director, Bike Corporation
```

Structured answer in JSON format

```
{
  "person": "Kim Cheol-su",
  "email": "chulsoo.kim@bikecorporation.me",
  "subject": "\"ZENESIS\" Bicycle distribution cooperation and meeting schedule proposal",
  "summary": "Kim Cheol-su, managing director of Bike Corporation, presents a new bicycle to Lee Eun-chae, deputy manager of Teddy International. 'ZENESIS' Request for brochures on the model and request for technical specifications, battery performance, and design information. Also, propose a meeting on January 15th at 10:00 AM to discuss cooperation.",
  "date": "January 15th at 10:00 AM"
}
```

### Conclusion <a href="#id-5" id="id-5"></a>

LangChain's output wave is an important tool for developing LLM-based applications. This allows developers to use LLM's output more effectively, **Easily convert to structured data** can do

<br>
