continue-custom/core/indexing/embeddings/BaseEmbeddingsProvider.ts
2024-05-12 15:18:23 -07:00

25 lines
696 B
TypeScript

import { EmbedOptions, EmbeddingsProvider, FetchFunction } from "../../index.js";
class BaseEmbeddingsProvider implements EmbeddingsProvider {
options: EmbedOptions;
fetch: FetchFunction;
static defaultOptions: Partial<EmbedOptions> | undefined = undefined;
get id(): string {
throw new Error("Method not implemented.");
}
constructor(options: EmbedOptions, fetch: FetchFunction) {
this.options = {
...(this.constructor as typeof BaseEmbeddingsProvider).defaultOptions,
...options,
};
this.fetch = fetch;
}
embed(chunks: string[]): Promise<number[][]> {
throw new Error("Method not implemented.");
}
}
export default BaseEmbeddingsProvider;