ResponseInput class sealed
Input for a response request.
Response input can be either:
- ResponseInputText: Simple text input
- ResponseInputItems: A list of Item objects for multi-turn conversations
Example
// Simple text
final text = ResponseInput.text('Hello!');
// Multi-turn conversation with items
final items = ResponseInput.items([
MessageItem.userText('What is 2+2?'),
MessageItem.assistantText('4'),
MessageItem.userText('What is 3+3?'),
]);
- Implementers
- Annotations
-
- @immutable
Constructors
- ResponseInput.fromJson(Object json)
-
Creates ResponseInput from JSON.
factory
-
ResponseInput.fromOutputItems(List<
Map< items)String, dynamic> > -
Creates input from raw output item JSON maps.
constfactory
-
ResponseInput.items(List<
Item> items) -
Creates item input for multi-turn conversations.
constfactory
- ResponseInput.text(String text)
-
Creates text input.
constfactory
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
-
toJson(
) → Object - Converts to JSON format expected by the API.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited