InfOrInt class sealed

A value that can be "inf" (infinity) or an integer.

Used for fields like max response output tokens where the model can use unlimited tokens.

Example

// Use unlimited tokens
final tokens = InfOrInt.inf();

// Use a specific limit
final tokens = InfOrInt.value(4096);
Implementers

Constructors

InfOrInt.fromJson(Object json)
Creates from JSON (string "inf" or int).
factory
InfOrInt.inf()
Creates an infinity value.
const
factory
InfOrInt.value(int value)
Creates a specific integer value.
const
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
isInf bool
Whether this is infinity.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
valueOrNull int?
Gets the integer value, or null if infinity.
no setter

Methods

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

Operators

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