Expand description
interface MockRequest {
format: FormatName;
headers: Readonly<Record<string, string | undefined>>;
lastMessage: string;
lastToolCallId: string | undefined;
messages: readonly Message[];
model: string;
path: string;
raw: unknown;
serverToolTypes: readonly string[];
streaming: boolean;
systemMessage: string;
toolNames: readonly string[];
tools?: readonly ToolDef[];
}Properties§
readonly format: FormatNameWhich API format route the request came in on.
readonly headers: Readonly<Record<string, string | undefined>>HTTP headers from the incoming request.
readonly last Message: stringThe last user message's text. This is what most matchers check.
readonly last Tool Call Id: string | undefinedSet when the last message was a tool result. Used by whenToolResult().
readonly messages: readonly Message[]Full conversation, normalised from whatever format came in.
readonly model: stringThe model string from the request, e.g. "gpt-5.4" or "claude-sonnet-4-6".
readonly path: stringThe URL path that was hit, e.g. /v1/chat/completions.
readonly raw: unknownThe raw request body, for anything we don't extract.
readonly server Tool Types: readonly string[]The type strings of server-side / built-in tools the request enabled
(e.g. Anthropic web_search_20250305, Responses web_search). These are
provider capabilities rather than user-defined tools, so they're kept
separate from tools/toolNames and matched via whenServerTool().
readonly streaming: booleanWhether the client asked for SSE streaming (from the stream field).
readonly system Message: stringSystem prompt text, or empty string if there wasn't one.
readonly tool Names: readonly string[]Tool names pulled out from tools for quick lookups via whenTool().
readonly tools?: readonly ToolDef[]Tool definitions from the request, if any were sent.
A normalised view of an incoming request, regardless of the original wire format. This is what rule matchers and resolvers receive.