Files
foam/packages/foam-vscode/src/ai/services/noop-embedding-provider.ts
Riccardo cf70c97fd7 add note embeddings and semantic similarity search (#1560)
* First implementation of embedding feature

* Improved caching

* Progress on embedding index build

* Added cancellation option, and updating embeds continuously

* Added "Related Notes" panel, plus various tweaks

* Added task deduplicator so that notes analysis command has only one running instance

* Added progress/cancel features to vscode mock

* Tests

* refactored code into `ai` module

* Added `foam.experimental.ai` feature flag, with AI features disabled by default

* `waitForNoteInFoamWorkspace` now fails on timeout

* Added watcher in VS Code mock, and updated related test
2025-12-15 13:22:19 +01:00

28 lines
630 B
TypeScript

import { EmbeddingProvider, EmbeddingProviderInfo } from './embedding-provider';
/**
* A no-op embedding provider that does nothing.
* Used when no real embedding provider is available.
*/
export class NoOpEmbeddingProvider implements EmbeddingProvider {
async embed(_text: string): Promise<number[]> {
return [];
}
async isAvailable(): Promise<boolean> {
return false;
}
getProviderInfo(): EmbeddingProviderInfo {
return {
name: 'None',
type: 'local',
model: {
name: 'none',
dimensions: 0,
},
description: 'No embedding provider configured',
};
}
}