voyageai
Version:
[](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fvoyage-ai%2Ftypescript-sdk) [ • 2.88 kB
TypeScript
/**
* This file was auto-generated by Fern from our API Definition.
*/
import * as environments from "./environments";
import * as core from "./core";
import * as VoyageAI from "./api/index";
export declare namespace VoyageAIClient {
interface Options {
environment?: core.Supplier<environments.VoyageAIEnvironment | string>;
apiKey?: core.Supplier<core.BearerToken | undefined>;
fetcher?: core.FetchFunction;
}
interface RequestOptions {
/** The maximum time to wait for a response in seconds. */
timeoutInSeconds?: number;
/** The number of times to retry the request. Defaults to 2. */
maxRetries?: number;
/** A hook to abort the request. */
abortSignal?: AbortSignal;
}
}
export declare class VoyageAIClient {
protected readonly _options: VoyageAIClient.Options;
constructor(_options?: VoyageAIClient.Options);
/**
* 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.
*
* @param {VoyageAI.EmbedRequest} request
* @param {VoyageAIClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @example
* await client.embed({
* input: "input",
* model: "model"
* })
*/
embed(request: VoyageAI.EmbedRequest, requestOptions?: VoyageAIClient.RequestOptions): Promise<VoyageAI.EmbedResponse>;
/**
* Voyage reranker endpoint receives as input a query, a list of documents, and other arguments such as the model name, and returns a response containing the reranking results.
*
* @param {VoyageAI.RerankRequest} request
* @param {VoyageAIClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @example
* await client.rerank({
* query: "query",
* documents: ["documents"],
* model: "model"
* })
*/
rerank(request: VoyageAI.RerankRequest, requestOptions?: VoyageAIClient.RequestOptions): Promise<VoyageAI.RerankResponse>;
/**
* The Voyage multimodal embedding endpoint returns vector representations for a given list of multimodal inputs consisting of text, images, or an interleaving of both modalities.
*
* @param {VoyageAI.MultimodalEmbedRequest} request
* @param {VoyageAIClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @example
* await client.multimodalEmbed({
* inputs: [{}],
* model: "model"
* })
*/
multimodalEmbed(request: VoyageAI.MultimodalEmbedRequest, requestOptions?: VoyageAIClient.RequestOptions): Promise<VoyageAI.MultimodalEmbedResponse>;
protected _getAuthorizationHeader(): Promise<string>;
}