{"record":{"id":"31c40d2ca1753bc9","repo":"HKUDS/DeepTutor","slug":"codegeneratoragent-prompts-are-not-configured","errorCode":null,"errorMessage":"CodeGeneratorAgent prompts are not configured.","messagePattern":"CodeGeneratorAgent prompts are not configured\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"deeptutor/agents/visualize/agents/code_generator_agent.py","lineNumber":52,"sourceCode":"        user_input: str,\n        history_context: str,\n        analysis: VisualizationAnalysis,\n    ) -> str:\n        # Structured prompt assembly: every render type loads the shared\n        # base + general rules, plus exactly one format-specific rule block.\n        # This keeps the per-call prompt dense with the rules that matter for\n        # *this* format without ever paying for the union of all four.\n        # render_type here is always one of svg/chartjs/mermaid/html — manim\n        # is dispatched away in the capability layer before code generation.\n        system_parts = (\n            self.get_prompt(\"system_base\"),\n            self.get_prompt(\"rules_general\"),\n            self.get_prompt(f\"rules_{analysis.render_type}\"),\n        )\n        system_prompt = \"\\n\\n\".join(part.strip() for part in system_parts if part and part.strip())\n        user_template = self.get_prompt(\"user_template\")\n        if not system_prompt or not user_template:\n            raise ValueError(\"CodeGeneratorAgent prompts are not configured.\")\n\n        user_prompt = user_template.format(\n            user_input=user_input.strip(),\n            history_context=history_context.strip() or \"(none)\",\n            render_type=analysis.render_type,\n            analysis_json=json.dumps(analysis.model_dump(), ensure_ascii=False, indent=2),\n        )\n\n        # Blocking rather than streamed: the fenced block is only usable whole.\n        response = await self.call_llm(\n            user_prompt=user_prompt,\n            system_prompt=system_prompt,\n            stage=\"generating\",\n            trace_meta=build_trace_metadata(\n                call_id=new_call_id(\"viz-codegen\"),\n                phase=\"generating\",\n                label=\"Code generation\",\n                call_kind=\"viz_code_generation\",","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/agents/visualize/agents/code_generator_agent.py#L34-L70","documentation":"Error \"CodeGeneratorAgent prompts are not configured.\" thrown in HKUDS/DeepTutor.","triggerScenarios":"Thrown at deeptutor/agents/visualize/agents/code_generator_agent.py:52 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}