Session
Defined in: agents/src/types.ts:200
A trusted, server-side conversation store. Every method is required.
Properties
Section titled “Properties”readonly id: string;Defined in: agents/src/types.ts:201
Methods
Section titled “Methods”append()
Section titled “append()”append(turn, options): Promise<{ revision: string;}>;Defined in: agents/src/types.ts:210
Atomic. Throw SessionConflictError when after is not the current revision, or when
runId already appended a different turn. Write nothing when you throw.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
turn |
SessionTurn |
options |
{ signal: AbortSignal; } |
options.signal |
AbortSignal |
Returns
Section titled “Returns”Promise<{
revision: string;
}>
load()
Section titled “load()”load(options): Promise<{ messages: AgentMessage[]; revision: string | null;}>;Defined in: agents/src/types.ts:204
The newest limit messages, or all of them, oldest first, with the revision they belong
to. A window may start inside a tool round; the run repairs it before sending.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
{ limit?: number; signal: AbortSignal; } |
options.limit? |
number |
options.signal |
AbortSignal |
Returns
Section titled “Returns”Promise<{
messages: AgentMessage[];
revision: string | null;
}>