Skip to content

Commit

Permalink
Fix/segment create with api (langgenius#7928)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnJyong authored and cuiks committed Sep 26, 2024
1 parent 77bdda0 commit 98f3efc
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 98f3efc

Please sign in to comment.