(startUrl: string, startedWithEmbedder: string)
| 315 | |
| 316 | // Used to check periodically during indexing if should cancel indexing |
| 317 | shouldCancel(startUrl: string, startedWithEmbedder: string) { |
| 318 | // Check if aborted |
| 319 | const isAborted = this.statuses.get(startUrl)?.status === "aborted"; |
| 320 | if (isAborted) { |
| 321 | return true; |
| 322 | } |
| 323 | |
| 324 | // Handle embeddings provider change mid-indexing |
| 325 | if ( |
| 326 | this.config.selectedModelByRole.embed?.embeddingId !== startedWithEmbedder |
| 327 | ) { |
| 328 | this.abort(startUrl); |
| 329 | return true; |
| 330 | } |
| 331 | return false; |
| 332 | } |
| 333 | |
| 334 | // Determine if transformers.js embeddings are supported in this environment |
| 335 | async canUseTransformersEmbeddings() { |
no test coverage detected