ApplyPatchCallItem - TypeScript SDK

ApplyPatchCallItem type definition

The TypeScript SDK and docs are currently in beta. Report issues on GitHub.

A tool call emitted by the model requesting a V4A patch operation. The client applies the patch and echoes an apply_patch_call_output on the next turn.

Example Usage

1import { ApplyPatchCallItem } from "@openrouter/sdk/models";
2
3let value: ApplyPatchCallItem = {
4 callId: "call_abc123",
5 operation: {
6 diff: "@@ function main() {\n+ console.log(\"hi\");\n }",
7 path: "/src/main.ts",
8 type: "update_file",
9 },
10 status: "completed",
11 type: "apply_patch_call",
12};

Fields

FieldTypeRequiredDescriptionExample
callIdstring✔️N/A
idstringN/A
operationmodels.ApplyPatchCallOperation✔️The patch operation requested by an apply_patch_call. create_file and update_file carry a V4A diff; delete_file omits it.{"diff": "@@ function main() {\n+ console.log(\"hi\");\n }”,
“path”: “/src/main.ts”,
“type”: “update_file”
}
statusmodels.ApplyPatchCallStatus✔️Lifecycle state of an apply_patch_call output item.completed
typemodels.ApplyPatchCallItemType✔️N/A