Interface GenerationHookContext

Context available to pre-generation hooks. Hooks may return a modified copy to transform the generation input.

interface GenerationHookContext {
    messages: Message[];
    system: undefined | string;
    tools: ITool<any, any>[];
    model: string;
    provider: string;
    step: number;
    prompt: undefined | string;
}

Properties

messages: Message[]

Current messages array (system + conversation + user).

system: undefined | string

System prompt text.

tools: ITool<any, any>[]

Tool definitions available for this step.

model: string

Resolved model ID.

provider: string

Resolved provider ID.

step: number

Current agentic step index (0-based).

prompt: undefined | string

The original user prompt (from opts.prompt).