Skip to main content
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.
The update_file variant of an apply_patch_call.operation. Carries a V4A diff describing edits to an existing file.

Example Usage

import { ApplyPatchUpdateFileOperation } from "@openrouter/sdk/models";

let value: ApplyPatchUpdateFileOperation = {
  diff: "@@ function main() {\n+  console.log(\"hi\");\n }",
  path: "/src/main.ts",
  type: "update_file",
};

Fields

FieldTypeRequiredDescription
diffstring:heavy_check_mark:N/A
pathstring:heavy_check_mark:N/A
type”update_file”:heavy_check_mark:N/A