HKUDS/DeepTutor · error · ValueError

AnalysisAgent prompts are not configured.

Error message

AnalysisAgent prompts are not configured.

What it means

Raised in AnalysisAgent.process when get_prompt('system_fixed'/'user_template_fixed' or the figure-mode equivalents) finds no configured prompt. The visualize pipeline cannot run analysis without its prompt templates; this indicates missing or unloadable prompt configuration for the agent (broken install or missing prompts YAML).

Solutions

  1. Verify the visualize capability's prompt YAML files (capabilities/prompts/{en,zh}/) are installed and readable
  2. Reinstall the package if prompt resources were excluded from the install
  3. Check the prompt-key names ('system_fixed', 'user_template_fixed', figure-mode keys) match the loaded prompt set
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at deeptutor/agents/visualize/agents/analysis_agent.py:64 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at deeptutor/agents/visualize/agents/analysis_agent.py:64

                data_description="",
                chart_type="",
                visual_elements=[],
                rationale=f"User selected {render_mode} explicitly.",
            )

        if render_mode in ("svg", "chartjs", "mermaid", "html"):
            system_prompt = self.get_prompt("system_fixed")
            user_template = self.get_prompt("user_template_fixed")
        elif render_mode == "figure":
            # Constrained-auto mode: LLM picks one of svg/chartjs/mermaid
            # (html is excluded). Used by the Book figure block.
            system_prompt = self.get_prompt("system_figure")
            user_template = self.get_prompt("user_template_figure")
        else:
            system_prompt = self.get_prompt("system")
            user_template = self.get_prompt("user_template")
        if not system_prompt or not user_template:
            raise ValueError("AnalysisAgent prompts are not configured.")

        format_kwargs: dict[str, str] = {
            "user_input": user_input.strip(),
            "history_context": history_context.strip() or "(none)",
        }
        if render_mode in ("svg", "chartjs", "mermaid", "html"):
            format_kwargs["render_type"] = render_mode

        user_prompt = user_template.format(**format_kwargs)

        # Blocking rather than streamed: nothing consumes the partial JSON, and
        # a reasoning model's <think> prelude never reaches the parser this way.
        raw = await self.call_llm(
            user_prompt=user_prompt,
            system_prompt=system_prompt,
            response_format={"type": "json_object"},
            stage="analyzing",
            attachments=attachments,

View on GitHub (pinned to 3e82f13042)