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 segment update issue (#1844)

Jyongda4847c5a832
diff --git a/api/services/dataset_service.py b/api/services/dataset_service.py
index 92740609a6a..55c0e640bff 100644
--- a/api/services/dataset_service.py
+++ b/api/services/dataset_service.py
@@ -1104,9 +1104,9 @@ class SegmentService:
if segment.content == content:
if document.doc_form == 'qa_model':
segment.answer = args['answer']
- if args['keywords']:
+ if 'keywords' in args and args['keywords']:
segment.keywords = args['keywords']
- if args['enabled'] is not None:
+ if'enabled' in args and args['enabled'] is not None:
segment.enabled = args['enabled']
db.session.add(segment)
db.session.commit()