{"record":{"id":"d3d0d81ca702ab97","repo":"langgenius/dify","slug":"invalid-param-d3d0d8","errorCode":"invalid_param","errorMessage":"Summary generation is only available for 'high_quality' indexing technique. Current indexing technique: {dataset.indexing_technique}","messagePattern":"Summary generation is only available for 'high_quality' indexing technique\\. Current indexing technique: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":400,"severity":"error","filePath":"api/controllers/console/datasets/datasets_document.py","lineNumber":1693,"sourceCode":"            raise Forbidden()\n\n        try:\n            DatasetService.check_dataset_permission(dataset, current_user, session)\n        except services.errors.account.NoPermissionError as e:\n            raise Forbidden(str(e))\n\n        # Validate request payload\n        payload = GenerateSummaryPayload.model_validate(console_ns.payload or {})\n        document_list = payload.document_list\n\n        if not document_list:\n            from werkzeug.exceptions import BadRequest\n\n            raise BadRequest(\"document_list cannot be empty.\")\n\n        # Check if dataset configuration supports summary generation\n        if dataset.indexing_technique != IndexTechniqueType.HIGH_QUALITY:\n            raise ValueError(\n                f\"Summary generation is only available for 'high_quality' indexing technique. \"\n                f\"Current indexing technique: {dataset.indexing_technique}\"\n            )\n\n        summary_index_setting = dataset.summary_index_setting\n        if not summary_index_setting or not summary_index_setting.get(\"enable\"):\n            raise ValueError(\"Summary index is not enabled for this dataset. Please enable it in the dataset settings.\")\n\n        # Verify all documents exist and belong to the dataset\n        documents = DocumentService.get_documents_by_ids(\n            DatasetRefService.create_dataset_ref(dataset), document_list, session\n        )\n\n        if len(documents) != len(document_list):\n            found_ids = {doc.id for doc in documents}\n            missing_ids = set(document_list) - found_ids\n            raise NotFound(f\"Some documents not found: {list(missing_ids)}\")\n","sourceCodeStart":1675,"sourceCodeEnd":1711,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/api/controllers/console/datasets/datasets_document.py#L1675-L1711","documentation":"Raised as a ValueError (surfaced as invalid_param) by the POST generate-summary endpoint when the target dataset's indexing_technique is not 'high_quality'. Summary generation builds over vector segments, which only exist under high_quality indexing; economy-indexed datasets have no embeddings to summarize. The check at datasets_document.py:1692 short-circuits before any task is dispatched.","triggerScenarios":"POST /console/api/datasets/{dataset_id}/generate-summary (or the matching route wrapping DocumentSummaryGenerateApi) with a dataset whose indexing_technique column is 'economy' or null. Payload like {\"document_list\": [\"<doc-id>\"]} on such a dataset hits this guard immediately after the document_list emptiness check.","commonSituations":"Dataset was created with 'Economical' indexing in the UI; a frontend summary button was enabled without re-checking indexing mode; a dataset was migrated/downgraded from high_quality to economy; calling the summary API against an older dataset created before summary index existed.","solutions":["Switch the dataset to high_quality indexing (re-index with IndexTechniqueType.HIGH_QUALITY) before invoking summary generation.","Before calling the endpoint, GET the dataset and assert dataset['indexing_technique'] == 'high_quality'; abort the summary flow otherwise.","In the UI, disable the 'Generate Summary' action for economy datasets so the request is never sent."],"exampleFix":"# before\nresp = client.post(f'/datasets/{dataset_id}/generate-summary', json={'document_list': doc_ids})\n\n# after\nds = client.get(f'/datasets/{dataset_id}').json()\nif ds['indexing_technique'] != 'high_quality':\n    raise RuntimeError('cannot generate summaries on a non-high_quality dataset')\nresp = client.post(f'/datasets/{dataset_id}/generate-summary', json={'document_list': doc_ids})","handlingStrategy":"validation","validationCode":"def can_generate_summary(dataset: dict) -> bool:\n    return dataset.get('indexing_technique') == 'high_quality'\n\nds = client.get(f'/console/api/datasets/{dataset_id}').json()\nassert can_generate_summary(ds), f\"indexing_technique={ds.get('indexing_technique')} is not high_quality\"","typeGuard":"from typing import TypedDict\n\nclass DatasetRef(TypedDict):\n    id: str\n    indexing_technique: str | None\n\ndef is_high_quality(d: DatasetRef) -> bool:\n    return d.get('indexing_technique') == 'high_quality'","tryCatchPattern":"try:\n    client.post(f'/datasets/{dataset_id}/generate-summary', json=payload)\nexcept HTTPError as e:\n    if e.response.status_code == 400 and 'high_quality' in e.response.text:\n        # prompt user to switch indexing; do not retry unchanged\n        ...","preventionTips":["Gate the 'Generate Summary' UI action on dataset.indexing_technique == 'high_quality'.","Document that summary generation requires high_quality indexing in your onboarding.","Never cache the decision indefinitely; re-read indexing_technique before each summary batch."],"tags":["datasets","summary-index","configuration","indexing-technique","validation"],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}