{"record":{"id":"020cd5e812e79c5a","repo":"BerriAI/litellm","slug":"error-rendering-template-prompt-id-e","errorCode":null,"errorMessage":"Error rendering template '{prompt_id}': {e}","messagePattern":"Error rendering template '(.+?)': (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/dotprompt/prompt_manager.py","lineNumber":224,"sourceCode":"\n        if template is None:\n            available_prompts: Final = list(self.prompts.keys())\n            version_str: Final = f\" (version {version})\" if version else \"\"\n            raise KeyError(f\"Prompt '{prompt_id}'{version_str} not found. Available prompts: {available_prompts}\")\n\n        variables: Final = prompt_variables or {}\n\n        # Validate input variables against schema if defined\n        if template.input_schema:\n            self._validate_input(variables, template.input_schema)\n\n        try:\n            # Create Jinja2 template and render\n            jinja_template: Final = self.jinja_env.from_string(template.content)\n            rendered: Final = jinja_template.render(**variables)\n            return rendered\n        except Exception as e:\n            raise ValueError(f\"Error rendering template '{prompt_id}': {e}\")\n\n    def _validate_input(self, variables: dict[str, Any], schema: dict[str, Any]) -> None:\n        \"\"\"Basic validation of input variables against schema.\"\"\"\n        for field_name, field_type in schema.items():\n            if field_name in variables:\n                value = variables[field_name]\n                expected_type = self._get_python_type(field_type)\n\n                if not isinstance(value, expected_type):\n                    raise ValueError(\n                        f\"Invalid type for field '{field_name}': \"\n                        f\"expected {getattr(expected_type, '__name__', str(expected_type))}, got {type(value).__name__}\"\n                    )\n\n    def _get_python_type(self, schema_type: str) -> type | tuple:\n        \"\"\"Convert schema type string to Python type.\"\"\"\n        type_mapping: Final[dict[str, type | tuple]] = {\n            \"string\": str,","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/integrations/dotprompt/prompt_manager.py#L206-L242","documentation":"Error \"Error rendering template '{prompt_id}': {e}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/integrations/dotprompt/prompt_manager.py:224 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the template variables/syntax for the prompt; see the wrapped exception."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}