LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangChain
  • Universal
  • Hub
  • Node
  • Load
  • Serializable
  • Encoder Backed
  • File System
  • In Memory
LangChain Core
  • Agents
  • Caches
  • Base
  • Dispatch
  • Web
  • Manager
  • Promises
  • Chat History
  • Context
  • Base
  • Langsmith
  • Documents
  • Embeddings
  • Errors
  • Example Selectors
  • Indexing
  • Base
  • Chat Models
  • Llms
  • Profile
  • Load
  • Serializable
  • Memory
  • Messages
  • Tool
  • Output Parsers
  • Openai Functions
  • Openai Tools
  • Outputs
  • Prompt Values
  • Prompts
  • Retrievers
  • Document Compressors
  • Runnables
  • Graph
  • Singletons
  • Stores
  • Structured Query
  • Tools
  • Base
  • Console
  • Log Stream
  • Run Collector
  • Tracer Langchain
  • Stream
  • Async Caller
  • Chunk Array
  • Context
  • Env
  • Event Source Parse
  • Format
  • Function Calling
  • Hash
  • Json Patch
  • Json Schema
  • Math
  • Ssrf
  • Stream
  • Testing
  • Tiktoken
  • Types
  • Vectorstores
Text Splitters
MCP Adapters
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangChain
UniversalHubNodeLoadSerializableEncoder BackedFile SystemIn Memory
LangChain Core
AgentsCachesBaseDispatchWebManagerPromisesChat HistoryContextBaseLangsmithDocumentsEmbeddingsErrorsExample SelectorsIndexingBaseChat ModelsLlmsProfileLoadSerializableMemoryMessagesToolOutput ParsersOpenai FunctionsOpenai ToolsOutputsPrompt ValuesPromptsRetrieversDocument CompressorsRunnablesGraphSingletonsStoresStructured QueryToolsBaseConsoleLog StreamRun CollectorTracer LangchainStreamAsync CallerChunk ArrayContextEnvEvent Source ParseFormatFunction CallingHashJson PatchJson SchemaMathSsrfStreamTestingTiktokenTypesVectorstores
Text Splitters
MCP Adapters
Language
Theme
JavaScript@langchain/coreoutput_parsers
Moduleā—Since v1.0

output_parsers

Copy
import { ... } from "@langchain/core/output_parsers";

Functions

function
parseJsonMarkdown→ any
function
parsePartialJson→ any
function
parseXMLMarkdown→ XMLResult

Classes

class
AsymmetricStructuredOutputParser

A type of StructuredOutputParser that handles asymmetric input and output schemas.

class
BaseCumulativeTransformOutputParser

A base class for output parsers that can handle streaming input. It extends the BaseTransformOutputParser class and provides a method for converting parsed outputs into a diff format.

class
BaseLLMOutputParser

Abstract base class for parsing the output of a Large Language Model (LLM) call. It provides methods for parsing the result of an LLM call and invoking the parser with a given input.

class
BaseOutputParser

Class to parse the output of an LLM call.

class
BaseTransformOutputParser

Class to parse the output of an LLM call that also allows streaming inputs.

class
BytesOutputParser

OutputParser that parses LLMResult into the top likely string and encodes it into bytes.

class
CommaSeparatedListOutputParser

Class to parse the output of an LLM call as a comma-separated list.

class
CustomListOutputParser

Class to parse the output of an LLM call to a list with a specific length and separator.

class
JsonMarkdownStructuredOutputParser

A specific type of StructuredOutputParser that parses JSON data formatted as a markdown code snippet.

class
JsonOutputParser

Class for parsing the output of an LLM into a JSON object.

class
ListOutputParser

Class to parse the output of an LLM call to a list.

class
MarkdownListOutputParser

Class to parse the output of an LLM call to a list.

class
NumberedListOutputParser

Class to parse the output of an LLM call to a list.

class
OutputParserException

Exception that output parsers should raise to signify a parsing error.

This exists to differentiate parsing errors from other code or execution errors that also may arise inside the output parser. OutputParserExceptions will be available to catch and handle in ways to fix the parsing error, while other errors will be raised.

class
StringOutputParser

OutputParser that parses LLMResult into the top likely string.

class
StructuredOutputParser

Class to parse the output of an LLM call.

class
XMLOutputParser

A base class for output parsers that can handle streaming input. It extends the BaseTransformOutputParser class and provides a method for converting parsed outputs into a diff format.

Interfaces

interface
AsymmetricStructuredOutputParserFields
interface
FormatInstructionsOptions

Options for formatting instructions.

interface
JsonMarkdownFormatInstructionsOptions

Options for formatting instructions.

interface
XMLOutputParserFields

Type Aliases

typeAlias
BaseCumulativeTransformOutputParserInput
typeAlias
Content: string | undefined | __type[]
typeAlias
JsonMarkdownStructuredOutputParserInput
typeAlias
XMLResult: __type

Variables

variable
XML_FORMAT_INSTRUCTIONS
View source on GitHub