Skip to main content

Interface: SessionSendStructuredResult<T>

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

Result returned by AgentSession.send when responseSchema is set. Extends GenerateTextResult with a typed Zod-validated object.

Extends

Type Parameters

T

T

Properties

agentCalls?

optional agentCalls: AgentCallRecord[]

Defined in: packages/agentos/src/api/generateText.ts:498

Ordered records of every sub-agent call made during an agency() run. undefined for plain generateText / agent() calls.

Inherited from

GenerateTextResult.agentCalls


finishReason

finishReason: "error" | "length" | "stop" | "tool-calls"

Defined in: packages/agentos/src/api/generateText.ts:493

Reason the model stopped generating.

  • "stop": natural end of response.
  • "length": maxTokens limit reached.
  • "tool-calls": loop exhausted maxSteps while still calling tools.
  • "error": provider returned an error.

Inherited from

GenerateTextResult.finishReason


grounding?

optional grounding: VerifiedResponse

Defined in: packages/agentos/src/api/generateText.ts:521

Per-claim citation verdicts attached when agent({ verifyCitations: … }) is configured. undefined when verification was not requested or could not run for this turn.

See

import('./types.js').VerifyCitationsConfig

Inherited from

GenerateTextResult.grounding


model

model: string

Defined in: packages/agentos/src/api/generateText.ts:479

Resolved model identifier used for the run.

Inherited from

GenerateTextResult.model


object

object: T

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

Zod-validated typed object.


parsed?

optional parsed: unknown

Defined in: packages/agentos/src/api/generateText.ts:508

Parsed structured output produced when BaseAgentConfig.output is a Zod schema. undefined when no output schema is configured.

Inherited from

GenerateTextResult.parsed


plan?

optional plan: Plan

Defined in: packages/agentos/src/api/generateText.ts:513

The plan produced by the planning phase when planning is enabled. undefined when planning is disabled or was not requested.

Inherited from

GenerateTextResult.plan


provider

provider: string

Defined in: packages/agentos/src/api/generateText.ts:477

Provider identifier used for the final run.

Inherited from

GenerateTextResult.provider


text

text: string

Defined in: packages/agentos/src/api/generateText.ts:481

Final assistant text after all agentic steps have completed.

Inherited from

GenerateTextResult.text


toolCalls

toolCalls: ToolCallRecord[]

Defined in: packages/agentos/src/api/generateText.ts:485

Ordered list of every tool call made during the run.

Inherited from

GenerateTextResult.toolCalls


trace?

optional trace: AgencyTraceEvent[]

Defined in: packages/agentos/src/api/generateText.ts:503

Structured trace events emitted during the run. Populated by the agency orchestrator; undefined for single-agent calls.

Inherited from

GenerateTextResult.trace


usage

usage: TokenUsage

Defined in: packages/agentos/src/api/generateText.ts:483

Aggregated token usage across all steps.

Inherited from

GenerateTextResult.usage