ToolCallOnly class final
Constraint that forces the model to only generate tool/function calls.
When this constraint is active, the model will not generate regular text responses and will only output function calls with optional prefix/suffix.
Example:
final toolOnly = ToolCallOnly(
constraintPrefix: 'Calling function: ',
constraintSuffix: '\n---\n',
);
Constructors
- ToolCallOnly({String? constraintPrefix, String? constraintSuffix})
-
Creates a new ToolCallOnly constraint.
const
- ToolCallOnly.fromProto(ConstraintOptions_ToolCallOnly proto)
-
Creates a ToolCallOnly instance from a Protocol Buffer message.
factory
Properties
- constraintPrefix → String?
-
Optional prefix text to add before tool call output.
final
- constraintSuffix → String?
-
Optional suffix text to add after tool call output.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
build(
) → ConstraintOptions_ToolCallOnly - Converts this instance to a Protocol Buffer message.
-
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