{"record":{"id":"90478e3d8760a9b8","repo":"zylon-ai/private-gpt","slug":"openai-responses-llm-dependencies-are-not-installe-90478e","errorCode":null,"errorMessage":"OpenAI Responses LLM dependencies are not installed. Install with `uv sync --inexact --extra llm-openai`.","messagePattern":"OpenAI Responses LLM dependencies are not installed\\. Install with `uv sync --inexact --extra llm-openai`\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"private_gpt/components/llm/factories/responses/generic.py","lineNumber":24,"sourceCode":"from private_gpt.components.llm.tokenizers.tokenizer_base import TokenizerBase\nfrom private_gpt.components.model_discovery.url_utils import is_openai_api_base\nfrom private_gpt.settings.settings import LLMModelConfig, Settings\nfrom private_gpt.utils.dependencies import format_missing_dependency_message\n\n\nclass OpenAIResponsesLLMLoader:\n    \"\"\"Mixin providing lazy-loaded access to PatchedOpenAIResponsesLLM.\"\"\"\n\n    @staticmethod\n    def _load_patched_openai_responses() -> type[Any]:\n        try:\n            from private_gpt.components.llm.custom.openairesponses import (\n                PatchedOpenAIResponsesLLM,\n            )\n\n            return PatchedOpenAIResponsesLLM\n        except ImportError as e:\n            raise ImportError(\n                format_missing_dependency_message(\n                    \"OpenAI Responses LLM\",\n                    extras=\"llm-openai\",\n                )\n            ) from e\n\n\nclass OpenAIGenericResponsesFactory(LLMFactory):\n    \"\"\"Responses API router.\n\n    Routes to OpenAIResponsesFactory for api.openai.com,\n    otherwise delegates to OpenAILikeResponsesFactory.\n    \"\"\"\n\n    def __init__(self, settings: Settings):\n        super().__init__(settings)\n        self.openai_settings = settings.openai\n","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/components/llm/factories/responses/generic.py#L6-L42","documentation":"ImportError raised by OpenAIResponsesLLMLoader._load_patched_openai_responses: the lazy import of PatchedOpenAIResponsesLLM from the custom openairesponses module failed, meaning the optional 'llm-openai' extra (OpenAI packages including Responses API support) is missing. The generic Responses factory uses this loader for api.openai.com traffic.","triggerScenarios":"Configuring the Responses API route for api.openai.com without the llm-openai extra installed, or with an openai package version too old to provide the Responses API surface the custom module imports.","commonSituations":"Minimal installs (`uv sync` with no extras); pinned old openai SDK versions that predate the Responses API; CI images built without the extra.","solutions":["Run `uv sync --inexact --extra llm-openai`.","If already installed, upgrade the openai package to a version supporting the Responses API and reinstall the extra.","Rebuild Docker/CI images with the extra included."],"exampleFix":"# before\nuv sync\n\n# after\nuv sync --inexact --extra llm-openai","handlingStrategy":"validation","validationCode":"def responses_api_available() -> bool:\n    try:\n        from openai.types import responses  # noqa: F401\n        return True\n    except ImportError:\n        return False","typeGuard":null,"tryCatchPattern":"try:\n    factory = OpenAIGenericResponsesFactory(settings)\nexcept ImportError as e:\n    if 'llm-openai' in str(e):\n        raise SystemExit('Run: uv sync --inexact --extra llm-openai') from e\n    raise","preventionTips":["Install the llm-openai extra in any environment using the Responses API route.","Pin an openai SDK version that includes Responses support in your lockfile.","Exercise the configured route in a startup smoke test, not just at first user request."],"tags":["dependencies","openai","responses-api","import-error"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}