(
query: string,
limit: number,
filters?: SearchFilters
)
| 1079 | } |
| 1080 | |
| 1081 | private async semanticSearch( |
| 1082 | query: string, |
| 1083 | limit: number, |
| 1084 | filters?: SearchFilters |
| 1085 | ): Promise<{ chunk: CodeChunk; score: number }[]> { |
| 1086 | if (!this.embeddingProvider || !this.storageProvider) { |
| 1087 | return []; |
| 1088 | } |
| 1089 | |
| 1090 | const queryVector = await this.embeddingProvider.embed(query); |
| 1091 | |
| 1092 | const results = await this.storageProvider.search(queryVector, limit, filters); |
| 1093 | |
| 1094 | return results.map((r) => ({ |
| 1095 | chunk: r.chunk, |
| 1096 | score: r.score |
| 1097 | })); |
| 1098 | } |
| 1099 | |
| 1100 | private async keywordSearch( |
| 1101 | query: string, |
no test coverage detected