JsonParsingUtils class

Shared JSON parsing utilities used by multiple format implementations.

Constructors

JsonParsingUtils()

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

cleanModelResponse(String response) → String
Remove model response wrappers (Gemma turn markers).
isBalancedJson(String str) → bool
Fast check for balanced braces without full JSON parsing.
isDefinitelyText(String buffer, {List<String> extraIndicators = const []}) → bool
Check if text is definitely plain text (not a function call). Shared heuristic for JSON-based formats.
parseJsonArray(String jsonStr) → List<FunctionCallResponse>
Parse a JSON array of function calls. Returns all successfully parsed calls.
parseJsonString(String jsonStr) → FunctionCallResponse?
Parse JSON string into FunctionCallResponse. Supports key names: "parameters", "args", "arguments".
parseMultipleJsonObjects(String text) → List<FunctionCallResponse>
Split text containing multiple JSON objects separated by newlines or commas. Handles: {...}\n{...}, {...}, {...}, and mixed.