MCPcopy
hub / github.com/continuedev/continue / retrieveChunksFromQuery

Method retrieveChunksFromQuery

core/indexing/docs/DocsService.ts:742–763  ·  view source on GitHub ↗
(
    query: string,
    startUrl: string,
    nRetrieve: number,
  )

Source from the content-addressed store, hash-verified

740
741 // Retrieve docs embeds based on user input
742 async retrieveChunksFromQuery(
743 query: string,
744 startUrl: string,
745 nRetrieve: number,
746 ) {
747 const { provider } = await this.getEmbeddingsProvider();
748
749 if (!provider) {
750 void this.ide.showToast(
751 "error",
752 "Set up an embeddings model to use the @docs context provider. See: " +
753 "https://docs.continue.dev/customize/model-roles/embeddings",
754 );
755 return [];
756 }
757
758 // Try to get embeddings for the query
759 const [vector] = await provider.embed([query]);
760
761 // Retrieve chunks using the query vector
762 return await this.retrieveChunks(startUrl, vector, nRetrieve);
763 }
764
765 private lanceDBRowToChunk(row: LanceDbDocsRow): Chunk {
766 return {

Callers 1

getContextItemsMethod · 0.80

Calls 4

getEmbeddingsProviderMethod · 0.95
retrieveChunksMethod · 0.95
showToastMethod · 0.65
embedMethod · 0.65

Tested by

no test coverage detected