---
title: "Generator"
method: POST
path: "/predict/generator"
---

# Generator

`POST /predict/generator`

Predict lines edition based on adding/deleting labels

## Request body

- GeneratorRequest
  - `language` string — Supported VS Code language-id of the input text
  - `filePath` string — Path of the file
  - `atLine` number — Line number of the edit
  - `codeWindow` string[] — Several lines of code around the edit location
  - `interLabels` string[] — Intermediate labels for each line
  - `inlineLabels` string[] — Inline labels for each line
  - `commitMessage` string — A message precisely describing of the current edit
  - `prevEdits` SinglePrevEdit[] — Several latest previous edits
    - `path` string — Path of the file
    - `line` integer — Line number of the edit
    - `rmLine` string — Number of removed Lines
    - `rmText` string[] — Removed lines
    - `addLine` string — Number of added lines
    - `addText` string[] — Added lines
    - `codeAbove` string[] — Several lines of code above the edit location
    - `codeBelow` string[] — Several lines of code below the edit location
  - `prevEditType` 'def&ref' | 'clone' | 'diagnose' | 'normal' — Type of the previous edit

## Response `200`

Successful generation

- string[] — Candidates of the edit, representing an entire replacement of the hunk and requires post-processing to determine the difference.

---

[API](https://skmtc.dev/code-philia/apis/backend-api-for-trace.md) · [All operations](https://skmtc.dev/code-philia/apis/backend-api-for-trace/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/code-philia/backend-api-for-trace/revisions/371aa69912d1/schema)
