File tree 3 files changed +15
-2
lines changed
ui/src/ui-component/extended
3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -436,6 +436,7 @@ export type FollowUpPromptProviderConfig = {
436
436
[ key in FollowUpPromptProvider ] : {
437
437
credentialId : string
438
438
modelName : string
439
+ baseUrl : string
439
440
prompt : string
440
441
temperature : string
441
442
}
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import { z } from 'zod'
8
8
import { PromptTemplate } from '@langchain/core/prompts'
9
9
import { StructuredOutputParser } from '@langchain/core/output_parsers'
10
10
import { ChatGroq } from '@langchain/groq'
11
- import ollama from 'ollama'
11
+ import { Ollama } from 'ollama'
12
12
13
13
const FollowUpPromptType = z
14
14
. object ( {
@@ -122,7 +122,11 @@ export const generateFollowUpPrompts = async (
122
122
return structuredResponse
123
123
}
124
124
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 ( {
126
130
model : providerConfig . modelName ,
127
131
messages : [
128
132
{
Original file line number Diff line number Diff line change @@ -269,6 +269,14 @@ const followUpPromptsOptions = {
269
269
name : FollowUpPromptProviders . OLLAMA ,
270
270
icon : ollamaIcon ,
271
271
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
+ } ,
272
280
{
273
281
label : 'Model Name' ,
274
282
name : 'modelName' ,
You can’t perform that action at this time.
0 commit comments