✨ add codebase context provider to config.json
This commit is contained in:
parent
cdbe5692db
commit
2a2ce80577
2 changed files with 30 additions and 2 deletions
5
core/index.d.ts
vendored
5
core/index.d.ts
vendored
|
|
@ -334,7 +334,8 @@ type ContextProviderName =
|
|||
| "search"
|
||||
| "url"
|
||||
| "tree"
|
||||
| "http";
|
||||
| "http"
|
||||
| "codebase";
|
||||
|
||||
type TemplateType =
|
||||
| "llama2"
|
||||
|
|
@ -461,7 +462,7 @@ export type EmbeddingsProviderName = "transformers.js" | "ollama" | "openai";
|
|||
export interface EmbedOptions {
|
||||
apiBase?: string;
|
||||
apiKey?: string;
|
||||
model: string;
|
||||
model?: string;
|
||||
}
|
||||
|
||||
export interface EmbeddingsProviderDescription extends EmbedOptions {
|
||||
|
|
|
|||
|
|
@ -75,6 +75,33 @@ class VsCodeIde implements IDE {
|
|||
fs.writeFileSync(configPath, contents, "utf8");
|
||||
});
|
||||
|
||||
migrate("codebaseContextProvider", () => {
|
||||
if (
|
||||
!config.contextProviders?.filter((cp) => cp.name === "codebase")
|
||||
?.length
|
||||
) {
|
||||
config.contextProviders = [
|
||||
...(config.contextProviders || []),
|
||||
{
|
||||
name: "codebase",
|
||||
params: {},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
if (!config.embeddingsProvider) {
|
||||
config.embeddingsProvider = {
|
||||
provider: "transformers.js",
|
||||
};
|
||||
}
|
||||
|
||||
fs.writeFileSync(
|
||||
configPath,
|
||||
JSON.stringify(config, undefined, 2),
|
||||
"utf8"
|
||||
);
|
||||
});
|
||||
|
||||
for (const workspacePath of await this.getWorkspaceDirs()) {
|
||||
const continueRcPath = path.join(workspacePath, ".continuerc.json");
|
||||
if (fs.existsSync(continueRcPath)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue