{"record":{"id":"b9b9ad34d663e32f","repo":"BerriAI/litellm","slug":"prompt-id-is-required-for-humanloop-integration","errorCode":null,"errorMessage":"prompt_id is required for Humanloop integration","messagePattern":"prompt_id is required for Humanloop integration","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/humanloop.py","lineNumber":161,"sourceCode":"        messages: list[AllMessageValues],\n        non_default_params: dict,\n        prompt_id: str | None,\n        prompt_variables: dict | None,\n        dynamic_callback_params: StandardCallbackDynamicParams,\n        prompt_spec: PromptSpec | None = None,\n        prompt_label: str | None = None,\n        prompt_version: int | None = None,\n        ignore_prompt_manager_model: bool | None = False,\n        ignore_prompt_manager_optional_params: bool | None = False,\n    ) -> tuple[\n        str,\n        list[AllMessageValues],\n        dict,\n    ]:\n        humanloop_api_key = dynamic_callback_params.get(\"humanloop_api_key\") or get_secret_str(\"HUMANLOOP_API_KEY\")\n\n        if prompt_id is None:\n            raise ValueError(\"prompt_id is required for Humanloop integration\")\n\n        if humanloop_api_key is None:\n            return super().get_chat_completion_prompt(\n                model=model,\n                messages=messages,\n                non_default_params=non_default_params,\n                prompt_id=prompt_id,\n                prompt_variables=prompt_variables,\n                dynamic_callback_params=dynamic_callback_params,\n                prompt_spec=prompt_spec,\n            )\n\n        prompt_template: Final = prompt_manager._get_prompt_from_id(\n            humanloop_prompt_id=prompt_id, humanloop_api_key=humanloop_api_key\n        )\n\n        updated_messages: Final = prompt_manager.compile_prompt(\n            prompt_template=prompt_template[\"prompt_template\"],","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/humanloop.py#L143-L179","documentation":"Guard in the Humanloop prompt-management callback: prompt_id is None, but the Humanloop integration requires a prompt_id to look up which prompt template to apply to the messages.","triggerScenarios":"Calling the Humanloop prompt integration without a prompt_id.","commonSituations":"prompt_id omitted from the request or lost when forwarding metadata.","solutions":["Pass prompt_id in the request when using the Humanloop integration."],"exampleFix":"litellm.completion(model='gpt-4', prompt_id='hl_prompt_id', messages=[{'role':'user','content':'hi'}])","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}