Thread class
A thread representing a conversation with an assistant.
Threads store the message history and can be used across multiple runs.
Example
final thread = await client.threads.create(
CreateThreadRequest(
messages: [
ThreadMessage.user('Hello!'),
],
),
);
- Annotations
-
- @immutable
Constructors
Properties
- createdAt → int
-
The Unix timestamp when the thread was created.
final
- createdAtDateTime → DateTime
-
The creation time as a DateTime.
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- id → String
-
The thread identifier.
final
-
metadata
→ Map<
String, String> -
Custom metadata for the thread.
final
- object → String
-
The object type (always "thread").
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- toolResources → ToolResources?
-
Tool resources available to the thread.
final
Methods
-
copyWith(
{String? id, String? object, int? createdAt, Object? toolResources = unsetCopyWithValue, Map< String, String> ? metadata}) → Thread - Creates a copy with the given fields replaced.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts to JSON.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override