Skip to content

ActionContext

type ActionContext<TInput> = {
input: z.infer<TInput>;
items?: ToolItems;
logger: Logger;
resumption?: ToolResumption;
services: Services;
userId?: string;
};

Defined in: core/src/action/action.types.ts:14

Everything an action’s execute receives: the validated input, the shared Services container, an optional userId, a Logger, the resumption answer if the call is being resumed after an interrupt, and access to conversation items.

Type Parameter Default type
TInput extends z.ZodType z.ZodType
input: z.infer<TInput>;

Defined in: core/src/action/action.types.ts:15


optional items?: ToolItems;

Defined in: core/src/action/action.types.ts:24

Absent when the action runs outside a conversation (e.g. invoked directly, or inside a sandbox script).


logger: Logger;

Defined in: core/src/action/action.types.ts:18


optional resumption?: ToolResumption;

Defined in: core/src/action/action.types.ts:19


services: Services;

Defined in: core/src/action/action.types.ts:16


optional userId?: string;

Defined in: core/src/action/action.types.ts:17