{"record":{"id":"257f3360695b21b4","repo":"HKUDS/DeepTutor","slug":"model-not-configured-for-agent-self-agent-name","errorCode":null,"errorMessage":"Model not configured for agent {self.agent_name}. Please activate a model in Settings > Catalog.","messagePattern":"Model not configured for agent (.+?)\\. Please activate a model in Settings > Catalog\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"deeptutor/agents/base_agent.py","lineNumber":175,"sourceCode":"        Returns:\n            Model name\n\n        Raises:\n            ValueError: If model is not configured\n        \"\"\"\n        # 1. Try agent-specific config\n        if self.agent_config.get(\"model\"):\n            return self.agent_config[\"model\"]\n\n        # 2. Try general LLM config\n        if self.llm_config.get(\"model\"):\n            return self.llm_config[\"model\"]\n\n        # 3. Use instance model\n        if self.model:\n            return self.model\n\n        raise ValueError(\n            f\"Model not configured for agent {self.agent_name}. \"\n            \"Please activate a model in Settings > Catalog.\"\n        )\n\n    def get_temperature(self) -> float:\n        \"\"\"\n        Get temperature parameter from unified config (agents.yaml).\n\n        Returns:\n            Temperature value\n        \"\"\"\n        return self._agent_params[\"temperature\"]\n\n    def get_max_tokens(self) -> int:\n        \"\"\"\n        Get maximum token count from unified config (agents.yaml).\n\n        Returns:","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/agents/base_agent.py#L157-L193","documentation":"Raised by extract_text_from_bytes when the filename's extension is not in SUPPORTED_DOC_EXTENSIONS. The extractor only handles a fixed whitelist of document types (pdf, docx, xlsx, pptx, epub, and text-like files), so anything else is rejected before any parsing. The filename kwarg is attached for upstream handling.","triggerScenarios":"Calling extract_text_from_bytes(data, filename='archive.tar.gz') or extract_text_from_path('notes.one') with an extension outside the whitelist; also passing a file with no extension at all.","commonSituations":"Users upload arbitrary files (images, zip archives, .pages/.odt variants) to a KB ingestion pipeline that routes everything through this extractor; or a filename is mangled/loses its extension during upload handling.","solutions":["Check the extension against SUPPORTED_DOC_EXTENSIONS before calling the extractor and route non-document files elsewhere (e.g. an image OCR path)","Normalize or correct the filename if the extension was lost during upload","Catch UnsupportedDocumentError and surface a user-friendly 'unsupported file type' message instead of failing the whole batch"],"exampleFix":"// before\next = _ext(filename)\nif ext not in SUPPORTED_DOC_EXTENSIONS:\n    text = extract_text_from_bytes(data, filename=filename)\n\n// after\nfrom deeptutor.utils.document_extractor import SUPPORTED_DOC_EXTENSIONS, UnsupportedDocumentError\next = _ext(filename)\nif ext not in SUPPORTED_DOC_EXTENSIONS:\n    raise UnsupportedDocumentError(f\"unsupported: {ext}\", filename=filename)\ntext = extract_text_from_bytes(data, filename=filename)","handlingStrategy":"validation","validationCode":"from deeptutor.utils.document_extractor import SUPPORTED_DOC_EXTENSIONS\nimport os\n\ndef is_supported(filename: str) -> bool:\n    return os.path.splitext(filename)[1].lower() in SUPPORTED_DOC_EXTENSIONS\n\nif not is_supported(fn):\n    skip_or_route_elsewhere(fn)","typeGuard":null,"tryCatchPattern":"from deeptutor.utils.document_extractor import UnsupportedDocumentError\ntry:\n    text = extract_text_from_bytes(data, filename=fn)\nexcept UnsupportedDocumentError as e:\n    log.warning(\"unsupported\", filename=e.filename)","preventionTips":["Maintain a UI-side accept list mirroring SUPPORTED_DOC_EXTENSIONS on file pickers","Validate extension before upload, not after"],"tags":["file-type","validation","document-extraction"],"backgroundTag":"unsupported-file-format","analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}