StructuredOutputHandler class

Handles structured output generation and validation Matches iOS StructuredOutputHandler from Features/LLM/StructuredOutput/StructuredOutputHandler.swift

Constructors

StructuredOutputHandler()

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

buildUserPrompt(String content) String
Build user prompt for structured output (simplified without instructions)
extractJSON(String text) String
Extract JSON from potentially mixed text
getSystemPrompt(String schema) String
Get system prompt for structured output generation
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parseStructuredOutput<T>(String text, T fromJson(Map<String, dynamic>)) → T
Parse and validate structured output from generated text
preparePrompt({required String originalPrompt, required StructuredOutputConfig config}) String
Prepare prompt with structured output instructions
toString() String
A string representation of this object.
inherited
validateStructuredOutput({required String text, required StructuredOutputConfig config}) StructuredOutputValidation
Validate that generated text contains valid structured output

Operators

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