Skip to content

Codebase improvements #4584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions core/config/yaml/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ async function modelConfigToBaseLLM(
title: model.name,
systemMessage,
promptTemplates: model.promptTemplates,
capabilities: {
tools: model.capabilities?.includes("tool_use"),
uploadImage: model.capabilities?.includes("image_input"),
},
};

if (model.embedOptions?.maxBatchSize) {
Expand Down
8 changes: 5 additions & 3 deletions core/context/retrieval/repoMapRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Chunk, ContinueConfig, IDE, ILLM } from "../..";
import { getModelByRole } from "../../config/util";
import generateRepoMap from "../../util/generateRepoMap";
import { renderChatMessage } from "../../util/messageContent";
import { localPathToUri } from "../../util/pathToUri";

const SUPPORTED_MODEL_TITLE_FAMILIES = [
"claude-3",
Expand Down Expand Up @@ -72,16 +73,17 @@ This is the question that you should select relevant files for: "${input}"`;
return [];
}

const fileUris = content
const filepaths = content
.split("<results>")[1]
?.split("</results>")[0]
?.split("\n")
.filter(Boolean)
.map((uri) => uri.trim());

const chunks = await Promise.all(
fileUris.map(async (uri) => {
const content = await ide.readFile(uri);
filepaths.map(async (filepath) => {
const uri = localPathToUri(filepath);
Copy link
Collaborator

@RomneyDa RomneyDa Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will fail for non-file schema paths

const content = await ide.readFile(filepath);
const lineCount = content.split("\n").length;
const chunk: Chunk = {
digest: uri,
Expand Down
3 changes: 1 addition & 2 deletions core/indexing/LanceDbIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
} from "./types";

import type * as LanceType from "vectordb";
import { localPathToUri } from "../util/pathToUri";

interface LanceDbRow {
uuid: string;
Expand Down Expand Up @@ -499,7 +498,7 @@ export class LanceDbIndex implements CodebaseIndex {
return data.map((d) => {
return {
digest: d.cacheKey,
filepath: localPathToUri(d.path),
filepath: d.path,
startLine: d.startLine,
endLine: d.endLine,
index: 0,
Expand Down
1 change: 1 addition & 0 deletions core/llm/llms/stubs/ContinueProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class ContinueProxy extends OpenAI {
query,
documents: chunks.map((chunk) => chunk.content),
model: this.model,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extrabodyproperties might conflict with using custom fetch added in this pr?
#4581

...this.extraBodyProperties(),
}),
});
const data: any = await resp.json();
Expand Down
8 changes: 4 additions & 4 deletions core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@aws-sdk/client-sagemaker-runtime": "^3.621.0",
"@aws-sdk/credential-providers": "^3.620.1",
"@continuedev/config-types": "^1.0.13",
"@continuedev/config-yaml": "^1.0.52",
"@continuedev/config-yaml": "^1.0.56",
"@continuedev/fetch": "^1.0.4",
"@continuedev/llm-info": "^1.0.2",
"@continuedev/openai-adapters": "^1.0.10",
Expand Down
4 changes: 4 additions & 0 deletions core/util/pathToUri.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import * as URI from "uri-js";

// Converts a local path to a file:/// URI
export function localPathToUri(path: string) {
if (path.startsWith("file://")) {
console.warn("localPathToUri: path already starts with file://");
return path;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might not be best place to catch this

}
const url = pathToFileURL(path);
return URI.normalize(url.toString());
}
Expand Down
6 changes: 3 additions & 3 deletions extensions/vscode/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion extensions/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "continue",
"icon": "media/icon.png",
"author": "Continue Dev, Inc",
"version": "1.1.7",
"version": "1.1.8",
"repository": {
"type": "git",
"url": "https://github.com/continuedev/continue"
Expand Down
2 changes: 1 addition & 1 deletion gui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading