?
Thread
TypeCarries a thread's full message history, as returned by `getThread`.
What getThread returns: a ThreadSummary's fields plus the messages array, the full conversation in order. Render it to restore a conversation the user reopens.
Thread.ts
interface Thread { id: string title: string | null messages: Message[] dateCreated: string dateUpdated: string }
Fields
id
string
Thread id (UUID).
title
string | null
User-editable title.
messages
Message[]
The full conversation history, in order.
dateCreated
string
ISO 8601 creation timestamp.
dateUpdated
string
ISO 8601 last-updated timestamp.
Restore a conversation
const thread: Thread = await chat.getThread(threadId); thread.messages.forEach((m) => renderMessage(m));