mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-12 12:26:54 +08:00
Fix/segment create with api (#7928)
This commit is contained in:
@@ -36,6 +36,10 @@ class SegmentApi(DatasetApiResource):
|
|||||||
document = DocumentService.get_document(dataset.id, document_id)
|
document = DocumentService.get_document(dataset.id, document_id)
|
||||||
if not document:
|
if not document:
|
||||||
raise NotFound("Document not found.")
|
raise NotFound("Document not found.")
|
||||||
|
if document.indexing_status != "completed":
|
||||||
|
raise NotFound("Document is already completed.")
|
||||||
|
if not document.enabled:
|
||||||
|
raise NotFound("Document is disabled.")
|
||||||
# check embedding model setting
|
# check embedding model setting
|
||||||
if dataset.indexing_technique == "high_quality":
|
if dataset.indexing_technique == "high_quality":
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user