ResponseInput class sealed

Input for a response request.

Response input can be either:

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<String, dynamic>> items)
Creates input from raw output item JSON maps.
const
factory
ResponseInput.items(List<Item> items)
Creates item input for multi-turn conversations.
const
factory
ResponseInput.text(String text)
Creates text input.
const
factory

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