diff --git a/core/autocomplete/postprocessing/index.ts b/core/autocomplete/postprocessing/index.ts index 3504a069d..b78d32009 100644 --- a/core/autocomplete/postprocessing/index.ts +++ b/core/autocomplete/postprocessing/index.ts @@ -103,6 +103,16 @@ export function postprocessCompletion({ } } + if (llm.model.includes("qwen3")) { + // Qwen3 always starts from special thinking markers, and we don't want them to output these contents + // Remove all content from " + completion = completion.replace(/.*?<\/think>/s, ""); + completion = completion.replace(/<\/think>/, ""); + + // Remove any number of newline characters at the beginning and end + completion = completion.replace(/^\n+|\n+$/g, ""); + } + if (llm.model.includes("mercury") || llm.model.includes("granite")) { // Granite tends to repeat the start of the line in the completion output let prefixEnd = prefix.split("\n").pop(); diff --git a/core/package-lock.json b/core/package-lock.json index dc7ec2d63..ce4c2a7c8 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -142,7 +142,7 @@ }, "../packages/config-yaml": { "name": "@continuedev/config-yaml", - "version": "1.0.95", + "version": "1.0.96", "license": "Apache-2.0", "dependencies": { "@continuedev/config-types": "^1.0.14", @@ -169,9 +169,11 @@ }, "../packages/openai-adapters": { "name": "@continuedev/openai-adapters", - "version": "1.0.44", + "version": "1.0.45", "license": "Apache-2.0", "dependencies": { + "@aws-sdk/client-bedrock-runtime": "^3.842.0", + "@aws-sdk/credential-providers": "^3.840.0", "@continuedev/config-types": "^1.0.5", "@continuedev/config-yaml": "^1.0.51", "@continuedev/fetch": "^1.0.15", diff --git a/docs/customize/deep-dives/autocomplete.mdx b/docs/customize/deep-dives/autocomplete.mdx index 96070edaf..d1ea3635e 100644 --- a/docs/customize/deep-dives/autocomplete.mdx +++ b/docs/customize/deep-dives/autocomplete.mdx @@ -84,6 +84,30 @@ Then, add the model to your configuration: Once the model has been downloaded, you should begin to see completions in VS Code. +NOTE: Typically, thinking-type models are not recommended as they generate more slowly and are not suitable for scenarios that require speed. + +However, if you use any thinking-switchable models, you can configure these models for autocomplete functions by turning off the thinking mode. + +For example: + + + + ```yaml title="config.yaml" + models: + - name: Qwen3 without Thinking for Autocomplete + provider: ollama + model: qwen3:4b # qwen3 is a thinking-switchable model + roles: + - autocomplete + requestOptions: + extraBodyProperties: + think: false # turning off the thinking + ``` + + + +Then, in the continue panel, select this model as the default model for autocomplete. + ## Configuration Options ### Hub Autocomplete models @@ -138,12 +162,12 @@ Yes, in VS Code, if you don't want to be shown suggestions automatically you can This is a built-in feature of VS Code, but it's just a bit hidden. Follow these settings to reassign the keyboard shortcuts in VS Code: -1. Press `Ctrl+Shift+P`, type the command: `Preferences: Open Keyboard Shortcuts`, and enter the keyboard shortcuts settings page. +1. Press Ctrl+Shift+P, type the command: `Preferences: Open Keyboard Shortcuts`, and enter the keyboard shortcuts settings page. 2. Search for `editor.action.inlineSuggest.acceptNextLine`. -3. Set the key binding to `Tab`. +3. Set the key binding to Tab. 4. Set the trigger condition (when) to `inlineSuggestionVisible && !editorReadonly`. - This will make multi-line completion (including continue and from VS Code built-in or other plugin snippets) still work, and you will see multi-line completion. However, Tab will only fill in one line at a time. Any unnecessary code can be canceled with `Esc`. - If you need to apply all the code, just press `Tab` multiple times. + This will make multi-line completion (including continue and from VS Code built-in or other plugin snippets) still work, and you will see multi-line completion. However, Tab will only fill in one line at a time. Any unnecessary code can be canceled with Esc. + If you need to apply all the code, just press Tab multiple times. ### How to turn off autocomplete diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 6936cc88b..e0b5bb109 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "1.1.59", + "version": "1.1.60", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "1.1.59", + "version": "1.1.60", "license": "Apache-2.0", "dependencies": { "@continuedev/config-types": "^1.0.14", diff --git a/gui/package-lock.json b/gui/package-lock.json index a92523acc..d611543e2 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -220,7 +220,7 @@ }, "../packages/config-yaml": { "name": "@continuedev/config-yaml", - "version": "1.0.95", + "version": "1.0.96", "license": "Apache-2.0", "dependencies": { "@continuedev/config-types": "^1.0.14", diff --git a/packages/config-yaml/package-lock.json b/packages/config-yaml/package-lock.json index 014ecac95..51091ea04 100644 --- a/packages/config-yaml/package-lock.json +++ b/packages/config-yaml/package-lock.json @@ -1,12 +1,12 @@ { "name": "@continuedev/config-yaml", - "version": "1.0.95", + "version": "1.0.96", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@continuedev/config-yaml", - "version": "1.0.95", + "version": "1.0.96", "license": "Apache-2.0", "dependencies": { "@continuedev/config-types": "^1.0.14", diff --git a/packages/openai-adapters/package-lock.json b/packages/openai-adapters/package-lock.json index 2c71d9e7f..97d95ef12 100644 --- a/packages/openai-adapters/package-lock.json +++ b/packages/openai-adapters/package-lock.json @@ -1,12 +1,12 @@ { "name": "@continuedev/openai-adapters", - "version": "1.0.44", + "version": "1.0.45", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@continuedev/openai-adapters", - "version": "1.0.44", + "version": "1.0.45", "license": "Apache-2.0", "dependencies": { "@aws-sdk/client-bedrock-runtime": "^3.842.0",