Skip to content

Commit

Permalink
relative-to-root file paths for rag retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
tijszwinkels committed Jun 1, 2024
1 parent 7217ab7 commit 3d326cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/context/retrieval/retrieval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from "../../index.js";
import { LanceDbIndex } from "../../indexing/LanceDbIndex.js";

import { deduplicateArray, getBasename } from "../../util/index.js";
import { deduplicateArray, getRelativePath } from "../../util/index.js";
import { RETRIEVAL_PARAMS } from "../../util/parameters.js";
import { retrieveFts } from "./fullTextSearch.js";

Expand Down Expand Up @@ -149,7 +149,7 @@ export async function retrieveContextItemsFromEmbeddings(

return [
...results.map((r) => {
const name = `${getBasename(r.filepath)} (${r.startLine}-${r.endLine})`;
const name = `${getRelativePath(r.filepath, workspaceDirs)} (${r.startLine}-${r.endLine})`;
const description = `${r.filepath} (${r.startLine}-${r.endLine})`;
return {
name,
Expand Down

0 comments on commit 3d326cf

Please sign in to comment.