Skip to main content

Interface: SessionSendStructuredResult<T>

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

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:1142

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

Inherited from​

GenerateTextResult.agentCalls


cacheDiagnostics?​

optional cacheDiagnostics: CacheDiagnostics | null

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

Cache-diagnostics verdict from the LAST agentic step (Anthropic beta; present only when the run opted in via GenerateTextOptions.cacheDiagnostics). null = the last step's request matched its predecessor (prefix stable). A populated cacheMissReason names the earliest divergence. Per-step verdicts are available on the onAfterGeneration hook.

Inherited from​

GenerateTextResult.cacheDiagnostics


fallback?​

optional fallback: FallbackSignal

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

Per-hop provider fallback trail. fired is true when any non-primary provider produced — or was tried for — the result, so callers can flag a degraded run even when the final attempt recovered on the primary. undefined only on legacy code paths that predate the field.

Inherited from​

GenerateTextResult.fallback


finishReason​

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

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

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:1166

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

See​

VerifyCitationsConfig (exported from @framers/agentos/api) for the verifyCitations options.

Inherited from​

GenerateTextResult.grounding


guardReport?​

optional guardReport: TextGuardrailReport

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

With guards: what each stage's guards answered, as codes and ids, and whether the reply passed, was rewritten or was replaced.

Inherited from​

GenerateTextResult.guardReport


historyOmitted?​

optional historyOmitted: PromptHistoryOmission

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

On a gmi() or agent({ runtime: 'gmi' }) session's turn: the conversation history the turn's requests left out to fit the prompt engine's history budget (35 percent of the serving model's context window). messages counts the oldest messages left out of the request that left out the most, tokens is their size at the prompt engine's estimate; the session's messages() still lists them. undefined when every request of the turn carried the whole history, and on the default runtime, which sends the whole history.

Inherited from​

GenerateTextResult.historyOmitted


memoryRecall?​

optional memoryRecall: MemoryRecallCapture

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

On a gmi() or agent({ runtime: 'gmi' }) session's turn with cognitive memory: the recall capture of the model hop that served the turn (every candidate with its ranks, scores and outcome, the legs, the reranker, the hop's budget and delivery, and the timings; never a memory's text or the query's). undefined when the turn assembled no memory block or the manager's recall.capture is 'off'.

Inherited from​

GenerateTextResult.memoryRecall


model​

model: string

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

Resolved model identifier used for the run.

Inherited from​

GenerateTextResult.model


object​

object: T

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

Zod-validated typed object.


parsed?​

optional parsed: unknown

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

Parsed structured output from BaseAgentConfig.output, or from agent().generate() with responseSchema. Undefined without a schema.

Inherited from​

GenerateTextResult.parsed


plan?​

optional plan: Plan

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

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:1082

Provider identifier used for the final run.

Inherited from​

GenerateTextResult.provider


providerMessageId?​

optional providerMessageId: string | null

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

Provider message id (msg_...) of the LAST agentic step; present only when the run opted in via GenerateTextOptions.cacheDiagnostics. Persist it and pass it back as the next request's cacheDiagnostics.previousMessageId to thread the comparison across turns. null when the provider reported no id.

Inherited from​

GenerateTextResult.providerMessageId


responseModel?​

optional responseModel: string

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

Provider-reported model id of the final step (spec batch-1 C1) — can differ from model across aliases and fallback routing. Undefined on paths where no provider-reported id was captured. model keeps its existing meaning (zero-change).

Inherited from​

GenerateTextResult.responseModel


serviceTier?​

optional serviceTier: string

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

Provider-reported service tier the final step actually ran at (OpenAI service_tier on the response; spec batch-1 C2). Undefined on providers/paths without a tier concept.

Inherited from​

GenerateTextResult.serviceTier


servingProvider?​

optional servingProvider: string

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

Upstream host that actually served the request when provider is an aggregator/router (OpenRouter reports e.g. 'Groq' or 'DeepInfra' per completion). Undefined for direct providers, for aggregators that omit it, and on the prompt-shim tool path. Latency attribution: identical model + token counts vary 3-5x in wall-clock by serving host, so telemetry needs this to interpret durations.

Inherited from​

GenerateTextResult.servingProvider


text​

text: string

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

Final assistant text after all agentic steps have completed.

Inherited from​

GenerateTextResult.text


toolCalls​

toolCalls: ToolCallRecord[]

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

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:1147

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

Inherited from​

GenerateTextResult.trace


transcriptDelta?​

optional transcriptDelta: SessionTranscriptMessage[]

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

Lossless message delta this call appended to the conversation: the request's user turn plus every assistant / tool turn the tool loop recorded, in order, in provider-replayable shape (tool_call ids, parallel results, thinking blocks). Sessions append THIS — never a reconstruction — to their history. Absent only on legacy paths that never seeded a conversation array. The prompt-shim path carries a partial delta (seeded turns only); native providers carry the full trail.

Inherited from​

GenerateTextResult.transcriptDelta


usage​

usage: TokenUsage

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

Aggregated token usage across all steps.

Inherited from​

GenerateTextResult.usage