@@ -164,7 +164,6 @@ export const getCreateBotConfigHandler = async (
164
164
disabled : model . model_id === "dialoqbase_eb_dialoqbase-ollama" ,
165
165
} ;
166
166
} ) ;
167
-
168
167
if ( settings ?. dynamicallyFetchOllamaModels ) {
169
168
const ollamaModels = await getAllOllamaModels ( settings . ollamaURL ) ;
170
169
chatModel . push (
@@ -201,11 +200,23 @@ export const getBotByIdSettingsHandler = async (
201
200
user_id : request . user . user_id ,
202
201
} ,
203
202
} ) ;
203
+ if ( ! bot ) {
204
+ return reply . status ( 404 ) . send ( {
205
+ message : "Bot not found" ,
206
+ } ) ;
207
+ }
208
+ const settings = await getSettings ( prisma ) ;
204
209
210
+ const not_to_hide_providers = settings ?. hideDefaultModels
211
+ ? [ "Local" , "local" , "ollama" , "transformer" , "Transformer" ]
212
+ : undefined ;
205
213
const models = await prisma . dialoqbaseModels . findMany ( {
206
214
where : {
207
215
hide : false ,
208
216
deleted : false ,
217
+ model_provider : {
218
+ in : not_to_hide_providers ,
219
+ } ,
209
220
} ,
210
221
} ) ;
211
222
@@ -232,11 +243,19 @@ export const getBotByIdSettingsHandler = async (
232
243
disabled : model . model_id === "dialoqbase_eb_dialoqbase-ollama" ,
233
244
} ;
234
245
} ) ;
235
-
236
- if ( ! bot ) {
237
- return reply . status ( 404 ) . send ( {
238
- message : "Bot not found" ,
239
- } ) ;
246
+ if ( settings ?. dynamicallyFetchOllamaModels ) {
247
+ const ollamaModels = await getAllOllamaModels ( settings . ollamaURL ) ;
248
+ chatModel . push (
249
+ ...ollamaModels ?. filter ( ( model ) => {
250
+ return (
251
+ ! model ?. details ?. families ?. includes ( "bert" ) &&
252
+ ! model ?. details ?. families ?. includes ( "nomic-bert" )
253
+ ) ;
254
+ } )
255
+ ) ;
256
+ embeddingModel . push (
257
+ ...ollamaModels . map ( ( model ) => ( { ...model , disabled : false } ) )
258
+ ) ;
240
259
}
241
260
return {
242
261
data : bot ,
0 commit comments