auto-dev-vscode icon indicating copy to clipboard operation
auto-dev-vscode copied to clipboard

how to set prompt template for completion?

Open keezen opened this issue 1 year ago • 2 comments

Before submitting your bug report

Relevant environment info

- OS: win11
- AutoDev VSCode: v0.5.2
- IDE:

Description

屏幕截图 2024-08-27 113728

To reproduce

No response

Log output

No response

keezen avatar Aug 27 '24 03:08 keezen

Use custom template, follow these steps.

  1. Identify the model special tokens.
  2. Populate the template with variables like:

Code Llama expects a specific format for infilling code:

<PRE> {prefix} <SUF>{suffix} <MID>

<PRE>, <SUF> and <MID> are guide tokens;{prefix} and {suffix} are for extension.

  1. These are the available variables in the template:

    • file_name:Current file name
    • language:Document’s programming language (e.g., Java, JavaScript)
    • prefix: Content before the cursor
    • suffix: Content after the cursor

Note: Formats differ by model; refer to the model introduction page or paper for specifics.

File: src/action/providers/AutoDevCodeInlineCompletionProvider.ts

Screenshot:

image

zhengxs2018 avatar Dec 10 '24 06:12 zhengxs2018