UNPKG

@athenox/talos

Version:

Talos: a backend you describe instead of write. Declare a schema, write the rules in plain language, map URLs to sentences; a small built-in model turns them into query plans.

14 lines (13 loc) • 603 B
/** whether the embedder's weights are installed */ export declare const hasEmbedder: () => boolean; /** A text's vector, unit length; null when the embedder is not installed. */ export declare function embedText(text: string): Float32Array | null; export declare const cosine: (a: Float32Array, b: Float32Array) => number; /** * The labels a text is closest to, best first: tagging an article with the * app's categories, routing a message to a department. */ export declare function classify(text: string, labels: Record<string, string>, top?: number): { label: string; score: number; }[];