/** * Schema conversion codecs. */ import type { Codec } from "@kernl-sdk/shared/lib"; import type { FieldSchema, VectorFieldSchema, ScalarFieldSchema } from "@kernl-sdk/retrieval"; import type { AttributeSchema, DistanceMetric } from "@turbopuffer/turbopuffer/resources/namespaces"; type Similarity = VectorFieldSchema["similarity"]; type ScalarType = ScalarFieldSchema["type"]; type TpufType = string; /** * Codec for converting kernl scalar types to Turbopuffer attribute types. */ export declare const SCALAR_TYPE: Codec; /** * Codec for converting similarity metric to Turbopuffer distance metric. * * Turbopuffer supports: cosine_distance, euclidean_squared * We support: cosine, euclidean, dot_product */ export declare const SIMILARITY: Codec; /** * Codec-like converter for FieldSchema to Turbopuffer AttributeSchema. * * Takes the field name as context since Turbopuffer requires `ann: true` * only on the special `vector` attribute. */ export declare const FIELD_SCHEMA: { encode: (field: FieldSchema, name: string) => AttributeSchema; decode: () => never; }; /** * Codec for converting a full schema record. * * Validates that vector fields are named `vector` since Turbopuffer only * supports ANN indexing on that specific attribute name. */ export declare const INDEX_SCHEMA: Codec, Record>; export {}; //# sourceMappingURL=schema.d.ts.map