UNPKG

@0xplaygrounds/rig-wasm

Version:

A TS and WebAssembly-based port of the Rust agentic AI framework Rig.

37 lines (36 loc) 1.05 kB
import { CanEmbed, VectorSearchOpts } from "../types"; export interface Point { id: string | number; vector: number[]; payload?: Record<string, any>; } export interface SearchResult { id: string | number; score: number; payload?: Record<string, any>; } export type QdrantClientParams = { port?: number; apiKey?: string; https?: boolean; prefix?: string; url?: string; host?: string; timeout?: number; checkCompatibility?: boolean; }; /** * An adapter for the Qdrant client to be able to interface with Rig. */ export declare class QdrantAdapter { private client; private collectionName; private params; private embeddingModel; constructor(collectionName: string, embeddingModel: CanEmbed, params: QdrantClientParams); loadClient(): Promise<void>; init(dimensions: number): Promise<void>; insertDocuments(points: Point[]): Promise<void>; topN(opts: VectorSearchOpts): Promise<SearchResult[]>; topNIds(opts: VectorSearchOpts): Promise<SearchResult[]>; }