{"record":{"id":"c85dab6ef18891f5","repo":"BerriAI/litellm","slug":"either-prompt-directory-or-prompt-data-must-be-set","errorCode":null,"errorMessage":"Either prompt_directory or prompt_data must be set before using dotprompt manager. Set litellm.global_prompt_directory, initialize with prompt_directory parameter, or provide prompt_data.","messagePattern":"Either prompt_directory or prompt_data must be set before using dotprompt manager\\. Set litellm\\.global_prompt_directory, initialize with prompt_directory parameter, or provide prompt_data\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/dotprompt/dotprompt_manager.py","lineNumber":73,"sourceCode":"            self.prompt_data = json.loads(prompt_data)\n        else:\n            self.prompt_data = prompt_data or {}\n\n        self._prompt_manager: PromptManager | None = None\n        self.prompt_file = prompt_file\n        self.prompt_id = prompt_id\n\n    @property\n    def integration_name(self) -> str:\n        \"\"\"Integration name used in model names like 'dotprompt/gpt-4'.\"\"\"\n        return \"dotprompt\"\n\n    @property\n    def prompt_manager(self) -> PromptManager:\n        \"\"\"Lazy-load the prompt manager.\"\"\"\n        if self._prompt_manager is None:\n            if self.prompt_directory is None and not self.prompt_data and not self.prompt_file:\n                raise ValueError(\n                    \"Either prompt_directory or prompt_data must be set before using dotprompt manager. \"\n                    \"Set litellm.global_prompt_directory, initialize with prompt_directory parameter, or provide prompt_data.\"\n                )\n            self._prompt_manager = PromptManager(\n                prompt_directory=self.prompt_directory,\n                prompt_data=self.prompt_data,\n                prompt_file=self.prompt_file,\n                prompt_id=self.prompt_id,\n            )\n        return self._prompt_manager\n\n    def should_run_prompt_management(\n        self,\n        prompt_id: str | None,\n        prompt_spec: PromptSpec | None,\n        dynamic_callback_params: StandardCallbackDynamicParams,\n    ) -> bool:\n        \"\"\"","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/integrations/dotprompt/dotprompt_manager.py#L55-L91","documentation":"Error \"Either prompt_directory or prompt_data must be set before using dotprompt manager. Set litellm.global_prompt_directory, initialize with prompt_directory parameter, or provide prompt_data.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/integrations/dotprompt/dotprompt_manager.py:73 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set litellm.global_prompt_directory, pass prompt_directory, or provide prompt_data before using the dotprompt manager."],"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"}