Skip to main content

completion

completion

Request Body REQUIRED
language string

Language identifier, full list is maintained at https://code.visualstudio.com/docs/languages/identifiers

segments object
prefix string REQUIRED

Content that appears before the cursor in the editor window.

suffix string

Content that appears after the cursor in the editor window.

filepath string

The relative path of the file that is being edited.

  • When [Segments::git_url] is set, this is the path of the file in the git repository.
  • When [Segments::git_url] is empty, this is the path of the file in the workspace.
git_url string

The remote URL of the current git repository. Leave this empty if the file is not in a git repository, or the git repository does not have a remote URL.

declarations object[]

The relevant declaration code snippets provided by the editor's LSP, contain declarations of symbols extracted from [Segments::prefix].

filepath string REQUIRED

Filepath of the file where the snippet is from.

  • When the file belongs to the same workspace as the current file, this is a relative filepath, use the same rule as [Segments::filepath].
  • When the file located outside the workspace, such as in a dependency package, this is a file URI with an absolute filepath.
body string REQUIRED

Body of the snippet.

relevant_snippets_from_changed_files object[]

The relevant code snippets extracted from recently edited files. These snippets are selected from candidates found within code chunks based on the edited location. The current editing file is excluded from the search candidates.

When provided alongside [Segments::declarations], the snippets have already been deduplicated to ensure no duplication with entries in [Segments::declarations].

Sorted in descending order of [Snippet::score].

filepath string REQUIRED
body string REQUIRED
score float REQUIRED
clipboard string

Clipboard content when requesting code completion.

user string

A unique identifier representing your end-user, which can help Tabby to monitor & generating reports.

temperature float

The temperature parameter for the model, used to tune variance and "creativity" of the model output

seed int64

The seed used for randomly selecting tokens

Responses
200

Success

Schema OPTIONAL
id string
choices object[]
index int32
text string
400

Bad Request