refactor: Parse keepAlive value in OllamaEmbeddingsPageAssist

This commit is contained in:
n4ze3m
2024-05-23 11:22:46 +05:30
parent b3a455382c
commit fadf736f70
3 changed files with 15 additions and 5 deletions

View File

@@ -15,6 +15,7 @@ import type { StringWithAutocomplete } from "@langchain/core/utils/types";
import {
createOllamaChatStream,
createOllamaGenerateStream,
parseKeepAlive,
type OllamaInput,
type OllamaMessage,
} from "./utils/ollama";
@@ -112,7 +113,7 @@ export class ChatOllama
this.baseUrl = fields.baseUrl?.endsWith("/")
? fields.baseUrl.slice(0, -1)
: fields.baseUrl ?? this.baseUrl;
this.keepAlive = fields.keepAlive ?? this.keepAlive;
this.keepAlive = parseKeepAlive(fields.keepAlive) ?? this.keepAlive;
this.embeddingOnly = fields.embeddingOnly;
this.f16KV = fields.f16KV;
this.frequencyPenalty = fields.frequencyPenalty;