merge main

This commit is contained in:
Dallin Romney 2025-04-30 01:00:36 -07:00
commit fd53feb2e4
34 changed files with 375 additions and 137 deletions

View file

@ -7,6 +7,7 @@
"plugins": ["@typescript-eslint", "import"],
"rules": {
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/semi": "warn",
"curly": "warn",
"eqeqeq": "warn",

View file

@ -16,9 +16,9 @@ jobs:
repo-token: ${{ secrets.CI_GITHUB_TOKEN }}
assignees: sestinj,Patrick-Erichsen,tomasz-stefaniak,RomneyDa
numOfAssignee: 1
- name: "Add default labels"
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: |
"needs-triage"
# - name: "Add default labels"
# uses: actions-ecosystem/action-add-labels@v1
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# labels: |
# "needs-triage"

View file

@ -7,7 +7,8 @@
"rules": {
"quotes": ["off", "double", {}],
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-floating-promises": "off",
// This is important: when floating promises cause unhandled rejections, the JetBrains binary blows up
"@typescript-eslint/no-floating-promises": "error",
"import/order": "off",
"curly": "off",
"@typescript-eslint/semi": "off",

View file

@ -261,7 +261,9 @@ export class CompletionProvider {
// Save to cache
if (!outcome.cacheHit && helper.options.useCache) {
(await this.autocompleteCache).put(outcome.prefix, outcome.completion);
(await this.autocompleteCache)
.put(outcome.prefix, outcome.completion)
.catch((e) => console.warn(`Failed to save to cache: ${e.message}`));
}
// When using the JetBrains extension, Mark as displayed

View file

@ -22,7 +22,13 @@ export class ImportDefinitionsService {
constructor(private readonly ide: IDE) {
ide.onDidChangeActiveTextEditor((filepath) => {
this.cache.initKey(filepath);
this.cache
.initKey(filepath)
.catch((e) =>
console.warn(
`Failed to initialize ImportDefinitionService: ${e.message}`,
),
);
});
}

View file

@ -3,16 +3,18 @@ export class ListenableGenerator<T> {
private _buffer: T[] = [];
private _listeners: Set<(value: T) => void> = new Set();
private _isEnded = false;
private _abortController: AbortController
private _abortController: AbortController;
constructor(
source: AsyncGenerator<T>,
private readonly onError: (e: any) => void,
abortController: AbortController
abortController: AbortController,
) {
this._source = source;
this._abortController = abortController;
this._start();
this._start().catch((e) =>
console.log(`Listenable generator failed: ${e.message}`),
);
}
public cancel() {

View file

@ -349,7 +349,7 @@ export class ConfigHandler {
this.currentOrg = org;
if (profileId) {
this.setSelectedProfileId(profileId);
await this.setSelectedProfileId(profileId);
} else {
this.currentProfile = org.currentProfile;
await this.reloadConfig();

View file

@ -1,35 +0,0 @@
import { AssistantUnrolled, ModelConfig } from "@continuedev/config-yaml";
import { SerializedContinueConfig } from "../..";
/*
TODO this is not functional
*/
export function convertConfigJsonToConfigYaml(
configJson: SerializedContinueConfig,
): AssistantUnrolled {
return {
name: "Local Assistant",
version: "1.0.0",
schema: "v1",
models: [
...configJson.models.map(
(model): ModelConfig => ({
model: model.model,
name: model.title,
// defaultCompletionOptions: model.completionOptions,
provider: model.provider,
roles: ["chat", "edit", "apply", "summarize"],
}),
),
// TODO
// tabAutocompleteModels
// embeddingsModels
// rerankModels
],
context: configJson.contextProviders?.map((provider) => ({
provider: provider.name,
params: provider.params,
})),
};
}

View file

@ -349,8 +349,8 @@ export class Core {
return await this.configHandler.getSerializedConfig();
});
on("config/ideSettingsUpdate", (msg) => {
this.configHandler.updateIdeSettings(msg.data);
on("config/ideSettingsUpdate", async (msg) => {
await this.configHandler.updateIdeSettings(msg.data);
});
on("config/refreshProfiles", async (msg) => {
@ -389,7 +389,7 @@ export class Core {
});
on("mcp/reloadServer", async (msg) => {
MCPManagerSingleton.getInstance().refreshConnection(msg.data.id);
await MCPManagerSingleton.getInstance().refreshConnection(msg.data.id);
});
// Context providers
on("context/addDocs", async (msg) => {
@ -743,7 +743,7 @@ export class Core {
if (!config) {
return false;
}
const llm = config?.selectedModelByRole.chat;
if (!llm) {
throw new Error("No chat model selected");
@ -1034,10 +1034,9 @@ export class Core {
}
this.indexingCancellationController = new AbortController();
try {
for await (const update of (await this.codebaseIndexerPromise).refreshDirs(
paths,
this.indexingCancellationController.signal,
)) {
for await (const update of (
await this.codebaseIndexerPromise
).refreshDirs(paths, this.indexingCancellationController.signal)) {
let updateToSend = { ...update };
void this.messenger.request("indexProgress", updateToSend);
@ -1067,10 +1066,10 @@ export class Core {
return;
}
this.indexingCancellationController = new AbortController();
try{
for await (const update of (await this.codebaseIndexerPromise).refreshFiles(
files,
)) {
try {
for await (const update of (
await this.codebaseIndexerPromise
).refreshFiles(files)) {
let updateToSend = { ...update };
void this.messenger.request("indexProgress", updateToSend);
@ -1093,18 +1092,18 @@ export class Core {
// private
handleIndexingError(e: any) {
if (e instanceof LLMError) {
// Need to report this specific error to the IDE for special handling
this.messenger.request("reportError", e);
}
// broadcast indexing error
let updateToSend: IndexingProgressUpdate = {
progress: 0,
status: "failed",
desc: e.message,
};
void this.messenger.request("indexProgress", updateToSend);
this.codebaseIndexingState = updateToSend;
void this.sendIndexingErrorTelemetry(updateToSend);
if (e instanceof LLMError) {
// Need to report this specific error to the IDE for special handling
void this.messenger.request("reportError", e);
}
// broadcast indexing error
let updateToSend: IndexingProgressUpdate = {
progress: 0,
status: "failed",
desc: e.message,
};
void this.messenger.request("indexProgress", updateToSend);
this.codebaseIndexingState = updateToSend;
void this.sendIndexingErrorTelemetry(updateToSend);
}
}

View file

@ -161,9 +161,11 @@ export async function* streamDiffLines({
? llm.streamComplete(prompt, new AbortController().signal, {
raw: true,
prediction,
reasoning: false,
})
: llm.streamChat(prompt, new AbortController().signal, {
prediction,
reasoning: false,
});
let lines = streamLines(completion);

View file

@ -57,7 +57,7 @@ export class CodeSnippetsCodebaseIndex implements CodebaseIndex {
FOREIGN KEY (snippetId) REFERENCES code_snippets (id)
)`);
migrate("add_signature_column", async () => {
await migrate("add_signature_column", async () => {
const tableInfo = await db.all("PRAGMA table_info(code_snippets)");
const signatureColumnExists = tableInfo.some(
(column) => column.name === "signature",
@ -71,7 +71,7 @@ export class CodeSnippetsCodebaseIndex implements CodebaseIndex {
}
});
migrate("delete_duplicate_code_snippets", async () => {
await migrate("delete_duplicate_code_snippets", async () => {
// Delete duplicate entries in code_snippets
await db.exec(`
DELETE FROM code_snippets
@ -256,7 +256,7 @@ export class CodeSnippetsCodebaseIndex implements CodebaseIndex {
progress: i / results.compute.length,
status: "indexing",
};
markComplete([compute], IndexResultType.Compute);
await markComplete([compute], IndexResultType.Compute);
}
// Delete
@ -278,7 +278,7 @@ export class CodeSnippetsCodebaseIndex implements CodebaseIndex {
);
}
markComplete([del], IndexResultType.Delete);
await markComplete([del], IndexResultType.Delete);
}
// Add tag
@ -313,7 +313,7 @@ export class CodeSnippetsCodebaseIndex implements CodebaseIndex {
);
}
markComplete([results.addTag[i]], IndexResultType.AddTag);
await markComplete([results.addTag[i]], IndexResultType.AddTag);
}
// Remove tag
@ -343,7 +343,7 @@ export class CodeSnippetsCodebaseIndex implements CodebaseIndex {
);
}
markComplete([results.removeTag[i]], IndexResultType.RemoveTag);
await markComplete([results.removeTag[i]], IndexResultType.RemoveTag);
}
}

View file

@ -48,10 +48,10 @@ export class TestCodebaseIndex implements CodebaseIndex {
);
}
markComplete(results.compute, IndexResultType.Compute);
markComplete(results.addTag, IndexResultType.AddTag);
markComplete(results.del, IndexResultType.Delete);
markComplete(results.removeTag, IndexResultType.RemoveTag);
await markComplete(results.compute, IndexResultType.Compute);
await markComplete(results.addTag, IndexResultType.AddTag);
await markComplete(results.del, IndexResultType.Delete);
await markComplete(results.removeTag, IndexResultType.RemoveTag);
}
async getIndexedFilesForTags(tags: IndexTag[]): Promise<string[]> {

View file

@ -510,7 +510,7 @@ export default class DocsService {
} catch (e) {
if (e instanceof LLMError) {
// Report the error to the IDE
this.messenger?.request("reportError", e);
await this.messenger?.request("reportError", e);
}
this.handleStatusUpdate({
...fixedStatus,

View file

@ -1,4 +1,4 @@
import { LlamaAsyncEncoder, GPTAsyncEncoder } from "./asyncEncoder";
import { GPTAsyncEncoder, LlamaAsyncEncoder } from "./asyncEncoder";
describe("llama encoder", () => {
var tokenizer: LlamaAsyncEncoder;
@ -8,7 +8,7 @@ describe("llama encoder", () => {
});
afterAll(() => {
tokenizer.close();
tokenizer.close().catch((e) => {});
});
test("hello world", async () => {
@ -30,7 +30,7 @@ describe("tiktoken encoder", () => {
});
afterAll(() => {
tokenizer.close();
tokenizer.close().catch((e) => {});
});
test("hello world", async () => {

View file

@ -72,6 +72,7 @@ const PROVIDER_SUPPORTS_IMAGES: string[] = [
"sagemaker",
"continue-proxy",
"openrouter",
"venice",
"sambanova",
"vertexai",
"azure",
@ -96,7 +97,7 @@ const MODEL_SUPPORTS_IMAGES: string[] = [
"pixtral",
"llama3.2",
"llama-3.2",
"llama4"
"llama4",
];
function modelSupportsTools(modelDescription: ModelDescription) {

View file

@ -60,7 +60,7 @@ class Docker extends OpenAI implements ModelInstaller {
}
// Check if Docker Model Runner is active and enable it if needed
this.ensureModelRunnerEnabled();
this.ensureModelRunnerEnabled().catch((e) => {});
}
/**
@ -198,7 +198,7 @@ class Docker extends OpenAI implements ModelInstaller {
return { success: true, stdout, stderr };
} catch (error) {
console.error(`Failed to install Docker model ${targetModel}:`, error);
// Fix: Type check the error before accessing message property
// Fix: Type check the error before accessing message property
const errorMessage =
error instanceof Error ? error.message : String(error);
throw new Error(

View file

@ -14,18 +14,22 @@ class HuggingFaceTGI extends BaseLLM {
this.fetch(new URL("info", this.apiBase), {
method: "GET",
}).then(async (response) => {
if (response.status !== 200) {
console.warn(
"Error calling Hugging Face TGI /info endpoint: ",
await response.text(),
);
return;
}
const json = await response.json();
this.model = json.model_id;
this.contextLength = Number.parseInt(json.max_input_length);
});
})
.then(async (response) => {
if (response.status !== 200) {
console.warn(
"Error calling Hugging Face TGI /info endpoint: ",
await response.text(),
);
return;
}
const json = await response.json();
this.model = json.model_id;
this.contextLength = Number.parseInt(json.max_input_length);
})
.catch((e) => {
console.log(`Failed to list models for HuggingFace TGI: ${e.message}`);
});
}
private _convertArgs(options: CompletionOptions, prompt: string) {

22
core/llm/llms/Venice.ts Normal file
View file

@ -0,0 +1,22 @@
import { ChatCompletionCreateParams } from "@continuedev/openai-adapters";
import { ChatMessage, CompletionOptions, LLMOptions } from "../../index.js";
import OpenAI from "./OpenAI";
class Venice extends OpenAI {
static providerName = "venice";
static defaultOptions: Partial<LLMOptions> = {
apiBase: "https://api.venice.ai/api/v1",
};
protected _convertArgs(options: CompletionOptions, messages: ChatMessage[]): ChatCompletionCreateParams {
const finalOptions = super._convertArgs(options, messages) as ChatCompletionCreateParams & { venice_parameters?: any };
if ("venice_parameters" in options && typeof options.venice_parameters === "object") {
finalOptions.venice_parameters = { ...options.venice_parameters };
}
return finalOptions;
}
}
export default Venice;

View file

@ -22,7 +22,11 @@ class VertexAI extends BaseLLM {
private clientPromise = new GoogleAuth({
scopes: "https://www.googleapis.com/auth/cloud-platform",
}).getClient();
})
.getClient()
.catch((e) => {
console.warn(`Failed to load credentials for Vertex AI: ${e.message}`);
});
private static getDefaultApiBaseFrom(options: LLMOptions) {
const { region, projectId } = options;
@ -60,8 +64,8 @@ class VertexAI extends BaseLLM {
async fetch(url: RequestInfo | URL, init?: RequestInit) {
const client = await this.clientPromise;
const { token } = await client.getAccessToken();
if (!token) {
const result = await client?.getAccessToken();
if (!result?.token) {
throw new Error(
"Could not get an access token. Set up your Google Application Default Credentials.",
);
@ -70,7 +74,7 @@ class VertexAI extends BaseLLM {
...init,
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${token}`,
Authorization: `Bearer ${result.token}`,
...init?.headers,
},
});
@ -370,8 +374,8 @@ class VertexAI extends BaseLLM {
protected async _embed(chunks: string[]): Promise<number[][]> {
const client = await this.clientPromise;
const { token } = await client.getAccessToken();
if (!token) {
const result = await client?.getAccessToken();
if (!result?.token) {
throw new Error(
"Could not get an access token. Set up your Google Application Default Credentials.",
);
@ -386,7 +390,7 @@ class VertexAI extends BaseLLM {
}),
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${token}`,
Authorization: `Bearer ${result.token}`,
},
},
);
@ -402,8 +406,4 @@ class VertexAI extends BaseLLM {
}
}
async function delay(seconds: number) {
return new Promise((resolve) => setTimeout(resolve, seconds * 1000));
}
export default VertexAI;

View file

@ -16,19 +16,23 @@ class Vllm extends OpenAI {
this.fetch(this._getEndpoint("models"), {
method: "GET",
headers: this._getHeaders(),
}).then(async (response) => {
if (response.status !== 200) {
console.warn(
"Error calling vLLM /models endpoint: ",
await response.text(),
);
return;
}
const json = await response.json();
const data = json.data[0];
this.model = data.id;
this.contextLength = Number.parseInt(data.max_model_len);
});
})
.then(async (response) => {
if (response.status !== 200) {
console.warn(
"Error calling vLLM /models endpoint: ",
await response.text(),
);
return;
}
const json = await response.json();
const data = json.data[0];
this.model = data.id;
this.contextLength = Number.parseInt(data.max_model_len);
})
.catch((e) => {
console.log(`Failed to list models for vLLM: ${e.message}`);
});
}
}

View file

@ -57,6 +57,7 @@ import ContinueProxy from "./stubs/ContinueProxy";
import TestLLM from "./Test";
import TextGenWebUI from "./TextGenWebUI";
import Together from "./Together";
import Venice from "./Venice";
import VertexAI from "./VertexAI";
import Vllm from "./Vllm";
import Voyage from "./Voyage";
@ -109,6 +110,7 @@ export const LLMClasses = [
Cerebras,
Asksage,
Nebius,
Venice,
VertexAI,
xAI,
SiliconFlow,

View file

@ -0,0 +1,35 @@
# Venice
Venice.AI is a privacy focused generative AI platform, allowing users to interact with open-source LLMs without storing any private user data. To get started with Venice's API, either purchase a pro account, stake $VVV to obtain daily inference allotments or fund your account with USD and head over to https://venice.ai/settings/api. Venice hosts state of the art open-source AI models and supports the OpenAI API standard, allowing users to easily interact with the platform. Learn more about the Venice API at https://venice.ai/api.
Change `~/.continue/config.json` to look like the following.
```json title="config.json"
{
"models": [
{
"provider": "venice",
"title": "Autodetect",
"model": "AUTODETECT",
"apiKey": "..."
}
]
}
```
To utilize features offered by the venice API that are not apart of the standard OpenAI API schema, include these as `venice_parameters`
For example, to use models with no system prompt, you can explicitly turn off the feature like so:
```json title="config.json"
{
"completionOptions": {
"venice_parameters": {
"include_venice_system_prompt" : false
},
...
}
}
```
Learn more about available settings [here](https://docs.venice.ai/api-reference/api-spec).

View file

@ -5,6 +5,7 @@
},
"extends": ["../../.eslintrc.shared.json"],
"rules": {
"@typescript-eslint/naming-convention": "off"
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-floating-promises": "warn"
}
}

View file

@ -231,8 +231,9 @@
"function-network",
"scaleway",
"relace",
"morph",
"ovhcloud",
"morph"
"venice"
],
"markdownEnumDescriptions": [
"### 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://docs.continue.dev/reference/Model%20Providers/openai)",
@ -280,8 +281,9 @@
"### Function Network offers private, affordable user-owned AI\nTo get started with Function Network, obtain your API key from [Function Network](https://www.function.network/join-waitlist). Function Network provides a variety of models for chat, completion, and embeddings.",
"### Scaleway\n Generative APIs are serverless endpoints for the most popular AI models.\nHosted in European data centers and priced competitively per million tokens used, models served by Scaleway are ideal for users requiring low latency, full data privacy, and 100% compliance with EU AI Act. To get access to the Scaleway Generative APIs, read the [Quickstart guide](https://www.scaleway.com/en/docs/ai-data/generative-apis/quickstart/) and get a [valid API key](https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/).",
"### Relace\n Relace provides a fast apply model. To get started, obtain an API key from [here](https://app.relace.ai/settings/api-keys).",
"### Morph\nMorph provides a fast apply model. To get started, obtain an API key from [here](https://morphllm.com/dashboard).",
"### OVHcloud AI Endpoints is a serverless inference API that provides access to a curated selection of models (e.g., Llama, Mistral, Qwen, Deepseek). It is designed with security and data privacy in mind and is compliant with GDPR. To get started, create an API key on the OVHcloud [AI Endpoints website](https://endpoints.ai.cloud.ovh.net/). For more information, including pricing, visit the OVHcloud [AI Endpoints product page](https://www.ovhcloud.com/en/public-cloud/ai-endpoints/).",
"### Morph\nMorph provides a fast apply model. To get started, obtain an API key from [here](https://morphllm.com/dashboard)."
"### Venice\n Venice.AI is a privacy-focused generative AI platform, allowing users to interact with open-source LLMs without storing any private user data.\nHosted models support the OpenAI API standard, providing seamless integration for users seeking privacy and flexibility.\nTo get started with the Venice API, either purchase a pro account, stake $VVV for daily inference allotments, or fund your account with USD.\nVisit the [API settings page](https://venice.ai/settings/api) or learn more at the [Venice API documentation](https://venice.ai/api)."
],
"type": "string"
},
@ -517,7 +519,8 @@
"xAI",
"kindo",
"scaleway",
"ovhcloud"
"ovhcloud",
"venice"
]
}
},
@ -1764,6 +1767,30 @@
}
}
}
},
{
"if": {
"properties": {
"provider": {
"enum": ["venice"]
}
},
"required": ["provider"]
},
"then": {
"properties": {
"model": {
"anyOf": [
{
"enum": ["AUTODETECT"]
},
{
"type": "string"
}
]
}
}
}
}
]
},

View file

@ -9,6 +9,7 @@
"version": "1.1.29",
"license": "Apache-2.0",
"dependencies": {
"@continuedev/config-types": "^1.0.14",
"@continuedev/fetch": "^1.0.3",
"@electron/rebuild": "^3.2.10",
"@reduxjs/toolkit": "^1.9.3",
@ -693,9 +694,9 @@
}
},
"node_modules/@continuedev/config-types": {
"version": "1.0.13",
"resolved": "https://registry.npmjs.org/@continuedev/config-types/-/config-types-1.0.13.tgz",
"integrity": "sha512-5Qmy2x58uhW1GYknypFT/7iwxEJSbt8gMgfQReV7d6xjbJ09ISOTki3hIfCilKrTCo0gIY6pzKEfCoQkUTEi6Q==",
"version": "1.0.14",
"resolved": "https://registry.npmjs.org/@continuedev/config-types/-/config-types-1.0.14.tgz",
"integrity": "sha512-PVHyHPyRXd2QsaNgnCpiKYU3uHFTlyuQSkqE8OwrBmQqO6/TXUVIr/2EGtyIZGrml4Y+rGMSH40WU4/0t4SGpQ==",
"dependencies": {
"zod": "^3.23.8"
}

View file

@ -2,7 +2,7 @@
"name": "continue",
"icon": "media/icon.png",
"author": "Continue Dev, Inc",
"version": "1.1.29",
"version": "1.1.30",
"repository": {
"type": "git",
"url": "https://github.com/continuedev/continue"
@ -661,6 +661,7 @@
"vscode-extension-tester": "^8.10.0"
},
"dependencies": {
"@continuedev/config-types": "^1.0.14",
"@continuedev/fetch": "^1.0.3",
"@electron/rebuild": "^3.2.10",
"@reduxjs/toolkit": "^1.9.3",

View file

@ -1,3 +1,6 @@
/* eslint-disable @typescript-eslint/naming-convention */
import * as fs from "node:fs";
import { ContextMenuConfig, ILLM, ModelInstaller } from "core";
import { CompletionProvider } from "core/autocomplete/CompletionProvider";
import { ConfigHandler } from "core/config/ConfigHandler";
@ -9,10 +12,15 @@ import { walkDirAsync } from "core/indexing/walkDir";
import { isModelInstaller } from "core/llm";
import { extractMinimalStackTraceInfo } from "core/util/extractMinimalStackTraceInfo";
import { startLocalOllama } from "core/util/ollamaHelper";
import { getDevDataFilePath } from "core/util/paths";
import {
getConfigJsonPath,
getConfigYamlPath,
getDevDataFilePath,
} from "core/util/paths";
import { Telemetry } from "core/util/posthog";
import readLastLines from "read-last-lines";
import * as vscode from "vscode";
import * as YAML from "yaml";
import {
getAutocompleteStatusBarDescription,
@ -32,11 +40,13 @@ import { Battery } from "./util/battery";
import { getMetaKeyLabel } from "./util/util";
import { VsCodeIde } from "./VsCodeIde";
import { convertJsonToYamlConfig } from "../../../packages/config-yaml/dist";
import {
addCodeToContextFromRange,
addEntireFileToContext,
addHighlightedCodeToContext,
} from "./util/addCode";
import { openEditorAndRevealRange } from "./util/vscode";
let fullScreenPanel: vscode.WebviewPanel | undefined;
@ -754,6 +764,35 @@ const getCommandsMap: (
);
}
},
"continue.convertConfigJsonToConfigYaml": async () => {
const configJson = fs.readFileSync(getConfigJsonPath(), "utf-8");
const parsed = JSON.parse(configJson);
const configYaml = convertJsonToYamlConfig(parsed);
const configYamlPath = getConfigYamlPath();
fs.writeFileSync(configYamlPath, YAML.stringify(configYaml));
// Open config.yaml
await openEditorAndRevealRange(
vscode.Uri.file(configYamlPath),
undefined,
undefined,
false,
);
vscode.window
.showInformationMessage(
"Your config.json has been converted to the new config.yaml format. If you need to switch back to config.json, you can delete or rename config.yaml.",
"Read the docs",
)
.then((selection) => {
if (selection === "Read the docs") {
vscode.env.openExternal(
vscode.Uri.parse("https://docs.continue.dev/yaml-migration"),
);
}
});
},
};
};

View file

@ -0,0 +1,30 @@
import { getConfigYamlPath } from "core/util/paths";
import * as fs from "fs";
import * as vscode from "vscode";
export class ConfigJsonConverterCodeLensProvider
implements vscode.CodeLensProvider
{
public provideCodeLenses(
document: vscode.TextDocument,
_: vscode.CancellationToken,
): vscode.CodeLens[] | Thenable<vscode.CodeLens[]> {
if (
!document.uri.fsPath.includes(".continue") ||
!document.uri.fsPath.endsWith("config.json")
) {
return [];
}
if (fs.existsSync(getConfigYamlPath())) {
return [];
}
return [
new vscode.CodeLens(new vscode.Range(0, 0, 0, 0), {
title: "config.json is being deprecated. Convert to config.yaml",
command: "continue.convertConfigJsonToConfigYaml",
}),
];
}
}

View file

@ -2,3 +2,5 @@ export { DownloadYamlExtensionCodeLensProvider } from "./DownloadYamlExtensionCo
export { QuickActionsCodeLensProvider } from "./QuickActionsCodeLensProvider";
export { SuggestionsCodeLensProvider } from "./SuggestionsCodeLensProvider";
export { VerticalDiffCodeLensProvider as VerticalPerLineCodeLensProvider } from "./VerticalPerLineCodeLensProvider";
export { ConfigJsonConverterCodeLensProvider } from "./ConfigJsonConverterCodeLensProvider";

View file

@ -19,6 +19,8 @@ let suggestionsCodeLensDisposable: vscode.Disposable | undefined = undefined;
let configPyCodeLensDisposable: vscode.Disposable | undefined = undefined;
let tutorialCodeLensDisposable: vscode.Disposable | undefined = undefined;
let quickActionsCodeLensDisposable: vscode.Disposable | undefined = undefined;
let configJsonConverterCodeLensDisposable: vscode.Disposable | undefined =
undefined;
let downloadYamlExtensionCodeLensDisposable: vscode.Disposable | undefined =
undefined;
@ -98,6 +100,10 @@ export function registerAllCodeLensProviders(
tutorialCodeLensDisposable.dispose();
}
if (configJsonConverterCodeLensDisposable) {
configJsonConverterCodeLensDisposable.dispose();
}
if (downloadYamlExtensionCodeLensDisposable) {
downloadYamlExtensionCodeLensDisposable.dispose();
}
@ -116,6 +122,11 @@ export function registerAllCodeLensProviders(
new providers.SuggestionsCodeLensProvider(),
);
configJsonConverterCodeLensDisposable = registerCodeLensProvider(
"*",
new providers.ConfigJsonConverterCodeLensProvider(),
);
downloadYamlExtensionCodeLensDisposable = registerCodeLensProvider(
"yaml",
new providers.DownloadYamlExtensionCodeLensProvider(),
@ -131,6 +142,7 @@ export function registerAllCodeLensProviders(
context.subscriptions.push(verticalPerLineCodeLensProvider);
context.subscriptions.push(suggestionsCodeLensDisposable);
context.subscriptions.push(configJsonConverterCodeLensDisposable);
return { verticalDiffCodeLens };
}

View file

@ -12,7 +12,8 @@
// "plugin:react/recommended"
],
"rules": {
"@typescript-eslint/naming-convention": "off"
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-floating-promises": "warn"
},
"overrides": [
{

BIN
gui/public/logos/venice.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View file

@ -996,4 +996,24 @@ To get started, [register](https://dataplatform.cloud.ibm.com/registration/stepo
],
apiKeyUrl: "https://cloud.siliconflow.cn/account/ak",
},
venice: {
title: "Venice",
provider: "venice",
icon: "venice.png",
description: "Venice.",
tags: [ModelProviderTags.RequiresApiKey, ModelProviderTags.OpenSource],
collectInputFor: [
{
inputType: "text",
key: "apiKey",
label: "API Key",
placeholder: "Enter your Venice API key",
required: true,
},
],
packages: [
{...models.AUTODETECT}
],
apiKeyUrl: "https://venice.ai/chat"
}
};

View file

@ -46,11 +46,69 @@ function convertReranker(m: NonNullable<ConfigJson["reranker"]>): ModelYaml {
};
}
function withFromContextProvider(
contextProvider: NonNullable<ConfigJson["contextProviders"]>[number],
): Record<string, string> | undefined {
const { name, params } = contextProvider;
switch (name) {
case "greptile":
return {
GITHUB_TOKEN: params?.GithubToken ?? "",
GREPTILE_TOKEN: params?.GreptileToken ?? "",
};
case "jira":
return {
JIRA_TOKEN: params?.JiraToken ?? "",
JIRA_API_VERSION: params?.JiraEmail,
JIRA_DOMAIN: params?.JiraDomain ?? "",
};
case "postgres":
return {
POSTGRES_HOST: params?.host,
POSTGRES_PORT: params?.port,
POSTGRES_USER: params?.user,
POSTGRES_PASSWORD: params?.password,
POSTGRES_DATABASE: params?.database,
POSTGRES_SCHEMA: params?.schema,
};
case "gitlab-mr":
return {
GITLAB_TOKEN: params?.token,
DOMAIN: params?.domain,
};
case "discord":
return {
DISCORD_KEY: params?.discordKey,
DISCORD_GUILD_ID: params?.guildId,
DISCORD_CHANNELS: params?.channels,
};
case "commits":
return {
DEPTH: params?.Depth,
LAST_N_COMMITS_DEPTH: params?.LastXCommitsDepth,
};
default:
return undefined;
}
}
function convertContext(configJson: ConfigJson): ContextYaml[] {
const context: ContextYaml[] =
configJson.contextProviders?.map((ctx) => {
// ctx providers that weren't given official blocks
if (
["web", "debugger", "issue", "database", "google", "http"].includes(
ctx.name,
)
) {
return {
provider: ctx.name,
params: ctx.params,
};
}
return {
uses: `builtin/${ctx.name}`,
uses: `continuedev/${ctx.name === "open" ? "open-files" : ctx.name}-context`,
with: ctx.params,
};
}) ?? [];