FunctionCallParser class

Unified parser for function calls in all formats:

  • Direct JSON: {"name": "function_name", "parameters": {...}}
  • Markdown blocks: json\n{"name": ...}\n
  • Tool code blocks: <tool_code>{"name": ...}</tool_code>

Constructors

FunctionCallParser()

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

isDefinitelyText(String buffer) bool
Checks if buffer looks definitely like text (not JSON)
isFunctionCallComplete(String buffer, {ModelType? modelType}) bool
Check if function call structure is complete
isFunctionCallStart(String buffer, {ModelType? modelType}) bool
Check if buffer starts with function call indicators Uses ModelType for explicit format detection
isJsonComplete(String buffer) bool
DEPRECATED: Use isFunctionCallComplete instead
isJsonStart(String buffer) bool
DEPRECATED: Use isFunctionCallStart instead
parse(String text, {ModelType? modelType}) FunctionCallResponse?
Parse function call based on model type Uses explicit ModelType routing - no fallback chains