(
query: string,
startUrl: string,
nRetrieve: number,
)
| 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 { |
no test coverage detected