{"version":3,"file":"embeddings.d.ts","names":["TaskType","Embeddings","EmbeddingsParams","GoogleGenerativeAIEmbeddingsParams","GoogleGenerativeAIEmbeddings","Promise"],"sources":["../src/embeddings.d.ts"],"sourcesContent":["import type { TaskType } from \"@google/generative-ai\";\nimport { Embeddings, EmbeddingsParams } from \"@langchain/core/embeddings\";\n/**\n * Interface that extends EmbeddingsParams and defines additional\n * parameters specific to the GoogleGenerativeAIEmbeddings class.\n */\nexport interface GoogleGenerativeAIEmbeddingsParams extends EmbeddingsParams {\n    /**\n     * Model Name to use\n     *\n     * Alias for `model`\n     *\n     * Note: The format must follow the pattern - `{model}`\n     */\n    modelName?: string;\n    /**\n     * Model Name to use\n     *\n     * Note: The format must follow the pattern - `{model}`\n     */\n    model?: string;\n    /**\n     * Type of task for which the embedding will be used\n     *\n     * Note: currently only supported by `embedding-001` model\n     */\n    taskType?: TaskType;\n    /**\n     * An optional title for the text. Only applicable when TaskType is\n     * `RETRIEVAL_DOCUMENT`\n     *\n     * Note: currently only supported by `embedding-001` model\n     */\n    title?: string;\n    /**\n     * Whether to strip new lines from the input text. Default to true\n     */\n    stripNewLines?: boolean;\n    /**\n     * Google API key to use\n     */\n    apiKey?: string;\n    /**\n     * Google API base URL to use\n     */\n    baseUrl?: string;\n}\n/**\n * Class that extends the Embeddings class and provides methods for\n * generating embeddings using the Google Palm API.\n * @example\n * ```typescript\n * const model = new GoogleGenerativeAIEmbeddings({\n *   apiKey: \"<YOUR API KEY>\",\n *   modelName: \"embedding-001\",\n * });\n *\n * // Embed a single query\n * const res = await model.embedQuery(\n *   \"What would be a good company name for a company that makes colorful socks?\"\n * );\n * console.log({ res });\n *\n * // Embed multiple documents\n * const documentRes = await model.embedDocuments([\"Hello world\", \"Bye bye\"]);\n * console.log({ documentRes });\n * ```\n */\nexport declare class GoogleGenerativeAIEmbeddings extends Embeddings implements GoogleGenerativeAIEmbeddingsParams {\n    apiKey?: string;\n    modelName: string;\n    model: string;\n    taskType?: TaskType;\n    title?: string;\n    stripNewLines: boolean;\n    maxBatchSize: number; // Max batch size for embedDocuments set by GenerativeModel client's batchEmbedContents call\n    private client;\n    constructor(fields?: GoogleGenerativeAIEmbeddingsParams);\n    private _convertToContent;\n    protected _embedQueryContent(text: string): Promise<number[]>;\n    protected _embedDocumentsContent(documents: string[]): Promise<number[][]>;\n    /**\n     * Method that takes a document as input and returns a promise that\n     * resolves to an embedding for the document. It calls the _embedText\n     * method with the document as the input.\n     * @param document Document for which to generate an embedding.\n     * @returns Promise that resolves to an embedding for the input document.\n     */\n    embedQuery(document: string): Promise<number[]>;\n    /**\n     * Method that takes an array of documents as input and returns a promise\n     * that resolves to a 2D array of embeddings for each document. It calls\n     * the _embedText method for each document in the array.\n     * @param documents Array of documents for which to generate embeddings.\n     * @returns Promise that resolves to a 2D array of embeddings for each input document.\n     */\n    embedDocuments(documents: string[]): Promise<number[][]>;\n}\n"],"mappings":";;;;;;;AAMA;;AAoBeA,UApBEG,kCAAAA,SAA2CD,gBAoB7CF,CAAAA;EAAQ;AApBqD;AA8D5E;;;;;EAWuD,SACIK,CAAAA,EAAAA,MAAAA;EAAO;;;;AAZgD;;;;;;;aA1CnGL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0CMI,4BAAAA,SAAqCH,UAAAA,YAAsBE;;;;aAIjEH;;;;;uBAKUG;;8CAEuBE;yDACWA;;;;;;;;gCAQzBA;;;;;;;;uCAQOA"}