41 lines
937 B
TypeScript
41 lines
937 B
TypeScript
import type {
|
|
AddFactInput,
|
|
EmbeddingProvider,
|
|
TopicLinkInput,
|
|
} from "../types/api";
|
|
|
|
export interface ExtractedFact {
|
|
statement?: string;
|
|
summary?: string | null;
|
|
source?: string | null;
|
|
confidence?: number | null;
|
|
metadata?: AddFactInput["metadata"];
|
|
topics: TopicLinkInput[];
|
|
}
|
|
|
|
export interface FactExtractor {
|
|
extract(input: string): Promise<ExtractedFact>;
|
|
}
|
|
|
|
export interface LlmTextGenerationModelInput {
|
|
instruction: string;
|
|
input: string;
|
|
additionalInstruction?: string | undefined;
|
|
}
|
|
|
|
export interface LlmTextGenerationModel {
|
|
generateText(prompt: LlmTextGenerationModelInput): Promise<ExtractedFact>;
|
|
}
|
|
|
|
export interface LlmFactExtractorOptions {
|
|
model: LlmTextGenerationModel;
|
|
additionalInstructions?: string | undefined;
|
|
}
|
|
|
|
export interface IngestStatementOptions {
|
|
extractor: FactExtractor;
|
|
embeddingProvider?: EmbeddingProvider;
|
|
duplicateThreshold?: number;
|
|
spaceName?: string;
|
|
}
|