autoreload and include autocomplete models
This commit is contained in:
parent
59ab07a19c
commit
353237caf9
2 changed files with 39 additions and 9 deletions
|
|
@ -141,6 +141,7 @@ async function configYamlToContinueConfig(
|
|||
const continueConfig: ContinueConfig = {
|
||||
slashCommands: await slashCommandsFromV1PromptFiles(ide),
|
||||
models: [],
|
||||
tabAutocompleteModels: [],
|
||||
tools: [],
|
||||
embeddingsProvider: new TransformersJsEmbeddingsProvider(),
|
||||
experimental: {
|
||||
|
|
@ -150,14 +151,31 @@ async function configYamlToContinueConfig(
|
|||
|
||||
// Models
|
||||
for (const model of config.models ?? []) {
|
||||
const llms = await llmsFromModelConfig(
|
||||
model,
|
||||
ide,
|
||||
uniqueId,
|
||||
ideSettings,
|
||||
writeLog,
|
||||
);
|
||||
continueConfig.models.push(...llms);
|
||||
if (
|
||||
["chat", "summarize", "apply", "edit"].some((role: any) =>
|
||||
model.roles?.includes(role),
|
||||
)
|
||||
) {
|
||||
// Main model array
|
||||
const llms = await llmsFromModelConfig(
|
||||
model,
|
||||
ide,
|
||||
uniqueId,
|
||||
ideSettings,
|
||||
writeLog,
|
||||
);
|
||||
continueConfig.models.push(...llms);
|
||||
} else if (model.roles?.includes("autocomplete")) {
|
||||
// Autocomplete models array
|
||||
const llms = await llmsFromModelConfig(
|
||||
model,
|
||||
ide,
|
||||
uniqueId,
|
||||
ideSettings,
|
||||
writeLog,
|
||||
);
|
||||
continueConfig.tabAutocompleteModels?.push(...llms);
|
||||
}
|
||||
}
|
||||
|
||||
if (allowFreeTrial) {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,11 @@ import { controlPlaneEnv, EXTENSION_NAME } from "core/control-plane/env";
|
|||
import { Core } from "core/core";
|
||||
import { FromCoreProtocol, ToCoreProtocol } from "core/protocol";
|
||||
import { InProcessMessenger } from "core/protocol/messenger";
|
||||
import { getConfigJsonPath, getConfigTsPath } from "core/util/paths";
|
||||
import {
|
||||
getConfigJsonPath,
|
||||
getConfigTsPath,
|
||||
getConfigYamlPath,
|
||||
} from "core/util/paths";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import * as vscode from "vscode";
|
||||
|
||||
|
|
@ -260,6 +264,14 @@ export class VsCodeExtension {
|
|||
await this.configHandler.reloadConfig();
|
||||
});
|
||||
|
||||
fs.watchFile(
|
||||
getConfigYamlPath("vscode"),
|
||||
{ interval: 1000 },
|
||||
async (stats) => {
|
||||
await this.configHandler.reloadConfig();
|
||||
},
|
||||
);
|
||||
|
||||
fs.watchFile(getConfigTsPath(), { interval: 1000 }, (stats) => {
|
||||
this.configHandler.reloadConfig();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue