llamaindex
Version:
<p align="center"> <img height="100" width="100" alt="LlamaIndex logo" src="https://ts.llamaindex.ai/square.svg" /> </p> <h1 align="center">LlamaIndex.TS</h1> <h3 align="center"> Data framework for your LLM application. </h3>
37 lines (32 loc) • 1.39 kB
text/typescript
import { BaseNodePostprocessor } from '@llamaindex/core/postprocessor';
import * as _llamaindex_core_schema from '@llamaindex/core/schema';
import { NodeWithScore } from '@llamaindex/core/schema';
import { MessageContent } from '@llamaindex/core/llms';
declare class MetadataReplacementPostProcessor implements BaseNodePostprocessor {
targetMetadataKey: string;
constructor(targetMetadataKey: string);
postprocessNodes(nodes: NodeWithScore[]): Promise<NodeWithScore[]>;
}
interface JinaAIRerankerResult {
index: number;
document?: {
text?: string;
};
relevance_score: number;
}
declare class JinaAIReranker implements BaseNodePostprocessor {
model: string;
topN?: number;
apiKey?: string;
constructor(init?: Partial<JinaAIReranker>);
rerank(query: string, documents: string[], topN?: number | undefined): Promise<JinaAIRerankerResult[]>;
postprocessNodes(nodes: NodeWithScore[], query?: MessageContent): Promise<NodeWithScore[]>;
}
declare class SimilarityPostprocessor implements BaseNodePostprocessor {
similarityCutoff?: number | undefined;
constructor(options?: {
similarityCutoff?: number | undefined;
});
postprocessNodes(nodes: NodeWithScore[]): Promise<NodeWithScore<_llamaindex_core_schema.Metadata>[]>;
}
export { JinaAIReranker, MetadataReplacementPostProcessor, SimilarityPostprocessor };