(kbCount: number, topK: number)
| 307 | } |
| 308 | |
| 309 | export function getQueryStrategy(kbCount: number, topK: number) { |
| 310 | const useParallel = kbCount > 4 || (kbCount > 2 && topK > 50) |
| 311 | const distanceThreshold = kbCount > 3 ? 0.8 : 1.0 |
| 312 | const parallelLimit = Math.ceil(topK / kbCount) + 5 |
| 313 | |
| 314 | return { |
| 315 | useParallel, |
| 316 | distanceThreshold, |
| 317 | parallelLimit, |
| 318 | singleQueryOptimized: kbCount <= 2, |
| 319 | } |
| 320 | } |
| 321 | |
| 322 | async function executeTagFilterQuery( |
| 323 | knowledgeBaseIds: string[], |
no outgoing calls
no test coverage detected