HKUDS/DeepTutor · error · ValueError

Model not configured for agent {self.agent_name}. Please act

Error message

Model not configured for agent {self.agent_name}. Please activate a model in Settings > Catalog.

What it means

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.

Source

Thrown at deeptutor/agents/base_agent.py:175

        Returns:
            Model name

        Raises:
            ValueError: If model is not configured
        """
        # 1. Try agent-specific config
        if self.agent_config.get("model"):
            return self.agent_config["model"]

        # 2. Try general LLM config
        if self.llm_config.get("model"):
            return self.llm_config["model"]

        # 3. Use instance model
        if self.model:
            return self.model

        raise ValueError(
            f"Model not configured for agent {self.agent_name}. "
            "Please activate a model in Settings > Catalog."
        )

    def get_temperature(self) -> float:
        """
        Get temperature parameter from unified config (agents.yaml).

        Returns:
            Temperature value
        """
        return self._agent_params["temperature"]

    def get_max_tokens(self) -> int:
        """
        Get maximum token count from unified config (agents.yaml).

        Returns:

View on GitHub (pinned to 3e82f13042)

Solutions

  1. Check the extension against SUPPORTED_DOC_EXTENSIONS before calling the extractor and route non-document files elsewhere (e.g. an image OCR path)
  2. Normalize or correct the filename if the extension was lost during upload
  3. Catch UnsupportedDocumentError and surface a user-friendly 'unsupported file type' message instead of failing the whole batch

Example fix

// before
ext = _ext(filename)
if ext not in SUPPORTED_DOC_EXTENSIONS:
    text = extract_text_from_bytes(data, filename=filename)

// after
from deeptutor.utils.document_extractor import SUPPORTED_DOC_EXTENSIONS, UnsupportedDocumentError
ext = _ext(filename)
if ext not in SUPPORTED_DOC_EXTENSIONS:
    raise UnsupportedDocumentError(f"unsupported: {ext}", filename=filename)
text = extract_text_from_bytes(data, filename=filename)
Defensive patterns

Strategy: validation

Validate before calling

from deeptutor.utils.document_extractor import SUPPORTED_DOC_EXTENSIONS
import os

def is_supported(filename: str) -> bool:
    return os.path.splitext(filename)[1].lower() in SUPPORTED_DOC_EXTENSIONS

if not is_supported(fn):
    skip_or_route_elsewhere(fn)

Try / catch

from deeptutor.utils.document_extractor import UnsupportedDocumentError
try:
    text = extract_text_from_bytes(data, filename=fn)
except UnsupportedDocumentError as e:
    log.warning("unsupported", filename=e.filename)

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of HKUDS/DeepTutor@3e82f13042 (2026-08-27). Data as JSON: /api/errors/257f3360695b21b4. Report an issue: GitHub.