feat(ollama): add keep_alive param

This commit is contained in:
ItzCrazyKns 2024-11-20 19:11:47 +05:30
parent 874505cd0e
commit c650d1c3d9
3 changed files with 8 additions and 2 deletions

View file

@ -1,11 +1,12 @@
import { OllamaEmbeddings } from '@langchain/community/embeddings/ollama';
import { getOllamaApiEndpoint } from '../../config';
import { getKeepAlive, getOllamaApiEndpoint } from '../../config';
import logger from '../../utils/logger';
import { ChatOllama } from '@langchain/community/chat_models/ollama';
export const loadOllamaChatModels = async () => {
const ollamaEndpoint = getOllamaApiEndpoint();
const keepAlive = getKeepAlive();
if (!ollamaEndpoint) return {};
try {
@ -24,6 +25,7 @@ export const loadOllamaChatModels = async () => {
baseUrl: ollamaEndpoint,
model: model.model,
temperature: 0.7,
keepAlive: keepAlive
}),
};