diff --git a/binary/package-lock.json b/binary/package-lock.json
index 2d1439878..4cf2af206 100644
--- a/binary/package-lock.json
+++ b/binary/package-lock.json
@@ -13,10 +13,13 @@
"commander": "^12.0.0",
"core": "file:../core",
"follow-redirects": "^1.15.5",
+ "mac-ca": "^2.0.3",
"ncp": "^2.0.0",
"posthog-node": "^3.6.3",
+ "system-ca": "^1.0.2",
"uuid": "^9.0.1",
- "vectordb": "^0.4.10"
+ "vectordb": "^0.4.10",
+ "win-ca": "^3.5.1"
},
"bin": {
"binary": "out/index.js"
@@ -68,7 +71,7 @@
"socket.io-client": "^4.7.3",
"sqlite": "^5.1.1",
"sqlite3": "^5.1.7",
- "tree-sitter-wasms": "^0.1.6",
+ "tree-sitter-wasms": "^0.1.11",
"uuid": "^9.0.1",
"vectordb": "0.4.12",
"web-tree-sitter": "^0.21.0"
@@ -1015,6 +1018,15 @@
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz",
"integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ=="
},
+ "node_modules/bindings": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
+ "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
+ "optional": true,
+ "dependencies": {
+ "file-uri-to-path": "1.0.0"
+ }
+ },
"node_modules/bl": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
@@ -1387,6 +1399,12 @@
"reusify": "^1.0.4"
}
},
+ "node_modules/file-uri-to-path": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
+ "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
+ "optional": true
+ },
"node_modules/fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
@@ -1653,6 +1671,11 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/is-electron": {
+ "version": "2.2.2",
+ "resolved": "https://registry.npmjs.org/is-electron/-/is-electron-2.2.2.tgz",
+ "integrity": "sha512-FO/Rhvz5tuw4MCWkpMzHFKWD2LsfHzIb7i6MdPYZ/KW7AlxawyLkqdy+jPZP1WubqEADE3O4FUENlJHDfQASRg=="
+ },
"node_modules/is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
@@ -1755,6 +1778,39 @@
"node": ">=10"
}
},
+ "node_modules/mac-ca": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/mac-ca/-/mac-ca-2.0.3.tgz",
+ "integrity": "sha512-FkcNXYdUzfNEElPoYYLDHOXPCQePj4iK7Ir4OYy6Tr7yAUS2bFud4Uh1QdIsATDwRQN/miNUyZEltX2nA/tDAQ==",
+ "dependencies": {
+ "node-forge": "^1.3.1"
+ }
+ },
+ "node_modules/macos-export-certificate-and-key": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/macos-export-certificate-and-key/-/macos-export-certificate-and-key-1.1.1.tgz",
+ "integrity": "sha512-J2g0dJRLG3DghmdCkbJnif/zPmSylj6ql//xBYff5allzNlHPnWxRoyho9XznBYLbPJw4jZlKjMO69jtV8VC7Q==",
+ "hasInstallScript": true,
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "dependencies": {
+ "bindings": "^1.5.0",
+ "node-addon-api": "^4.3.0"
+ }
+ },
+ "node_modules/make-dir": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
+ "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==",
+ "dependencies": {
+ "pify": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
"node_modules/merge2": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
@@ -1893,6 +1949,12 @@
"node": ">=10"
}
},
+ "node_modules/node-addon-api": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz",
+ "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==",
+ "optional": true
+ },
"node_modules/node-fetch": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
@@ -1913,6 +1975,14 @@
}
}
},
+ "node_modules/node-forge": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz",
+ "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==",
+ "engines": {
+ "node": ">= 6.13.0"
+ }
+ },
"node_modules/once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
@@ -1969,6 +2039,14 @@
"url": "https://github.com/sponsors/jonschlinkert"
}
},
+ "node_modules/pify": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+ "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
"node_modules/pkg": {
"version": "5.8.1",
"resolved": "https://registry.npmjs.org/pkg/-/pkg-5.8.1.tgz",
@@ -2299,6 +2377,17 @@
"node": ">=8"
}
},
+ "node_modules/split": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz",
+ "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==",
+ "dependencies": {
+ "through": "2"
+ },
+ "engines": {
+ "node": "*"
+ }
+ },
"node_modules/stream-meter": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/stream-meter/-/stream-meter-1.0.4.tgz",
@@ -2384,6 +2473,15 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/system-ca": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/system-ca/-/system-ca-1.0.2.tgz",
+ "integrity": "sha512-/6CCJOKB5Fpi0x7/DCbV7uiFPgwGCeJsAaSondXS2DjLBv7ER2worVGvQWJqPM0kgOKO6auaCcSWpJKnrDmXjw==",
+ "optionalDependencies": {
+ "macos-export-certificate-and-key": "^1.1.1",
+ "win-export-certificate-and-key": "^1.1.1"
+ }
+ },
"node_modules/table-layout": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/table-layout/-/table-layout-3.0.2.tgz",
@@ -2465,6 +2563,11 @@
"node": ">= 6"
}
},
+ "node_modules/through": {
+ "version": "2.3.8",
+ "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
+ "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg=="
+ },
"node_modules/to-fast-properties": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
@@ -2609,6 +2712,33 @@
"webidl-conversions": "^3.0.0"
}
},
+ "node_modules/win-ca": {
+ "version": "3.5.1",
+ "resolved": "https://registry.npmjs.org/win-ca/-/win-ca-3.5.1.tgz",
+ "integrity": "sha512-RNy9gpBS6cxWHjfbqwBA7odaHyT+YQNhtdpJZwYCFoxB/Dq22oeOZ9YCXMwjhLytKpo7JJMnKdJ/ve7N12zzfQ==",
+ "hasInstallScript": true,
+ "dependencies": {
+ "is-electron": "^2.2.0",
+ "make-dir": "^1.3.0",
+ "node-forge": "^1.2.1",
+ "split": "^1.0.1"
+ }
+ },
+ "node_modules/win-export-certificate-and-key": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/win-export-certificate-and-key/-/win-export-certificate-and-key-1.1.1.tgz",
+ "integrity": "sha512-wvF1DKlbt/PLOSdnKzIqv0Ipj+87n2VYOJFbkqBoN7l3l244reT7Lf6+Dnu86bYVWoVpq3ZZG417OLNHFnkP6A==",
+ "hasInstallScript": true,
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "dependencies": {
+ "bindings": "^1.5.0",
+ "node-addon-api": "^4.3.0",
+ "node-forge": "^1.2.1"
+ }
+ },
"node_modules/wordwrapjs": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-5.1.0.tgz",
diff --git a/binary/package.json b/binary/package.json
index d821cd3fe..eed56f17c 100644
--- a/binary/package.json
+++ b/binary/package.json
@@ -41,9 +41,12 @@
"commander": "^12.0.0",
"core": "file:../core",
"follow-redirects": "^1.15.5",
+ "mac-ca": "^2.0.3",
"ncp": "^2.0.0",
"posthog-node": "^3.6.3",
+ "system-ca": "^1.0.2",
"uuid": "^9.0.1",
- "vectordb": "^0.4.10"
+ "vectordb": "^0.4.10",
+ "win-ca": "^3.5.1"
}
}
diff --git a/binary/src/ca.ts b/binary/src/ca.ts
new file mode 100644
index 000000000..9767c556b
--- /dev/null
+++ b/binary/src/ca.ts
@@ -0,0 +1,23 @@
+import { globalAgent } from "https";
+import { systemCertsAsync } from "system-ca";
+
+export async function setupCa() {
+ try {
+ switch (process.platform) {
+ case "darwin":
+ // https://www.npmjs.com/package/mac-ca#usage
+ require("mac-ca").addToGlobalAgent();
+ break;
+ case "win32":
+ // https://www.npmjs.com/package/win-ca#caveats
+ require("win-ca").inject("+");
+ break;
+ default:
+ // https://www.npmjs.com/package/system-ca
+ globalAgent.options.ca = await systemCertsAsync();
+ break;
+ }
+ } catch (e) {
+ console.warn("Failed to setup CA: ", e);
+ }
+}
diff --git a/binary/src/core.ts b/binary/src/core.ts
index 8cded9f25..63caec347 100644
--- a/binary/src/core.ts
+++ b/binary/src/core.ts
@@ -90,7 +90,7 @@ export class Core {
// History
on("history/list", (msg) => {
- return historyManager.list();
+ return historyManager.list(msg.data);
});
on("history/delete", (msg) => {
historyManager.delete(msg.data.id);
diff --git a/binary/src/index.ts b/binary/src/index.ts
index 4f6c8448e..de600d15f 100644
--- a/binary/src/index.ts
+++ b/binary/src/index.ts
@@ -3,6 +3,7 @@ import { Command } from "commander";
import { getCoreLogsPath } from "core/util/paths";
import fs from "fs";
import { IpcIde } from "./IpcIde";
+import { setupCa } from "./ca";
import { Core } from "./core";
import { IpcMessenger } from "./messenger";
@@ -18,6 +19,8 @@ program.action(() => {
// const ide = new FileSystemIde();
const core = new Core(messenger, ide);
+ setupCa();
+
// setTimeout(() => {
// messenger.mock({
// messageId: "2fe7823c-10bd-4771-abb5-781f520039ec",
diff --git a/binary/src/messenger.ts b/binary/src/messenger.ts
index f8f02a7f9..1e2d3a745 100644
--- a/binary/src/messenger.ts
+++ b/binary/src/messenger.ts
@@ -80,14 +80,31 @@ export class IpcMessenger {
// Call handler which is waiting for the response, nothing to return
this.idListeners.get(msg.messageId)?.(msg);
} catch (e) {
- console.error("Error parsing line: ", line, e);
+ let truncatedLine = line;
+ if (line.length > 200) {
+ truncatedLine =
+ line.substring(0, 100) + "..." + line.substring(line.length - 100);
+ }
+ console.error("Error parsing line: ", truncatedLine, e);
return;
}
}
+ private _unfinishedLine: string | undefined = undefined;
private _handleData(data: Buffer) {
const d = data.toString();
- const lines = d.split(/\r\n|\r|\n/).filter((line) => line.trim() !== "");
+ const lines = d.split(/\r\n/).filter((line) => line.trim() !== "");
+ if (lines.length === 0) {
+ return;
+ }
+
+ if (this._unfinishedLine) {
+ lines[0] = this._unfinishedLine + lines[0];
+ this._unfinishedLine = undefined;
+ }
+ if (!d.endsWith("\r\n")) {
+ this._unfinishedLine = lines.pop();
+ }
lines.forEach((line) => this._handleLine(line));
}
diff --git a/core/autocomplete/completionProvider.ts b/core/autocomplete/completionProvider.ts
index dadacf6f1..f765b115a 100644
--- a/core/autocomplete/completionProvider.ts
+++ b/core/autocomplete/completionProvider.ts
@@ -1,4 +1,6 @@
import Handlebars from "handlebars";
+import ignore from "ignore";
+import path from "path";
import { v4 as uuidv4 } from "uuid";
import { IDE, ILLM, Position, TabAutocompleteOptions } from "..";
import { RangeInFileWithContents } from "../commands/util";
@@ -79,6 +81,8 @@ function formatExternalSnippet(
return lines.join("\n");
}
+let shownGptClaudeWarning = false;
+
export async function getTabCompletion(
token: AbortSignal,
options: TabAutocompleteOptions,
@@ -115,6 +119,7 @@ export async function getTabCompletion(
}
// Model
+ if (!llm) return;
if (llm instanceof OpenAI) {
llm.useLegacyCompletionsEndpoint = true;
} else if (
@@ -125,7 +130,16 @@ export async function getTabCompletion(
"The only free trial model supported for tab-autocomplete is starcoder-7b.",
);
}
- if (!llm) return;
+
+ if (
+ !shownGptClaudeWarning &&
+ (llm.model.includes("gpt") || llm.model.includes("claude"))
+ ) {
+ shownGptClaudeWarning = true;
+ throw new Error(
+ `Warning: ${llm.model} is not trained for tab-autocomplete, and will result in low-quality suggestions. See the docs to learn more about why: https://continue.dev/docs/walkthroughs/tab-autocomplete#i-want-better-completions-should-i-use-gpt-4`,
+ );
+ }
// Prompt
const fullPrefix = getRangeInString(fileContents, {
@@ -367,13 +381,6 @@ export class CompletionProvider {
input: AutocompleteInput,
token: AbortSignal | undefined,
): Promise {
- // Create abort signal if not given
- if (!token) {
- const controller = new AbortController();
- token = controller.signal;
- this._abortControllers.set(input.completionId, controller);
- }
-
try {
// Debounce
const uuid = uuidv4();
@@ -385,6 +392,36 @@ export class CompletionProvider {
...config.tabAutocompleteOptions,
};
+ // Check whether autocomplete is disabled for this file
+ if (options.disableInFiles) {
+ // Relative path needed for `ignore`
+ const workspaceDirs = await this.ide.getWorkspaceDirs();
+ let filepath = input.filepath;
+ for (const workspaceDir of workspaceDirs) {
+ if (filepath.startsWith(workspaceDir)) {
+ filepath = path.relative(workspaceDir, filepath);
+ break;
+ }
+ }
+
+ // Worst case we can check filetype glob patterns
+ if (filepath === input.filepath) {
+ filepath = getBasename(filepath);
+ }
+
+ const pattern = ignore().add(options.disableInFiles);
+ if (pattern.ignores(filepath)) {
+ return undefined;
+ }
+ }
+
+ // Create abort signal if not given
+ if (!token) {
+ const controller = new AbortController();
+ token = controller.signal;
+ this._abortControllers.set(input.completionId, controller);
+ }
+
// Allow disabling autocomplete from config.json
if (options.disable) {
return undefined;
diff --git a/core/commands/index.ts b/core/commands/index.ts
index ff0dc35db..5cef3ccb7 100644
--- a/core/commands/index.ts
+++ b/core/commands/index.ts
@@ -1,43 +1,58 @@
import { CustomCommand, SlashCommand, SlashCommandDescription } from "..";
import { stripImages } from "../llm/countTokens";
+import { renderTemplatedString } from "../llm/llms";
import SlashCommands from "./slash";
export function slashFromCustomCommand(
- customCommand: CustomCommand,
+ customCommand: CustomCommand,
): SlashCommand {
- return {
- name: customCommand.name,
- description: customCommand.description,
- run: async function* ({ input, llm, history }) {
- const promptUserInput = `Task: ${customCommand.prompt}. Additional info: ${input}`;
- const messages = [...history];
- // Find the last chat message with this slash command and replace it with the user input
- for (let i = messages.length - 1; i >= 0; i--) {
- if (
- messages[i].role === "user" &&
- stripImages(messages[i].content).startsWith(`/${customCommand.name}`)
- ) {
- messages[i] = { ...messages[i], content: promptUserInput };
- break;
- }
- }
+ return {
+ name: customCommand.name,
+ description: customCommand.description,
+ run: async function* ({ input, llm, history, ide }) {
+ // Remove slash command prefix from input
+ let userInput = input;
+ if (userInput.startsWith(`/${customCommand.name}`)) {
+ userInput = userInput
+ .slice(customCommand.name.length + 1, userInput.length)
+ .trimStart();
+ }
- for await (const chunk of llm.streamChat(messages)) {
- yield stripImages(chunk.content);
- }
- },
- };
+ // Render prompt template
+ const promptUserInput = await renderTemplatedString(
+ customCommand.prompt,
+ ide.readFile.bind(ide),
+ { input: userInput },
+ );
+
+ const messages = [...history];
+ // Find the last chat message with this slash command and replace it with the user input
+ for (let i = messages.length - 1; i >= 0; i--) {
+ if (
+ messages[i].role === "user" &&
+ stripImages(messages[i].content).startsWith(`/${customCommand.name}`)
+ ) {
+ messages[i] = { ...messages[i], content: promptUserInput };
+ break;
+ }
+ }
+
+ for await (const chunk of llm.streamChat(messages)) {
+ yield stripImages(chunk.content);
+ }
+ },
+ };
}
export function slashCommandFromDescription(
- desc: SlashCommandDescription,
+ desc: SlashCommandDescription,
): SlashCommand | undefined {
- const cmd = SlashCommands.find((cmd) => cmd.name === desc.name);
- if (!cmd) {
- return undefined;
- }
- return {
- ...cmd,
- params: desc.params,
- };
+ const cmd = SlashCommands.find((cmd) => cmd.name === desc.name);
+ if (!cmd) {
+ return undefined;
+ }
+ return {
+ ...cmd,
+ params: desc.params,
+ };
}
diff --git a/core/config/default.ts b/core/config/default.ts
index e27c674ff..adae7fe60 100644
--- a/core/config/default.ts
+++ b/core/config/default.ts
@@ -8,9 +8,9 @@ export const defaultConfig: SerializedContinueConfig = {
model: "claude-3-sonnet-20240229",
},
{
- title: "GPT-4 Vision (Free Trial)",
+ title: "GPT-4 Turbo (Free Trial)",
provider: "free-trial",
- model: "gpt-4-vision-preview",
+ model: "gpt-4-turbo",
},
{
title: "GPT-3.5-Turbo (Free Trial)",
@@ -55,13 +55,13 @@ export const defaultConfig: SerializedContinueConfig = {
},
],
contextProviders: [
+ { name: "code", params: {} },
+ { name: "docs", params: {} },
{ name: "diff", params: {} },
- {
- name: "open",
- params: {},
- },
+ { name: "open", params: {} },
{ name: "terminal", params: {} },
{ name: "problems", params: {} },
+ { name: "folder", params: {} },
{ name: "codebase", params: {} },
],
tabAutocompleteModel: {
@@ -79,9 +79,9 @@ export const defaultConfigJetBrains: SerializedContinueConfig = {
model: "claude-3-sonnet-20240229",
},
{
- title: "GPT-4 Vision (Free Trial)",
+ title: "GPT-4 Turbo (Free Trial)",
provider: "free-trial",
- model: "gpt-4-vision-preview",
+ model: "gpt-4-turbo",
},
{
title: "GPT-3.5-Turbo (Free Trial)",
@@ -121,12 +121,7 @@ export const defaultConfigJetBrains: SerializedContinueConfig = {
description: "Write unit tests for highlighted code",
},
],
- contextProviders: [
- {
- name: "open",
- params: {},
- },
- ],
+ contextProviders: [{ name: "open", params: {} }],
tabAutocompleteModel: {
title: "Starcoder2 3b",
provider: "ollama",
diff --git a/core/config/handler.ts b/core/config/handler.ts
index 0b93cbe78..c64eea703 100644
--- a/core/config/handler.ts
+++ b/core/config/handler.ts
@@ -1,12 +1,12 @@
import { ContinueConfig, ContinueRcJson, IDE, ILLM } from "..";
import { IdeSettings } from "../protocol";
+import { fetchwithRequestOptions } from "../util/fetchWithOptions";
import { Telemetry } from "../util/posthog";
import {
BrowserSerializedContinueConfig,
finalToBrowserConfig,
loadFullConfigNode,
} from "./load";
-import { fetchwithRequestOptions } from "../util/fetchWithOptions";
export class ConfigHandler {
private savedConfig: ContinueConfig | undefined;
@@ -16,7 +16,7 @@ export class ConfigHandler {
private readonly ide: IDE,
private ideSettingsPromise: Promise,
private readonly writeLog: (text: string) => void,
- private readonly onConfigUpdate: () => void
+ private readonly onConfigUpdate: () => void,
) {
this.ide = ide;
this.ideSettingsPromise = ideSettingsPromise;
@@ -76,7 +76,7 @@ export class ConfigHandler {
this.ide.readFile,
workspaceConfigs,
remoteConfigServerUrl,
- ideInfo.ideType
+ ideInfo.ideType,
);
this.savedConfig.allowAnonymousTelemetry =
this.savedConfig.allowAnonymousTelemetry &&
@@ -86,7 +86,7 @@ export class ConfigHandler {
await Telemetry.setup(
this.savedConfig.allowAnonymousTelemetry ?? true,
await this.ide.getUniqueId(),
- ideInfo.extensionVersion
+ ideInfo.extensionVersion,
);
return this.savedConfig;
@@ -94,32 +94,43 @@ export class ConfigHandler {
setupLlm(llm: ILLM): ILLM {
llm._fetch = async (input, init) => {
- const resp = await fetchwithRequestOptions(
- new URL(input),
- { ...init },
- llm.requestOptions
- );
-
- if (!resp.ok) {
- let text = await resp.text();
- if (resp.status === 404 && !resp.url.includes("/v1")) {
- if (text.includes("try pulling it first")) {
- const model = JSON.parse(text).error.split(" ")[1].slice(1, -1);
- text = `The model "${model}" was not found. To download it, run \`ollama run ${model}\`.`;
- } else if (text.includes("/api/chat")) {
- text =
- "The /api/chat endpoint was not found. This may mean that you are using an older version of Ollama that does not support /api/chat. Upgrading to the latest version will solve the issue.";
- } else {
- text =
- "This may mean that you forgot to add '/v1' to the end of your 'apiBase' in config.json.";
- }
- }
- throw new Error(
- `HTTP ${resp.status} ${resp.statusText} from ${resp.url}\n\n${text}`
+ try {
+ const resp = await fetchwithRequestOptions(
+ new URL(input),
+ { ...init },
+ llm.requestOptions,
);
- }
+ if (!resp.ok) {
+ let text = await resp.text();
+ if (resp.status === 404 && !resp.url.includes("/v1")) {
+ if (text.includes("try pulling it first")) {
+ const model = JSON.parse(text).error.split(" ")[1].slice(1, -1);
+ text = `The model "${model}" was not found. To download it, run \`ollama run ${model}\`.`;
+ } else if (text.includes("/api/chat")) {
+ text =
+ "The /api/chat endpoint was not found. This may mean that you are using an older version of Ollama that does not support /api/chat. Upgrading to the latest version will solve the issue.";
+ } else {
+ text =
+ "This may mean that you forgot to add '/v1' to the end of your 'apiBase' in config.json.";
+ }
+ }
+ throw new Error(
+ `HTTP ${resp.status} ${resp.statusText} from ${resp.url}\n\n${text}`,
+ );
+ }
- return resp;
+ return resp;
+ } catch (e: any) {
+ if (
+ e.code === "ECONNREFUSED" &&
+ e.message.includes("http://127.0.0.1:11434")
+ ) {
+ throw new Error(
+ "Failed to connect to local Ollama instance. To start Ollama, first download it at https://ollama.ai.",
+ );
+ }
+ throw new Error(`${e}`);
+ }
};
llm.writeLog = async (log: string) => {
diff --git a/core/config/load.ts b/core/config/load.ts
index af207f711..cdd91aacf 100644
--- a/core/config/load.ts
+++ b/core/config/load.ts
@@ -272,13 +272,15 @@ async function intermediateToFinalConfig(
}
// Embeddings Provider
- if (
- (config.embeddingsProvider as EmbeddingsProviderDescription | undefined)
- ?.provider
- ) {
- const { provider, ...options } =
- config.embeddingsProvider as EmbeddingsProviderDescription;
- config.embeddingsProvider = new AllEmbeddingsProviders[provider](options);
+ const embeddingsProviderDescription = config.embeddingsProvider as
+ | EmbeddingsProviderDescription
+ | undefined;
+ if (embeddingsProviderDescription?.provider) {
+ const { provider, ...options } = embeddingsProviderDescription;
+ const embeddingsProviderClass = AllEmbeddingsProviders[provider];
+ if (embeddingsProviderClass) {
+ config.embeddingsProvider = new embeddingsProviderClass(options);
+ }
}
if (!config.embeddingsProvider) {
diff --git a/core/config/onboarding.ts b/core/config/onboarding.ts
index bc6261404..ee2b10971 100644
--- a/core/config/onboarding.ts
+++ b/core/config/onboarding.ts
@@ -12,9 +12,9 @@ export function setupOptimizedMode(
model: "claude-3-sonnet-20240229",
},
{
- title: "GPT-4 Vision (Free Trial)",
+ title: "GPT-4 Turbo (Free Trial)",
provider: "free-trial",
- model: "gpt-4-vision-preview",
+ model: "gpt-4-turbo",
},
{
title: "GPT-3.5-Turbo (Free Trial)",
@@ -71,6 +71,11 @@ export function setupLocalMode(
return {
...config,
models: [
+ {
+ title: "Llama 3",
+ provider: "ollama",
+ model: "llama3",
+ },
{
title: "Ollama",
provider: "ollama",
diff --git a/core/config/types.ts b/core/config/types.ts
index e69a11716..ba03a31a8 100644
--- a/core/config/types.ts
+++ b/core/config/types.ts
@@ -18,7 +18,7 @@ declare global {
postIntellijMessage?: (
messageType: string,
data: any,
- messageIde: string
+ messageIde: string,
) => void;
}
}
@@ -45,6 +45,14 @@ declare global {
prompt: string;
completion: string;
}
+
+ export type PromptTemplate =
+ | string
+ | ((
+ history: ChatMessage[],
+ otherData: Record,
+ ) => string | ChatMessage[]);
+
export interface ILLM extends LLMOptions {
get providerName(): ModelProvider;
@@ -75,24 +83,35 @@ declare global {
streamComplete(
prompt: string,
- options?: LLMFullCompletionOptions
+ options?: LLMFullCompletionOptions,
): AsyncGenerator;
streamChat(
messages: ChatMessage[],
- options?: LLMFullCompletionOptions
+ options?: LLMFullCompletionOptions,
): AsyncGenerator;
chat(
messages: ChatMessage[],
- options?: LLMFullCompletionOptions
+ options?: LLMFullCompletionOptions,
): Promise;
countTokens(text: string): number;
supportsImages(): boolean;
+ supportsCompletions(): boolean;
+
+ supportsPrefill(): boolean;
+
listModels(): Promise;
+
+ renderPromptTemplate(
+ template: PromptTemplate,
+ history: ChatMessage[],
+ otherData: Record,
+ canPutWordsInModelsMouth?: boolean,
+ ): string | ChatMessage[];
}
export type ContextProviderType = "normal" | "query" | "submenu";
@@ -108,6 +127,7 @@ declare global {
export interface ContextProviderExtras {
fullInput: string;
embeddingsProvider: EmbeddingsProvider;
+ reranker: Reranker | undefined;
llm: ILLM;
ide: IDE;
selectedCode: RangeInFile[];
@@ -125,10 +145,10 @@ declare global {
type?: ContextProviderType;
getContextItems(
query: string,
- extras: ContextProviderExtras
+ extras: ContextProviderExtras,
): Promise;
loadSubmenuItems?: (
- args: LoadSubmenuItemsArgs
+ args: LoadSubmenuItemsArgs,
) => Promise;
}
@@ -143,7 +163,7 @@ declare global {
getContextItems(
query: string,
- extras: ContextProviderExtras
+ extras: ContextProviderExtras,
): Promise;
loadSubmenuItems(args: LoadSubmenuItemsArgs): Promise;
@@ -168,6 +188,11 @@ declare global {
range: Range;
}
+ export interface FileWithContents {
+ filepath: string;
+ contents: string;
+ }
+
export interface Range {
start: Position;
end: Position;
@@ -228,9 +253,14 @@ declare global {
editable?: boolean;
}
+ export interface InputModifiers {
+ useCodebase: boolean;
+ }
+
export interface ChatHistoryItem {
message: ChatMessage;
editorState?: any;
+ modifiers?: InputModifiers;
contextItems: ContextItemWithId[];
promptLogs?: [string, string][]; // [prompt, completion]
}
@@ -240,7 +270,6 @@ declare global {
// LLM
export interface LLMFullCompletionOptions extends BaseCompletionOptions {
- raw?: boolean;
log?: boolean;
model?: string;
@@ -262,6 +291,8 @@ declare global {
apiKey?: string;
apiBase?: string;
+ useLegacyCompletionsEndpoint?: boolean;
+
// Azure options
engine?: string;
apiVersion?: string;
@@ -284,15 +315,15 @@ declare global {
streamCompletion?: (
prompt: string,
options: CompletionOptions,
- fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise
+ fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise,
) => AsyncGenerator;
streamChat?: (
messages: ChatMessage[],
options: CompletionOptions,
- fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise
+ fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise,
) => AsyncGenerator;
listModels?: (
- fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise
+ fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise,
) => Promise;
}
@@ -317,12 +348,27 @@ declare global {
message: string;
}
+ export class Thread {
+ name: string;
+ id: number;
+ }
+
export type IdeType = "vscode" | "jetbrains";
export interface IdeInfo {
ideType: IdeType;
name: string;
version: string;
remoteName: string;
+ extensionVersion: string;
+ }
+
+ export interface BranchAndDir {
+ branch: string;
+ directory: string;
+ }
+
+ export interface IndexTag extends BranchAndDir {
+ artifactId: string;
}
export interface IDE {
@@ -331,6 +377,12 @@ declare global {
isTelemetryEnabled(): Promise;
getUniqueId(): Promise;
getTerminalContents(): Promise;
+ getDebugLocals(threadIndex: number): Promise;
+ getTopLevelCallStackSources(
+ threadIndex: number,
+ stackDepth: number,
+ ): Promise;
+ getAvailableThreads(): Promise;
listWorkspaceContents(directory?: string): Promise;
listFolders(): Promise;
getWorkspaceDirs(): Promise;
@@ -346,12 +398,12 @@ declare global {
showLines(
filepath: string,
startLine: number,
- endLine: number
+ endLine: number,
): Promise;
showDiff(
filepath: string,
newContents: string,
- stepIndex: number
+ stepIndex: number,
): Promise;
getOpenFiles(): Promise;
getPinnedFiles(): Promise;
@@ -360,6 +412,8 @@ declare global {
getProblems(filepath?: string | undefined): Promise;
getBranch(dir: string): Promise;
getStats(directory: string): Promise<{ [path: string]: number }>;
+ getTags(artifactId: string): Promise;
+ getRepoName(dir: string): Promise;
}
// Slash Commands
@@ -405,6 +459,7 @@ declare global {
| "diff"
| "github"
| "terminal"
+ | "locals"
| "open"
| "google"
| "search"
@@ -412,7 +467,14 @@ declare global {
| "http"
| "codebase"
| "problems"
- | "folder";
+ | "folder"
+ | "jira"
+ | "postgres"
+ | "database"
+ | "code"
+ | "docs"
+ | "gitlab-mr"
+ | "os";
type TemplateType =
| "llama2"
@@ -428,7 +490,8 @@ declare global {
| "xwin-coder"
| "neural-chat"
| "codellama-70b"
- | "llava";
+ | "llava"
+ | "gemma";
type ModelProvider =
| "openai"
@@ -441,14 +504,15 @@ declare global {
| "llama.cpp"
| "replicate"
| "text-gen-webui"
- | "google-palm"
+ | "gemini"
| "lmstudio"
| "llamafile"
| "gemini"
| "mistral"
| "bedrock"
| "deepinfra"
- | "flowise";
+ | "flowise"
+ | "groq";
export type ModelName =
| "AUTODETECT"
@@ -465,6 +529,7 @@ declare global {
| "mistral-8x7b"
| "llama2-7b"
| "llama2-13b"
+ | "llama2-70b"
| "codellama-7b"
| "codellama-13b"
| "codellama-34b"
@@ -481,8 +546,10 @@ declare global {
| "neural-chat-7b"
// Anthropic
| "claude-2"
- // Google PaLM
- | "chat-bison-001"
+ | "claude-3-opus-20240229"
+ | "claude-3-sonnet-20240229"
+ | "claude-3-haiku-20240307"
+ | "claude-2.1"
// Gemini
| "gemini-pro"
| "gemini-1.5-pro-latest"
@@ -494,6 +561,7 @@ declare global {
| "deepseek-1b"
| "starcoder-1b"
| "starcoder-3b"
+ | "starcoder2-3b"
| "stable-code-3b";
export interface RequestOptions {
@@ -537,6 +605,10 @@ declare global {
mirostat?: number;
stop?: string[];
maxTokens?: number;
+ numThreads?: number;
+ keepAlive?: number;
+ raw?: boolean;
+ stream?: boolean;
}
export interface ModelDescription {
@@ -553,7 +625,11 @@ declare global {
promptTemplates?: { [key: string]: string };
}
- export type EmbeddingsProviderName = "transformers.js" | "ollama" | "openai";
+ export type EmbeddingsProviderName =
+ | "transformers.js"
+ | "ollama"
+ | "openai"
+ | "free-trial";
export interface EmbedOptions {
apiBase?: string;
@@ -570,7 +646,20 @@ declare global {
embed(chunks: string[]): Promise;
}
+ export type RerankerName = "voyage" | "llm" | "free-trial";
+
+ export interface RerankerDescription {
+ name: RerankerName;
+ params?: { [key: string]: any };
+ }
+
+ export interface Reranker {
+ name: string;
+ rerank(query: string, chunks: Chunk[]): Promise;
+ }
+
export interface TabAutocompleteOptions {
+ disable: boolean;
useCopyBuffer: boolean;
useSuffix: boolean;
maxPromptTokens: number;
@@ -578,10 +667,33 @@ declare global {
maxSuffixPercentage: number;
prefixPercentage: number;
template?: string;
- disableMultiLineCompletions?: boolean;
+ multilineCompletions: "always" | "never" | "auto";
+ slidingWindowPrefixPercentage: number;
+ slidingWindowSize: number;
+ maxSnippetPercentage: number;
+ recentlyEditedSimilarityThreshold: number;
+ useCache: boolean;
+ onlyMyCode: boolean;
+ useOtherFiles: boolean;
+ }
+
+ export interface ContinueUIConfig {
+ codeBlockToolbarPosition?: "top" | "bottom";
+ }
+
+ interface ContextMenuConfig {
+ comment?: string;
+ docstring?: string;
+ fix?: string;
+ optimize?: string;
+ fixGrammar?: string;
+ }
+ interface ExperimantalConfig {
+ contextMenuPrompts?: ContextMenuConfig;
}
export interface SerializedContinueConfig {
+ env?: string[];
allowAnonymousTelemetry?: boolean;
models: ModelDescription[];
systemMessage?: string;
@@ -595,6 +707,9 @@ declare global {
embeddingsProvider?: EmbeddingsProviderDescription;
tabAutocompleteModel?: ModelDescription;
tabAutocompleteOptions?: Partial;
+ ui?: ContinueUIConfig;
+ reranker?: RerankerDescription;
+ experimental?: ExperimantalConfig;
}
export type ConfigMergeType = "merge" | "overwrite";
@@ -633,6 +748,12 @@ declare global {
tabAutocompleteModel?: CustomLLM | ModelDescription;
/** Options for tab autocomplete */
tabAutocompleteOptions?: Partial;
+ /** UI styles customization */
+ ui?: ContinueUIConfig;
+ /** Options for the reranker */
+ reranker?: RerankerDescription | Reranker;
+ /** Experimental configuration */
+ experimental?: ExperimantalConfig;
}
export interface ContinueConfig {
@@ -648,6 +769,9 @@ declare global {
embeddingsProvider: EmbeddingsProvider;
tabAutocompleteModel?: ILLM;
tabAutocompleteOptions?: Partial;
+ ui?: ContinueUIConfig;
+ reranker?: Reranker;
+ experimental?: ExperimantalConfig;
}
export interface BrowserSerializedContinueConfig {
@@ -661,6 +785,9 @@ declare global {
disableSessionTitles?: boolean;
userToken?: string;
embeddingsProvider?: string;
+ ui?: ContinueUIConfig;
+ reranker?: RerankerDescription;
+ experimental?: ExperimantalConfig;
}
}
diff --git a/core/context/providers/HttpContextProvider.ts b/core/context/providers/HttpContextProvider.ts
index c72d8c654..e66869828 100644
--- a/core/context/providers/HttpContextProvider.ts
+++ b/core/context/providers/HttpContextProvider.ts
@@ -4,6 +4,7 @@ import {
ContextProviderDescription,
ContextProviderExtras,
} from "../..";
+import { fetchwithRequestOptions } from "../../util/fetchWithOptions";
class HttpContextProvider extends BaseContextProvider {
static description: ContextProviderDescription = {
@@ -28,18 +29,21 @@ class HttpContextProvider extends BaseContextProvider {
query: string,
extras: ContextProviderExtras,
): Promise {
- const response = await fetch(this.options.url, {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- },
- body: JSON.stringify({
- query: query || "",
- fullInput: extras.fullInput,
- }),
- });
-
- const json = await response.json();
+ const response = await fetchwithRequestOptions(
+ new URL(this.options.url),
+ {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({
+ query: query || "",
+ fullInput: extras.fullInput,
+ }),
+ }
+ );
+
+ const json: any = await response.json();
return [
{
description: json.description || "HTTP Context Item",
diff --git a/core/context/retrieval/retrieval.ts b/core/context/retrieval/retrieval.ts
index 63ed4a70d..9527aaa83 100644
--- a/core/context/retrieval/retrieval.ts
+++ b/core/context/retrieval/retrieval.ts
@@ -66,24 +66,26 @@ export async function retrieveContextItemsFromEmbeddings(
// Source: expansion with code graph
// consider doing this after reranking? Or just having a lower reranking threshold
// This is VS Code only until we use PSI for JetBrains or build our own general solution
- if ((await extras.ide.getIdeInfo()).ideType === "vscode") {
- const { expandSnippet } = await import(
- "../../../extensions/vscode/src/util/expandSnippet"
- );
- let expansionResults = (
- await Promise.all(
- extras.selectedCode.map(async (rif) => {
- return expandSnippet(
- rif.filepath,
- rif.range.start.line,
- rif.range.end.line,
- extras.ide,
- );
- }),
- )
- ).flat() as Chunk[];
- retrievalResults.push(...expansionResults);
- }
+ // TODO: Need to pass in the expandSnippet function as a function argument
+ // because this import causes `tsc` to fail
+ // if ((await extras.ide.getIdeInfo()).ideType === "vscode") {
+ // const { expandSnippet } = await import(
+ // "../../../extensions/vscode/src/util/expandSnippet"
+ // );
+ // let expansionResults = (
+ // await Promise.all(
+ // extras.selectedCode.map(async (rif) => {
+ // return expandSnippet(
+ // rif.filepath,
+ // rif.range.start.line,
+ // rif.range.end.line,
+ // extras.ide,
+ // );
+ // }),
+ // )
+ // ).flat() as Chunk[];
+ // retrievalResults.push(...expansionResults);
+ // }
// Source: Open file exact match
// Source: Class/function name exact match
diff --git a/core/index.d.ts b/core/index.d.ts
index 04aa4a326..de35a97d9 100644
--- a/core/index.d.ts
+++ b/core/index.d.ts
@@ -495,6 +495,7 @@ type ModelProvider =
| "openai"
| "free-trial"
| "anthropic"
+ | "cohere"
| "together"
| "ollama"
| "huggingface-tgi"
@@ -502,7 +503,6 @@ type ModelProvider =
| "llama.cpp"
| "replicate"
| "text-gen-webui"
- | "google-palm"
| "lmstudio"
| "llamafile"
| "gemini"
@@ -520,11 +520,13 @@ export type ModelName =
| "gpt-4"
| "gpt-3.5-turbo-0613"
| "gpt-4-32k"
+ | "gpt-4-turbo"
| "gpt-4-turbo-preview"
| "gpt-4-vision-preview"
- // Open Source
+ // Mistral
| "mistral-7b"
| "mistral-8x7b"
+ // Llama 2
| "llama2-7b"
| "llama2-13b"
| "llama2-70b"
@@ -532,6 +534,10 @@ export type ModelName =
| "codellama-13b"
| "codellama-34b"
| "codellama-70b"
+ // Llama 3
+ | "llama3-8b"
+ | "llama3-70b"
+ // Other Open-source
| "phi2"
| "phind-codellama-34b"
| "wizardcoder-7b"
@@ -548,8 +554,9 @@ export type ModelName =
| "claude-3-sonnet-20240229"
| "claude-3-haiku-20240307"
| "claude-2.1"
- // Google PaLM
- | "chat-bison-001"
+ // Cohere
+ | "command-r"
+ | "command-r-plus"
// Gemini
| "gemini-pro"
| "gemini-1.5-pro-latest"
@@ -675,6 +682,7 @@ export interface TabAutocompleteOptions {
useCache: boolean;
onlyMyCode: boolean;
useOtherFiles: boolean;
+ disableInFiles?: string[];
}
export interface ContinueUIConfig {
diff --git a/core/indexing/ignore.ts b/core/indexing/ignore.ts
index c0776b3bf..ac8d38dec 100644
--- a/core/indexing/ignore.ts
+++ b/core/indexing/ignore.ts
@@ -25,6 +25,7 @@ const DEFAULT_IGNORE_FILETYPES = [
"*.dll",
"*.obj",
"*.o",
+ "*.o.d",
"*.a",
"*.lib",
"*.so",
@@ -54,6 +55,9 @@ const DEFAULT_IGNORE_FILETYPES = [
"*.sqlite",
"*.wasm",
"*.plist",
+ "*.profraw",
+ "*.gcda",
+ "*.gcno",
];
export const defaultIgnoreFile = ignore().add(DEFAULT_IGNORE_FILETYPES);
export const DEFAULT_IGNORE_DIRS = [
@@ -76,5 +80,6 @@ export const DEFAULT_IGNORE_DIRS = [
".continue",
"__pycache__",
"site-packages",
+ ".cache",
];
export const defaultIgnoreDir = ignore().add(DEFAULT_IGNORE_DIRS);
diff --git a/core/indexing/indexCodebase.ts b/core/indexing/indexCodebase.ts
index b3b1ba688..4f06adb88 100644
--- a/core/indexing/indexCodebase.ts
+++ b/core/indexing/indexCodebase.ts
@@ -72,7 +72,9 @@ export class CodebaseIndexer {
// Wait until Git Extension has loaded to report progress
// so we don't appear stuck at 0% while waiting
- await this.ide.getRepoName(workspaceDirs[0]);
+ if (workspaceDirs.length > 0) {
+ await this.ide.getRepoName(workspaceDirs[0]);
+ }
yield {
progress: 0,
desc: "Starting indexing...",
diff --git a/core/llm/autodetect.ts b/core/llm/autodetect.ts
index 98a6bb654..882f7efa5 100644
--- a/core/llm/autodetect.ts
+++ b/core/llm/autodetect.ts
@@ -44,32 +44,38 @@ const PROVIDER_HANDLES_TEMPLATING: ModelProvider[] = [
const PROVIDER_SUPPORTS_IMAGES: ModelProvider[] = [
"openai",
"ollama",
- "google-palm",
+ "gemini",
"free-trial",
"anthropic",
"bedrock",
];
-function modelSupportsImages(provider: ModelProvider, model: string): boolean {
+const MODEL_SUPPORTS_IMAGES: string[] = [
+ "llava",
+ "gpt-4-turbo",
+ "gpt-4-vision",
+ "claude-3",
+ "gemini-ultra",
+ "gemini-1.5-pro",
+ "sonnet",
+ "opus",
+ "haiku",
+];
+
+function modelSupportsImages(
+ provider: ModelProvider,
+ model: string,
+ title: string | undefined,
+): boolean {
if (!PROVIDER_SUPPORTS_IMAGES.includes(provider)) {
return false;
}
- if (model.includes("llava")) {
- return true;
- }
-
- if (model.includes("claude-3")) {
- return true;
- }
-
- if (["gpt-4-vision-preview"].includes(model)) {
- return true;
- }
-
+ const lower = model.toLowerCase();
if (
- model === "gemini-ultra" &&
- (provider === "google-palm" || provider === "free-trial")
+ MODEL_SUPPORTS_IMAGES.some(
+ (modelName) => lower.includes(modelName) || title?.includes(modelName),
+ )
) {
return true;
}
@@ -81,7 +87,7 @@ const PARALLEL_PROVIDERS: ModelProvider[] = [
"bedrock",
"deepinfra",
"gemini",
- "google-palm",
+ "gemini",
"huggingface-inference-api",
"huggingface-tgi",
"mistral",
@@ -110,6 +116,7 @@ function autodetectTemplateType(model: string): TemplateType | undefined {
if (
lower.includes("gpt") ||
+ lower.includes("command") ||
lower.includes("chat-bison") ||
lower.includes("pplx") ||
lower.includes("gemini")
@@ -277,6 +284,8 @@ function autodetectPromptTemplates(
editTemplate = claudeEditPrompt;
} else if (templateType === "gemma") {
editTemplate = gemmaEditPrompt;
+ } else if (templateType === "none") {
+ editTemplate = null;
} else if (templateType) {
editTemplate = gptEditPrompt;
}
diff --git a/core/llm/index.ts b/core/llm/index.ts
index e8f4ec550..820079463 100644
--- a/core/llm/index.ts
+++ b/core/llm/index.ts
@@ -15,6 +15,7 @@ import {
import { DevDataSqliteDb } from "../util/devdataSqlite";
import mergeJson from "../util/merge";
import { Telemetry } from "../util/posthog";
+import { withExponentialBackoff } from "../util/withExponentialBackoff";
import {
autodetectPromptTemplates,
autodetectTemplateFunction,
@@ -44,7 +45,25 @@ export abstract class BaseLLM implements ILLM {
}
supportsImages(): boolean {
- return modelSupportsImages(this.providerName, this.model);
+ return modelSupportsImages(this.providerName, this.model, this.title);
+ }
+
+ supportsCompletions(): boolean {
+ if (this.providerName === "openai") {
+ if (
+ this.apiBase?.includes("api.groq.com") ||
+ this.apiBase?.includes(":1337") ||
+ this._llmOptions.useLegacyCompletionsEndpoint?.valueOf() === false
+ ) {
+ // Jan + Groq don't support completions : (
+ return false;
+ }
+ }
+ return true;
+ }
+
+ supportsPrefill(): boolean {
+ return ["ollama", "anthropic"].includes(this.providerName);
}
supportsCompletions(): boolean {
@@ -234,7 +253,12 @@ ${prompt}`;
): Promise {
if (this._fetch) {
// Custom Node.js fetch
- return this._fetch(url, init);
+ const customFetch = this._fetch;
+ return withExponentialBackoff(
+ () => customFetch(url, init),
+ 5,
+ 0.5,
+ );
}
// Most of the requestOptions aren't available in the browser
@@ -245,10 +269,12 @@ ${prompt}`;
headers.append(key, value as string);
}
- return fetch(url, {
- ...init,
- headers,
- });
+ return withExponentialBackoff(() =>
+ fetch(url, {
+ ...init,
+ headers,
+ }),
+ );
}
private _parseCompletionOptions(options: LLMFullCompletionOptions) {
diff --git a/core/llm/llms/Bedrock.ts b/core/llm/llms/Bedrock.ts
index 138a7f536..1a6a883a8 100644
--- a/core/llm/llms/Bedrock.ts
+++ b/core/llm/llms/Bedrock.ts
@@ -1,4 +1,5 @@
import * as fs from "fs";
+import os from "os";
import { join as joinPath } from "path";
import { promisify } from "util";
import { BaseLLM } from "..";
@@ -143,7 +144,7 @@ class Bedrock extends BaseLLM {
try {
const data = await readFile(
- joinPath(process.env.HOME!, ".aws", "credentials"),
+ joinPath(process.env.HOME ?? os.homedir(), ".aws", "credentials"),
"utf8",
);
const credentials = this._parseCredentialsFile(data);
diff --git a/core/llm/llms/Cohere.ts b/core/llm/llms/Cohere.ts
new file mode 100644
index 000000000..d5781f645
--- /dev/null
+++ b/core/llm/llms/Cohere.ts
@@ -0,0 +1,92 @@
+import { BaseLLM } from "..";
+import {
+ ChatMessage,
+ CompletionOptions,
+ LLMOptions,
+ ModelProvider,
+} from "../..";
+import { stripImages } from "../countTokens";
+import { streamJSON } from "../stream";
+
+class Cohere extends BaseLLM {
+ static providerName: ModelProvider = "cohere";
+ static defaultOptions: Partial = {
+ apiBase: "https://api.cohere.ai/v1",
+ };
+ static maxStopSequences = 5;
+
+ private _convertMessages(msgs: ChatMessage[]): any[] {
+ const messages = [];
+ for (const m of msgs) {
+ if (m.role === "system" || !m.content) {
+ continue;
+ }
+ messages.push({
+ role: m.role === "assistant" ? "chatbot" : m.role,
+ message: m.content,
+ });
+ }
+ return messages;
+ }
+
+ private _convertArgs(options: CompletionOptions) {
+ return {
+ model: options.model,
+ stream: options.stream ?? true,
+ temperature: options.temperature,
+ max_tokens: options.maxTokens,
+ k: options.topK,
+ p: options.topP,
+ stop_sequences: options.stop?.slice(0, Cohere.maxStopSequences),
+ frequency_penalty: options.frequencyPenalty,
+ presence_penalty: options.presencePenalty,
+ raw_prompting: options.raw,
+ };
+ }
+
+ protected async *_streamComplete(
+ prompt: string,
+ options: CompletionOptions,
+ ): AsyncGenerator {
+ const messages = [{ role: "user" as const, content: prompt }];
+ for await (const update of this._streamChat(messages, options)) {
+ yield stripImages(update.content);
+ }
+ }
+
+ protected async *_streamChat(
+ messages: ChatMessage[],
+ options: CompletionOptions,
+ ): AsyncGenerator {
+ const headers = {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${this.apiKey}`,
+ ...this.requestOptions?.headers,
+ };
+
+ const resp = await this.fetch(new URL("chat", this.apiBase), {
+ method: "POST",
+ headers,
+ body: JSON.stringify({
+ ...this._convertArgs(options),
+ message: messages.pop()?.content,
+ chat_history: this._convertMessages(messages),
+ preamble: this.systemMessage,
+ }),
+ });
+
+ if (options.stream === false) {
+ const data = await resp.json();
+ yield { role: "assistant", content: data.text };
+ return;
+ }
+
+ for await (const value of streamJSON(resp)) {
+ if (value.event_type === "text-generation") {
+ yield { role: "assistant", content: value.text };
+ }
+ }
+ }
+}
+
+export default Cohere;
diff --git a/core/llm/llms/FreeTrial.ts b/core/llm/llms/FreeTrial.ts
index 05cec040e..bd2cb51d1 100644
--- a/core/llm/llms/FreeTrial.ts
+++ b/core/llm/llms/FreeTrial.ts
@@ -95,8 +95,8 @@ class FreeTrial extends BaseLLM {
return [
"gpt-3.5-turbo",
"gpt-4",
- "gemini-pro",
- "gpt-4-vision-preview",
+ "gemini-1.5-pro-latest",
+ "gpt-4-turbo",
"codellama-70b",
"claude-3-opus-20240229",
"claude-3-sonnet-20240229",
diff --git a/core/llm/llms/Gemini.ts b/core/llm/llms/Gemini.ts
index 836bdf970..fba80dc26 100644
--- a/core/llm/llms/Gemini.ts
+++ b/core/llm/llms/Gemini.ts
@@ -3,70 +3,179 @@ import {
ChatMessage,
CompletionOptions,
LLMOptions,
+ MessagePart,
ModelProvider,
} from "../..";
import { stripImages } from "../countTokens";
+import { streamResponse } from "../stream";
class Gemini extends BaseLLM {
static providerName: ModelProvider = "gemini";
static defaultOptions: Partial = {
model: "gemini-pro",
- region: "us-central1",
+ apiBase: "https://generativelanguage.googleapis.com/v1beta/",
};
protected async *_streamComplete(
prompt: string,
options: CompletionOptions,
): AsyncGenerator {
- for await (const chunk of this._streamChat(
- [{ role: "user", content: prompt }],
+ for await (const message of this._streamChat(
+ [{ content: prompt, role: "user" }],
options,
)) {
- yield stripImages(chunk.content);
+ yield stripImages(message.content);
}
}
+ private removeSystemMessage(messages: ChatMessage[]) {
+ const msgs = [...messages];
+
+ if (msgs[0]?.role === "system") {
+ let sysMsg = msgs.shift()!.content;
+ // @ts-ignore
+ if (msgs[0]?.role === "user") {
+ msgs[0].content = `System message - follow these instructions in every response: ${sysMsg}\n\n---\n\n${msgs[0].content}`;
+ }
+ }
+
+ return msgs;
+ }
+
protected async *_streamChat(
messages: ChatMessage[],
options: CompletionOptions,
): AsyncGenerator {
- const apiUrl = `https://${this.region}-aiplatform.googleapis.com/v1/projects/${this.projectId}/locations/${this.region}/publishers/google/models/gemini-pro:streamGenerateContent`;
+ let convertedMsgs = this.removeSystemMessage(messages);
+ if (options.model.includes("gemini")) {
+ for await (const message of this.streamChatGemini(
+ convertedMsgs,
+ options,
+ )) {
+ yield message;
+ }
+ } else {
+ for await (const message of this.streamChatBison(
+ convertedMsgs,
+ options,
+ )) {
+ yield message;
+ }
+ }
+ }
+
+ private _continuePartToGeminiPart(part: MessagePart) {
+ return part.type === "text"
+ ? {
+ text: part.text,
+ }
+ : {
+ inlineData: {
+ mimeType: "image/jpeg",
+ data: part.imageUrl?.url.split(",")[1],
+ },
+ };
+ }
+
+ private async *streamChatGemini(
+ messages: ChatMessage[],
+ options: CompletionOptions,
+ ): AsyncGenerator {
+ const apiURL = new URL(
+ `models/${options.model}:streamGenerateContent?key=${this.apiKey}`,
+ this.apiBase,
+ );
const body = {
contents: messages.map((msg) => {
return {
- role: msg.role === "assistant" ? "ASSISTANT" : "USER",
- parts: [{ text: msg.content }],
+ role: msg.role === "assistant" ? "model" : "user",
+ parts:
+ typeof msg.content === "string"
+ ? [{ text: msg.content }]
+ : msg.content.map(this._continuePartToGeminiPart),
};
}),
- generationConfig: {
- temperature: options.temperature,
- topP: options.topP,
- topK: options.topK,
- candidateCount: 1,
- maxOutputTokens: options.maxTokens,
- stopSequences: options.stop,
- },
};
- const response = await this.fetch(apiUrl, {
+ const response = await this.fetch(apiURL, {
method: "POST",
body: JSON.stringify(body),
- headers: {
- Authorization: `Bearer ${this.apiKey}`,
- "Content-Type": "application/json; charset=utf-8",
- },
});
- const data = await response.json();
- if (data[0]?.error) {
- throw new Error(data[0].error.message);
+
+ let buffer = "";
+ for await (const chunk of streamResponse(response)) {
+ buffer += chunk;
+ if (buffer.startsWith("[")) {
+ buffer = buffer.slice(1);
+ }
+ if (buffer.endsWith("]")) {
+ buffer = buffer.slice(0, -1);
+ }
+ if (buffer.startsWith(",")) {
+ buffer = buffer.slice(1);
+ }
+
+ const parts = buffer.split("\n,");
+
+ let foundIncomplete = false;
+ for (let i = 0; i < parts.length; i++) {
+ const part = parts[i];
+ let data;
+ try {
+ data = JSON.parse(part);
+ } catch (e) {
+ foundIncomplete = true;
+ continue;
+ }
+ if (data.error) {
+ throw new Error(data.error.message);
+ }
+
+ // Incrementally stream the content to make it smoother
+ const content = data.candidates[0].content.parts[0].text;
+ const words = content.split(" ");
+ const delaySeconds = Math.min(4.0 / (words.length + 1), 0.1);
+ while (words.length > 0) {
+ const wordsToYield = Math.min(3, words.length);
+ yield {
+ role: "assistant",
+ content: words.splice(0, wordsToYield).join(" ") + " ",
+ };
+ await delay(delaySeconds);
+ }
+ }
+ if (foundIncomplete) {
+ buffer = parts[parts.length - 1];
+ } else {
+ buffer = "";
+ }
}
- let combinedText = "";
- for (const entry of data || []) {
- combinedText += entry?.candidates?.[0]?.content?.parts?.[0]?.text || "";
+ }
+ private async *streamChatBison(
+ messages: ChatMessage[],
+ options: CompletionOptions,
+ ): AsyncGenerator {
+ const msgList = [];
+ for (const message of messages) {
+ msgList.push({ content: message.content });
}
- yield { role: "assistant", content: combinedText.trim() };
+ const apiURL = new URL(
+ `models/${options.model}:generateMessage?key=${this.apiKey}`,
+ this.apiBase,
+ );
+ const body = { prompt: { messages: msgList } };
+ const response = await this.fetch(apiURL, {
+ method: "POST",
+ body: JSON.stringify(body),
+ });
+ const data = await response.json();
+ yield { role: "assistant", content: data.candidates[0].content };
}
}
+async function delay(seconds: number) {
+ return new Promise((resolve) => setTimeout(resolve, seconds * 1000));
+}
+
export default Gemini;
diff --git a/core/llm/llms/GooglePalm.ts b/core/llm/llms/GooglePalm.ts
deleted file mode 100644
index 311019fb5..000000000
--- a/core/llm/llms/GooglePalm.ts
+++ /dev/null
@@ -1,181 +0,0 @@
-import { BaseLLM } from "..";
-import {
- ChatMessage,
- CompletionOptions,
- LLMOptions,
- MessagePart,
- ModelProvider,
-} from "../..";
-import { stripImages } from "../countTokens";
-import { streamResponse } from "../stream";
-
-class GooglePalm extends BaseLLM {
- static providerName: ModelProvider = "google-palm";
-
- static defaultOptions: Partial = {
- model: "gemini-pro",
- apiBase: "https://generativelanguage.googleapis.com/v1beta/",
- };
-
- protected async *_streamComplete(
- prompt: string,
- options: CompletionOptions,
- ): AsyncGenerator {
- for await (const message of this._streamChat(
- [{ content: prompt, role: "user" }],
- options,
- )) {
- yield stripImages(message.content);
- }
- }
-
- private removeSystemMessage(messages: ChatMessage[]) {
- const msgs = [...messages];
-
- if (msgs[0]?.role === "system") {
- let sysMsg = msgs.shift()!.content;
- // @ts-ignore
- if (msgs[0]?.role === "user") {
- msgs[0].content = `System message - follow these instructions in every response: ${sysMsg}\n\n---\n\n${msgs[0].content}`;
- }
- }
-
- return msgs;
- }
-
- protected async *_streamChat(
- messages: ChatMessage[],
- options: CompletionOptions,
- ): AsyncGenerator {
- let convertedMsgs = this.removeSystemMessage(messages);
- if (options.model.includes("gemini")) {
- for await (const message of this.streamChatGemini(
- convertedMsgs,
- options,
- )) {
- yield message;
- }
- } else {
- for await (const message of this.streamChatBison(
- convertedMsgs,
- options,
- )) {
- yield message;
- }
- }
- }
-
- private _continuePartToGeminiPart(part: MessagePart) {
- return part.type === "text"
- ? {
- text: part.text,
- }
- : {
- inlineData: {
- mimeType: "image/jpeg",
- data: part.imageUrl?.url.split(",")[1],
- },
- };
- }
-
- private async *streamChatGemini(
- messages: ChatMessage[],
- options: CompletionOptions,
- ): AsyncGenerator {
- const apiURL = new URL(
- `models/${options.model}:streamGenerateContent?key=${this.apiKey}`,
- this.apiBase,
- );
- const body = {
- contents: messages.map((msg) => {
- return {
- role: msg.role === "assistant" ? "model" : "user",
- parts:
- typeof msg.content === "string"
- ? [{ text: msg.content }]
- : msg.content.map(this._continuePartToGeminiPart),
- };
- }),
- };
- const response = await this.fetch(apiURL, {
- method: "POST",
- body: JSON.stringify(body),
- });
-
- let buffer = "";
- for await (const chunk of streamResponse(response)) {
- buffer += chunk;
- if (buffer.startsWith("[")) {
- buffer = buffer.slice(1);
- }
- if (buffer.endsWith("]")) {
- buffer = buffer.slice(0, -1);
- }
- if (buffer.startsWith(",")) {
- buffer = buffer.slice(1);
- }
-
- const parts = buffer.split("\n,");
-
- let foundIncomplete = false;
- for (let i = 0; i < parts.length; i++) {
- const part = parts[i];
- let data;
- try {
- data = JSON.parse(part);
- } catch (e) {
- foundIncomplete = true;
- continue;
- }
- if (data.error) {
- throw new Error(data.error.message);
- }
-
- // Incrementally stream the content to make it smoother
- const content = data.candidates[0].content.parts[0].text;
- const words = content.split(" ");
- const delaySeconds = Math.min(4.0 / (words.length + 1), 0.1);
- while (words.length > 0) {
- const wordsToYield = Math.min(3, words.length);
- yield {
- role: "assistant",
- content: words.splice(0, wordsToYield).join(" ") + " ",
- };
- await delay(delaySeconds);
- }
- }
- if (foundIncomplete) {
- buffer = parts[parts.length - 1];
- } else {
- buffer = "";
- }
- }
- }
- private async *streamChatBison(
- messages: ChatMessage[],
- options: CompletionOptions,
- ): AsyncGenerator {
- const msgList = [];
- for (const message of messages) {
- msgList.push({ content: message.content });
- }
-
- const apiURL = new URL(
- `models/${options.model}:generateMessage?key=${this.apiKey}`,
- this.apiBase,
- );
- const body = { prompt: { messages: msgList } };
- const response = await this.fetch(apiURL, {
- method: "POST",
- body: JSON.stringify(body),
- });
- const data = await response.json();
- yield { role: "assistant", content: data.candidates[0].content };
- }
-}
-
-async function delay(seconds: number) {
- return new Promise((resolve) => setTimeout(resolve, seconds * 1000));
-}
-
-export default GooglePalm;
diff --git a/core/llm/llms/Groq.ts b/core/llm/llms/Groq.ts
index a11159b2a..9f5e6f896 100644
--- a/core/llm/llms/Groq.ts
+++ b/core/llm/llms/Groq.ts
@@ -10,7 +10,9 @@ class Groq extends OpenAI {
private static modelConversion: { [key: string]: string } = {
"llama2-70b": "llama2-70b-4096",
"mistral-8x7b": "mixtral-8x7b-32768",
- "gemma": "gemma-7b-it",
+ gemma: "gemma-7b-it",
+ "llama3-8b": "llama3-8b-8192",
+ "llama3-70b": "llama3-70b-8192",
};
protected _convertModelName(model: string): string {
return Groq.modelConversion[model] ?? model;
diff --git a/core/llm/llms/Ollama.ts b/core/llm/llms/Ollama.ts
index b7c05bbcc..10ce18b2e 100644
--- a/core/llm/llms/Ollama.ts
+++ b/core/llm/llms/Ollama.ts
@@ -52,7 +52,7 @@ class Ollama extends BaseLLM {
if (!this.completionOptions.stop) {
this.completionOptions.stop = [];
}
- this.completionOptions.stop.push(value);
+ this.completionOptions.stop.push(JSON.parse(value));
break;
default:
break;
@@ -76,6 +76,8 @@ class Ollama extends BaseLLM {
"codellama-13b": "codellama:13b",
"codellama-34b": "codellama:34b",
"codellama-70b": "codellama:70b",
+ "llama3-8b": "llama3:8b",
+ "llama3-70b": "llama3:70b",
"phi-2": "phi:2.7b",
"phind-codellama-34b": "phind-codellama:34b-v2",
"wizardcoder-7b": "wizardcoder:7b-python",
diff --git a/core/llm/llms/OpenAI.ts b/core/llm/llms/OpenAI.ts
index 9dfba7fee..55bcfbd6d 100644
--- a/core/llm/llms/OpenAI.ts
+++ b/core/llm/llms/OpenAI.ts
@@ -26,6 +26,7 @@ const CHAT_ONLY_MODELS = [
"gpt-3.5-turbo-0613",
"gpt-3.5-turbo-16k",
"gpt-4",
+ "gpt-4-turbo",
"gpt-35-turbo-16k",
"gpt-35-turbo-0613",
"gpt-35-turbo",
@@ -37,7 +38,12 @@ const CHAT_ONLY_MODELS = [
];
class OpenAI extends BaseLLM {
- public useLegacyCompletionsEndpoint = false;
+ public useLegacyCompletionsEndpoint: boolean | undefined = undefined;
+
+ constructor(options: LLMOptions) {
+ super(options);
+ this.useLegacyCompletionsEndpoint = options.useLegacyCompletionsEndpoint;
+ }
constructor(options: LLMOptions) {
super(options);
diff --git a/core/llm/llms/Replicate.ts b/core/llm/llms/Replicate.ts
index daca82a83..4ebe96332 100644
--- a/core/llm/llms/Replicate.ts
+++ b/core/llm/llms/Replicate.ts
@@ -16,6 +16,8 @@ class Replicate extends BaseLLM {
"meta/codellama-70b-instruct:a279116fe47a0f65701a8817188601e2fe8f4b9e04a518789655ea7b995851bf",
"llama2-7b": "meta/llama-2-7b-chat" as any,
"llama2-13b": "meta/llama-2-13b-chat" as any,
+ "llama3-8b": "meta/meta-llama-3-8b-instruct" as any,
+ "llama3-70b": "meta/meta-llama-3-70b-instruct" as any,
"zephyr-7b":
"nateraw/zephyr-7b-beta:b79f33de5c6c4e34087d44eaea4a9d98ce5d3f3a09522f7328eea0685003a931",
"mistral-7b":
diff --git a/core/llm/llms/Together.ts b/core/llm/llms/Together.ts
index 62ce21e83..c15b6d181 100644
--- a/core/llm/llms/Together.ts
+++ b/core/llm/llms/Together.ts
@@ -18,6 +18,8 @@ class Together extends OpenAI {
"codellama-13b": "togethercomputer/CodeLlama-13b-Instruct",
"codellama-34b": "togethercomputer/CodeLlama-34b-Instruct",
"codellama-70b": "codellama/CodeLlama-70b-Instruct-hf",
+ "llama3-8b": "meta-llama/Llama-3-8b-chat-hf",
+ "llama3-70b": "meta-llama/Llama-3-70b-chat-hf",
"llama2-7b": "togethercomputer/llama-2-7b-chat",
"llama2-13b": "togethercomputer/llama-2-13b-chat",
"llama2-70b": "togethercomputer/llama-2-70b-chat",
diff --git a/core/llm/llms/index.ts b/core/llm/llms/index.ts
index 1c1214a9d..2e789ea05 100644
--- a/core/llm/llms/index.ts
+++ b/core/llm/llms/index.ts
@@ -9,11 +9,11 @@ import {
import { DEFAULT_MAX_TOKENS } from "../constants";
import Anthropic from "./Anthropic";
import Bedrock from "./Bedrock";
+import Cohere from "./Cohere";
import DeepInfra from "./DeepInfra";
import Flowise from "./Flowise";
import FreeTrial from "./FreeTrial";
import Gemini from "./Gemini";
-import GooglePalm from "./GooglePalm";
import Groq from "./Groq";
import HuggingFaceInferenceAPI from "./HuggingFaceInferenceAPI";
import HuggingFaceTGI from "./HuggingFaceTGI";
@@ -59,26 +59,27 @@ const getHandlebarsVars = (
return [value, keysToFilepath];
};
-async function renderTemplatedString(
+export async function renderTemplatedString(
template: string,
readFile: (filepath: string) => Promise,
+ inputData: any,
): Promise {
const [newTemplate, vars] = getHandlebarsVars(template);
- template = newTemplate;
- let data: any = {};
- for (let key in vars) {
- let fileContents = await readFile(vars[key]);
- data[key] = fileContents || vars[key];
+ const data: any = { ...inputData };
+ for (const key in vars) {
+ const fileContents = await readFile(vars[key]);
+ data[key] = fileContents || (inputData[vars[key]] ?? vars[key]);
}
- const templateFn = Handlebars.compile(template);
- let final = templateFn(data);
+ const templateFn = Handlebars.compile(newTemplate);
+ const final = templateFn(data);
return final;
}
const LLMs = [
Anthropic,
+ Cohere,
FreeTrial,
- GooglePalm,
+ Gemini,
Llamafile,
Ollama,
Replicate,
@@ -89,7 +90,6 @@ const LLMs = [
LlamaCpp,
OpenAI,
LMStudio,
- Gemini,
Mistral,
Bedrock,
DeepInfra,
@@ -117,7 +117,7 @@ export async function llmFromDescription(
systemMessage = desc.systemMessage ?? systemMessage;
if (systemMessage !== undefined) {
- systemMessage = await renderTemplatedString(systemMessage, readFile);
+ systemMessage = await renderTemplatedString(systemMessage, readFile, {});
}
const options: LLMOptions = {
diff --git a/core/llm/stream.ts b/core/llm/stream.ts
index 302ee82ed..02a35c365 100644
--- a/core/llm/stream.ts
+++ b/core/llm/stream.ts
@@ -73,3 +73,18 @@ export async function* streamSse(response: Response): AsyncGenerator {
}
}
}
+
+export async function* streamJSON(response: Response): AsyncGenerator {
+ let buffer = "";
+ for await (const value of streamResponse(response)) {
+ buffer += value;
+
+ let position;
+ while ((position = buffer.indexOf("\n")) >= 0) {
+ const line = buffer.slice(0, position);
+ const data = JSON.parse(line);
+ yield data;
+ buffer = buffer.slice(position + 1);
+ }
+ }
+}
diff --git a/core/package-lock.json b/core/package-lock.json
index 13f36dd80..d4ba70c2d 100644
--- a/core/package-lock.json
+++ b/core/package-lock.json
@@ -42,7 +42,7 @@
"socket.io-client": "^4.7.3",
"sqlite": "^5.1.1",
"sqlite3": "^5.1.7",
- "tree-sitter-wasms": "^0.1.6",
+ "tree-sitter-wasms": "^0.1.11",
"uuid": "^9.0.1",
"vectordb": "0.4.12",
"web-tree-sitter": "^0.21.0"
@@ -9395,9 +9395,9 @@
}
},
"node_modules/tree-sitter-wasms": {
- "version": "0.1.7",
- "resolved": "https://registry.npmjs.org/tree-sitter-wasms/-/tree-sitter-wasms-0.1.7.tgz",
- "integrity": "sha512-/EnmSDDqEnSnIuCqVhSOc14T8r792LmiztqlZMFSRg+4ACrgUWNLvEr2AUP1K76XCJrvuH8liSWfkdQpK41hIA=="
+ "version": "0.1.11",
+ "resolved": "https://registry.npmjs.org/tree-sitter-wasms/-/tree-sitter-wasms-0.1.11.tgz",
+ "integrity": "sha512-26sE4+qoTi1CbzHdo9sHs9pRE/jXVFVRigSG/5TNAbwhSMVjHfMAg4UjmOhAFAIx5UxgoQuaURwqhm0SRNrpWA=="
},
"node_modules/ts-jest": {
"version": "29.1.2",
diff --git a/core/package.json b/core/package.json
index ee0ff76f9..d60d90131 100644
--- a/core/package.json
+++ b/core/package.json
@@ -53,7 +53,7 @@
"socket.io-client": "^4.7.3",
"sqlite": "^5.1.1",
"sqlite3": "^5.1.7",
- "tree-sitter-wasms": "^0.1.6",
+ "tree-sitter-wasms": "^0.1.11",
"uuid": "^9.0.1",
"vectordb": "0.4.12",
"web-tree-sitter": "^0.21.0"
diff --git a/core/protocol.ts b/core/protocol.ts
index 43d5c729c..3e37b00ee 100644
--- a/core/protocol.ts
+++ b/core/protocol.ts
@@ -19,6 +19,11 @@ export type ProtocolGeneratorType = AsyncGenerator<{
content: T;
}>;
+export interface ListHistoryOptions {
+ offset?: number;
+ limit?: number;
+}
+
export type Protocol = {
// New
"update/modelChange": [string, void];
@@ -27,7 +32,7 @@ export type Protocol = {
abort: [undefined, void];
// History
- "history/list": [undefined, SessionInfo[]];
+ "history/list": [ListHistoryOptions, SessionInfo[]];
"history/delete": [{ id: string }, void];
"history/load": [{ id: string }, PersistedSessionInfo];
"history/save": [PersistedSessionInfo, void];
@@ -82,6 +87,7 @@ export type Protocol = {
},
string,
];
+ "llm/listModels": [{ title: string }, string[] | undefined];
"llm/streamComplete": [
{
prompt: string;
diff --git a/core/test/llm.test.ts b/core/test/llm.test.ts
index 02b5596ca..3c6296377 100644
--- a/core/test/llm.test.ts
+++ b/core/test/llm.test.ts
@@ -94,7 +94,7 @@ describe("LLM", () => {
// testLLM(new HuggingFaceTGI({ model: "codellama-7b" }));
// testLLM(new HuggingFaceInferenceAPI({ model: "codellama-7b" }));
// testLLM(
- // new GooglePalm({
+ // new Gemini({
// model: "gemini-pro",
// // model: "chat-bison-001",
// apiKey: process.env.GOOGLE_PALM_API_KEY,
diff --git a/core/util/fetchWithOptions.ts b/core/util/fetchWithOptions.ts
index 83f146d86..0ec07c2d7 100644
--- a/core/util/fetchWithOptions.ts
+++ b/core/util/fetchWithOptions.ts
@@ -1,6 +1,7 @@
import { http, https } from "follow-redirects";
import * as fs from "fs";
import { HttpProxyAgent } from "http-proxy-agent";
+import { globalAgent } from "https";
import { HttpsProxyAgent } from "https-proxy-agent";
import fetch, { RequestInit, Response } from "node-fetch";
import tls from "tls";
@@ -13,7 +14,15 @@ export function fetchwithRequestOptions(
): Promise {
const TIMEOUT = 7200; // 7200 seconds = 2 hours
- const ca = [...tls.rootCertificates];
+ let globalCerts: string[] = [];
+ if (process.env.IS_BINARY) {
+ if (Array.isArray(globalAgent.options.ca)) {
+ globalCerts = [...globalAgent.options.ca.map((cert) => cert.toString())];
+ } else if (typeof globalAgent.options.ca !== "undefined") {
+ globalCerts.push(globalAgent.options.ca.toString());
+ }
+ }
+ const ca = Array.from(new Set([...tls.rootCertificates, ...globalCerts]));
const customCerts =
typeof requestOptions?.caBundlePath === "string"
? [requestOptions?.caBundlePath]
diff --git a/core/util/history.ts b/core/util/history.ts
index a7b4167e4..21313d51e 100644
--- a/core/util/history.ts
+++ b/core/util/history.ts
@@ -1,18 +1,26 @@
import * as fs from "fs";
import { PersistedSessionInfo, SessionInfo } from "..";
+import { ListHistoryOptions } from "../protocol";
import { getSessionFilePath, getSessionsListPath } from "./paths";
class HistoryManager {
- list(): SessionInfo[] {
+ list(options: ListHistoryOptions): SessionInfo[] {
const filepath = getSessionsListPath();
if (!fs.existsSync(filepath)) {
return [];
}
const content = fs.readFileSync(filepath, "utf8");
- const sessions = JSON.parse(content).filter((session: any) => {
+ let sessions = JSON.parse(content).filter((session: any) => {
// Filter out old format
return typeof session.session_id !== "string";
});
+
+ // Apply limit and offset
+ if (options.limit) {
+ const offset = options.offset || 0;
+ sessions = sessions.slice(offset, offset + options.limit);
+ }
+
return sessions;
}
diff --git a/core/util/parameters.ts b/core/util/parameters.ts
index 86f3e1b34..b83802c7e 100644
--- a/core/util/parameters.ts
+++ b/core/util/parameters.ts
@@ -16,6 +16,7 @@ export const DEFAULT_AUTOCOMPLETE_OPTS: TabAutocompleteOptions = {
useCache: true,
onlyMyCode: true,
useOtherFiles: false,
+ disableInFiles: undefined,
};
export const RETRIEVAL_PARAMS = {
@@ -26,4 +27,4 @@ export const RETRIEVAL_PARAMS = {
};
// export const SERVER_URL = "http://localhost:3000";
-export const SERVER_URL = "https://proxy-server-green-l6vsfbzhba-uw.a.run.app";
+export const SERVER_URL = "https://proxy-server-blue-l6vsfbzhba-uw.a.run.app";
diff --git a/core/util/treeSitter.ts b/core/util/treeSitter.ts
index 64a7d66d3..b246ce4bf 100644
--- a/core/util/treeSitter.ts
+++ b/core/util/treeSitter.ts
@@ -70,6 +70,7 @@ export const supportedLanguages: { [key: string]: string } = {
rs: "rust",
rdl: "systemrdl",
toml: "toml",
+ sol: "solidity",
// jl: "julia",
// swift: "swift",
diff --git a/core/yarn.lock b/core/yarn.lock
index fe19c35ee..1973fd6fd 100644
--- a/core/yarn.lock
+++ b/core/yarn.lock
@@ -5512,10 +5512,10 @@ tr46@~0.0.3:
resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz"
integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==
-tree-sitter-wasms@^0.1.6:
- version "0.1.7"
- resolved "https://registry.npmjs.org/tree-sitter-wasms/-/tree-sitter-wasms-0.1.7.tgz"
- integrity sha512-/EnmSDDqEnSnIuCqVhSOc14T8r792LmiztqlZMFSRg+4ACrgUWNLvEr2AUP1K76XCJrvuH8liSWfkdQpK41hIA==
+tree-sitter-wasms@^0.1.11, tree-sitter-wasms@^0.1.6:
+ version "0.1.11"
+ resolved "https://registry.npmjs.org/tree-sitter-wasms/-/tree-sitter-wasms-0.1.11.tgz"
+ integrity sha512-26sE4+qoTi1CbzHdo9sHs9pRE/jXVFVRigSG/5TNAbwhSMVjHfMAg4UjmOhAFAIx5UxgoQuaURwqhm0SRNrpWA==
ts-jest@^29.1.1:
version "29.1.2"
diff --git a/docs/docs/config-file-migration.md b/docs/docs/config-file-migration.md
index d38c72327..eda986d3a 100644
--- a/docs/docs/config-file-migration.md
+++ b/docs/docs/config-file-migration.md
@@ -73,8 +73,6 @@ Instead of writing something like `Ollama(model="phind-codellama:34b", ...)`, wh
"neural-chat-7b"
# Anthropic
"claude-2",
- # Google PaLM
- "chat-bison-001",
```
If you want to use a model not listed here, you can still do that by specifying whichever value of `model` you need. But if there's something you think we should add as a default, let us know!
@@ -208,7 +206,7 @@ This is an example of serving a model using an OpenAI-compatible API on http://l
"title": "OpenAI-compatible API",
"provider": "openai",
"model": "codellama-13b",
- "api_base": "http://localhost:8000"
+ "api_base": "http://localhost:8000/v1"
}
]
}
diff --git a/docs/docs/model-setup/select-provider.md b/docs/docs/model-setup/select-provider.md
index 1a3f24f4a..ab919b9af 100644
--- a/docs/docs/model-setup/select-provider.md
+++ b/docs/docs/model-setup/select-provider.md
@@ -1,7 +1,7 @@
---
title: Select a provider
description: Swap out different LLM providers
-keywords: [openai, anthropic, PaLM, ollama, ggml]
+keywords: [openai, anthropic, gemini, ollama, ggml]
---
# Select a model provider
@@ -57,6 +57,6 @@ You can use commercial LLMs via APIs using:
- [OpenAI API](../reference/Model%20Providers/openai.md)
- [Azure OpenAI Service](../reference/Model%20Providers/openai.md) (OpenAI compatible API)
- [Anthrophic API](../reference/Model%20Providers/anthropicllm.md)
-- [Google PaLM API](../reference/Model%20Providers/googlepalmapi.md)
+- [Google Gemini API](../reference/Model%20Providers/googlepalmapi.md)
- [OpenAI free trial](../reference/Model%20Providers/freetrial.md)
- [Mistral API](../reference/Model%20Providers/mistral.md)
diff --git a/docs/docs/reference/Model Providers/cohere.md b/docs/docs/reference/Model Providers/cohere.md
new file mode 100644
index 000000000..06906470c
--- /dev/null
+++ b/docs/docs/reference/Model Providers/cohere.md
@@ -0,0 +1,20 @@
+# Cohere
+
+To setup Cohere, add the following to your `config.json` file:
+
+```json title="~/.continue/config.json"
+{
+ "models": [
+ {
+ "title": "Cohere",
+ "provider": "cohere",
+ "model": "command-r-plus",
+ "apiKey": "YOUR_API_KEY"
+ }
+ ]
+}
+```
+
+Visit the [Cohere dashboard](https://dashboard.cohere.com/api-keys) to create an API key.
+
+[View the source](https://github.com/continuedev/continue/blob/main/core/llm/llms/Cohere.ts)
diff --git a/docs/docs/reference/Model Providers/googlepalmapi.md b/docs/docs/reference/Model Providers/googlepalmapi.md
index 00fffaeac..abbec270c 100644
--- a/docs/docs/reference/Model Providers/googlepalmapi.md
+++ b/docs/docs/reference/Model Providers/googlepalmapi.md
@@ -1,18 +1,18 @@
-# GooglePaLMAPI
+# Gemini API
-The Google PaLM API is currently in beta. You can [create an API key in Google MakerSuite](https://makersuite.google.com/u/2/app/apikey) and use either the `chat-bison-001` model or `gemini-pro`. Change `~/.continue/config.json` to look like this:
+The Google Gemini API is currently in beta. You can [create an API key in Google AI Studio](https://aistudio.google.com) and use `gemini-1.5-pro-latest`. Change `~/.continue/config.json` to look like this:
```json title="~/.continue/config.json"
{
"models": [
{
"title": "Gemini Pro",
- "provider": "google-palm",
- "model": "gemini-pro",
+ "provider": "gemini",
+ "model": "gemini-1.5-pro-latest",
"apiKey": "YOUR_API_KEY"
}
]
}
```
-[View the source](https://github.com/continuedev/continue/blob/main/core/llm/llms/GooglePalm.ts)
+[View the source](https://github.com/continuedev/continue/blob/main/core/llm/llms/Gemini.ts)
diff --git a/docs/docs/reference/Model Providers/openai.md b/docs/docs/reference/Model Providers/openai.md
index 853d97b43..52abcd662 100644
--- a/docs/docs/reference/Model Providers/openai.md
+++ b/docs/docs/reference/Model Providers/openai.md
@@ -24,6 +24,7 @@ The easiest way to find this information is from the chat playground in the Azur
### OpenAI compatible servers / APIs
OpenAI compatible servers
+
- [KoboldCpp](https://github.com/lostruins/koboldcpp)
- [text-gen-webui](https://github.com/oobabooga/text-generation-webui/tree/main/extensions/openai#setup--installation)
- [FastChat](https://github.com/lm-sys/FastChat/blob/main/docs/openai_api.md)
@@ -46,10 +47,16 @@ If you are [using an OpenAI compatible server / API](../../model-setup/select-pr
"provider": "openai",
"model": "MODEL_NAME",
"apiKey": "EMPTY",
- "apiBase": "http://localhost:8000"
+ "apiBase": "http://localhost:8000/v1"
}
]
}
```
+To force usage of `chat/completions` instead of `completions` endpoint you can set
+
+```json
+"useLegacyCompletionsEndpoint": false
+```
+
[View the source](https://github.com/continuedev/continue/blob/main/core/llm/llms/OpenAI.ts)
diff --git a/docs/docs/walkthroughs/config-file-migration.md b/docs/docs/walkthroughs/config-file-migration.md
index b8e83d2f8..8abb962bb 100644
--- a/docs/docs/walkthroughs/config-file-migration.md
+++ b/docs/docs/walkthroughs/config-file-migration.md
@@ -72,8 +72,6 @@ Instead of writing something like `Ollama(model="phind-codellama:34b", ...)`, wh
"neural-chat-7b",
# Anthropic
"claude-2",
- # Google PaLM
- "chat-bison-001",
```
If you want to use a model not listed here, you can still do that by specifying whichever value of `model` you need. But if there's something you think we should add as a default, let us know!
@@ -207,7 +205,7 @@ This is an example of serving a model using an OpenAI-compatible API on http://l
"title": "OpenAI-compatible API",
"provider": "openai",
"model": "codellama-13b",
- "api_base": "http://localhost:8000"
+ "api_base": "http://localhost:8000/v1"
}
]
}
diff --git a/docs/static/schemas/config.json b/docs/static/schemas/config.json
index fff595834..f94d3e5df 100644
--- a/docs/static/schemas/config.json
+++ b/docs/static/schemas/config.json
@@ -134,6 +134,7 @@
"openai",
"free-trial",
"anthropic",
+ "cohere",
"bedrock",
"together",
"ollama",
@@ -141,7 +142,7 @@
"huggingface-inference-api",
"llama.cpp",
"replicate",
- "google-palm",
+ "gemini",
"lmstudio",
"llamafile",
"mistral",
@@ -153,6 +154,7 @@
"### OpenAI\nUse gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/openai)",
"### Free Trial\nNew users can try out Continue for free using a proxy server that securely makes calls to OpenAI using our API key. If you are ready to use your own API key or have used all 250 free uses, you can enter your API key in config.py where it says `apiKey=\"\"` or select another model provider.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/freetrial)",
"### Anthropic\nTo get started with Anthropic models, you first need to sign up for the open beta [here](https://claude.ai/login) to obtain an API key.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/anthropicllm)",
+ "### Cohere\nTo use Cohere, visit the [Cohere dashboard](https://dashboard.cohere.com/api-keys) to create an API key.\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/cohere)",
"### Bedrock\nTo get started with Bedrock you need to sign up on AWS [here](https://aws.amazon.com/bedrock/claude/)",
"### Together\nTogether is a hosted service that provides extremely fast streaming of open-source language models. To get started with Together:\n1. Obtain an API key from [here](https://together.ai)\n2. Paste below\n3. Select a model preset\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/togetherllm)",
"### Ollama\nTo get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama run `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model=\"codellama:7b-instruct\"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/ollama)",
@@ -160,7 +162,7 @@
"### Huggingface Inference API\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/huggingfaceinferenceapi)",
"### Llama.cpp\nllama.cpp comes with a [built-in server](https://github.com/ggerganov/llama.cpp/tree/master/examples/server#llamacppexampleserver) that can be run from source. To do this:\n\n1. Clone the repository with `git clone https://github.com/ggerganov/llama.cpp`.\n2. `cd llama.cpp`\n3. Run `make` to build the server.\n4. Download the model you'd like to use and place it in the `llama.cpp/models` directory (the best place to find models is [The Bloke on HuggingFace](https://huggingface.co/TheBloke))\n5. Run the llama.cpp server with the command below (replacing with the model you downloaded):\n\n```shell\n.\\server.exe -c 4096 --host 0.0.0.0 -t 16 --mlock -m models/codellama-7b-instruct.Q8_0.gguf\n```\n\nAfter it's up and running, you can start using Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/llamacpp)",
"### Replicate\nReplicate is a hosted service that makes it easy to run ML models. To get started with Replicate:\n1. Obtain an API key from [here](https://replicate.com)\n2. Paste below\n3. Select a model preset\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/replicatellm)",
- "### Google PALM\nTo get started with Google Makersuite, obtain your API key from [here](https://makersuite.google.com) and paste it below.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/googlepalmapi)",
+ "### Gemini API\nTo get started with Google Makersuite, obtain your API key from [here](https://makersuite.google.com) and paste it below.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/googlepalmapi)",
"### LMStudio\nLMStudio provides a professional and well-designed GUI for exploring, configuring, and serving LLMs. It is available on both Mac and Windows. To get started:\n1. Download from [lmstudio.ai](https://lmstudio.ai/) and open the application\n2. Search for and download the desired model from the home screen of LMStudio.\n3. In the left-bar, click the '<->' icon to open the Local Inference Server and press 'Start Server'.\n4. Once your model is loaded and the server has started, you can begin using Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/lmstudio)",
"### Llamafile\nTo get started with llamafiles, find and download a binary on their [GitHub repo](https://github.com/Mozilla-Ocho/llamafile#binary-instructions). Then run it with the following command:\n\n```shell\nchmod +x ./llamafile\n./llamafile\n```\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/llamafile)",
"### Mistral API\n\nTo get access to the Mistral API, obtain your API key from the [Mistral platform](https://docs.mistral.ai/)",
@@ -175,7 +177,7 @@
},
"apiKey": {
"title": "Api Key",
- "description": "OpenAI, Anthropic, Together, or other API key",
+ "description": "OpenAI, Anthropic, Cohere, Together, or other API key",
"type": "string"
},
"apiBase": {
@@ -303,7 +305,8 @@
"enum": [
"openai",
"anthropic",
- "google-palm",
+ "cohere",
+ "gemini",
"huggingface-inference-api",
"replicate",
"together"
@@ -373,7 +376,7 @@
"gpt-3.5-turbo-0613",
"gpt-4-32k",
"gpt-4-0125-preview",
- "gpt-4-turbo-preview",
+ "gpt-4-turbo",
"AUTODETECT"
]
},
@@ -400,6 +403,8 @@
"anyOf": [
{
"enum": [
+ "llama3-8b",
+ "llama3-70b",
"codellama-7b",
"codellama-13b",
"codellama-34b",
@@ -471,7 +476,7 @@
"gpt-4",
"gpt-3.5-turbo-0613",
"gpt-4-32k",
- "gpt-4-turbo-preview",
+ "gpt-4-turbo",
"gpt-4-vision-preview",
"mistral-7b",
"mistral-8x7b",
@@ -481,6 +486,8 @@
"codellama-13b",
"codellama-34b",
"codellama-70b",
+ "llama3-8b",
+ "llama3-70b",
"phind-codellama-34b",
"wizardcoder-7b",
"wizardcoder-13b",
@@ -540,6 +547,23 @@
}
}
},
+ {
+ "if": {
+ "properties": {
+ "provider": {
+ "enum": ["cohere"]
+ }
+ },
+ "required": ["provider"]
+ },
+ "then": {
+ "properties": {
+ "model": {
+ "enum": ["command-r", "command-r-plus"]
+ }
+ }
+ }
+ },
{
"if": {
"properties": {
@@ -572,7 +596,7 @@
"if": {
"properties": {
"provider": {
- "enum": ["google-palm"]
+ "enum": ["gemini"]
}
},
"required": ["provider"]
@@ -580,7 +604,11 @@
"then": {
"properties": {
"model": {
- "enum": ["chat-bison-001", "gemini-pro"]
+ "enum": [
+ "chat-bison-001",
+ "gemini-pro",
+ "gemini-1.5-pro-latest"
+ ]
}
}
}
@@ -604,6 +632,8 @@
"mistral-8x7b",
"llama2-7b",
"llama2-13b",
+ "llama3-8b",
+ "llama3-70b",
"codellama-7b",
"codellama-13b",
"codellama-34b",
@@ -666,6 +696,8 @@
"codellama-13b",
"codellama-34b",
"codellama-70b",
+ "llama3-8b",
+ "llama3-70b",
"phind-codellama-34b",
"wizardcoder-7b",
"wizardcoder-13b",
@@ -712,6 +744,8 @@
"codellama-13b",
"codellama-34b",
"codellama-70b",
+ "llama3-8b",
+ "llama3-70b",
"phi-2",
"phind-codellama-34b",
"wizardcoder-7b",
@@ -768,7 +802,13 @@
"then": {
"properties": {
"model": {
- "enum": ["llama2-70b", "mistral-8x7b", "gemma"]
+ "enum": [
+ "llama2-70b",
+ "mistral-8x7b",
+ "gemma",
+ "llama3-8b",
+ "llama3-70b"
+ ]
}
}
}
@@ -902,7 +942,7 @@
"gpt-4",
"gpt-3.5-turbo-0613",
"gpt-4-32k",
- "gpt-4-turbo-preview",
+ "gpt-4-turbo",
"gpt-4-vision-preview",
"mistral-7b",
"mistral-8x7b",
@@ -912,6 +952,8 @@
"codellama-13b",
"codellama-34b",
"codellama-70b",
+ "llama3-8b",
+ "llama3-70b",
"phind-codellama-34b",
"wizardcoder-7b",
"wizardcoder-13b",
@@ -926,8 +968,11 @@
"claude-3-sonnet-20240229",
"claude-3-haiku-20240307",
"claude-2.1",
+ "command-r",
+ "command-r-plus",
"chat-bison-001",
"gemini-pro",
+ "gemini-1.5-pro-latest",
"mistral-tiny",
"mistral-small",
"mistral-medium",
@@ -1585,7 +1630,7 @@
{
"name": "test",
"prompt": "Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
- "description": "This is an example custom command. Use /config to edit it and create more"
+ "description": "This is an example custom command. Open config.json to edit it and create more"
}
],
"type": "array",
@@ -1794,6 +1839,13 @@
"useOtherFiles": {
"type": "boolean",
"description": "Defaults to true. If set to false, Continue will not attempt to include snippets from other files."
+ },
+ "disableInFiles": {
+ "description": "A list of files / glob patterns in which to disable tab autocomplete. For example, *.csv if you'd like to disable autocomplete in .csv files.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
}
},
"required": []
diff --git a/extensions/intellij/gradle.properties b/extensions/intellij/gradle.properties
index fc276a336..c046f7df1 100644
--- a/extensions/intellij/gradle.properties
+++ b/extensions/intellij/gradle.properties
@@ -4,7 +4,7 @@ pluginGroup = com.github.continuedev.continueintellijextension
pluginName = continue-intellij-extension
pluginRepositoryUrl = https://github.com/continuedev/continue
# SemVer format -> https://semver.org
-pluginVersion = 0.0.42
+pluginVersion = 0.0.45
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 223
diff --git a/extensions/intellij/src/main/resources/config_schema.json b/extensions/intellij/src/main/resources/config_schema.json
index fff595834..f94d3e5df 100644
--- a/extensions/intellij/src/main/resources/config_schema.json
+++ b/extensions/intellij/src/main/resources/config_schema.json
@@ -134,6 +134,7 @@
"openai",
"free-trial",
"anthropic",
+ "cohere",
"bedrock",
"together",
"ollama",
@@ -141,7 +142,7 @@
"huggingface-inference-api",
"llama.cpp",
"replicate",
- "google-palm",
+ "gemini",
"lmstudio",
"llamafile",
"mistral",
@@ -153,6 +154,7 @@
"### OpenAI\nUse gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/openai)",
"### Free Trial\nNew users can try out Continue for free using a proxy server that securely makes calls to OpenAI using our API key. If you are ready to use your own API key or have used all 250 free uses, you can enter your API key in config.py where it says `apiKey=\"\"` or select another model provider.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/freetrial)",
"### Anthropic\nTo get started with Anthropic models, you first need to sign up for the open beta [here](https://claude.ai/login) to obtain an API key.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/anthropicllm)",
+ "### Cohere\nTo use Cohere, visit the [Cohere dashboard](https://dashboard.cohere.com/api-keys) to create an API key.\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/cohere)",
"### Bedrock\nTo get started with Bedrock you need to sign up on AWS [here](https://aws.amazon.com/bedrock/claude/)",
"### Together\nTogether is a hosted service that provides extremely fast streaming of open-source language models. To get started with Together:\n1. Obtain an API key from [here](https://together.ai)\n2. Paste below\n3. Select a model preset\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/togetherllm)",
"### Ollama\nTo get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama run `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model=\"codellama:7b-instruct\"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/ollama)",
@@ -160,7 +162,7 @@
"### Huggingface Inference API\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/huggingfaceinferenceapi)",
"### Llama.cpp\nllama.cpp comes with a [built-in server](https://github.com/ggerganov/llama.cpp/tree/master/examples/server#llamacppexampleserver) that can be run from source. To do this:\n\n1. Clone the repository with `git clone https://github.com/ggerganov/llama.cpp`.\n2. `cd llama.cpp`\n3. Run `make` to build the server.\n4. Download the model you'd like to use and place it in the `llama.cpp/models` directory (the best place to find models is [The Bloke on HuggingFace](https://huggingface.co/TheBloke))\n5. Run the llama.cpp server with the command below (replacing with the model you downloaded):\n\n```shell\n.\\server.exe -c 4096 --host 0.0.0.0 -t 16 --mlock -m models/codellama-7b-instruct.Q8_0.gguf\n```\n\nAfter it's up and running, you can start using Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/llamacpp)",
"### Replicate\nReplicate is a hosted service that makes it easy to run ML models. To get started with Replicate:\n1. Obtain an API key from [here](https://replicate.com)\n2. Paste below\n3. Select a model preset\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/replicatellm)",
- "### Google PALM\nTo get started with Google Makersuite, obtain your API key from [here](https://makersuite.google.com) and paste it below.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/googlepalmapi)",
+ "### Gemini API\nTo get started with Google Makersuite, obtain your API key from [here](https://makersuite.google.com) and paste it below.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/googlepalmapi)",
"### LMStudio\nLMStudio provides a professional and well-designed GUI for exploring, configuring, and serving LLMs. It is available on both Mac and Windows. To get started:\n1. Download from [lmstudio.ai](https://lmstudio.ai/) and open the application\n2. Search for and download the desired model from the home screen of LMStudio.\n3. In the left-bar, click the '<->' icon to open the Local Inference Server and press 'Start Server'.\n4. Once your model is loaded and the server has started, you can begin using Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/lmstudio)",
"### Llamafile\nTo get started with llamafiles, find and download a binary on their [GitHub repo](https://github.com/Mozilla-Ocho/llamafile#binary-instructions). Then run it with the following command:\n\n```shell\nchmod +x ./llamafile\n./llamafile\n```\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/llamafile)",
"### Mistral API\n\nTo get access to the Mistral API, obtain your API key from the [Mistral platform](https://docs.mistral.ai/)",
@@ -175,7 +177,7 @@
},
"apiKey": {
"title": "Api Key",
- "description": "OpenAI, Anthropic, Together, or other API key",
+ "description": "OpenAI, Anthropic, Cohere, Together, or other API key",
"type": "string"
},
"apiBase": {
@@ -303,7 +305,8 @@
"enum": [
"openai",
"anthropic",
- "google-palm",
+ "cohere",
+ "gemini",
"huggingface-inference-api",
"replicate",
"together"
@@ -373,7 +376,7 @@
"gpt-3.5-turbo-0613",
"gpt-4-32k",
"gpt-4-0125-preview",
- "gpt-4-turbo-preview",
+ "gpt-4-turbo",
"AUTODETECT"
]
},
@@ -400,6 +403,8 @@
"anyOf": [
{
"enum": [
+ "llama3-8b",
+ "llama3-70b",
"codellama-7b",
"codellama-13b",
"codellama-34b",
@@ -471,7 +476,7 @@
"gpt-4",
"gpt-3.5-turbo-0613",
"gpt-4-32k",
- "gpt-4-turbo-preview",
+ "gpt-4-turbo",
"gpt-4-vision-preview",
"mistral-7b",
"mistral-8x7b",
@@ -481,6 +486,8 @@
"codellama-13b",
"codellama-34b",
"codellama-70b",
+ "llama3-8b",
+ "llama3-70b",
"phind-codellama-34b",
"wizardcoder-7b",
"wizardcoder-13b",
@@ -540,6 +547,23 @@
}
}
},
+ {
+ "if": {
+ "properties": {
+ "provider": {
+ "enum": ["cohere"]
+ }
+ },
+ "required": ["provider"]
+ },
+ "then": {
+ "properties": {
+ "model": {
+ "enum": ["command-r", "command-r-plus"]
+ }
+ }
+ }
+ },
{
"if": {
"properties": {
@@ -572,7 +596,7 @@
"if": {
"properties": {
"provider": {
- "enum": ["google-palm"]
+ "enum": ["gemini"]
}
},
"required": ["provider"]
@@ -580,7 +604,11 @@
"then": {
"properties": {
"model": {
- "enum": ["chat-bison-001", "gemini-pro"]
+ "enum": [
+ "chat-bison-001",
+ "gemini-pro",
+ "gemini-1.5-pro-latest"
+ ]
}
}
}
@@ -604,6 +632,8 @@
"mistral-8x7b",
"llama2-7b",
"llama2-13b",
+ "llama3-8b",
+ "llama3-70b",
"codellama-7b",
"codellama-13b",
"codellama-34b",
@@ -666,6 +696,8 @@
"codellama-13b",
"codellama-34b",
"codellama-70b",
+ "llama3-8b",
+ "llama3-70b",
"phind-codellama-34b",
"wizardcoder-7b",
"wizardcoder-13b",
@@ -712,6 +744,8 @@
"codellama-13b",
"codellama-34b",
"codellama-70b",
+ "llama3-8b",
+ "llama3-70b",
"phi-2",
"phind-codellama-34b",
"wizardcoder-7b",
@@ -768,7 +802,13 @@
"then": {
"properties": {
"model": {
- "enum": ["llama2-70b", "mistral-8x7b", "gemma"]
+ "enum": [
+ "llama2-70b",
+ "mistral-8x7b",
+ "gemma",
+ "llama3-8b",
+ "llama3-70b"
+ ]
}
}
}
@@ -902,7 +942,7 @@
"gpt-4",
"gpt-3.5-turbo-0613",
"gpt-4-32k",
- "gpt-4-turbo-preview",
+ "gpt-4-turbo",
"gpt-4-vision-preview",
"mistral-7b",
"mistral-8x7b",
@@ -912,6 +952,8 @@
"codellama-13b",
"codellama-34b",
"codellama-70b",
+ "llama3-8b",
+ "llama3-70b",
"phind-codellama-34b",
"wizardcoder-7b",
"wizardcoder-13b",
@@ -926,8 +968,11 @@
"claude-3-sonnet-20240229",
"claude-3-haiku-20240307",
"claude-2.1",
+ "command-r",
+ "command-r-plus",
"chat-bison-001",
"gemini-pro",
+ "gemini-1.5-pro-latest",
"mistral-tiny",
"mistral-small",
"mistral-medium",
@@ -1585,7 +1630,7 @@
{
"name": "test",
"prompt": "Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
- "description": "This is an example custom command. Use /config to edit it and create more"
+ "description": "This is an example custom command. Open config.json to edit it and create more"
}
],
"type": "array",
@@ -1794,6 +1839,13 @@
"useOtherFiles": {
"type": "boolean",
"description": "Defaults to true. If set to false, Continue will not attempt to include snippets from other files."
+ },
+ "disableInFiles": {
+ "description": "A list of files / glob patterns in which to disable tab autocomplete. For example, *.csv if you'd like to disable autocomplete in .csv files.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
}
},
"required": []
diff --git a/extensions/intellij/src/main/resources/continue_tutorial.py b/extensions/intellij/src/main/resources/continue_tutorial.py
index 9a7194ad0..1c79f2c88 100644
--- a/extensions/intellij/src/main/resources/continue_tutorial.py
+++ b/extensions/intellij/src/main/resources/continue_tutorial.py
@@ -3,7 +3,7 @@ Welcome to Continue!
_________ _____ _____
__ ____/______ _______ __ /____(_)_______ ____ _______
-_ / _ __ \__ __ \_ __/__ / __ __ \_ / / /_ _ \
+_ / _ __ \__ __ \_ __/__ / __ __ \_ / / /_ _ \
/ /___ / /_/ /_ / / // /_ _ / _ / / // /_/ / / __/
\____/ \____/ /_/ /_/ \__/ /_/ /_/ /_/ \__,_/ \___/
diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json
index d94309807..f94d3e5df 100644
--- a/extensions/vscode/config_schema.json
+++ b/extensions/vscode/config_schema.json
@@ -134,6 +134,7 @@
"openai",
"free-trial",
"anthropic",
+ "cohere",
"bedrock",
"together",
"ollama",
@@ -141,7 +142,7 @@
"huggingface-inference-api",
"llama.cpp",
"replicate",
- "google-palm",
+ "gemini",
"lmstudio",
"llamafile",
"mistral",
@@ -153,6 +154,7 @@
"### OpenAI\nUse gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/openai)",
"### Free Trial\nNew users can try out Continue for free using a proxy server that securely makes calls to OpenAI using our API key. If you are ready to use your own API key or have used all 250 free uses, you can enter your API key in config.py where it says `apiKey=\"\"` or select another model provider.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/freetrial)",
"### Anthropic\nTo get started with Anthropic models, you first need to sign up for the open beta [here](https://claude.ai/login) to obtain an API key.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/anthropicllm)",
+ "### Cohere\nTo use Cohere, visit the [Cohere dashboard](https://dashboard.cohere.com/api-keys) to create an API key.\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/cohere)",
"### Bedrock\nTo get started with Bedrock you need to sign up on AWS [here](https://aws.amazon.com/bedrock/claude/)",
"### Together\nTogether is a hosted service that provides extremely fast streaming of open-source language models. To get started with Together:\n1. Obtain an API key from [here](https://together.ai)\n2. Paste below\n3. Select a model preset\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/togetherllm)",
"### Ollama\nTo get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama run `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model=\"codellama:7b-instruct\"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/ollama)",
@@ -160,7 +162,7 @@
"### Huggingface Inference API\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/huggingfaceinferenceapi)",
"### Llama.cpp\nllama.cpp comes with a [built-in server](https://github.com/ggerganov/llama.cpp/tree/master/examples/server#llamacppexampleserver) that can be run from source. To do this:\n\n1. Clone the repository with `git clone https://github.com/ggerganov/llama.cpp`.\n2. `cd llama.cpp`\n3. Run `make` to build the server.\n4. Download the model you'd like to use and place it in the `llama.cpp/models` directory (the best place to find models is [The Bloke on HuggingFace](https://huggingface.co/TheBloke))\n5. Run the llama.cpp server with the command below (replacing with the model you downloaded):\n\n```shell\n.\\server.exe -c 4096 --host 0.0.0.0 -t 16 --mlock -m models/codellama-7b-instruct.Q8_0.gguf\n```\n\nAfter it's up and running, you can start using Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/llamacpp)",
"### Replicate\nReplicate is a hosted service that makes it easy to run ML models. To get started with Replicate:\n1. Obtain an API key from [here](https://replicate.com)\n2. Paste below\n3. Select a model preset\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/replicatellm)",
- "### Google PALM\nTo get started with Google Makersuite, obtain your API key from [here](https://makersuite.google.com) and paste it below.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/googlepalmapi)",
+ "### Gemini API\nTo get started with Google Makersuite, obtain your API key from [here](https://makersuite.google.com) and paste it below.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/googlepalmapi)",
"### LMStudio\nLMStudio provides a professional and well-designed GUI for exploring, configuring, and serving LLMs. It is available on both Mac and Windows. To get started:\n1. Download from [lmstudio.ai](https://lmstudio.ai/) and open the application\n2. Search for and download the desired model from the home screen of LMStudio.\n3. In the left-bar, click the '<->' icon to open the Local Inference Server and press 'Start Server'.\n4. Once your model is loaded and the server has started, you can begin using Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/lmstudio)",
"### Llamafile\nTo get started with llamafiles, find and download a binary on their [GitHub repo](https://github.com/Mozilla-Ocho/llamafile#binary-instructions). Then run it with the following command:\n\n```shell\nchmod +x ./llamafile\n./llamafile\n```\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/llamafile)",
"### Mistral API\n\nTo get access to the Mistral API, obtain your API key from the [Mistral platform](https://docs.mistral.ai/)",
@@ -175,7 +177,7 @@
},
"apiKey": {
"title": "Api Key",
- "description": "OpenAI, Anthropic, Together, or other API key",
+ "description": "OpenAI, Anthropic, Cohere, Together, or other API key",
"type": "string"
},
"apiBase": {
@@ -303,7 +305,8 @@
"enum": [
"openai",
"anthropic",
- "google-palm",
+ "cohere",
+ "gemini",
"huggingface-inference-api",
"replicate",
"together"
@@ -373,7 +376,7 @@
"gpt-3.5-turbo-0613",
"gpt-4-32k",
"gpt-4-0125-preview",
- "gpt-4-turbo-preview",
+ "gpt-4-turbo",
"AUTODETECT"
]
},
@@ -400,6 +403,8 @@
"anyOf": [
{
"enum": [
+ "llama3-8b",
+ "llama3-70b",
"codellama-7b",
"codellama-13b",
"codellama-34b",
@@ -471,7 +476,7 @@
"gpt-4",
"gpt-3.5-turbo-0613",
"gpt-4-32k",
- "gpt-4-turbo-preview",
+ "gpt-4-turbo",
"gpt-4-vision-preview",
"mistral-7b",
"mistral-8x7b",
@@ -481,6 +486,8 @@
"codellama-13b",
"codellama-34b",
"codellama-70b",
+ "llama3-8b",
+ "llama3-70b",
"phind-codellama-34b",
"wizardcoder-7b",
"wizardcoder-13b",
@@ -540,6 +547,23 @@
}
}
},
+ {
+ "if": {
+ "properties": {
+ "provider": {
+ "enum": ["cohere"]
+ }
+ },
+ "required": ["provider"]
+ },
+ "then": {
+ "properties": {
+ "model": {
+ "enum": ["command-r", "command-r-plus"]
+ }
+ }
+ }
+ },
{
"if": {
"properties": {
@@ -572,7 +596,7 @@
"if": {
"properties": {
"provider": {
- "enum": ["google-palm"]
+ "enum": ["gemini"]
}
},
"required": ["provider"]
@@ -608,6 +632,8 @@
"mistral-8x7b",
"llama2-7b",
"llama2-13b",
+ "llama3-8b",
+ "llama3-70b",
"codellama-7b",
"codellama-13b",
"codellama-34b",
@@ -670,6 +696,8 @@
"codellama-13b",
"codellama-34b",
"codellama-70b",
+ "llama3-8b",
+ "llama3-70b",
"phind-codellama-34b",
"wizardcoder-7b",
"wizardcoder-13b",
@@ -716,6 +744,8 @@
"codellama-13b",
"codellama-34b",
"codellama-70b",
+ "llama3-8b",
+ "llama3-70b",
"phi-2",
"phind-codellama-34b",
"wizardcoder-7b",
@@ -772,7 +802,13 @@
"then": {
"properties": {
"model": {
- "enum": ["llama2-70b", "mistral-8x7b", "gemma"]
+ "enum": [
+ "llama2-70b",
+ "mistral-8x7b",
+ "gemma",
+ "llama3-8b",
+ "llama3-70b"
+ ]
}
}
}
@@ -906,7 +942,7 @@
"gpt-4",
"gpt-3.5-turbo-0613",
"gpt-4-32k",
- "gpt-4-turbo-preview",
+ "gpt-4-turbo",
"gpt-4-vision-preview",
"mistral-7b",
"mistral-8x7b",
@@ -916,6 +952,8 @@
"codellama-13b",
"codellama-34b",
"codellama-70b",
+ "llama3-8b",
+ "llama3-70b",
"phind-codellama-34b",
"wizardcoder-7b",
"wizardcoder-13b",
@@ -930,6 +968,8 @@
"claude-3-sonnet-20240229",
"claude-3-haiku-20240307",
"claude-2.1",
+ "command-r",
+ "command-r-plus",
"chat-bison-001",
"gemini-pro",
"gemini-1.5-pro-latest",
@@ -1590,7 +1630,7 @@
{
"name": "test",
"prompt": "Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
- "description": "This is an example custom command. Use /config to edit it and create more"
+ "description": "This is an example custom command. Open config.json to edit it and create more"
}
],
"type": "array",
@@ -1799,6 +1839,13 @@
"useOtherFiles": {
"type": "boolean",
"description": "Defaults to true. If set to false, Continue will not attempt to include snippets from other files."
+ },
+ "disableInFiles": {
+ "description": "A list of files / glob patterns in which to disable tab autocomplete. For example, *.csv if you'd like to disable autocomplete in .csv files.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
}
},
"required": []
diff --git a/extensions/vscode/continue_rc_schema.json b/extensions/vscode/continue_rc_schema.json
index d1cbb3d42..ed9bfd761 100644
--- a/extensions/vscode/continue_rc_schema.json
+++ b/extensions/vscode/continue_rc_schema.json
@@ -134,6 +134,7 @@
"openai",
"free-trial",
"anthropic",
+ "cohere",
"bedrock",
"together",
"ollama",
@@ -141,7 +142,7 @@
"huggingface-inference-api",
"llama.cpp",
"replicate",
- "google-palm",
+ "gemini",
"lmstudio",
"llamafile",
"mistral",
@@ -153,6 +154,7 @@
"### OpenAI\nUse gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/openai)",
"### Free Trial\nNew users can try out Continue for free using a proxy server that securely makes calls to OpenAI using our API key. If you are ready to use your own API key or have used all 250 free uses, you can enter your API key in config.py where it says `apiKey=\"\"` or select another model provider.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/freetrial)",
"### Anthropic\nTo get started with Anthropic models, you first need to sign up for the open beta [here](https://claude.ai/login) to obtain an API key.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/anthropicllm)",
+ "### Cohere\nTo use Cohere, visit the [Cohere dashboard](https://dashboard.cohere.com/api-keys) to create an API key.\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/cohere)",
"### Bedrock\nTo get started with Bedrock you need to sign up on AWS [here](https://aws.amazon.com/bedrock/claude/)",
"### Together\nTogether is a hosted service that provides extremely fast streaming of open-source language models. To get started with Together:\n1. Obtain an API key from [here](https://together.ai)\n2. Paste below\n3. Select a model preset\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/togetherllm)",
"### Ollama\nTo get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama run `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model=\"codellama:7b-instruct\"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/ollama)",
@@ -160,7 +162,7 @@
"### Huggingface Inference API\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/huggingfaceinferenceapi)",
"### Llama.cpp\nllama.cpp comes with a [built-in server](https://github.com/ggerganov/llama.cpp/tree/master/examples/server#llamacppexampleserver) that can be run from source. To do this:\n\n1. Clone the repository with `git clone https://github.com/ggerganov/llama.cpp`.\n2. `cd llama.cpp`\n3. Run `make` to build the server.\n4. Download the model you'd like to use and place it in the `llama.cpp/models` directory (the best place to find models is [The Bloke on HuggingFace](https://huggingface.co/TheBloke))\n5. Run the llama.cpp server with the command below (replacing with the model you downloaded):\n\n```shell\n.\\server.exe -c 4096 --host 0.0.0.0 -t 16 --mlock -m models/codellama-7b-instruct.Q8_0.gguf\n```\n\nAfter it's up and running, you can start using Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/llamacpp)",
"### Replicate\nReplicate is a hosted service that makes it easy to run ML models. To get started with Replicate:\n1. Obtain an API key from [here](https://replicate.com)\n2. Paste below\n3. Select a model preset\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/replicatellm)",
- "### Google PALM\nTo get started with Google Makersuite, obtain your API key from [here](https://makersuite.google.com) and paste it below.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/googlepalmapi)",
+ "### Gemini API\nTo get started with Google Makersuite, obtain your API key from [here](https://makersuite.google.com) and paste it below.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/googlepalmapi)",
"### LMStudio\nLMStudio provides a professional and well-designed GUI for exploring, configuring, and serving LLMs. It is available on both Mac and Windows. To get started:\n1. Download from [lmstudio.ai](https://lmstudio.ai/) and open the application\n2. Search for and download the desired model from the home screen of LMStudio.\n3. In the left-bar, click the '<->' icon to open the Local Inference Server and press 'Start Server'.\n4. Once your model is loaded and the server has started, you can begin using Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/lmstudio)",
"### Llamafile\nTo get started with llamafiles, find and download a binary on their [GitHub repo](https://github.com/Mozilla-Ocho/llamafile#binary-instructions). Then run it with the following command:\n\n```shell\nchmod +x ./llamafile\n./llamafile\n```\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/llamafile)",
"### Mistral API\n\nTo get access to the Mistral API, obtain your API key from the [Mistral platform](https://docs.mistral.ai/)",
@@ -175,7 +177,7 @@
},
"apiKey": {
"title": "Api Key",
- "description": "OpenAI, Anthropic, Together, or other API key",
+ "description": "OpenAI, Anthropic, Cohere, Together, or other API key",
"type": "string"
},
"apiBase": {
@@ -312,7 +314,8 @@
"enum": [
"openai",
"anthropic",
- "google-palm",
+ "cohere",
+ "gemini",
"huggingface-inference-api",
"replicate",
"together"
@@ -401,7 +404,7 @@
"gpt-3.5-turbo-0613",
"gpt-4-32k",
"gpt-4-0125-preview",
- "gpt-4-turbo-preview",
+ "gpt-4-turbo",
"AUTODETECT"
]
},
@@ -432,6 +435,8 @@
"anyOf": [
{
"enum": [
+ "llama3-8b",
+ "llama3-70b",
"codellama-7b",
"codellama-13b",
"codellama-34b",
@@ -511,7 +516,7 @@
"gpt-4",
"gpt-3.5-turbo-0613",
"gpt-4-32k",
- "gpt-4-turbo-preview",
+ "gpt-4-turbo",
"gpt-4-vision-preview",
"mistral-7b",
"mistral-8x7b",
@@ -521,6 +526,8 @@
"codellama-13b",
"codellama-34b",
"codellama-70b",
+ "llama3-8b",
+ "llama3-70b",
"phind-codellama-34b",
"wizardcoder-7b",
"wizardcoder-13b",
@@ -584,6 +591,30 @@
}
}
},
+ {
+ "if": {
+ "properties": {
+ "provider": {
+ "enum": [
+ "cohere"
+ ]
+ }
+ },
+ "required": [
+ "provider"
+ ]
+ },
+ "then": {
+ "properties": {
+ "model": {
+ "enum": [
+ "command-r",
+ "command-r-plus"
+ ]
+ }
+ }
+ }
+ },
{
"if": {
"properties": {
@@ -621,7 +652,7 @@
"properties": {
"provider": {
"enum": [
- "google-palm"
+ "gemini"
]
}
},
@@ -634,7 +665,8 @@
"model": {
"enum": [
"chat-bison-001",
- "gemini-pro"
+ "gemini-pro",
+ "gemini-1.5-pro-latest"
]
}
}
@@ -663,6 +695,8 @@
"mistral-8x7b",
"llama2-7b",
"llama2-13b",
+ "llama3-8b",
+ "llama3-70b",
"codellama-7b",
"codellama-13b",
"codellama-34b",
@@ -731,6 +765,8 @@
"codellama-13b",
"codellama-34b",
"codellama-70b",
+ "llama3-8b",
+ "llama3-70b",
"phind-codellama-34b",
"wizardcoder-7b",
"wizardcoder-13b",
@@ -781,6 +817,8 @@
"codellama-13b",
"codellama-34b",
"codellama-70b",
+ "llama3-8b",
+ "llama3-70b",
"phi-2",
"phind-codellama-34b",
"wizardcoder-7b",
@@ -852,7 +890,9 @@
"enum": [
"llama2-70b",
"mistral-8x7b",
- "gemma"
+ "gemma",
+ "llama3-8b",
+ "llama3-70b"
]
}
}
@@ -1013,7 +1053,7 @@
"gpt-4",
"gpt-3.5-turbo-0613",
"gpt-4-32k",
- "gpt-4-turbo-preview",
+ "gpt-4-turbo",
"gpt-4-vision-preview",
"mistral-7b",
"mistral-8x7b",
@@ -1023,6 +1063,8 @@
"codellama-13b",
"codellama-34b",
"codellama-70b",
+ "llama3-8b",
+ "llama3-70b",
"phind-codellama-34b",
"wizardcoder-7b",
"wizardcoder-13b",
@@ -1037,8 +1079,11 @@
"claude-3-sonnet-20240229",
"claude-3-haiku-20240307",
"claude-2.1",
+ "command-r",
+ "command-r-plus",
"chat-bison-001",
"gemini-pro",
+ "gemini-1.5-pro-latest",
"mistral-tiny",
"mistral-small",
"mistral-medium",
@@ -1778,7 +1823,7 @@
{
"name": "test",
"prompt": "Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
- "description": "This is an example custom command. Use /config to edit it and create more"
+ "description": "This is an example custom command. Open config.json to edit it and create more"
}
],
"type": "array",
@@ -2024,6 +2069,13 @@
"useOtherFiles": {
"type": "boolean",
"description": "Defaults to true. If set to false, Continue will not attempt to include snippets from other files."
+ },
+ "disableInFiles": {
+ "description": "A list of files / glob patterns in which to disable tab autocomplete. For example, *.csv if you'd like to disable autocomplete in .csv files.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
}
},
"required": []
diff --git a/extensions/vscode/continue_tutorial.py b/extensions/vscode/continue_tutorial.py
index e332e22af..b19980706 100644
--- a/extensions/vscode/continue_tutorial.py
+++ b/extensions/vscode/continue_tutorial.py
@@ -1,15 +1,13 @@
"""
_________ _____ _____
__ ____/______ _______ __ /____(_)_______ ____ _______
-_ / _ __ \__ __ \_ __/__ / __ __ \_ / / /_ _ \
+_ / _ __ \__ __ \_ __/__ / __ __ \_ / / /_ _ \
/ /___ / /_/ /_ / / // /_ _ / _ / / // /_/ / / __/
\____/ \____/ /_/ /_/ \__/ /_/ /_/ /_/ \__,_/ \___/
Welcome to Continue! This is a 2 minute tutorial.
-You can either
-- follow the instructions on your own, or
-- follow along by clicking the gray CodeLens buttons above the lines, in order, starting with "Begin Section"
+You can click the gray buttons, starting with "Highlight the function" to follow along.
"""
# region —————————————————————————— Part 1: Ask a question about code [Cmd+L] ——————————————————————————
@@ -78,4 +76,4 @@ print_sum(["a", "b", "c"])
# endregion
-# Ready to learn more? Check out the Continue documentation: https://continue.dev/docs
\ No newline at end of file
+# Ready to learn more? Check out the Continue documentation: https://continue.dev/docs
diff --git a/extensions/vscode/media/continue-dev-square.png b/extensions/vscode/media/continue-dev-square.png
deleted file mode 100644
index e4b625568..000000000
Binary files a/extensions/vscode/media/continue-dev-square.png and /dev/null differ
diff --git a/extensions/vscode/media/icon.png b/extensions/vscode/media/icon.png
index 9ea7ec3fb..d8f9f16c5 100644
Binary files a/extensions/vscode/media/icon.png and b/extensions/vscode/media/icon.png differ
diff --git a/extensions/vscode/media/sidebar-icon.png b/extensions/vscode/media/sidebar-icon.png
new file mode 100644
index 000000000..4f41d9dfd
Binary files /dev/null and b/extensions/vscode/media/sidebar-icon.png differ
diff --git a/extensions/vscode/media/welcome.md b/extensions/vscode/media/welcome.md
index dac249e0a..1887f4641 100644
--- a/extensions/vscode/media/welcome.md
+++ b/extensions/vscode/media/welcome.md
@@ -2,13 +2,15 @@
## ❗️ Before you get started
-Continue is currently in the left sidebar, but we recommend moving it to the right. This way it won't cover your file explorer. You can move it back at any time.
+Continue is currently in the left sidebar, but we recommend moving it to the right. This way it won't cover your file explorer.
+
+You can move it back at any time. If you close the sidebar, it can be re-opened with Cmd/Ctrl + L.

## 🔑 Most important shortcuts
-> If you've been using Continue, these have changed. You can always customize them in VS Code settings.
+> If you'd prefer different keys, these shortcuts can be customized in VS Code settings.
Cmd/Ctrl + L = Select code
@@ -17,13 +19,3 @@ Continue is currently in the left sidebar, but we recommend moving it to the rig
Cmd/Ctrl + I = Quick edit
Cmd/Ctrl + Shift + R = Automatically debug terminal
-
-## ⚡️ Setting up tab autocomplete
-
-1. Download [Ollama](https://ollama.ai)
-2. Download starcoder2:3b by running `ollama run starcoder2:3b` in the terminal
-3. That's it! You can disable autocomplete at any time by clicking the `Continue` button in the status bar (bottom right of the VS Code window)
-
-> Learn how to customize your autocomplete experience in [our walkthrough](https://continue.dev/docs/walkthroughs/tab-autocomplete)
-
-
diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json
index 4c98f50b6..1861ae0d9 100644
--- a/extensions/vscode/package-lock.json
+++ b/extensions/vscode/package-lock.json
@@ -122,7 +122,7 @@
"socket.io-client": "^4.7.3",
"sqlite": "^5.1.1",
"sqlite3": "^5.1.7",
- "tree-sitter-wasms": "^0.1.6",
+ "tree-sitter-wasms": "^0.1.11",
"uuid": "^9.0.1",
"vectordb": "0.4.12",
"web-tree-sitter": "^0.21.0"
diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json
index 3886791a1..093974c8c 100644
--- a/extensions/vscode/package.json
+++ b/extensions/vscode/package.json
@@ -1,7 +1,7 @@
{
"name": "continue",
"icon": "media/icon.png",
- "version": "0.9.92",
+ "version": "0.9.93",
"repository": {
"type": "git",
"url": "https://github.com/continuedev/continue"
@@ -17,7 +17,7 @@
"homepage": "https://continue.dev",
"qna": "https://github.com/continuedev/continue/issues/new/choose",
"license": "Apache-2.0",
- "displayName": "Continue - Claude, CodeLlama, GPT-4, and more",
+ "displayName": "Continue - Llama 3, GPT-4, and more",
"pricing": "Free",
"description": "Open-source autopilot for software development - bring the power of ChatGPT to your IDE",
"publisher": "Continue",
@@ -41,6 +41,7 @@
"github",
"copilot",
"llama",
+ "3",
"codegpt",
"ai"
],
@@ -149,6 +150,18 @@
"icon": "$(fullscreen)",
"group": "Continue"
},
+ {
+ "command": "continue.openConfigJson",
+ "category": "Continue",
+ "title": "Open config.json",
+ "group": "Continue"
+ },
+ {
+ "command": "continue.toggleTabAutocompleteEnabled",
+ "category": "Continue",
+ "title": "Toggle Autocomplete Enabled",
+ "group": "Continue"
+ },
{
"command": "continue.shareSession",
"category": "Continue",
@@ -263,6 +276,16 @@
"mac": "cmd+k cmd+m",
"key": "ctrl+k ctrl+m",
"when": "!terminalFocus"
+ },
+ {
+ "command": "continue.toggleTabAutocompleteEnabled",
+ "mac": "cmd+k cmd+a",
+ "key": "ctrl+k ctrl+a"
+ },
+ {
+ "command": "continue.openConfigJson",
+ "mac": "cmd+k cmd+c",
+ "key": "ctrl+k ctrl+c"
}
],
"submenus": [
@@ -382,7 +405,7 @@
{
"id": "continue",
"title": "Continue",
- "icon": "media/continue-dev-square.png"
+ "icon": "media/sidebar-icon.png"
}
]
},
diff --git a/extensions/vscode/scripts/package.js b/extensions/vscode/scripts/package.js
index e5b376fac..615ee8bbb 100644
--- a/extensions/vscode/scripts/package.js
+++ b/extensions/vscode/scripts/package.js
@@ -9,8 +9,8 @@ if (!fs.existsSync("build")) {
}
const command = isPreRelease
- ? "vsce package --out ./build patch --pre-release" // --yarn"
- : "vsce package --out ./build patch"; // --yarn";
+ ? "npx vsce package --out ./build patch --pre-release" // --yarn"
+ : "npx vsce package --out ./build patch"; // --yarn";
exec(command, (error) => {
if (error) throw error;
diff --git a/extensions/vscode/scripts/prepackage.js b/extensions/vscode/scripts/prepackage.js
index 4444362c4..cbf4a621d 100644
--- a/extensions/vscode/scripts/prepackage.js
+++ b/extensions/vscode/scripts/prepackage.js
@@ -41,6 +41,8 @@ if (!target) {
s390x: "x64",
x64: "x64",
}[process.arch];
+} else {
+ [os, arch] = target.split("-");
}
if (os === "alpine") {
diff --git a/extensions/vscode/src/autocomplete/completionProvider.ts b/extensions/vscode/src/autocomplete/completionProvider.ts
index 5a7830d3a..a89664e3e 100644
--- a/extensions/vscode/src/autocomplete/completionProvider.ts
+++ b/extensions/vscode/src/autocomplete/completionProvider.ts
@@ -16,13 +16,19 @@ export class ContinueCompletionProvider
implements vscode.InlineCompletionItemProvider
{
private onError(e: any) {
- vscode.window.showErrorMessage(e.message, "Documentation").then((val) => {
+ const options = ["Documentation"];
+ if (e.message.includes("https://ollama.ai")) {
+ options.push("Download Ollama");
+ }
+ vscode.window.showErrorMessage(e.message, ...options).then((val) => {
if (val === "Documentation") {
vscode.env.openExternal(
vscode.Uri.parse(
- "https://continue.dev/docs/walkthroughs/tab-autocomplete"
- )
+ "https://continue.dev/docs/walkthroughs/tab-autocomplete",
+ ),
);
+ } else if (val === "Download Ollama") {
+ vscode.env.openExternal(vscode.Uri.parse("https://ollama.ai"));
}
});
}
@@ -32,14 +38,14 @@ export class ContinueCompletionProvider
constructor(
private readonly configHandler: ConfigHandler,
private readonly ide: IDE,
- private readonly tabAutocompleteModel: TabAutocompleteModel
+ private readonly tabAutocompleteModel: TabAutocompleteModel,
) {
this.completionProvider = new CompletionProvider(
this.configHandler,
this.ide,
this.tabAutocompleteModel.get.bind(this.tabAutocompleteModel),
this.onError.bind(this),
- getDefinitionsFromLsp
+ getDefinitionsFromLsp,
);
}
@@ -47,7 +53,7 @@ export class ContinueCompletionProvider
document: vscode.TextDocument,
position: vscode.Position,
context: vscode.InlineCompletionContext,
- token: vscode.CancellationToken
+ token: vscode.CancellationToken,
//@ts-ignore
): ProviderResult {
const enableTabAutocomplete =
@@ -75,14 +81,14 @@ export class ContinueCompletionProvider
pos: { line: position.line, character: position.character },
recentlyEditedFiles: [],
recentlyEditedRanges: [],
- clipboardText: clipboardText
+ clipboardText: clipboardText,
};
setupStatusBar(true, true);
const outcome =
await this.completionProvider.provideInlineCompletionItems(
input,
- signal
+ signal,
);
if (!outcome || !outcome.completion) {
@@ -107,13 +113,13 @@ export class ContinueCompletionProvider
outcome.completion,
new vscode.Range(
position,
- position.translate(0, outcome.completion.length)
+ position.translate(0, outcome.completion.length),
),
{
title: "Log Autocomplete Outcome",
command: "continue.logAutocompleteOutcome",
arguments: [outcome, logRejectionTimeout],
- }
+ },
),
];
} finally {
diff --git a/extensions/vscode/src/commands.ts b/extensions/vscode/src/commands.ts
index c026b72da..fa85a3ea2 100644
--- a/extensions/vscode/src/commands.ts
+++ b/extensions/vscode/src/commands.ts
@@ -7,6 +7,7 @@ import { IDE } from "core";
import { AutocompleteOutcome } from "core/autocomplete/completionProvider";
import { ConfigHandler } from "core/config/handler";
import { logDevData } from "core/util/devdata";
+import { getConfigJsonPath } from "core/util/paths";
import { Telemetry } from "core/util/posthog";
import { ContinueGUIWebviewViewProvider } from "./debugPanel";
import { DiffManager } from "./diff/horizontal";
@@ -21,10 +22,45 @@ function getFullScreenTab() {
);
}
-function addHighlightedCodeToContext(
+async function addHighlightedCodeToContext(
edit: boolean,
webviewProtocol: VsCodeWebviewProtocol | undefined,
) {
+ // Capture highlighted terminal text
+ // const activeTerminal = vscode.window.activeTerminal;
+ // if (activeTerminal) {
+ // // Copy selected text
+ // const tempCopyBuffer = await vscode.env.clipboard.readText();
+ // await vscode.commands.executeCommand(
+ // "workbench.action.terminal.copySelection",
+ // );
+ // await vscode.commands.executeCommand(
+ // "workbench.action.terminal.clearSelection",
+ // );
+ // const contents = (await vscode.env.clipboard.readText()).trim();
+ // await vscode.env.clipboard.writeText(tempCopyBuffer);
+
+ // // Add to context
+ // const rangeInFileWithContents = {
+ // filepath: activeTerminal.name,
+ // contents,
+ // range: {
+ // start: {
+ // line: 0,
+ // character: 0,
+ // },
+ // end: {
+ // line: contents.split("\n").length,
+ // character: 0,
+ // },
+ // },
+ // };
+
+ // webviewProtocol?.request("highlightedCode", {
+ // rangeInFileWithContents,
+ // });
+ // }
+
const editor = vscode.window.activeTextEditor;
if (editor) {
const selection = editor.selection;
@@ -147,7 +183,7 @@ const commandsMap: (
vscode.commands.executeCommand("continue.continueGUIView.focus");
}
sidebar.webviewProtocol?.request("focusContinueInput", undefined);
- addHighlightedCodeToContext(false, sidebar.webviewProtocol);
+ await addHighlightedCodeToContext(false, sidebar.webviewProtocol);
},
"continue.focusContinueInputWithoutClear": async () => {
if (!getFullScreenTab()) {
@@ -157,12 +193,12 @@ const commandsMap: (
"focusContinueInputWithoutClear",
undefined,
);
- addHighlightedCodeToContext(true, sidebar.webviewProtocol);
+ await addHighlightedCodeToContext(true, sidebar.webviewProtocol);
},
"continue.toggleAuxiliaryBar": () => {
vscode.commands.executeCommand("workbench.action.toggleAuxiliaryBar");
},
- "continue.quickEdit": async () => {
+ "continue.quickEdit": async (prompt?: string) => {
const selectionEmpty = vscode.window.activeTextEditor?.selection.isEmpty;
const editor = vscode.window.activeTextEditor;
@@ -199,6 +235,7 @@ const commandsMap: (
: `Describe how to edit the highlighted code${addContextMsg}`,
title: `${getPlatform() === "mac" ? "Cmd" : "Ctrl"}+I`,
prompt: `[${defaultModelTitle}]`,
+ value: prompt,
};
if (previousInput) {
textInputOptions.value = previousInput + ", ";
@@ -441,6 +478,9 @@ const commandsMap: (
extensionContext.subscriptions,
);
},
+ "continue.openConfigJson": () => {
+ ide.openFile(getConfigJsonPath());
+ },
"continue.selectFilesAsContext": (
firstUri: vscode.Uri,
uris: vscode.Uri[],
diff --git a/extensions/vscode/src/diff/verticalPerLine/manager.ts b/extensions/vscode/src/diff/verticalPerLine/manager.ts
index 3ce6f79c0..45bb82c10 100644
--- a/extensions/vscode/src/diff/verticalPerLine/manager.ts
+++ b/extensions/vscode/src/diff/verticalPerLine/manager.ts
@@ -220,6 +220,7 @@ export class VerticalPerLineDiffManager {
);
} catch (e) {
console.error("Error streaming diff:", e);
+ vscode.window.showErrorMessage(`Error streaming diff: ${e}`);
} finally {
vscode.commands.executeCommand(
"setContext",
diff --git a/extensions/vscode/src/extension/vscodeExtension.ts b/extensions/vscode/src/extension/vscodeExtension.ts
index 5f1cc1ea8..84cf58869 100644
--- a/extensions/vscode/src/extension/vscodeExtension.ts
+++ b/extensions/vscode/src/extension/vscodeExtension.ts
@@ -1,6 +1,8 @@
import { ConfigHandler } from "core/config/handler";
import { CodebaseIndexer, PauseToken } from "core/indexing/indexCodebase";
import { IdeSettings } from "core/protocol";
+import { getConfigJsonPath, getConfigTsPath } from "core/util/paths";
+import fs from "fs";
import { v4 as uuidv4 } from "uuid";
import * as vscode from "vscode";
import { ContinueCompletionProvider } from "../autocomplete/completionProvider";
@@ -189,17 +191,20 @@ export class VsCodeExtension {
// Indexing
this.ide.getWorkspaceDirs().then((dirs) => this.refreshCodebaseIndex(dirs));
- // Listen for file saving
+ // Listen for file saving - use global file watcher so that changes
+ // from outside the window are also caught
+ fs.watchFile(getConfigJsonPath(), { interval: 1000 }, (stats) => {
+ this.configHandler.reloadConfig();
+ });
+ fs.watchFile(getConfigTsPath(), { interval: 1000 }, (stats) => {
+ this.configHandler.reloadConfig();
+ });
+
vscode.workspace.onDidSaveTextDocument((event) => {
+ // Listen for file changes in the workspace
const filepath = event.uri.fsPath;
- if (
- filepath.endsWith(".continue/config.json") ||
- filepath.endsWith(".continue\\config.json") ||
- filepath.endsWith(".continue/config.ts") ||
- filepath.endsWith(".continue\\config.ts") ||
- filepath.endsWith(".continuerc.json")
- ) {
+ if (filepath.endsWith(".continuerc.json")) {
this.configHandler.reloadConfig();
this.tabAutocompleteModel.clearLlm();
} else if (
diff --git a/extensions/vscode/src/ideProtocol.ts b/extensions/vscode/src/ideProtocol.ts
index 82d2b91a8..74cfe21c7 100644
--- a/extensions/vscode/src/ideProtocol.ts
+++ b/extensions/vscode/src/ideProtocol.ts
@@ -30,9 +30,12 @@ class VsCodeIde implements IDE {
async getRepoName(dir: string): Promise {
const repo = await this.getRepo(vscode.Uri.file(dir));
+ const remotes = repo?.repository?.remotes;
+ if (!remotes) {
+ return undefined;
+ }
const remote =
- repo?.repository.remotes.find((r: any) => r.name === "origin") ??
- repo?.repository.remotes[0];
+ remotes?.find((r: any) => r.name === "origin") ?? remotes?.[0];
if (!remote) {
return undefined;
}
@@ -228,8 +231,10 @@ class VsCodeIde implements IDE {
async runCommand(command: string): Promise {
if (vscode.window.terminals.length) {
- vscode.window.terminals[0].show();
- vscode.window.terminals[0].sendText(command, false);
+ const terminal =
+ vscode.window.activeTerminal ?? vscode.window.terminals[0];
+ terminal.show();
+ terminal.sendText(command, false);
} else {
const terminal = vscode.window.createTerminal();
terminal.show();
diff --git a/extensions/vscode/src/lang-server/codeLens.ts b/extensions/vscode/src/lang-server/codeLens.ts
index ee42828ce..bdc7de4fd 100644
--- a/extensions/vscode/src/lang-server/codeLens.ts
+++ b/extensions/vscode/src/lang-server/codeLens.ts
@@ -4,7 +4,7 @@ import * as vscode from "vscode";
import { DIFF_DIRECTORY, DiffManager } from "../diff/horizontal";
import { VerticalDiffCodeLens } from "../diff/verticalPerLine/manager";
import { editorSuggestionsLocked, editorToSuggestions } from "../suggestions";
-import { getAltOrOption, getMetaKeyLabel } from "../util/util";
+import { getAltOrOption, getMetaKeyLabel, getPlatform } from "../util/util";
import { getExtensionUri } from "../util/vscode";
class VerticalPerLineCodeLensProvider implements vscode.CodeLensProvider {
@@ -227,12 +227,15 @@ interface TutorialCodeLensItems {
lineIncludes: string;
commands: vscode.Command[];
}
+
+const cmdCtrl = getPlatform() === "mac" ? "Cmd" : "Ctrl";
+
const actions: TutorialCodeLensItems[] = [
{
- lineIncludes: "Step 2: Use the keyboard shortcut cmd/ctrl + L",
+ lineIncludes: `Step 2: Use the keyboard shortcut [${cmdCtrl}+L]`,
commands: [
{
- title: `Do it for me`,
+ title: `${cmdCtrl}+L`,
command: "continue.focusContinueInput",
},
],
@@ -253,17 +256,12 @@ const actions: TutorialCodeLensItems[] = [
],
},
{
- lineIncludes: 'Step 3: Type "" and press Enter',
+ lineIncludes: `Step 2: Use the keyboard shortcut [${cmdCtrl}+I] to edit`,
commands: [
{
- title: `"/edit make this more efficient"`,
- command: "continue.sendMainUserInput",
- arguments: ["/edit make this more efficient"],
- },
- {
- title: `"/edit write comments for this function"`,
- command: "continue.sendMainUserInput",
- arguments: ["/edit write comments for this function"],
+ title: `${cmdCtrl}+I`,
+ command: "continue.quickEdit",
+ arguments: ["Add comments"],
},
],
},
@@ -290,6 +288,15 @@ const actions: TutorialCodeLensItems[] = [
},
],
},
+ {
+ lineIncludes: `Step 2: Use the keyboard shortcut [${cmdCtrl}+Shift+R]`,
+ commands: [
+ {
+ title: `${cmdCtrl}+Shift+R`,
+ command: "continue.debugTerminal",
+ },
+ ],
+ },
];
class TutorialCodeLensProvider implements vscode.CodeLensProvider {
@@ -346,26 +353,26 @@ class TutorialCodeLensProvider implements vscode.CodeLensProvider {
}
// Folding of the tutorial
- const regionLines = lines
- .map((line, i) => [line, i])
- .filter(([line, i]) => (line as string).startsWith("# region "))
- .map(([line, i]) => i);
- for (const lineOfRegion of regionLines as number[]) {
- const range = new vscode.Range(lineOfRegion, 0, lineOfRegion + 1, 0);
+ // const regionLines = lines
+ // .map((line, i) => [line, i])
+ // .filter(([line, i]) => (line as string).startsWith("# region "))
+ // .map(([line, i]) => i);
+ // for (const lineOfRegion of regionLines as number[]) {
+ // const range = new vscode.Range(lineOfRegion, 0, lineOfRegion + 1, 0);
- const linesToFold = regionLines
- .filter((i) => lineOfRegion !== i)
- .flatMap((i) => {
- return [i, (i as number) + 1];
- });
- codeLenses.push(
- new vscode.CodeLens(range, {
- title: `Begin Section`,
- command: "continue.foldAndUnfold",
- arguments: [linesToFold, [lineOfRegion, lineOfRegion + 1]],
- }),
- );
- }
+ // const linesToFold = regionLines
+ // .filter((i) => lineOfRegion !== i)
+ // .flatMap((i) => {
+ // return [i, (i as number) + 1];
+ // });
+ // codeLenses.push(
+ // new vscode.CodeLens(range, {
+ // title: `Begin Section`,
+ // command: "continue.foldAndUnfold",
+ // arguments: [linesToFold, [lineOfRegion, lineOfRegion + 1]],
+ // }),
+ // );
+ // }
return codeLenses;
}
diff --git a/extensions/vscode/src/util/cleanSlate.ts b/extensions/vscode/src/util/cleanSlate.ts
new file mode 100644
index 000000000..837d93fec
--- /dev/null
+++ b/extensions/vscode/src/util/cleanSlate.ts
@@ -0,0 +1,16 @@
+import { ExtensionContext } from "vscode";
+/**
+ * Clear all Continue-related artifacts to simulate a brand new user
+ */
+export function cleanSlate(context: ExtensionContext) {
+ // Commented just to be safe
+ // // Remove ~/.continue
+ // const continuePath = getContinueGlobalPath();
+ // if (fs.existsSync(continuePath)) {
+ // fs.rmSync(continuePath, { recursive: true, force: true });
+ // }
+ // // Clear extension's globalState
+ // context.globalState.keys().forEach((key) => {
+ // context.globalState.update(key, undefined);
+ // });
+}
diff --git a/extensions/vscode/src/util/loadAutocompleteModel.ts b/extensions/vscode/src/util/loadAutocompleteModel.ts
index b2f698013..c813a6cf1 100644
--- a/extensions/vscode/src/util/loadAutocompleteModel.ts
+++ b/extensions/vscode/src/util/loadAutocompleteModel.ts
@@ -56,6 +56,7 @@ export class TabAutocompleteModel {
vscode.window
.showWarningMessage(
"Continue failed to connect to Ollama, which is used by default for tab-autocomplete. If you haven't downloaded it yet, you can do so at https://ollama.ai (recommended). If you'd like to use a custom model for tab autocomplete, learn more in the docs",
+ "Download Ollama",
"Documentation",
)
.then((value) => {
@@ -65,6 +66,8 @@ export class TabAutocompleteModel {
"https://continue.dev/docs/walkthroughs/tab-autocomplete",
),
);
+ } else if (value === "Download Ollama") {
+ vscode.env.openExternal(vscode.Uri.parse("https://ollama.ai"));
}
});
this.shownOllamaWarning = true;
diff --git a/extensions/vscode/src/webviewProtocol.ts b/extensions/vscode/src/webviewProtocol.ts
index 4ffc24116..092c65e99 100644
--- a/extensions/vscode/src/webviewProtocol.ts
+++ b/extensions/vscode/src/webviewProtocol.ts
@@ -234,7 +234,7 @@ export class VsCodeWebviewProtocol {
});
// History
this.on("history/list", (msg) => {
- return historyManager.list();
+ return historyManager.list(msg.data);
});
this.on("history/save", (msg) => {
historyManager.save(msg.data);
@@ -335,6 +335,17 @@ export class VsCodeWebviewProtocol {
this.configHandler.reloadConfig();
});
+ this.on("llm/listModels", async (msg) => {
+ try {
+ const model = await this.configHandler.llmFromTitle(msg.data.title);
+ const models = await model.listModels();
+ return models;
+ } catch (e) {
+ console.warn("Error listing models", e);
+ return undefined;
+ }
+ });
+
async function* llmStreamComplete(
protocol: VsCodeWebviewProtocol,
msg: Message,
@@ -579,6 +590,7 @@ export class VsCodeWebviewProtocol {
? setupOptimizedMode
: setupOptimizedExistingUserMode,
);
+ this.configHandler.reloadConfig();
});
this.on("openUrl", (msg) => {
@@ -605,6 +617,9 @@ export class VsCodeWebviewProtocol {
);
});
});
+ this.on("copyText", async (msg) => {
+ await vscode.env.clipboard.writeText(msg.data.text);
+ });
}
public request(
@@ -612,10 +627,16 @@ export class VsCodeWebviewProtocol {
data: ReverseWebviewProtocol[T][0],
): Promise {
const messageId = uuidv4();
- return new Promise((resolve) => {
- if (!this.webview) {
- resolve(undefined);
- return;
+ return new Promise(async (resolve) => {
+ let i = 0;
+ while (!this.webview) {
+ if (i >= 10) {
+ resolve(undefined);
+ return;
+ } else {
+ await new Promise((res) => setTimeout(res, i >= 5 ? 1000 : 500));
+ i++;
+ }
}
this.send(messageType, data, messageId);
diff --git a/extensions/vscode/tsconfig.json b/extensions/vscode/tsconfig.json
index 9d1481221..0a9234dae 100644
--- a/extensions/vscode/tsconfig.json
+++ b/extensions/vscode/tsconfig.json
@@ -15,5 +15,5 @@
"resolveJsonModule": true /* Enable importing .json files */
},
"include": ["src/**/*", "../../core/**/*.ts"],
- "exclude": ["../../core/dist/**/*"]
+ "exclude": ["../../core/dist/**/*", "../../core/test/**/*"]
}
diff --git a/extensions/vscode/yarn.lock b/extensions/vscode/yarn.lock
index 07f331801..0d5d39a4d 100644
--- a/extensions/vscode/yarn.lock
+++ b/extensions/vscode/yarn.lock
@@ -2389,7 +2389,7 @@ core-util-is@1.0.2:
socket.io-client "^4.7.3"
sqlite "^5.1.1"
sqlite3 "^5.1.7"
- tree-sitter-wasms "^0.1.6"
+ tree-sitter-wasms "^0.1.11"
uuid "^9.0.1"
vectordb "0.4.12"
web-tree-sitter "^0.21.0"
diff --git a/gui/package-lock.json b/gui/package-lock.json
index 317237093..ef71dc6e0 100644
--- a/gui/package-lock.json
+++ b/gui/package-lock.json
@@ -111,7 +111,7 @@
"socket.io-client": "^4.7.3",
"sqlite": "^5.1.1",
"sqlite3": "^5.1.7",
- "tree-sitter-wasms": "^0.1.6",
+ "tree-sitter-wasms": "^0.1.11",
"uuid": "^9.0.1",
"vectordb": "0.4.12",
"web-tree-sitter": "^0.21.0"
diff --git a/gui/public/logos/cohere.png b/gui/public/logos/cohere.png
new file mode 100644
index 000000000..3da0b8373
Binary files /dev/null and b/gui/public/logos/cohere.png differ
diff --git a/gui/src/App.tsx b/gui/src/App.tsx
index 50ae708a1..13f205dbe 100644
--- a/gui/src/App.tsx
+++ b/gui/src/App.tsx
@@ -16,6 +16,7 @@ import { ContextSubmenuItem } from "core";
import useSubmenuContextProviders from "./hooks/useSubmenuContextProviders";
import { useVscTheme } from "./hooks/useVscTheme";
import GUI from "./pages/gui";
+import LocalOnboarding from "./pages/localOnboarding";
import ExistingUserOnboarding from "./pages/onboarding/existingUserOnboarding";
import Onboarding from "./pages/onboarding/onboarding";
import Stats from "./pages/stats";
@@ -74,6 +75,10 @@ const router = createMemoryRouter([
path: "/existingUserOnboarding",
element: ,
},
+ {
+ path: "/localOnboarding",
+ element: ,
+ },
{
path: "/migration",
element: ,
diff --git a/gui/src/components/HeaderButtonWithText.tsx b/gui/src/components/HeaderButtonWithText.tsx
index b1b4f5241..9c5647a91 100644
--- a/gui/src/components/HeaderButtonWithText.tsx
+++ b/gui/src/components/HeaderButtonWithText.tsx
@@ -5,7 +5,7 @@ import { HeaderButton, StyledTooltip } from ".";
import { v4 as uuidv4 } from "uuid";
interface HeaderButtonWithTextProps {
- text: string;
+ text: string | undefined;
onClick?: (e: any) => void;
children: React.ReactNode;
disabled?: boolean;
@@ -15,6 +15,8 @@ interface HeaderButtonWithTextProps {
onKeyDown?: (e: any) => void;
tabIndex?: number;
style?: React.CSSProperties;
+ backgroundColor?: string;
+ hoverBackgroundColor?: string;
}
const HeaderButtonWithText = React.forwardRef<
@@ -29,6 +31,8 @@ const HeaderButtonWithText = React.forwardRef<
return (
<>
{props.children}
- {tooltipPortalDiv &&
+ {props.text &&
+ tooltipPortalDiv &&
ReactDOM.createPortal(
)}
@@ -106,19 +106,47 @@ function Onboarding() {
This can always be done later.
+ {selected === 2 && (
+
+ Use config.json to configure your own{" "}
+ models,{" "}
+
+ context providers
+
+ ,{" "}
+
+ slash commands
+
+ , and more.
+
+ )}
{
- postToIde("showTutorial", undefined);
postToIde("completeOnboarding", {
mode: ["local", "optimized", "custom"][selected] as any,
});
setLocalStorage("onboardingComplete", true);
- postToIde("index/forceReIndex", undefined);
- navigate("/");
+
+ if (selected === 0) {
+ navigate("/localOnboarding");
+ } else {
+ // Only needed when we switch from the default (local) embeddings provider
+ postToIde("index/forceReIndex", undefined);
+ // Don't show the tutorial above yet because there's another step to complete at /localOnboarding
+ postToIde("showTutorial", undefined);
+ navigate("/");
+ }
}}
>
Continue
diff --git a/gui/src/redux/slices/stateSlice.ts b/gui/src/redux/slices/stateSlice.ts
index 1977bb500..b25edd7a5 100644
--- a/gui/src/redux/slices/stateSlice.ts
+++ b/gui/src/redux/slices/stateSlice.ts
@@ -118,9 +118,9 @@ const initialState: State = {
contextProviders: [],
models: [
{
- title: "GPT-4 Vision (Free Trial)",
+ title: "GPT-4 Turbo (Free Trial)",
provider: "free-trial",
- model: "gpt-4-vision-preview",
+ model: "gpt-4-turbo",
},
{
title: "GPT-3.5-Turbo (Free Trial)",
@@ -164,7 +164,9 @@ export const stateSlice = createSlice({
) => {
const defaultModelTitle =
config.models.find((model) => model.title === state.defaultModelTitle)
- ?.title || config.models[0].title;
+ ?.title ||
+ config.models[0]?.title ||
+ "";
state.config = config;
state.defaultModelTitle = defaultModelTitle;
},
diff --git a/gui/src/util/localStorage.ts b/gui/src/util/localStorage.ts
index faddd64f6..2ad952bd3 100644
--- a/gui/src/util/localStorage.ts
+++ b/gui/src/util/localStorage.ts
@@ -1,6 +1,7 @@
type LocalStorageTypes = {
onboardingComplete: boolean;
mainTextEntryCounter: number;
+ lastSessionId: string | undefined;
};
export function getLocalStorage(
diff --git a/gui/src/util/modelData.ts b/gui/src/util/modelData.ts
index b4afcc7a9..99702f296 100644
--- a/gui/src/util/modelData.ts
+++ b/gui/src/util/modelData.ts
@@ -231,6 +231,32 @@ const mixtralTrial: ModelPackage = {
providerOptions: ["freetrial", "groq"],
};
+const llama38bChat: ModelPackage = {
+ title: "Llama3 8b",
+ description: "The latest Llama model from Meta, fine-tuned for chat",
+ refUrl: "",
+ params: {
+ title: "Llama3-8b",
+ model: "llama3-8b",
+ contextLength: 8192,
+ },
+ icon: "meta.png",
+ providerOptions: ["groq"],
+};
+
+const llama370bChat: ModelPackage = {
+ title: "Llama3 70b Chat",
+ description: "The latest Llama model from Meta, fine-tuned for chat",
+ refUrl: "",
+ params: {
+ title: "Llama3-70b",
+ model: "llama3-70b",
+ contextLength: 8192,
+ },
+ icon: "meta.png",
+ providerOptions: ["groq"],
+};
+
const llama270bChat: ModelPackage = {
title: "Llama2 70b Chat",
description: "The latest Llama model from Meta, fine-tuned for chat",
@@ -244,14 +270,14 @@ const llama270bChat: ModelPackage = {
providerOptions: ["groq"],
};
-const llama2Chat: ModelPackage = {
- title: "Llama2 Chat",
- description: "The latest Llama model from Meta, fine-tuned for chat",
+const llama3Chat: ModelPackage = {
+ title: "Llama3 Chat",
+ description: "The latest model from Meta, fine-tuned for chat",
refUrl: "",
params: {
- title: "Llama2-7b",
- model: "llama2-7b",
- contextLength: 4096,
+ title: "Llama3-8b",
+ model: "llama3-8b",
+ contextLength: 8192,
},
icon: "meta.png",
dimensions: [
@@ -259,17 +285,13 @@ const llama2Chat: ModelPackage = {
name: "Parameter Count",
description: "The number of parameters in the model",
options: {
- "7b": {
- model: "llama2-7b",
- title: "Llama2-7b",
+ "8b": {
+ model: "llama3-8b",
+ title: "Llama3-8b",
},
- "13b": {
- model: "llama2-13b",
- title: "Llama2-13b",
- },
- "34b": {
- model: "llama2-34b",
- title: "Llama2-34b",
+ "70b": {
+ model: "llama3-70b",
+ title: "Llama3-70b",
},
},
},
@@ -418,7 +440,19 @@ const geminiPro: ModelPackage = {
apiKey: "",
},
icon: "gemini.png",
- providerOptions: ["palm", "freetrial"],
+ providerOptions: ["gemini"],
+};
+const gemini15Pro: ModelPackage = {
+ title: "Gemini 1.5 Pro",
+ description: "A newer Gemini model with 1M token context length",
+ params: {
+ title: "Gemini 1.5 Pro",
+ model: "gemini-1.5-pro-latest",
+ contextLength: 1_000_000,
+ apiKey: "",
+ },
+ icon: "gemini.png",
+ providerOptions: ["gemini", "freetrial"],
};
const zephyr: ModelPackage = {
@@ -490,30 +524,45 @@ const neuralChat: ModelPackage = {
providerOptions: ["ollama", "lmstudio", "llamacpp", "replicate"],
};
+const commandR: ModelPackage = {
+ title: "Command R",
+ description:
+ "Command R is a scalable generative model targeting RAG and Tool Use to enable production-scale AI for enterprise.",
+ params: {
+ model: "command-r",
+ contextLength: 128_000,
+ title: "Command R",
+ apiKey: "",
+ },
+ providerOptions: ["cohere"],
+ icon: "cohere.png",
+};
+
+const commandRPlus: ModelPackage = {
+ title: "Command R+",
+ description:
+ "Command R+ is a state-of-the-art RAG-optimized model designed to tackle enterprise-grade workloads",
+ params: {
+ model: "command-r-plus",
+ contextLength: 128_000,
+ title: "Command R+",
+ apiKey: "",
+ },
+ providerOptions: ["cohere"],
+ icon: "cohere.png",
+};
+
const osModels = [
+ llama3Chat,
deepseek,
wizardCoder,
codeLlamaInstruct,
mistral,
phindCodeLlama,
- llama2Chat,
zephyr,
neuralChat,
];
-const gpt4turbo: ModelPackage = {
- title: "GPT-4 Turbo",
- description:
- "A faster, cheaper version of GPT-4 with a longer context length",
- params: {
- model: "gpt-4-turbo-preview",
- contextLength: 128_000,
- title: "gpt-4-turbo-preview",
- },
- providerOptions: ["openai", "freetrial"],
- icon: "openai.png",
-};
-
const gpt4: ModelPackage = {
title: "GPT-4",
description: "The most powerful model from OpenAI",
@@ -526,14 +575,14 @@ const gpt4: ModelPackage = {
icon: "openai.png",
};
-const gpt4vision: ModelPackage = {
- title: "GPT-4 Vision",
+const gpt4turbo: ModelPackage = {
+ title: "GPT-4 Turbo",
description:
- "A faster version of GPT-4 with longer context length and image support",
+ "A faster and more capable version of GPT-4 with longer context length and image support",
params: {
- model: "gpt-4-vision-preview",
+ model: "gpt-4-turbo",
contextLength: 128_000,
- title: "GPT-4 Vision",
+ title: "GPT-4 Turbo",
},
providerOptions: ["openai", "freetrial"],
icon: "openai.png",
@@ -607,20 +656,6 @@ const claude3Haiku: ModelPackage = {
icon: "anthropic.png",
};
-const chatBison: ModelPackage = {
- title: "chat-bison-001",
- description:
- "Google PaLM's chat-bison-001 model, fine-tuned for chatting about code",
- params: {
- model: "chat-bison-001",
- contextLength: 8000,
- apiKey: "",
- title: "Chat Bison",
- },
- providerOptions: ["palm"],
- icon: "google-palm.png",
-};
-
const AUTODETECT: ModelPackage = {
title: "Autodetect",
description:
@@ -631,22 +666,30 @@ const AUTODETECT: ModelPackage = {
providerOptions: [],
};
-export const MODEL_INFO: ModelPackage[] = [
+export const MODEL_INFO: (ModelPackage | string)[] = [
+ "OpenAI",
gpt4turbo,
gpt4,
gpt35turbo,
- geminiPro,
+ "Anthropic",
claude3Opus,
claude3Sonnet,
claude3Haiku,
claude2,
+ "Cohere",
+ commandR,
+ commandRPlus,
+ "Gemini",
+ gemini15Pro,
+ geminiPro,
+ "Open Source",
+ llama3Chat,
deepseek,
mistral,
codellama70bTrial,
wizardCoder,
codeLlamaInstruct,
phindCodeLlama,
- llama2Chat,
zephyr,
];
@@ -663,7 +706,7 @@ export const PROVIDER_INFO: { [key: string]: ModelInfo } = {
gpt4,
gpt35turbo,
gpt4turbo,
- gpt4vision,
+ gpt4turbo,
{
...AUTODETECT,
params: {
@@ -709,6 +752,28 @@ export const PROVIDER_INFO: { [key: string]: ModelInfo } = {
],
packages: [claude3Opus, claude3Sonnet, claude3Haiku, claude2],
},
+ cohere: {
+ title: "Cohere",
+ provider: "cohere",
+ refPage: "cohere",
+ description:
+ "Optimized for enterprise generative AI, search and discovery, and advanced retrieval.",
+ icon: "cohere.png",
+ tags: [ModelProviderTag["Requires API Key"]],
+ longDescription:
+ "To use Cohere, visit the [Cohere dashboard](https://dashboard.cohere.com/api-keys) to create an API key.",
+ collectInputFor: [
+ {
+ inputType: CollectInputType.text,
+ key: "apiKey",
+ label: "API Key",
+ placeholder: "Enter your Cohere API key",
+ required: true,
+ },
+ ...completionParamsInputs,
+ ],
+ packages: [commandR, commandRPlus],
+ },
ollama: {
title: "Ollama",
provider: "ollama",
@@ -758,7 +823,7 @@ export const PROVIDER_INFO: { [key: string]: ModelInfo } = {
},
...completionParamsInputs,
],
- packages: [llama2Chat, codeLlamaInstruct, mistral].map((p) => {
+ packages: [llama3Chat, codeLlamaInstruct, mistral].map((p) => {
p.params.contextLength = 4096;
return p;
}),
@@ -785,6 +850,8 @@ export const PROVIDER_INFO: { [key: string]: ModelInfo } = {
},
],
packages: [
+ llama370bChat,
+ llama38bChat,
{ ...mixtralTrial, title: "Mixtral" },
llama270bChat,
{
@@ -797,9 +864,9 @@ export const PROVIDER_INFO: { [key: string]: ModelInfo } = {
,
],
},
- palm: {
+ gemini: {
title: "Google Gemini API",
- provider: "google-palm",
+ provider: "gemini",
refPage: "googlepalmapi",
description:
"Try out Google's state-of-the-art Gemini model from their API.",
@@ -815,7 +882,7 @@ export const PROVIDER_INFO: { [key: string]: ModelInfo } = {
required: true,
},
],
- packages: [geminiPro],
+ packages: [gemini15Pro, geminiPro],
},
mistral: {
title: "Mistral API",
@@ -905,7 +972,7 @@ export const PROVIDER_INFO: { [key: string]: ModelInfo } = {
ModelProviderTag["Requires API Key"],
ModelProviderTag["Open-Source"],
],
- packages: [codeLlamaInstruct, llama2Chat, wizardCoder, mistral, zephyr],
+ packages: [llama3Chat, codeLlamaInstruct, wizardCoder, mistral, zephyr],
},
llamacpp: {
title: "llama.cpp",
@@ -989,8 +1056,8 @@ After it's up and running, you can start using Continue.`,
{ ...claude3Opus, title: "Claude 3 Opus (trial)" },
{ ...claude3Sonnet, title: "Claude 3 Sonnet (trial)" },
{ ...claude3Haiku, title: "Claude 3 Haiku (trial)" },
- { ...geminiPro, title: "Gemini Pro (trial)" },
- { ...gpt4vision, title: "GPT-4 Vision (trial)" },
+ { ...gemini15Pro, title: "Gemini 1.5 Pro (trial)" },
+ { ...gpt4turbo, title: "GPT-4 Turbo (trial)" },
{ ...gpt35turbo, title: "GPT-3.5-Turbo (trial)" },
{
...AUTODETECT,
diff --git a/gui/tailwind.config.cjs b/gui/tailwind.config.cjs
index 276d3b8a0..269b57ef1 100644
--- a/gui/tailwind.config.cjs
+++ b/gui/tailwind.config.cjs
@@ -1,5 +1,4 @@
/** @type {import('tailwindcss').Config} */
-const colors = require("tailwindcss/colors");
module.exports = {
content: [
@@ -12,7 +11,6 @@ module.exports = {
colors: {
"vsc-background": "rgb(var(--vsc-background) / )",
"secondary-dark": "rgb(var(--secondary-dark) / )",
- ...colors,
},
},
plugins: [],
diff --git a/install-dependencies.sh b/install-dependencies.sh
index 3400e40b6..b32f75774 100755
--- a/install-dependencies.sh
+++ b/install-dependencies.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# This is used in a task in .vscode/tasks.json
# Start developing with:
# - Run Task -> Install Dependencies
diff --git a/schema/json/ModelDescription.json b/schema/json/ModelDescription.json
index 53bd6c6e0..16136e8fe 100644
--- a/schema/json/ModelDescription.json
+++ b/schema/json/ModelDescription.json
@@ -107,7 +107,7 @@
"llama.cpp",
"replicate",
"text-gen-webui",
- "google-palm",
+ "gemini",
"lmstudio",
"llamafile"
],
diff --git a/schema/json/ModelProvider.json b/schema/json/ModelProvider.json
index 0912799ba..7e6eb32a1 100644
--- a/schema/json/ModelProvider.json
+++ b/schema/json/ModelProvider.json
@@ -12,7 +12,7 @@
"llama.cpp",
"replicate",
"text-gen-webui",
- "google-palm",
+ "gemini",
"lmstudio",
"llamafile"
],
diff --git a/schema/json/SerializedContinueConfig.json b/schema/json/SerializedContinueConfig.json
index d3e3991f2..b65b7d0a4 100644
--- a/schema/json/SerializedContinueConfig.json
+++ b/schema/json/SerializedContinueConfig.json
@@ -107,7 +107,7 @@
"llama.cpp",
"replicate",
"text-gen-webui",
- "google-palm",
+ "gemini",
"lmstudio",
"llamafile"
],