Skip to content

IRRequest

This content is not available in your language yet.

type IRRequest = {
maxTokens: number;
messages: {
blocks: (
| {
t: "text";
text: string;
}
| {
signature?: string;
t: "thinking";
text: string;
}
| {
payload?: unknown;
provider: string;
t: "opaque";
}
| {
args?: unknown;
id: string;
name: string;
t: "tool_call";
}
| {
callId: string;
content: (
| {
t: ...;
text: ...;
}
| {
data: ...;
mime: ...;
t: ...;
})[];
isError?: boolean;
t: "tool_result";
}
| {
data: string;
mime: string;
t: "image";
})[];
meta?: {
compactionId?: string;
kind?: "compaction_summary";
};
role: "user" | "assistant";
}[];
model: {
model: string;
provider: string;
};
promptTokensEstimate?: number;
skipCacheWrite?: boolean;
stopSequences?: string[];
system: {
cacheable?: boolean;
label?: string;
text: string;
}[];
temperature?: number;
thinking?: {
budget?: number;
off?: boolean;
};
tools: {
description: string;
inputSchema: Record<string, unknown>;
name: string;
}[];
};

模型调用请求(IRRequestSchema 推导)。

maxTokens: number;

messages: {
blocks: (
| {
t: "text";
text: string;
}
| {
signature?: string;
t: "thinking";
text: string;
}
| {
payload?: unknown;
provider: string;
t: "opaque";
}
| {
args?: unknown;
id: string;
name: string;
t: "tool_call";
}
| {
callId: string;
content: (
| {
t: ...;
text: ...;
}
| {
data: ...;
mime: ...;
t: ...;
})[];
isError?: boolean;
t: "tool_result";
}
| {
data: string;
mime: string;
t: "image";
})[];
meta?: {
compactionId?: string;
kind?: "compaction_summary";
};
role: "user" | "assistant";
}[];
blocks: (
| {
t: "text";
text: string;
}
| {
signature?: string;
t: "thinking";
text: string;
}
| {
payload?: unknown;
provider: string;
t: "opaque";
}
| {
args?: unknown;
id: string;
name: string;
t: "tool_call";
}
| {
callId: string;
content: (
| {
t: ...;
text: ...;
}
| {
data: ...;
mime: ...;
t: ...;
})[];
isError?: boolean;
t: "tool_result";
}
| {
data: string;
mime: string;
t: "image";
})[];
optional meta?: {
compactionId?: string;
kind?: "compaction_summary";
};
optional compactionId?: string;
optional kind?: "compaction_summary";
role: "user" | "assistant";

model: {
model: string;
provider: string;
};
model: string;
provider: string;

optional promptTokensEstimate?: number;

optional skipCacheWrite?: boolean;

optional stopSequences?: string[];

system: {
cacheable?: boolean;
label?: string;
text: string;
}[];
optional cacheable?: boolean;
optional label?: string;
text: string;

optional temperature?: number;

optional thinking?: {
budget?: number;
off?: boolean;
};
optional budget?: number;
optional off?: boolean;

tools: {
description: string;
inputSchema: Record<string, unknown>;
name: string;
}[];
description: string;
inputSchema: Record<string, unknown>;
name: string;