Skip to main content

Interface: ProviderSession

Defined in: packages/client/src/types.ts:230

A provider-side conversation. The core owns the message history; a session gets each new user message and may keep its own context (an agent session) or resend the history (a stateless HTTP API).

message is the user message as the model should see it: the turn context is already rendered into its text (see promptText).

Properties​

close​

close: () => void

Defined in: packages/client/src/types.ts:239

Returns​

void


closed?​

readonly optional closed?: boolean

Defined in: packages/client/src/types.ts:244

The provider ended this session on its own (e.g. the visitor changed the AI or model for this site): the conversation opens a new one.


send​

send: (message, context) => Promise<{ text: string; }>

Defined in: packages/client/src/types.ts:236

Run one turn. Resolves with the assistant text when the turn ends. When context.signal aborts, stop the turn and settle soon after, keeping the session usable if possible.

Parameters​

message​

Message

context​

TurnContext

Returns​

Promise<{ text: string; }>


warm?​

optional warm?: () => Promise<void>

Defined in: packages/client/src/types.ts:238

Get ready ahead of the first turn (start an agent, load a model).

Returns​

Promise<void>