import { OllamaCamelCaseOptions } from "./types.js"; import { Ollama } from "ollama/browser"; import { Embeddings, EmbeddingsParams } from "@langchain/core/embeddings"; import { Options } from "ollama"; //#region src/embeddings.d.ts /** * Interface for OllamaEmbeddings parameters. Extends EmbeddingsParams and * defines additional parameters specific to the OllamaEmbeddings class. */ interface OllamaEmbeddingsParams extends EmbeddingsParams { /** * The Ollama model to use for embeddings. * @default "mxbai-embed-large" */ model?: string; /** * Base URL of the Ollama server. * Defaults to `OLLAMA_BASE_URL` if set. * @default "http://localhost:11434" */ baseUrl?: string; /** * The number of dimensions for the embeddings. */ dimensions?: number; /** * Defaults to "5m" */ keepAlive?: string | number; /** * Whether or not to truncate the input text to fit inside the model's * context window. * @default false */ truncate?: boolean; /** * Optional HTTP Headers to include in the request. */ headers?: Headers | Record; /** * Advanced Ollama API request parameters in camelCase, see * https://github.com/ollama/ollama/blob/main/docs/modelfile.md#valid-parameters-and-values * for details of the available parameters. */ requestOptions?: OllamaCamelCaseOptions & Partial; /** * The fetch function to use. * @default fetch */ fetch?: typeof fetch; } declare class OllamaEmbeddings extends Embeddings { model: string; baseUrl: string; dimensions?: number; keepAlive?: string | number; requestOptions?: Partial; client: Ollama; truncate: boolean; constructor(fields?: OllamaEmbeddingsParams); /** convert camelCased Ollama request options like "useMMap" to * the snake_cased equivalent which the ollama API actually uses. * Used only for consistency with the llms/Ollama and chatModels/Ollama classes */ _convertOptions(requestOptions: OllamaCamelCaseOptions): Partial; embedDocuments(texts: string[]): Promise; embedQuery(text: string): Promise; private embeddingWithRetry; } //#endregion export { OllamaEmbeddings, OllamaEmbeddingsParams }; //# sourceMappingURL=embeddings.d.ts.map