( queryEmbedding: number[], query: string, chunks: Chunk[], topK: number, )
| 294 | * queries (function names, error strings) while keeping semantic recall. |
| 295 | */ |
| 296 | export async function rankChunksHybrid( |
| 297 | queryEmbedding: number[], |
| 298 | query: string, |
| 299 | chunks: Chunk[], |
| 300 | topK: number, |
| 301 | ): Promise<ScoredChunk[]> { |
| 302 | // Semantic candidate pool — take a wide slice so fusion has material to work with. |
| 303 | const semantic = rankChunks(queryEmbedding, chunks, Math.max(topK * 3, 50)); |
| 304 | const { hybridRank } = await import('./hybrid-search.js'); |
| 305 | return hybridRank(chunks, semantic, query, topK); |
| 306 | } |
| 307 | |
| 308 | export interface RankedFile { |
| 309 | file: string; |
no test coverage detected