mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
[autofix.ci] apply automated fixes
This commit is contained in:
@ -1341,10 +1341,7 @@ class DocumentGenerateSummaryApi(Resource):
|
|||||||
|
|
||||||
# Update need_summary to True for documents that don't have it set
|
# Update need_summary to True for documents that don't have it set
|
||||||
# This handles the case where documents were created when summary_index_setting was disabled
|
# This handles the case where documents were created when summary_index_setting was disabled
|
||||||
documents_to_update = [
|
documents_to_update = [doc for doc in documents if not doc.need_summary and doc.doc_form != "qa_model"]
|
||||||
doc for doc in documents
|
|
||||||
if not doc.need_summary and doc.doc_form != "qa_model"
|
|
||||||
]
|
|
||||||
|
|
||||||
if documents_to_update:
|
if documents_to_update:
|
||||||
document_ids_to_update = [str(doc.id) for doc in documents_to_update]
|
document_ids_to_update = [str(doc.id) for doc in documents_to_update]
|
||||||
|
|||||||
@ -58,7 +58,7 @@ class BaseIndexProcessor(ABC):
|
|||||||
For each segment in preview_texts, generate a summary using LLM and attach it to the segment.
|
For each segment in preview_texts, generate a summary using LLM and attach it to the segment.
|
||||||
The summary can be stored in a new attribute, e.g., summary.
|
The summary can be stored in a new attribute, e.g., summary.
|
||||||
This method should be implemented by subclasses.
|
This method should be implemented by subclasses.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
tenant_id: Tenant ID
|
tenant_id: Tenant ID
|
||||||
preview_texts: List of preview details to generate summaries for
|
preview_texts: List of preview details to generate summaries for
|
||||||
|
|||||||
@ -1390,9 +1390,7 @@ class DocumentService:
|
|||||||
return documents
|
return documents
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def update_documents_need_summary(
|
def update_documents_need_summary(dataset_id: str, document_ids: Sequence[str], need_summary: bool = True) -> int:
|
||||||
dataset_id: str, document_ids: Sequence[str], need_summary: bool = True
|
|
||||||
) -> int:
|
|
||||||
"""
|
"""
|
||||||
Update need_summary field for multiple documents.
|
Update need_summary field for multiple documents.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user