LogoLogo
Home
  • Introduction
  • Quickstart
    • Starter guide
    • Core Concepts
      • Stack Type
      • Data Loader
      • Inputs/Outputs
      • Text Splitters
      • Embedding Model
      • Vector Store
      • Large Language Model
      • Memory
      • Chain
    • Testing Stack
    • Deployment
    • Knowledge Base
    • Organization and Teams
    • Secret Keys
    • Logs
  • Components
    • Inputs
    • Outputs
    • Document Loaders
    • Prompts
    • Text Splitters
    • Embeddings
    • Vector Store
    • Retrievers
    • Multi Modals
    • Agents
    • Large Language Models
    • Memories
    • Chains
    • Output Parsers
  • Customization
    • Writing Custom Components in GenAI Stack
    • Build your own custom component
    • Define parameters used for required components
  • Usecases
    • Simple QA using Open Source Large Language Models
    • Multilingual Indic Language Translation
    • Document Search and Chat
    • Chat with Multiple Documents
  • Terminologies
    • RAG - Retrieval Augmented Generation
    • Hybrid Search - Ensemble Retriever
  • REST APIs
    • GenAI Stack REST APIs
    • Chat API Reference
    • Text Generation API Reference
    • Rate Limiting and Sleep Mode
  • Troubleshooting
    • How to verify what is loaded and chunked from the loader?
  • Acknowledgements
    • Special Mentions
Powered by GitBook
On this page
  • Response Schema
  • Structured Output Parsers

Was this helpful?

  1. Components

Output Parsers

PreviousChainsNextWriting Custom Components in GenAI Stack

Last updated 1 year ago

Was this helpful?

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.

  • Description: A brief description of the schema, including its purpose and any relevant details. This field helps others understand the schema's intended use.

  • 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: