continue-custom/core/continueServer/interface.ts
Nate Sesti 40364adfb5 🎨 indexing
2024-03-24 15:08:25 -07:00

27 lines
661 B
TypeScript

import { Chunk } from "..";
export interface EmbeddingsCacheChunk {
vector: number[];
startLine: number;
endLine: number;
contents: string;
}
interface ArtifactReturnTypes {
chunks: Chunk[];
embeddings: EmbeddingsCacheChunk[];
}
export type ArtifactType = keyof ArtifactReturnTypes;
export interface EmbeddingsCacheResponse<T extends ArtifactType> {
files: { [cacheKey: string]: ArtifactReturnTypes[T] };
}
export interface IContinueServerClient {
getConfig(): Promise<{ configJson: string; configJs: string }>;
getFromIndexCache<T extends ArtifactType>(
keys: string[],
artifactId: T,
): Promise<EmbeddingsCacheResponse<T>>;
}