Merge branch 'main' into preview

This commit is contained in:
Nate Sesti 2024-02-11 16:21:30 -08:00
commit 9082f8eb1d
18 changed files with 45 additions and 27 deletions

View file

@ -428,7 +428,7 @@ declare global {
| "gpt-4"
| "gpt-3.5-turbo-0613"
| "gpt-4-32k"
| "gpt-4-1106-preview"
| "gpt-4-turbo-preview"
// Open Source
| "mistral-7b"
| "mistral-8x7b"

2
core/index.d.ts vendored
View file

@ -460,7 +460,7 @@ export type ModelName =
| "gpt-4"
| "gpt-3.5-turbo-0613"
| "gpt-4-32k"
| "gpt-4-0125-preview"
| "gpt-4-turbo-preview"
| "gpt-4-vision-preview"
// Open Source
| "mistral-7b"

View file

@ -1,6 +1,5 @@
// NOTE: vectordb requirement must be listed in extensions/vscode to avoid error
import { v4 as uuidv4 } from "uuid";
import * as lancedb from "vectordb";
import { Chunk, EmbeddingsProvider, IndexingProgressUpdate } from "..";
import { MAX_CHUNK_SIZE } from "../llm/constants";
import { getBasename } from "../util";
@ -134,6 +133,7 @@ export class LanceDbIndex implements CodebaseIndex {
resultType: IndexResultType
) => void
): AsyncGenerator<IndexingProgressUpdate> {
const lancedb = await import("vectordb");
const tableName = this.tableNameForTag(tag);
const db = await lancedb.connect(getLanceDbPath());
@ -141,7 +141,7 @@ export class LanceDbIndex implements CodebaseIndex {
await this.createSqliteCacheTable(sqlite);
// Compute
let table: lancedb.Table | undefined = undefined;
let table = undefined;
let needToCreateTable = true;
const existingTables = await db.tableNames();
let computedRows: LanceDbRow[] = [];
@ -243,7 +243,7 @@ export class LanceDbIndex implements CodebaseIndex {
n: number,
directory: string | undefined,
vector: number[],
db: lancedb.Connection
db: any /// lancedb.Connection
): Promise<LanceDbRow[]> {
const tableName = this.tableNameForTag(tag);
const tableNames = await db.tableNames();
@ -269,6 +269,10 @@ export class LanceDbIndex implements CodebaseIndex {
n: number,
directory: string | undefined
): Promise<Chunk[]> {
const lancedb = await import("vectordb");
if (!lancedb.connect) {
throw new Error("LanceDB failed to load a native module");
}
const [vector] = await this.embeddingsProvider.embed([text]);
const db = await lancedb.connect(getLanceDbPath());

View file

@ -1,6 +1,5 @@
import { Database, open } from "sqlite";
import sqlite3 from "sqlite3";
import * as lancedb from "vectordb";
import { Chunk } from "../..";
import { getDocsSqlitePath, getLanceDbPath } from "../../util/paths";
@ -31,6 +30,7 @@ export async function retrieveDocs(
vector: number[],
nRetrieve: number
): Promise<Chunk[]> {
const lancedb = await import("vectordb");
const lance = await lancedb.connect(getLanceDbPath());
const table = await lance.openTable(DOCS_TABLE_NAME);
const docs: LanceDbDocsRow[] = await table
@ -68,6 +68,7 @@ export async function addDocs(
vector: embeddings[i],
}));
const lancedb = await import("vectordb");
const lance = await lancedb.connect(getLanceDbPath());
const tableNames = await lance.tableNames();
if (!tableNames.includes(DOCS_TABLE_NAME)) {

View file

@ -16,7 +16,7 @@ const CONTEXT_LENGTH_FOR_MODEL: { [name: string]: number } = {
"gpt-35-turbo-0613": 4096,
"gpt-35-turbo": 4096,
"gpt-4-32k": 32_768,
"gpt-4-1106-preview": 128_000,
"gpt-4-turbo-preview": 128_000,
"gpt-4-vision": 128_000,
"gpt-4-0125-preview": 128_000,
};

View file

@ -53,7 +53,7 @@ Instead of writing something like `Ollama(model="phind-codellama:34b", ...)`, wh
"gpt-4",
"gpt-3.5-turbo-0613",
"gpt-4-32k",
"gpt-4-1106-preview",
"gpt-4-turbo-preview",
# Open-Source
"mistral-7b",
"llama2-7b",

View file

@ -98,9 +98,9 @@ This exact function and a few other default implementations are available in [`c
You also have access to customize the prompt used in the '/edit' slash command. We already have a well-engineered prompt for GPT-4 and sensible defaults for less powerful open-source models, but you might wish to play with the prompt and try to find a more reliable alternative if you are for example getting English as well as code in your output.
To customize the prompt, use the `promptTemplates` property of any model, which is a dictionary, and set the "edit" key to a template string with Mustache syntax. The 'filePrefix', 'fileSuffix', 'codeToEdit', 'language', 'contextItems', and 'userInput' variables are available in the template. Here is an example:
To customize the prompt, use the `promptTemplates` property of any model, which is a dictionary, and set the "edit" key to a template string with Mustache syntax. The 'filePrefix', 'fileSuffix', 'codeToEdit', 'language', 'contextItems', and 'userInput' variables are available in the template. Here is an example of how it can be set in `config.ts`:
```typescript
```typescript title="~/.continue/config.ts"
const codellamaEditPrompt = `\`\`\`{{{language}}}
{{{codeToEdit}}}
\`\`\`
@ -109,13 +109,9 @@ const codellamaEditPrompt = `\`\`\`{{{language}}}
Your answer should be given inside of a code block. It should use the same kind of indentation as above.
[/INST] Sure! Here's the rewritten code you requested:
\`\`\`{{{language}}}`;
```
It can then be used like this in `config.ts`:
```typescript title="~/.continue/config.ts"
function modifyConfig(config: Config): Config {
config.models[0].promptTemplates["edit"] = "<INSERT_TEMPLATE_HERE>";
config.models[0].promptTemplates["edit"] = codellamaEditPrompt;
return config;
}
```

View file

@ -52,7 +52,7 @@ Instead of writing something like `Ollama(model="phind-codellama:34b", ...)`, wh
"gpt-4",
"gpt-3.5-turbo-0613",
"gpt-4-32k",
"gpt-4-1106-preview",
"gpt-4-turbo-preview",
# Open-Source
"mistral-7b",
"llama2-7b",

View file

@ -2,7 +2,7 @@
Continue now provides experimental support for tab autocomplete in VS Code. You can enable it by downloading the pre-release version of the extension, opening VS Code settings, and then checking the box that says "Enable Tab Autocomplete". There is also a button on the bottom/status bar for fast access. We will be greatly improving the experience over the next few releases, and it is always helpful to hear feedback. If you have any problems or suggestions, please let us know in our [Discord](https://discord.gg/vapESyrFmJ).
## Setting up with Ollama
## Setting up with Ollama (default)
We recommend setting up tab-autocomplete with a local Ollama instance. To do this, first download the latest version of Ollama from [here](https://ollama.ai). Then, run the following command to download our recommended model:
@ -12,6 +12,24 @@ ollama run deepseek-coder:1.3b-base
Once it has been downloaded, you should begin to see completions in VS Code.
## Setting up a custom model
All of the configuration options available for chat models are available to use for tab-autocomplete. For example, if you wanted to use a remote Ollama instance you would edit your `config.json` like this:
```json
{
"tabAutocompleteModel": {
"title": "Tab Autocomplete Model",
"provider": "ollama",
"model": "deepseek-coder:1.3b-base",
"apiBase": "https://<my endpoint>"
},
...
}
```
If you aren't yet familiar with the available options, you can learn more in our [overview](../model-setup/overview.md).
## Configuration Options
The following can be configured in `config.json`:

View file

@ -336,6 +336,7 @@
"gpt-3.5-turbo-0613",
"gpt-4-32k",
"gpt-4-0125-preview",
"gpt-4-turbo-preview",
"AUTODETECT"
]
}
@ -421,7 +422,7 @@
"gpt-4",
"gpt-3.5-turbo-0613",
"gpt-4-32k",
"gpt-4-0125-preview",
"gpt-4-turbo-preview",
"gpt-4-vision-preview",
"mistral-7b",
"mistral-8x7b",
@ -782,7 +783,7 @@
"gpt-4",
"gpt-3.5-turbo-0613",
"gpt-4-32k",
"gpt-4-0125-preview",
"gpt-4-turbo-preview",
"gpt-4-vision-preview",
"mistral-7b",
"mistral-8x7b",

View file

@ -336,6 +336,7 @@
"gpt-3.5-turbo-0613",
"gpt-4-32k",
"gpt-4-0125-preview",
"gpt-4-turbo-preview",
"AUTODETECT"
]
}
@ -421,7 +422,7 @@
"gpt-4",
"gpt-3.5-turbo-0613",
"gpt-4-32k",
"gpt-4-0125-preview",
"gpt-4-turbo-preview",
"gpt-4-vision-preview",
"mistral-7b",
"mistral-8x7b",
@ -782,7 +783,7 @@
"gpt-4",
"gpt-3.5-turbo-0613",
"gpt-4-32k",
"gpt-4-0125-preview",
"gpt-4-turbo-preview",
"gpt-4-vision-preview",
"mistral-7b",
"mistral-8x7b",

View file

@ -8,9 +8,6 @@
"name": "continue",
"version": "0.9.62",
"license": "Apache-2.0",
"dependencies": {
"@electron/rebuild": "^3.2.10",
"@reduxjs/toolkit": "^1.9.3",
"@types/jest": "^29.5.11",
"@types/node-fetch": "^2.6.11",
"@vscode/ripgrep": "^1.15.9",

View file

@ -479,9 +479,9 @@ const gpt4turbo: ModelPackage = {
description:
"A faster, cheaper version of GPT-4 with a longer context length",
params: {
model: "gpt-4-0125-preview",
model: "gpt-4-turbo-preview",
contextLength: 128_000,
title: "GPT-4 Turbo",
title: "gpt-4-turbo-preview",
},
providerOptions: ["openai", "freetrial"],
icon: "openai.png",

BIN
media/above-line-edit.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 MiB

BIN
media/autocomplete.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

BIN
media/image.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 MiB

BIN
media/scratch.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

View file

@ -6,7 +6,7 @@
"gpt-4",
"gpt-3.5-turbo-0613",
"gpt-4-32k",
"gpt-4-1106-preview",
"gpt-4-turbo-preview",
"mistral-7b",
"llama2-7b",
"llama2-13b",