JsonBlockParser class

Utilities for parsing JSON blocks from text, commonly used when extracting structured data from LLM text responses.

Constructors

JsonBlockParser()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

parseFirstJsonBlock(String text) Object?
Parses the first valid JSON object or array found in text.
parseJsonBlocks(String text) List<Object>
Parses all valid JSON objects or arrays found in text.
stripJsonBlock(String text) String
Removes all found JSON blocks from the text.