{"record":{"id":"e9755e5a23b19dea","repo":"BerriAI/litellm","slug":"response-format-type-json-schema-requires-a-jso","errorCode":null,"errorMessage":"response_format type 'json_schema' requires a 'json_schema' object","messagePattern":"response_format type 'json_schema' requires a 'json_schema' object","errorType":"exception","errorClass":"OCIError","httpStatus":400,"severity":"error","filePath":"litellm/llms/oci/chat/transformation.py","lineNumber":207,"sourceCode":"    rf_type: Final = str(rf[\"type\"]).lower()\n    raw_schema: Final = rf.get(\"json_schema\")\n    json_schema: Final = raw_schema if isinstance(raw_schema, dict) else None\n\n    if rf_type == \"text\":\n        selected_params[\"responseFormat\"] = {\"type\": \"TEXT\"}\n        return\n\n    if vendor == OCIVendors.COHERE:\n        # OCI Cohere has no JSON_SCHEMA type; a schema rides on JSON_OBJECT.\n        payload: Final[dict[str, Any]] = {\"type\": \"JSON_OBJECT\"}\n        if json_schema is not None and json_schema.get(\"schema\") is not None:\n            payload[\"schema\"] = json_schema[\"schema\"]\n        selected_params[\"responseFormat\"] = payload\n        return\n\n    if rf_type == \"json_schema\":\n        if json_schema is None:\n            raise OCIError(\n                status_code=400,\n                message=\"response_format type 'json_schema' requires a 'json_schema' object\",\n            )\n        # OCI's ResponseJsonSchema accepts only name/description/schema/isStrict.\n        # OpenAI sends `strict` instead of `isStrict`; forwarding it (or any\n        # other extra key) makes OCI reject the whole request with HTTP 400.\n        oci_schema: Final[dict[str, Any]] = {\"name\": json_schema.get(\"name\") or \"response\"}\n        if json_schema.get(\"description\") is not None:\n            oci_schema[\"description\"] = json_schema[\"description\"]\n        if json_schema.get(\"schema\") is not None:\n            oci_schema[\"schema\"] = json_schema[\"schema\"]\n        if json_schema.get(\"strict\") is not None:\n            oci_schema[\"isStrict\"] = json_schema[\"strict\"]\n        selected_params[\"responseFormat\"] = {\n            \"type\": \"JSON_SCHEMA\",\n            \"jsonSchema\": oci_schema,\n        }\n        return","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/oci/chat/transformation.py#L189-L225","documentation":"Error \"response_format type 'json_schema' requires a 'json_schema' object\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/oci/chat/transformation.py:207 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include a 'json_schema' object when response_format type is 'json_schema'."],"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-15T17:31:12.345Z"}