{"record":{"id":"36d1cda0937fdbe5","repo":"BerriAI/litellm","slug":"unsupported-response-format-type-response-forma","errorCode":null,"errorMessage":"Unsupported response_format type - {response_format}","messagePattern":"Unsupported response_format type - (.+?)","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"litellm/llms/base_llm/base_utils.py","lineNumber":190,"sourceCode":"    response_format: type[BaseModel] | dict | None,\n    ref_template: str | None = None,\n) -> dict | None:\n    \"\"\"\n    Re-implementation of openai's 'type_to_response_format_param' function\n\n    Used for converting pydantic object to api schema.\n    \"\"\"\n    if response_format is None:\n        return None\n\n    if isinstance(response_format, dict):\n        return _dict_to_response_format_helper(response_format, ref_template)\n\n    # type checkers don't narrow the negation of a `TypeGuard` as it isn't\n    # a safe default behaviour but we know that at this point the `response_format`\n    # can only be a `type`\n    if not _parsing._completions.is_basemodel_type(response_format):\n        raise TypeError(f\"Unsupported response_format type - {response_format}\")\n\n    if ref_template is not None:\n        schema = response_format.model_json_schema(ref_template=ref_template)\n    else:\n        schema = _pydantic.to_strict_json_schema(response_format)\n\n    return {\n        \"type\": \"json_schema\",\n        \"json_schema\": {\n            \"schema\": schema,\n            \"name\": response_format.__name__,\n            \"strict\": True,\n        },\n    }\n\n\ndef map_developer_role_to_system_role(\n    messages: list[AllMessageValues],","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/base_llm/base_utils.py#L172-L208","documentation":"Error \"Unsupported response_format type - {response_format}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/base_llm/base_utils.py:190 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a supported response_format type (e.g. {'type':'json_object'} or {'type':'text'})."],"exampleFix":null,"handlingStrategy":null,"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"}