File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed
ui/src/ui-component/extended Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -436,6 +436,7 @@ export type FollowUpPromptProviderConfig = {
436436 [ key in FollowUpPromptProvider ] : {
437437 credentialId : string
438438 modelName : string
439+ baseUrl : string
439440 prompt : string
440441 temperature : string
441442 }
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import { z } from 'zod'
88import { PromptTemplate } from '@langchain/core/prompts'
99import { StructuredOutputParser } from '@langchain/core/output_parsers'
1010import { ChatGroq } from '@langchain/groq'
11- import ollama from 'ollama'
11+ import { Ollama } from 'ollama'
1212
1313const FollowUpPromptType = z
1414 . object ( {
@@ -122,7 +122,11 @@ export const generateFollowUpPrompts = async (
122122 return structuredResponse
123123 }
124124 case FollowUpPromptProvider . OLLAMA : {
125- const response = await ollama . chat ( {
125+ const ollamaClient = new Ollama ( {
126+ host : providerConfig . baseUrl || 'http://127.0.0.1:11434'
127+ } )
128+
129+ const response = await ollamaClient . chat ( {
126130 model : providerConfig . modelName ,
127131 messages : [
128132 {
Original file line number Diff line number Diff line change @@ -269,6 +269,14 @@ const followUpPromptsOptions = {
269269 name : FollowUpPromptProviders . OLLAMA ,
270270 icon : ollamaIcon ,
271271 inputs : [
272+ {
273+ label : 'Base URL' ,
274+ name : 'baseUrl' ,
275+ type : 'string' ,
276+ placeholder : 'http://127.0.0.1:11434' ,
277+ description : 'Base URL of your Ollama instance' ,
278+ default : 'http://127.0.0.1:11434'
279+ } ,
272280 {
273281 label : 'Model Name' ,
274282 name : 'modelName' ,
You can’t perform that action at this time.
0 commit comments