/** * @license * Copyright 2025 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ import type { IRunConfig, TaskConfig } from "@workglow/task-graph"; import { CreateWorkflow, Task } from "@workglow/task-graph"; import { DataPortSchema, TypedArray } from "@workglow/util/schema"; import type { Capability } from "../capability/Capabilities"; export type VectorQuantizeTaskInput = { normalize?: boolean | undefined; vector: TypedArray | TypedArray[]; targetType: "float16" | "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16"; }; export type VectorQuantizeTaskOutput = { vector: TypedArray | TypedArray[]; targetType: "float16" | "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16"; originalType: "float16" | "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16"; }; export type VectorQuantizeTaskConfig = TaskConfig; /** * Task for quantizing vectors to reduce storage and improve performance. * Supports various quantization types including binary, int8, uint8, int16, uint16. */ export declare class VectorQuantizeTask extends Task { static type: string; /** Pure-compute vector quantization — no provider capability required. */ static readonly requires: readonly Capability[]; static category: string; static title: string; static description: string; static cacheable: boolean; static inputSchema(): DataPortSchema; static outputSchema(): DataPortSchema; execute(input: VectorQuantizeTaskInput): Promise; executePreview(input: VectorQuantizeTaskInput): Promise; private getVectorType; private vectorQuantize; /** * Find min and max values in a single pass for better performance */ private findMinMax; private quantizeToInt8; private quantizeToUint8; private quantizeToInt16; private quantizeToUint16; } export declare const vectorQuantize: (input: VectorQuantizeTaskInput, config?: VectorQuantizeTaskConfig, runConfig?: Partial) => Promise; declare module "@workglow/task-graph" { interface Workflow { vectorQuantize: CreateWorkflow; } } //# sourceMappingURL=VectorQuantizeTask.d.ts.map