Skip to content

Commit 83e9a8c

Browse files
committed
feat: add folder_id support in knowledge and tool modules
1 parent 66ab7fd commit 83e9a8c

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

apps/application/serializers/application.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ def edit(self, instance: Dict, with_valid=True):
690690
'stt_model_id', 'tts_model_id', 'tts_model_enable', 'stt_model_enable', 'tts_type',
691691
'tts_autoplay', 'stt_autosend', 'file_upload_enable', 'file_upload_setting',
692692
'api_key_is_active', 'icon', 'work_flow', 'model_params_setting', 'tts_model_params_setting',
693-
'problem_optimization_prompt', 'clean_time']
693+
'problem_optimization_prompt', 'clean_time', 'folder_id']
694694
for update_key in update_keys:
695695
if update_key in instance and instance.get(update_key) is not None:
696696
application.__setattr__(update_key, instance.get(update_key))

apps/knowledge/serializers/knowledge.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ def edit(self, instance: Dict):
337337
knowledge.desc = instance.get("desc")
338338
if 'meta' in instance:
339339
knowledge.meta = instance.get('meta')
340+
if 'folder_id' in instance:
341+
knowledge.folder_id = instance.get('folder_id')
340342
if 'file_size_limit' in instance:
341343
knowledge.file_size_limit = instance.get('file_size_limit')
342344
if 'file_count_limit' in instance:

apps/tools/serializers/tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def edit(self, instance, with_valid=True):
280280
raise serializers.ValidationError(_('Tool not found'))
281281

282282
edit_field_list = ['name', 'desc', 'code', 'icon', 'input_field_list', 'init_field_list', 'init_params',
283-
'is_active']
283+
'is_active', 'folder_id']
284284
edit_dict = {field: instance.get(field) for field in edit_field_list if (
285285
field in instance and instance.get(field) is not None)}
286286

0 commit comments

Comments
 (0)