{"record":{"id":"321a7e0978ff036f","repo":"HKUDS/DeepTutor","slug":"the-model-provider-interrupted-this-response-plea","errorCode":null,"errorMessage":"The model provider interrupted this response. Please retry.","messagePattern":"The model provider interrupted this response\\. Please retry\\.","errorType":"exception","errorClass":"LLMProviderTransportError","httpStatus":null,"severity":"warning","filePath":"deeptutor/agents/chat/agent_loop.py","lineNumber":787,"sourceCode":"                            \"error_code\": \"provider_transport\",\n                            \"retryable\": True,\n                            \"partial_response\": partial_response,\n                        },\n                    ),\n                )\n                message = self.pipeline._t(\n                    (\n                        \"notices.provider_stream_interrupted\"\n                        if partial_response\n                        else \"notices.provider_unavailable\"\n                    ),\n                    default=(\n                        \"The model provider interrupted this response. Please retry.\"\n                        if partial_response\n                        else \"Unable to reach the model provider. Please retry.\"\n                    ),\n                )\n                raise LLMProviderTransportError(\n                    message,\n                    partial_response=partial_response,\n                ) from exc\n            finally:\n                close = getattr(response_stream, \"close\", None)\n                if callable(close):\n                    with suppress(Exception):\n                        await close()\n            break\n\n        dsml_tail = dsml_filter.flush()\n        if dsml_tail:\n            await _emit_segments(think_filter.feed(dsml_tail))\n        await _emit_segments(think_filter.flush())\n        text = \"\".join(text_parts)\n        record_streamed_usage(\n            self.pipeline.usage,\n            usage_seen,","sourceCodeStart":769,"sourceCodeEnd":805,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/agents/chat/agent_loop.py#L769-L805","documentation":"Raised as EmptyDocumentError after successful extraction when the resulting text is empty or only whitespace. This means the file parsed fine but genuinely contained no retrievable text — e.g. a scanned/image-only PDF, an empty DOCX, or a spreadsheet of blank cells.","triggerScenarios":"Extracting a scanned PDF with no text layer; an empty .docx or .xlsx created but never filled; a .txt containing only whitespace/newlines; an EPUB whose chapters contain only images.","commonSituations":"KB ingestion of scanned books or image-heavy slide decks; users uploading a newly created empty file; OCR-less pipelines feeding image PDFs into a text extractor.","solutions":["If the file is a scanned PDF, run OCR (e.g. pytesseract/ocrmypdf) before extraction","Pre-check the file: warn users when a document has 0 extractable characters","Catch EmptyDocumentError and skip the file (log it) rather than aborting a batch ingest"],"exampleFix":"// before\ntext = extract_text_from_bytes(data, filename=fn)\n\n// after\nfrom deeptutor.utils.document_extractor import EmptyDocumentError\ntry:\n    text = extract_text_from_bytes(data, filename=fn)\nexcept EmptyDocumentError:\n    text = ocr_fallback(data)  # or skip with a warning\n    if not text.strip():\n        raise","handlingStrategy":"try-catch","validationCode":"import fitz\nwith fitz.open(stream=data, filetype=\"pdf\") as doc:\n    if not any(page.get_text().strip() for page in doc):\n        warn_user(\"document has no text layer; OCR needed\")","typeGuard":null,"tryCatchPattern":"from deeptutor.utils.document_extractor import EmptyDocumentError\ntry:\n    text = extract_text_from_bytes(data, filename=fn)\nexcept EmptyDocumentError:\n    text = \"\"  # treat as empty, run OCR or skip","preventionTips":["OCR scanned PDFs before ingestion","Warn users when uploads contain no selectable text"],"tags":["empty-document","pdf","document-extraction"],"backgroundTag":"empty-extraction-result","analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}