@gemina/sdk 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -195,7 +195,27 @@ console.log(follow.answer, "· session:", chat.sessionId);
195
195
  await chat.delete(); // end it server-side (or chat.reset() to just forget it locally)
196
196
  ```
197
197
 
198
- A conversation expires after 24h of inactivity; the next `send` then throws the API's `404 CHAT_SESSION_NOT_FOUND` — call `chat.reset()` and resend to continue in a fresh one. One-shot `client.chat.chatQuery({ chatQueryInDTO: { message, sessionId } })` is still available if you'd rather hold the id yourself; every response returns a `sessionId`.
198
+ A conversation's live context expires after roughly 24h of inactivity; the next `send` then throws the API's `404 CHAT_SESSION_NOT_FOUND` — call `chat.reset()` and resend to continue in a fresh one. The transcript itself is not lost: it stays available in chat history (below) until your data-retention window — or an explicit purge — removes it. One-shot `client.chat.chatQuery({ chatQueryInDTO: { message, sessionId } })` is still available if you'd rather hold the id yourself; every response returns a `sessionId`.
199
+
200
+ ## Chat history
201
+
202
+ Past conversations are kept as sessions you can list, reread, and purge:
203
+
204
+ ```ts
205
+ const listing = await client.chat.listChatSessions({ limit: 20 });
206
+ for (const session of listing.sessions) {
207
+ console.log(session.title, "·", session.turnCount, "turns");
208
+ }
209
+
210
+ const transcript = await client.chat.getChatSession({ sessionId: listing.sessions[0].id });
211
+ for (const msg of transcript.messages) {
212
+ console.log(`[${msg.role}] ${msg.content}`);
213
+ }
214
+
215
+ await client.chat.purgeChatSession({ sessionId: listing.sessions[0].id });
216
+ ```
217
+
218
+ `purgeChatSession` permanently deletes the transcript and the server-side copy of its content — it cannot be undone. Purged sessions vanish from the list; pass `withPurged: true` to see their content-free stubs — title cleared, `purgedAt`/`purgeReason` set; timestamps and `turnCount` survive. Transcripts also age out automatically under your account's data-retention setting (each session's `purgeAt` tells you when). Purging requires an API key or a console sign-in — browser session tokens can list and read history, but never purge.
199
219
 
200
220
  ## Session tokens (browser embedding)
201
221