Interface: AfterLLMHookContext
Defined in: hooks/types.ts:164
Context for after:llm hook
Extends
Properties
durationMs
durationMs: number;
Defined in: hooks/types.ts:195
Duration of the LLM call in milliseconds
iteration
iteration: number;
Defined in: hooks/types.ts:28
Current iteration number (1-indexed)
Inherited from
messages
messages: Message[];
Defined in: hooks/types.ts:111
Messages to be sent to LLM
Inherited from
metadata
metadata: Record<string, unknown>;
Defined in: hooks/types.ts:38
Custom metadata that can be passed between hooks
Inherited from
model?
optional model?: string;
Defined in: hooks/types.ts:190
Model that was used
sessionId
sessionId: string;
Defined in: hooks/types.ts:23
Current session ID
Inherited from
signal?
optional signal?: AbortSignal;
Defined in: hooks/types.ts:33
Abort signal for cancellation
Inherited from
systemPrompt
systemPrompt: string;
Defined in: hooks/types.ts:122
Current system prompt (fully assembled, including anchors). Hooks can read this and return a modified version in BeforeLLMHookResult.
Inherited from
text
text: string;
Defined in: hooks/types.ts:168
Text response from LLM
tools
tools: ToolDefinition[];
Defined in: hooks/types.ts:116
Tool definitions available to LLM
Inherited from
toolUses
toolUses: {
id: string;
input: Record<string, unknown>;
name: string;
}[];
Defined in: hooks/types.ts:173
Tool uses requested by LLM
id
id: string;
input
input: Record<string, unknown>;
name
name: string;
usage?
optional usage?: {
inputTokens: number;
outputTokens: number;
};
Defined in: hooks/types.ts:182
Token usage from the call
inputTokens
inputTokens: number;
outputTokens
outputTokens: number;