non strict json schema seems to have changed in the last 24hrs. I have a schema that used to work being generated in rust from the serde_json crate. The response_format is set to jsonschema and strict=false. Frequently I get either responses that don’t match the schema but actually look like they are the schema definition itself. Sometimes with data but usually empty.
When I changed my schema to manually defined and strict=true, it is now working again. I had to change my schema because the serde_json output caused this error when strict=true:
“Invalid schema for response_format ‘equipment’: In context=(), ‘additionalProperties’ is required to be supplied and to be false.”,
I prob should have had strict=true before but it was successful 99% time with strict=false with better data and then in the last 48hrs went to 90% failing to parse correctly.
UPDATE:
The structured outputs handling of json schemas have just seemed to have changed. I posted a couple examples but the rust serde_json schema with strict=false is no longer giving results that match the schema when it had until ~48 hrs ago. The results are formatted like a schema not like a json instance of that schema. Manually creating the schema has worked around the issue but something must have changed with openai because we had no changes on our side and the behavior is dramatic. This is an example expected result:
"{"attributes":{"name":"Oil Boiler","type":"Boiler","brand":"Peerless","model":"EC-03","serial":"337780220002","category":"HVAC","room":"Utility Room"},"issues":[{"description":"Burner fails to ignite due to a faulty igniter or clogged nozzle.","difficulty":"High","name":"Failing to Ignite","parts":["Igniter","Nozzle"]},{"description":"Kettling noise caused by trapped air or limescale.","difficulty":"Medium","name":"Kettling","parts":["Heat Exchanger"]},{"description":"Water leaks due to pressure valve failure.","difficulty":"Medium","name":"Leaking","parts":["Pressure Valve"]}],"maintenance":[{"description":"Check for leaks and ensure proper pressure.","frequency":"Monthly","name":"Pressure Check","parts":[]},{"description":"Clean the burner and inspect the igniter for soot and residue buildup.","frequency":"Quarterly","name":"Burner Cleaning","parts":["Igniter","Nozzle"]},{"description":"Flush the system to remove limescale and debris.","frequency":"Annually","name":"System Flush","parts":["Heat Exchanger"]}],"parts":[{"description":"Used to ignite the fuel mixture for combustion.","name":"Igniter"},{"description":"Controls the flow of heated water or steam.","name":"Pressure Valve"},{"description":"Channels and disperses the input fuel within the burner compartment.","name":"Nozzle"}]}"
Instead we got the result below that has fields nested under a properties
fieldwith a
type` field instead of a value. In short, OpenAI is responding with a schema instead of json.
{"title":"AiEquipmentResult","type":"object","properties":{"attributes":{"type":"object","properties":{"brand":{"type":"string"},"model":{"type":"string"},"room":{"type":"string"},"serial":{"type":"string"},"type":{"type":"string"},"category":{"type":"string"}},"additionalProperties":false},"issues":{"type":"array","items":{"$ref":"#/definitions/EquipmentIssue"}},"maintenance":{"type":"array","items":{"$ref":"#/definitions/EquipmentMaintenance"}},"parts":{"type":"array","items":{"$ref":"#/definitions/EquipmentPart"}}},"definitions":{"EquipmentIssue":{"type":"object","properties":{"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"difficulty":{"type":"string","nullable":true},"parts":{"type":"array","items":{"type":"string"}}}},"EquipmentMaintenance":{"type":"object","properties":{"name":{"type":"string","nullable":true},"frequency":{"anyOf":[{"$ref":"#/definitions/MaintenanceSchedule"},{"type":"null"}]},"description":{"type":"string","nullable":true},"parts":{"type":"array","items":{"type":"string"}}}},"EquipmentPart":{"type":"object","properties":{"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true}}},"MaintenanceSchedule":{"type":"string","enum":["Annually","Quarterly","Monthly","Weekly","AsNeeded","Unknown"]}}}"