Skip to main content

Interface: SessionSendOptions<S>

Defined in: packages/agentos/src/api/agent.ts:407

Options for a single AgentSession.send call.

Type Parameters​

S​

S extends ZodType | undefined = undefined

Properties​

abortSignal?​

optional abortSignal: AbortSignal

Defined in: packages/agentos/src/api/agent.ts:457

Ends this send when it aborts: the provider request in flight is cancelled, no further step, retry or fallback hop starts, and the send rejects with the signal's reason. The session stays open. With the default runtime nothing of the send is added to the session's history; with runtime: 'gmi' the turn ends as close() ends one, and the steps it finished stay in messages(), marked partial.


blockLabel?​

optional blockLabel: string

Defined in: packages/agentos/src/api/agent.ts:438

Telemetry + eviction-boundary label for this send's transcript block. Labels are markers, not pins.


budget?​

optional budget: SpendBudget | SpendBudgetOptions

Defined in: packages/agentos/src/api/agent.ts:464

A spend budget for this send in place of the agent's; on a seat session (sessionSeat(), or a member a launched team seats) held beside it, each call checked against both and charged to both. Every provider call of the send is checked against it before it is made and recorded after it (settings make a new SpendBudget for the send). With runtime: 'gmi', every completion call of the turn, metaprompts included.


cache?​

optional cache: false | { ttl?: "5m" | "1h"; }

Defined in: packages/agentos/src/api/agent.ts:449


cacheDiagnostics?​

optional cacheDiagnostics: boolean | { previousMessageId?: string | null; }

Defined in: packages/agentos/src/api/agent.ts:448


maxTokens?​

optional maxTokens: number

Defined in: packages/agentos/src/api/agent.ts:450


maxValidationRetries?​

optional maxValidationRetries: number

Defined in: packages/agentos/src/api/agent.ts:433

Extra schema-validation attempts on the default runtime. Defaults to 0.


requestTimeout?​

optional requestTimeout: number

Defined in: packages/agentos/src/api/agent.ts:447


responseSchema?​

optional responseSchema: S

Defined in: packages/agentos/src/api/agent.ts:425

Zod schema describing the expected shape of the assistant reply. When present, agentos converts the schema to JSON Schema, routes through the provider's native structured-output API (OpenAI json_schema; Anthropic's JSON output format, or a forced tool call for a schema the format cannot carry; Gemini responseSchema), and returns a Zod-validated typed object on result.object alongside the JSON string in result.text. A call whose provider payload carries no schema (a provider with none, a record schema on an Anthropic model that refuses a forced tool choice, JSON-object mode) gets the schema in its system prompt, in the words generateObject uses; each fallback provider is checked for its own payload.

The agent's tools are left out of a schema request, and with them the chain-of-thought instruction; runtime: 'legacy' (the default) warns that it leaves them out.


schemaName?​

optional schemaName: string

Defined in: packages/agentos/src/api/agent.ts:431

Display name for the schema in provider payloads. Surfaces in OpenAI's json_schema.name and Anthropic's tool name. Defaults to 'response'. Sanitized to /[a-zA-Z0-9_]/ and truncated to 64 chars.


toolChoice?​

optional toolChoice: string | Record<string, unknown>

Defined in: packages/agentos/src/api/agent.ts:446

Per-send generation overrides, merged over the agent's baseOpts with send-level precedence — the same contract generate(prompt, extra) gives extra. Long tool-driving loops rely on these (toolChoice, requestTimeout, cacheDiagnostics); without send-level carriage a caller migrating from generate() silently loses them.