Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: universal chat external_data_tools NPE (#1467)

takatost260672986ed9
diff --git a/api/models/model.py b/api/models/model.py
index cefc275e35c..cdc4346ff5a 100644
--- a/api/models/model.py
+++ b/api/models/model.py
@@ -197,7 +197,8 @@ class AppModelConfig(db.Model):
self.more_like_this = json.dumps(model_config['more_like_this'])
self.sensitive_word_avoidance = json.dumps(model_config['sensitive_word_avoidance']) \
if model_config.get('sensitive_word_avoidance') else None
- self.external_data_tools = json.dumps(model_config['external_data_tools'])
+ self.external_data_tools = json.dumps(model_config['sensitive_word_avoidance']) \
+ if model_config.get('external_data_tools') else None
self.model = json.dumps(model_config['model'])
self.user_input_form = json.dumps(model_config['user_input_form'])
self.dataset_query_variable = model_config.get('dataset_query_variable')