Skip to content

Commit

Permalink
Fix/segment create with api (#7928)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnJyong authored Sep 3, 2024
1 parent 01581dd commit 1a5116c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/controllers/service_api/dataset/segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ def post(self, tenant_id, dataset_id, document_id):
document = DocumentService.get_document(dataset.id, document_id)
if not document:
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
if dataset.indexing_technique == "high_quality":
try:
Expand Down

0 comments on commit 1a5116c

Please sign in to comment.