/** * Extended VoyageAI client with local model support */ import { VoyageAIClient as GeneratedClient } from "../Client"; import type * as VoyageAI from "../api"; import { HttpResponsePromise } from "../core/fetcher/HttpResponsePromise"; import type { TokenizeResult } from "../local/tokenizer"; export declare class VoyageAIClient extends GeneratedClient { /** * Voyage embedding endpoint receives as input a string (or a list of strings) and other arguments such as the preferred model name, and returns a response containing a list of embeddings. * * For local models (e.g., 'voyage-4-nano'), embeddings are computed locally using Transformers.js. * For all other models, the request is forwarded to the Voyage AI API. * * @param {VoyageAI.EmbedRequest} request * @param {GeneratedClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * // Local embedding (no API key required) * await client.embed({ * input: "hello world", * model: "voyage-4-nano" * }) * * @example * // API embedding * await client.embed({ * input: "hello world", * model: "voyage-3-large" * }) */ embed(request: VoyageAI.EmbedRequest, requestOptions?: GeneratedClient.RequestOptions): HttpResponsePromise; /** * Tokenize texts using the specified model's tokenizer. * Works with both local models (e.g., 'voyage-4-nano') and API models (e.g., 'voyage-3-large'). * * @param texts - Array of strings to tokenize * @param model - Voyage model name * @returns Array of TokenizeResult, each containing tokens (string[]) and ids (number[]) * * @example * const results = await client.tokenize(["hello world"], "voyage-4-nano"); * console.log(results[0].tokens); // ["hello", "world"] * console.log(results[0].ids); // [123, 456] */ tokenize(texts: string[], model: string): Promise; }