mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(Ollama Chat Model Node): Add aditional Ollama config parameters & fix vision (#9215)
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com> Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
@@ -22,6 +22,7 @@ import { LLMChain } from 'langchain/chains';
|
||||
import type { BaseChatModel } from '@langchain/core/language_models/chat_models';
|
||||
import { HumanMessage } from '@langchain/core/messages';
|
||||
import { ChatGoogleGenerativeAI } from '@langchain/google-genai';
|
||||
import { ChatOllama } from '@langchain/community/chat_models/ollama';
|
||||
import { getTemplateNoticeField } from '../../../utils/sharedFields';
|
||||
import {
|
||||
getOptionalOutputParsers,
|
||||
@@ -81,7 +82,10 @@ async function getImageMessage(
|
||||
)) as BaseLanguageModel;
|
||||
const dataURI = `data:image/jpeg;base64,${bufferData.toString('base64')}`;
|
||||
|
||||
const imageUrl = model instanceof ChatGoogleGenerativeAI ? dataURI : { url: dataURI, detail };
|
||||
const directUriModels = [ChatGoogleGenerativeAI, ChatOllama];
|
||||
const imageUrl = directUriModels.some((i) => model instanceof i)
|
||||
? dataURI
|
||||
: { url: dataURI, detail };
|
||||
|
||||
return new HumanMessage({
|
||||
content: [
|
||||
|
||||
Reference in New Issue
Block a user