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: sensitive_word_avoidance npe (#902)

takatost6ca3bcbcfd49
diff --git a/api/models/model.py b/api/models/model.py
index e8b3ec5e506..d11cff2e24e 100644
--- a/api/models/model.py
+++ b/api/models/model.py
@@ -158,7 +158,8 @@ class AppModelConfig(db.Model):
self.speech_to_text = json.dumps(model_config['speech_to_text']) \
if model_config.get('speech_to_text') else None
self.more_like_this = json.dumps(model_config['more_like_this'])
- self.sensitive_word_avoidance = json.dumps(model_config['sensitive_word_avoidance'])
+ self.sensitive_word_avoidance = json.dumps(model_config['sensitive_word_avoidance']) \
+ if model_config.get('sensitive_word_avoidance') else None
self.model = json.dumps(model_config['model'])
self.user_input_form = json.dumps(model_config['user_input_form'])
self.pre_prompt = model_config['pre_prompt']