From 6bcb3dcb7158ccb9674f79978b343312f9ad8a31 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 19 Jul 2023 09:52:39 -0700 Subject: patch --- extension/package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'extension/package-lock.json') diff --git a/extension/package-lock.json b/extension/package-lock.json index 6818857b..bc2824c4 100644 --- a/extension/package-lock.json +++ b/extension/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.0.181", + "version": "0.0.182", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "continue", - "version": "0.0.181", + "version": "0.0.182", "license": "Apache-2.0", "dependencies": { "@electron/rebuild": "^3.2.10", -- cgit v1.2.3-70-g09d2 From 2f777ea933d4a41b600feedeff7d85257c5b136d Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 19 Jul 2023 18:45:46 -0700 Subject: transparent bg fix --- extension/package-lock.json | 4 ++-- extension/package.json | 2 +- extension/react-app/src/components/ComboBox.tsx | 3 +-- extension/react-app/src/components/PillButton.tsx | 2 ++ extension/src/commands.ts | 3 +++ 5 files changed, 9 insertions(+), 5 deletions(-) (limited to 'extension/package-lock.json') diff --git a/extension/package-lock.json b/extension/package-lock.json index bc2824c4..3f9ff3aa 100644 --- a/extension/package-lock.json +++ b/extension/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.0.182", + "version": "0.0.184", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "continue", - "version": "0.0.182", + "version": "0.0.184", "license": "Apache-2.0", "dependencies": { "@electron/rebuild": "^3.2.10", diff --git a/extension/package.json b/extension/package.json index 2998b148..72afa46f 100644 --- a/extension/package.json +++ b/extension/package.json @@ -14,7 +14,7 @@ "displayName": "Continue", "pricing": "Free", "description": "The open-source coding autopilot", - "version": "0.0.182", + "version": "0.0.184", "publisher": "Continue", "engines": { "vscode": "^1.67.0" diff --git a/extension/react-app/src/components/ComboBox.tsx b/extension/react-app/src/components/ComboBox.tsx index f327e3a3..1e2ca135 100644 --- a/extension/react-app/src/components/ComboBox.tsx +++ b/extension/react-app/src/components/ComboBox.tsx @@ -71,7 +71,6 @@ const Ul = styled.ul<{ : `transform: translateY(${2 * mainInputFontSize}px);`} position: absolute; background: ${vscBackground}; - background-color: ${secondaryDark}; color: ${vscForeground}; max-height: ${UlMaxHeight}px; width: calc(100% - 16px); @@ -96,7 +95,7 @@ const Li = styled.li<{ selected: boolean; isLastItem: boolean; }>` - background-color: ${secondaryDark}; + background-color: ${vscBackground}; ${({ highlighted }) => highlighted && "background: #ff000066;"} ${({ selected }) => selected && "font-weight: bold;"} padding: 0.5rem 0.75rem; diff --git a/extension/react-app/src/components/PillButton.tsx b/extension/react-app/src/components/PillButton.tsx index c24dba83..5929d06a 100644 --- a/extension/react-app/src/components/PillButton.tsx +++ b/extension/react-app/src/components/PillButton.tsx @@ -4,6 +4,7 @@ import { StyledTooltip, defaultBorderRadius, secondaryDark, + vscBackground, vscForeground, } from "."; import { @@ -113,6 +114,7 @@ const PillButton = (props: PillButtonProps) => { {props.onlyShowDelete || ( diff --git a/extension/src/commands.ts b/extension/src/commands.ts index 2b7f4c0c..1da2f04e 100644 --- a/extension/src/commands.ts +++ b/extension/src/commands.ts @@ -40,6 +40,9 @@ const commandsMap: { [command: string]: (...args: any) => any } = { edit ? "/edit " : "" }${code}\n\nHow do I fix this problem in the above code?: ${message}` ); + if (!edit) { + vscode.commands.executeCommand("continue.continueGUIView.focus"); + } }, "continue.focusContinueInput": async () => { if (focusedOnContinueInput) { -- cgit v1.2.3-70-g09d2 From 67b1e77e9dc2134e63a0e2d87524db2260ad817a Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Thu, 20 Jul 2023 12:21:07 -0700 Subject: patch --- extension/package-lock.json | 4 ++-- extension/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'extension/package-lock.json') diff --git a/extension/package-lock.json b/extension/package-lock.json index 3f9ff3aa..d37a29a7 100644 --- a/extension/package-lock.json +++ b/extension/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.0.184", + "version": "0.0.185", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "continue", - "version": "0.0.184", + "version": "0.0.185", "license": "Apache-2.0", "dependencies": { "@electron/rebuild": "^3.2.10", diff --git a/extension/package.json b/extension/package.json index 72afa46f..a5b0a7b6 100644 --- a/extension/package.json +++ b/extension/package.json @@ -14,7 +14,7 @@ "displayName": "Continue", "pricing": "Free", "description": "The open-source coding autopilot", - "version": "0.0.184", + "version": "0.0.185", "publisher": "Continue", "engines": { "vscode": "^1.67.0" -- cgit v1.2.3-70-g09d2 From 883219874035f46ca3409901ea186493a2ce46a5 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Thu, 20 Jul 2023 16:47:15 -0700 Subject: patch --- extension/package-lock.json | 4 ++-- extension/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'extension/package-lock.json') diff --git a/extension/package-lock.json b/extension/package-lock.json index d37a29a7..7ca62d4a 100644 --- a/extension/package-lock.json +++ b/extension/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.0.185", + "version": "0.0.186", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "continue", - "version": "0.0.185", + "version": "0.0.186", "license": "Apache-2.0", "dependencies": { "@electron/rebuild": "^3.2.10", diff --git a/extension/package.json b/extension/package.json index a5b0a7b6..76b80ed7 100644 --- a/extension/package.json +++ b/extension/package.json @@ -14,7 +14,7 @@ "displayName": "Continue", "pricing": "Free", "description": "The open-source coding autopilot", - "version": "0.0.185", + "version": "0.0.186", "publisher": "Continue", "engines": { "vscode": "^1.67.0" -- cgit v1.2.3-70-g09d2 From 0cd32ba813f5506c0871159658728b8ce31825e1 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Fri, 21 Jul 2023 01:49:28 -0700 Subject: fix for top-of-file pruning in default edit step --- continuedev/src/continuedev/steps/core/core.py | 14 +++++++------- extension/package-lock.json | 4 ++-- extension/package.json | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'extension/package-lock.json') diff --git a/continuedev/src/continuedev/steps/core/core.py b/continuedev/src/continuedev/steps/core/core.py index 4afc36e8..98600f8b 100644 --- a/continuedev/src/continuedev/steps/core/core.py +++ b/continuedev/src/continuedev/steps/core/core.py @@ -220,13 +220,13 @@ class DefaultModelEditCodeStep(Step): if total_tokens < MAX_TOKENS_FOR_MODEL[model_to_use.name]: break - if total_tokens > MAX_TOKENS_FOR_MODEL[model_to_use.name]: - while cur_start_line < max_start_line: - cur_start_line += 1 - total_tokens -= model_to_use.count_tokens( - full_file_contents_lst[cur_end_line]) - if total_tokens < MAX_TOKENS_FOR_MODEL[model_to_use.name]: - break + if total_tokens > MAX_TOKENS_FOR_MODEL[model_to_use.name]: + while cur_start_line < max_start_line: + cur_start_line += 1 + total_tokens -= model_to_use.count_tokens( + full_file_contents_lst[cur_start_line]) + if total_tokens < MAX_TOKENS_FOR_MODEL[model_to_use.name]: + break # Now use the found start/end lines to get the prefix and suffix strings file_prefix = "\n".join( diff --git a/extension/package-lock.json b/extension/package-lock.json index 7ca62d4a..d44b84c4 100644 --- a/extension/package-lock.json +++ b/extension/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.0.186", + "version": "0.0.187", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "continue", - "version": "0.0.186", + "version": "0.0.187", "license": "Apache-2.0", "dependencies": { "@electron/rebuild": "^3.2.10", diff --git a/extension/package.json b/extension/package.json index 76b80ed7..34bc8bc4 100644 --- a/extension/package.json +++ b/extension/package.json @@ -14,7 +14,7 @@ "displayName": "Continue", "pricing": "Free", "description": "The open-source coding autopilot", - "version": "0.0.186", + "version": "0.0.187", "publisher": "Continue", "engines": { "vscode": "^1.67.0" -- cgit v1.2.3-70-g09d2 From b97ceee5cad5f3a645f067353aa33c17dfcf0a60 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Fri, 21 Jul 2023 16:43:17 -0700 Subject: notify to reload window after changing settings --- extension/package-lock.json | 4 ++-- extension/package.json | 2 +- extension/src/continueIdeClient.ts | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) (limited to 'extension/package-lock.json') diff --git a/extension/package-lock.json b/extension/package-lock.json index d44b84c4..5c8e27d0 100644 --- a/extension/package-lock.json +++ b/extension/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.0.187", + "version": "0.0.188", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "continue", - "version": "0.0.187", + "version": "0.0.188", "license": "Apache-2.0", "dependencies": { "@electron/rebuild": "^3.2.10", diff --git a/extension/package.json b/extension/package.json index 34bc8bc4..3d44c156 100644 --- a/extension/package.json +++ b/extension/package.json @@ -14,7 +14,7 @@ "displayName": "Continue", "pricing": "Free", "description": "The open-source coding autopilot", - "version": "0.0.187", + "version": "0.0.188", "publisher": "Continue", "engines": { "vscode": "^1.67.0" diff --git a/extension/src/continueIdeClient.ts b/extension/src/continueIdeClient.ts index a1370a01..3a42e773 100644 --- a/extension/src/continueIdeClient.ts +++ b/extension/src/continueIdeClient.ts @@ -167,6 +167,20 @@ class IdeProtocolClient { documentContentProvider ) ); + + // Listen for changes to settings.json + vscode.workspace.onDidChangeConfiguration((event) => { + if (event.affectsConfiguration("continue")) { + vscode.window.showInformationMessage( + "Please reload VS Code for changes to Continue settings to take effect.", + "Reload" + ).then((selection) => { + if (selection === "Reload") { + vscode.commands.executeCommand("workbench.action.reloadWindow"); + } + }); + } + }); } async handleMessage( -- cgit v1.2.3-70-g09d2 From 0ad32bd6dfaf96af0a2db82fb2b06c200e131e62 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Sat, 22 Jul 2023 12:14:07 -0700 Subject: how to use private model docs and button --- docs/docs/customization.md | 124 ++++++++++++++++++++++ docs/sidebars.js | 10 +- extension/package-lock.json | 4 +- extension/package.json | 2 +- extension/react-app/src/components/TextDialog.tsx | 60 ++++++----- extension/react-app/src/pages/gui.tsx | 40 +++---- 6 files changed, 189 insertions(+), 51 deletions(-) create mode 100644 docs/docs/customization.md (limited to 'extension/package-lock.json') diff --git a/docs/docs/customization.md b/docs/docs/customization.md new file mode 100644 index 00000000..cd306cfe --- /dev/null +++ b/docs/docs/customization.md @@ -0,0 +1,124 @@ +# Customization + +Continue can be deeply customized by editing the `ContinueConfig` object in `~/.continue/config.py` on your machine. This file is created the first time you run Continue. + +## Change the default LLM + +Change the `default_model` field to any of "gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-4", "claude-2", or "ggml". + +### claude-2 and gpt-X + +If you have access, simply set `default_model` to the model you would like to use, then you will be prompted for a personal API key after reloading VS Code. If using an OpenAI model, you can press enter to try with our API key for free. + +### Local models with ggml + +See our [5 minute quickstart](https://github.com/continuedev/ggml-server-example) to run any model locally with ggml. While these models don't yet perform as well, they are free, entirely private, and run offline. + +### Azure OpenAI Service + +If you'd like to use OpenAI models but are concerned about privacy, you can use the Azure OpenAI service, which is GDPR and HIPAA compliant. After applying for access [here](https://azure.microsoft.com/en-us/products/ai-services/openai-service), you will typically hear back within only a few days. Once you have access, set `default_model` to "gpt-4", and then set the `azure_openai_info` property in the `ContinueConfig` like so: + +```python +config = ContinueConfig( + ... + azure_openai_info=AzureInfo( + endpoint="https://my-azure-openai-instance.openai.azure.com/", + engine="my-azure-openai-deployment", + api_version="2023-03-15-preview" + ) +) +``` + +The easiest way to find this information is from the chat playground in the Azure OpenAI portal. Under the "Chat Session" section, click "View Code" to see each of these parameters. Finally, find one of your Azure OpenAI keys and enter it in the VS Code settings under `continue.OPENAI_API_KEY`. + +## Customize System Message + +You can write your own system message, a set of instructions that will always be top-of-mind for the LLM, by setting the `system_message` property to any string. For example, you might request "Please make all responses as concise as possible and never repeat something you have already explained." + +System messages can also reference files. For example, if there is a markdown file (e.g. at `/Users/nate/Documents/docs/reference.md`) you'd like the LLM to know about, you can reference it with [Mustache](http://mustache.github.io/mustache.5.html) templating like this: "Please reference this documentation: {{ Users/nate/Documents/docs/reference.md }}". As of now, you must use an absolute path. + +## Custom Commands + +You can add custom slash commands by adding a `CustomCommand` object to the `custom_commands` property. Each `CustomCommand` has + +- `name`: the name of the command, which will be invoked with `/name` +- `description`: a short description of the command, which will appear in the dropdown +- `prompt`: a set of instructions to the LLM, which will be shown in the prompt + +Custom commands are great when you are frequently reusing a prompt. For example, if you've crafted a great prompt and frequently ask the LLM to check for mistakes in your code, you could add a command like this: + +```python +config = ContinueConfig( + ... + custom_commands=[ + CustomCommand( + name="check", + description="Check for mistakes in my code", + prompt=dedent("""\ + Please read the highlighted code and check for any mistakes. You should look for the following, and be extremely vigilant: + - Syntax errors + - Logic errors + - Security vulnerabilities + - Performance issues + - Anything else that looks wrong + + Once you find an error, please explain it as clearly as possible, but without using extra words. For example, instead of saying "I think there is a syntax error on line 5", you should say "Syntax error on line 5". Give your answer as one bullet point per mistake found.""") + ) + ] +) +``` + +## Temperature + +Set `temperature` to any value between 0 and 1. Higher values will make the LLM more creative, while lower values will make it more predictable. The default is 0.5. + +## Custom Context Providers + +When you type '@' in the Continue text box, it will display a dropdown of items that can be selected to include in your message as context. For example, you might want to reference a GitHub Issue, file, or Slack thread. All of these options are provided by a `ContextProvider` class, and we make it easy to write your own. As an example, here is the `GitHubIssuesContextProvider`, which lets you search all open GitHub Issues in a repo: + +```python +class GitHubIssuesContextProvider(ContextProvider): + """ + The GitHubIssuesContextProvider is a ContextProvider that allows you to search GitHub Issues in a repo. + """ + + title = "issues" + repo_name: str + auth_token: str + + async def provide_context_items(self) -> List[ContextItem]: + auth = Auth.Token(self.auth_token) + gh = Github(auth=auth) + + repo = gh.get_repo(self.repo_name) + issues = repo.get_issues().get_page(0) + + items = [ContextItem( + content=issue.body, + description=ContextItemDescription( + name=f"Issue #{issue.number}", + description=issue.title, + id=ContextItemId( + provider_title=self.title, + item_id=issue.id + ) + ) + ) for issue in issues] + self.context_items = { + item.description.id.to_string(): item for item in items} + return items +``` + +It can then be set in the `ContinueConfig` like so: + +```python +config = ContinueConfig( + ... + context_providers=[ + GitHubIssuesContextProvider( + repo_name="my-github-username-or-org/my-github-repo", + auth_token="my-github-auth-token" + ) + ] +) +``` diff --git a/docs/sidebars.js b/docs/sidebars.js index 9baf1b94..83b34ee8 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -13,7 +13,15 @@ /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ const sidebars = { - docsSidebar: ["intro", "getting-started", "how-to-use-continue", "how-continue-works", "telemetry", "collecting-data"], + docsSidebar: [ + "intro", + "getting-started", + "how-to-use-continue", + "how-continue-works", + "telemetry", + "collecting-data", + "customization", + ], }; module.exports = sidebars; diff --git a/extension/package-lock.json b/extension/package-lock.json index 5c8e27d0..933da12b 100644 --- a/extension/package-lock.json +++ b/extension/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.0.188", + "version": "0.0.189", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "continue", - "version": "0.0.188", + "version": "0.0.189", "license": "Apache-2.0", "dependencies": { "@electron/rebuild": "^3.2.10", diff --git a/extension/package.json b/extension/package.json index 3d44c156..08737ff4 100644 --- a/extension/package.json +++ b/extension/package.json @@ -14,7 +14,7 @@ "displayName": "Continue", "pricing": "Free", "description": "The open-source coding autopilot", - "version": "0.0.188", + "version": "0.0.189", "publisher": "Continue", "engines": { "vscode": "^1.67.0" diff --git a/extension/react-app/src/components/TextDialog.tsx b/extension/react-app/src/components/TextDialog.tsx index cba3852d..9597b578 100644 --- a/extension/react-app/src/components/TextDialog.tsx +++ b/extension/react-app/src/components/TextDialog.tsx @@ -3,6 +3,7 @@ import React, { useEffect, useState } from "react"; import styled from "styled-components"; import { Button, secondaryDark, vscBackground, vscForeground } from "."; import { isMetaEquivalentKeyPressed } from "../util"; +import { ReactMarkdown } from "react-markdown/lib/react-markdown"; const ScreenCover = styled.div` position: absolute; @@ -56,6 +57,7 @@ const TextDialog = (props: { onEnter: (text: string) => void; onClose: () => void; message?: string; + entryOn?: boolean; }) => { const [text, setText] = useState(""); const textAreaRef = React.createRef(); @@ -79,33 +81,37 @@ const TextDialog = (props: { }} > -

{props.message || ""}

-