From b0e676b5dd15878ccd616e24e2c7c48df802c684 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Tue, 15 Apr 2025 18:55:25 +0530 Subject: [PATCH] update corresponding docs --- core/autocomplete/CompletionProvider.ts | 2 ++ .../customize/model-roles/autocomplete.md | 21 +++++++++++++++++++ docs/docs/reference.md | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/core/autocomplete/CompletionProvider.ts b/core/autocomplete/CompletionProvider.ts index 9753ab57a..389c45495 100644 --- a/core/autocomplete/CompletionProvider.ts +++ b/core/autocomplete/CompletionProvider.ts @@ -186,6 +186,8 @@ export class CompletionProvider { helper, }); + console.log('debug1 the prompt was->', prompt) + // Completion let completion: string | undefined = ""; diff --git a/docs/docs/customize/model-roles/autocomplete.md b/docs/docs/customize/model-roles/autocomplete.md index 9641d5dcb..194656ab0 100644 --- a/docs/docs/customize/model-roles/autocomplete.md +++ b/docs/docs/customize/model-roles/autocomplete.md @@ -12,3 +12,24 @@ In Continue, autocomplete models are used to display inline [Autocomplete](../.. ## Recommended Autocomplete models Visit the [Autocomplete Deep Dive](../deep-dives/autocomplete.mdx) for recommended models and more details. + +## Prompt templating + +You can customize the prompt template used when autocomplete happens by setting the `promptTemplates.autocomplete` property in your model configuration. Continue uses [Handlebars syntax](https://handlebarsjs.com/guide/) for templating. + +Available variables for the apply template: + +- `{{{prefix}}}` - the code before your cursor +- `{{{suffix}}}` - the code after your cursor +- `{{{filename}}}` - the name of the file your cursor currently is +- `{{{reponame}}}` - the name of the folder where the codebase is +- `{{{language}}}` - the name of the programming language in full (ex. Typescript) + +Example: + +```yaml +models: + - name: My Custom Autocomplete Template + provider: ollama + model: qwen2.5-coder:1.5b +``` \ No newline at end of file diff --git a/docs/docs/reference.md b/docs/docs/reference.md index 6269a1bb7..ac90b8269 100644 --- a/docs/docs/reference.md +++ b/docs/docs/reference.md @@ -145,7 +145,7 @@ The `models` section defines the language models used in your configuration. Mod - `apiBase`: Can be used to override the default API base that is specified per model - `roles`: An array specifying the roles this model can fulfill, such as `chat`, `autocomplete`, `embed`, `rerank`, `edit`, `apply`, `summarize`. The default value is `[chat, edit, apply, summarize]`. Note that the `summarize` role is not currently used. - `capabilities`: Array of strings denoting model capabilities, which will overwrite Continue's autodetection based on provider and model. Supported capabilities include `tool_use` and `image_input`. -- `promptTemplates`: Can be used to override the default prompt templates for different model roles. Valid values are [`edit`](./customize/model-roles/edit.mdx#prompt-templating) and [`apply`](./customize/model-roles/apply.mdx#prompt-templating). +- `promptTemplates`: Can be used to override the default prompt templates for different model roles. Valid values are [`edit`](./customize/model-roles/edit.mdx#prompt-templating), [`apply`](./customize/model-roles/apply.mdx#prompt-templating) and [autocomplete](./customize/model-roles/autocomplete.md#prompt-templating) - `chatOptions`: If the model includes role `chat`, these settings apply for Chat and Agent mode: - `baseSystemMessage`: Can be used to override the default system prompt. - `embedOptions`: If the model includes role `embed`, these settings apply for embeddings: