diff --git a/libs/langchain-ollama/src/chat_models.ts b/libs/langchain-ollama/src/chat_models.ts index 4bb1c7a1a4e7..1eeb745f5bba 100644 --- a/libs/langchain-ollama/src/chat_models.ts +++ b/libs/langchain-ollama/src/chat_models.ts @@ -455,7 +455,7 @@ export class ChatOllama format?: string; - keepAlive?: string | number = "5m"; + keepAlive?: string | number; client: Ollama; @@ -504,7 +504,7 @@ export class ChatOllama this.penalizeNewline = fields?.penalizeNewline; this.streaming = fields?.streaming; this.format = fields?.format; - this.keepAlive = fields?.keepAlive ?? this.keepAlive; + this.keepAlive = fields?.keepAlive; this.checkOrPullModel = fields?.checkOrPullModel ?? this.checkOrPullModel; } diff --git a/libs/langchain-ollama/src/embeddings.ts b/libs/langchain-ollama/src/embeddings.ts index f330bb8c9580..8271ac525147 100644 --- a/libs/langchain-ollama/src/embeddings.ts +++ b/libs/langchain-ollama/src/embeddings.ts @@ -50,7 +50,7 @@ export class OllamaEmbeddings extends Embeddings { baseUrl = "http://localhost:11434"; - keepAlive: string | number = "5m"; + keepAlive?: string | number; requestOptions?: Partial; @@ -68,7 +68,7 @@ export class OllamaEmbeddings extends Embeddings { this.baseUrl = fields?.baseUrl ?? this.baseUrl; this.model = fields?.model ?? this.model; - this.keepAlive = fields?.keepAlive ?? this.keepAlive; + this.keepAlive = fields?.keepAlive; this.truncate = fields?.truncate ?? this.truncate; this.requestOptions = fields?.requestOptions ? this._convertOptions(fields?.requestOptions) diff --git a/libs/langchain-ollama/src/llms.ts b/libs/langchain-ollama/src/llms.ts index b560bc4682ff..2b1449ef0179 100644 --- a/libs/langchain-ollama/src/llms.ts +++ b/libs/langchain-ollama/src/llms.ts @@ -66,7 +66,7 @@ export class Ollama extends LLM implements OllamaInput { baseUrl = "http://localhost:11434"; - keepAlive: string | number = "5m"; + keepAlive?: string | number; embeddingOnly?: boolean; @@ -138,7 +138,7 @@ export class Ollama extends LLM implements OllamaInput { host: this.baseUrl, headers: fields?.headers, }); - this.keepAlive = fields?.keepAlive ?? this.keepAlive; + this.keepAlive = fields?.keepAlive; this.embeddingOnly = fields?.embeddingOnly; this.f16KV = fields?.f16Kv;