Skip to main content

Interface: GenerationHookResult

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

Context available to post-generation hooks. Hooks may return a modified copy to transform the generation output.

Properties​

cacheDiagnostics?​

optional cacheDiagnostics: CacheDiagnostics | null

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

Cache-diagnostics verdict for THIS step (Anthropic beta; present only when the run opted in via GenerateTextOptions.cacheDiagnostics). null = this step's request matched the previous one (cached prefix stable). A populated cacheMissReason names the earliest divergence — log it: it is the direct answer to "why did this step miss the cache".


step​

step: number

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

Current agentic step index (0-based).


text​

text: string

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

Generated text from the LLM.


toolCalls​

toolCalls: ToolCallRecord[]

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

Tool calls requested by the LLM.


usage​

usage: TokenUsage

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

Token usage for this step.