diff --git a/libs/langchain-ollama/src/embeddings.ts b/libs/langchain-ollama/src/embeddings.ts index a2075b501c98..43ddaadacccf 100644 --- a/libs/langchain-ollama/src/embeddings.ts +++ b/libs/langchain-ollama/src/embeddings.ts @@ -35,7 +35,7 @@ interface OllamaEmbeddingsParams extends EmbeddingsParams { /** * Optional HTTP Headers to include in the request. */ - headers?: Record; + headers?: Headers | Record; /** * Advanced Ollama API request parameters in camelCase, see @@ -63,7 +63,7 @@ export class OllamaEmbeddings extends Embeddings { this.client = new Ollama({ host: fields?.baseUrl, - headers: fields?.headers, + headers: fields?.headers ? new Headers(fields.headers) : undefined, }); this.baseUrl = fields?.baseUrl ?? this.baseUrl;