continue-custom/core/context/index.ts
2023-12-09 19:10:37 -08:00

27 lines
723 B
TypeScript

import { ContextItem } from "../llm/types";
export interface ContextProviderDescription {
title: string;
displayTitle: string;
description: string;
dynamic: boolean;
requiresQuery: boolean;
}
export abstract class ContextProvider {
options: Object;
constructor(options: Object) {
this.options = options;
}
static description: ContextProviderDescription;
get description(): ContextProviderDescription {
return (this.constructor as any).description;
}
// Maybe just include the chat message in here. Should never have to go back to the context provider once you have the information.
abstract getContextItems(query: string): Promise<ContextItem[]>;
abstract load(): Promise<void>;
}