---
title: "Invoker"
method: POST
path: "/predict/invoker"
---

# Invoker

`POST /predict/invoker`

Judge the type of referenceable information of next edit.

For previous edits, this model takes the latest one and then compares
it with earlier ones to determine the behavior (called an edit composition type) of the last edit, among
`rename`, `def&ref`, `clone` and `normal`.

If the last edit is a normal edit, this function will pass it to the locator and return predicted edit labels.
Otherwise, it will send the edit composition type to the front end.

## Request body

- LocatorRequest
  - `language` string — Supported VS Code language-id of the input text
  - `commitMsg` 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
  - `files` object — All files to be scanned for potential edit locations
  - `lspServiceName` 'def&ref' | 'clone' | 'diagnose' | 'normal' — Name of the predicted edit composition type before querying locator
  - `lspFoundLocations` LspDiagnoseLocation[]
    - `file_path` string
    - `start` object
      - `line` number
      - `col` number
    - `end` object
      - `line` number
      - `col` number

## Response `200`

Success

- union
  - object
    - `type` string — Type of the result
    - `info` union
      - InvokerRenameInfo
      - InvokerDefRefInfo
      - InvokerCloneInfo
  - LocatorResponse
    - `files` object — Recommendation of edit locations of each file

---

[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)
