UNPKG

@langchain/community

Version:
1 lines • 3.92 kB
{"version":3,"file":"voyage.d.cts","names":["Embeddings","EmbeddingsParams","VoyageEmbeddingsParams","CreateVoyageEmbeddingRequest","VoyageEmbeddings","Record","Partial","Promise"],"sources":["../../src/embeddings/voyage.d.ts"],"sourcesContent":["import { Embeddings, type EmbeddingsParams } from \"@langchain/core/embeddings\";\n/**\n * Interface that extends EmbeddingsParams and defines additional\n * parameters specific to the VoyageEmbeddings class.\n */\nexport interface VoyageEmbeddingsParams extends EmbeddingsParams {\n modelName: string;\n /**\n * The maximum number of documents to embed in a single request. This is\n * limited by the Voyage AI API to a maximum of 8.\n */\n batchSize?: number;\n /**\n * Input type for the embeddings request.\n */\n inputType?: string;\n /**\n * Whether to truncate the input texts to the maximum length allowed by the model.\n */\n truncation?: boolean;\n /**\n * The desired dimension of the output embeddings.\n */\n outputDimension?: number;\n /**\n * The data type of the output embeddings. Can be \"float\" or \"int8\".\n */\n outputDtype?: string;\n /**\n * The format of the output embeddings. Can be \"float\", \"base64\", or \"ubinary\".\n */\n encodingFormat?: string;\n}\n/**\n * Interface for the request body to generate embeddings.\n */\nexport interface CreateVoyageEmbeddingRequest {\n /**\n * @type {string}\n * @memberof CreateVoyageEmbeddingRequest\n */\n model: string;\n /**\n * Text to generate vector expectation\n * @type {CreateEmbeddingRequestInput}\n * @memberof CreateVoyageEmbeddingRequest\n */\n input: string | string[];\n /**\n * Input type for the embeddings request.\n */\n input_type?: string;\n /**\n * Whether to truncate the input texts.\n */\n truncation?: boolean;\n /**\n * The desired dimension of the output embeddings.\n */\n output_dimension?: number;\n /**\n * The data type of the output embeddings.\n */\n output_dtype?: string;\n /**\n * The format of the output embeddings.\n */\n encoding_format?: string;\n}\n/**\n * A class for generating embeddings using the Voyage AI API.\n */\nexport declare class VoyageEmbeddings extends Embeddings implements VoyageEmbeddingsParams {\n modelName: string;\n batchSize: number;\n private apiKey;\n basePath?: string;\n apiUrl: string;\n headers?: Record<string, string>;\n inputType?: string;\n truncation?: boolean;\n outputDimension?: number;\n outputDtype?: string;\n encodingFormat?: string;\n /**\n * Constructor for the VoyageEmbeddings class.\n * @param fields - An optional object with properties to configure the instance.\n */\n constructor(fields?: Partial<VoyageEmbeddingsParams> & {\n verbose?: boolean;\n apiKey?: string;\n inputType?: string;\n });\n /**\n * Generates embeddings for an array of texts.\n * @param texts - An array of strings to generate embeddings for.\n * @returns A Promise that resolves to an array of embeddings.\n */\n embedDocuments(texts: string[]): Promise<number[][]>;\n /**\n * Generates an embedding for a single text.\n * @param text - A string to generate an embedding for.\n * @returns A Promise that resolves to an array of numbers representing the embedding.\n */\n embedQuery(text: string): Promise<number[]>;\n private embeddingWithRetry;\n}\n//# sourceMappingURL=voyage.d.ts.map"],"mappings":";;;;;;AAKA;AA+BA;AAoCqBI,UAnEJF,sBAAAA,SAA+BD,gBAmEX,CAAA;EAMvBI,SAAAA,EAAAA,MAAAA;EAUmBH;;;;EAhBaF,SAAAA,CAAAA,EAAAA,MAAAA;EAAsBE;AAAsB;;;;;;;;;;;;;;;;;;;;;;;UApCzEC,4BAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAoCIC,gBAAAA,SAAyBJ,UAAAA,YAAsBE;;;;;;YAMtDG;;;;;;;;;;uBAUWC,QAAQJ;;;;;;;;;;mCAUIK;;;;;;4BAMPA"}