File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,7 @@ export async function updateKnowledgeBase(
155155 maxSize : number
156156 minSize : number
157157 overlap : number
158+ ollamaBaseUrl ?: unknown
158159 }
159160 embeddingModel ?: string
160161 embeddingDimension ?: number
@@ -166,7 +167,17 @@ export async function updateKnowledgeBase(
166167 if ( updates . description !== undefined ) updateData . description = updates . description
167168 if ( updates . workspaceId !== undefined ) updateData . workspaceId = updates . workspaceId
168169 if ( updates . chunkingConfig !== undefined ) {
169- updateData . chunkingConfig = updates . chunkingConfig
170+ // Preserve ollamaBaseUrl stored in existing chunkingConfig JSONB
171+ const existing = await db
172+ . select ( { chunkingConfig : knowledgeBase . chunkingConfig } )
173+ . from ( knowledgeBase )
174+ . where ( eq ( knowledgeBase . id , knowledgeBaseId ) )
175+ . limit ( 1 )
176+ const existingConfig = existing [ 0 ] ?. chunkingConfig as Record < string , unknown > | null
177+ const ollamaBaseUrl = existingConfig ?. ollamaBaseUrl
178+ updateData . chunkingConfig = ollamaBaseUrl
179+ ? { ...updates . chunkingConfig , ollamaBaseUrl }
180+ : updates . chunkingConfig
170181 }
171182
172183 await db . update ( knowledgeBase ) . set ( updateData ) . where ( eq ( knowledgeBase . id , knowledgeBaseId ) )
You can’t perform that action at this time.
0 commit comments