bilberrydb
Version:
TypeScript/JavaScript SDK for BilberryDB vector search API
72 lines • 1.94 kB
TypeScript
export interface BilberryConfig {
api_key: string;
api_id: string;
base_url?: string;
}
export interface SearchResult {
id: string;
filename?: string;
file_name?: string;
similarity_score: number;
file_type: string;
content_type: string;
created_at?: string;
file_size?: number;
}
export interface ItemResponse {
id: string;
filename: string;
file_type: string;
content_type: string;
created_at: string;
file_size: number;
}
declare class BilberryVector {
private client;
private config;
constructor(config: BilberryConfig);
/**
* Search for similar images using an image file
* @param imagePath - Path to the image file or Buffer/Uint8Array
* @param options - Search options
*/
search(imagePath: string | Buffer | Uint8Array, options?: {
top_k?: number;
content_type?: string;
}): Promise<SearchResult[]>;
/**
* Get all items for the user
* @param content_type - Optional content type filter
*/
getAllItems(content_type?: string): Promise<ItemResponse[]>;
/**
* Download a file by ID
* @param itemId - The ID of the item to download
*/
downloadFile(itemId: string): Promise<Buffer>;
}
declare class BilberryClient {
private config;
constructor(config: BilberryConfig);
/**
* Get vector search instance
*/
get_vec(): BilberryVector;
/**
* Alias for get_vec() for consistency
*/
getVector(): BilberryVector;
}
/**
* Initialize BilberryDB client
* @param config - Configuration object with api_key and api_id
*/
export declare function init(config: BilberryConfig): BilberryClient;
declare const _default: {
init: typeof init;
BilberryClient: typeof BilberryClient;
BilberryVector: typeof BilberryVector;
};
export default _default;
export { BilberryClient, BilberryVector };
//# sourceMappingURL=index.d.ts.map