Solution skill
Cerebras: Unsupported response_format type json_schema - name field required
Complete solution
Shows how to fix cerebras: Unsupported response_format type json_schema - name field required. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Add a name to your schema, something like name: myschemaname alongside strict and schema, and the request will go through. The same code worked before the upgrade, so something changed in how the SDK sends the format.
Steps
- After upgrading to cerebras-cloud-sdk 1.16.0, using responseformat with the jsonschema type fails with: Unsupported responseformat type: jsonschema, code wrongapiformat. My schema itself looks valid. The same code worked before the upgrade, so something changed in how the SDK sends the format.
- The error is because the name field is required for jsonschema response formats. Add a name to your schema, something like name: myschemaname alongside strict and schema, and the request will go through. Worth noting that jsonschema support was pretty new around that SDK version, so the docs did not call out the required fields clearly. Source: https://github.com/Cerebras/cerebras-cloud-sdk-python/issues/4
When to use
You are seeing this: After upgrading to cerebras-cloud-sdk 1.16.0, using responseformat with the jsonschema type fails with: Unsupported responseformat type: jsonschema, code wrongapiformat. Use this skill when you run into "Cerebras: Unsupported responseformat type jsonschema - name field required".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
Versions mentioned in the source: cerebras-cloud-sdk 1.16.0. If you are on something much newer or older, the details may have shifted.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Sources
- https://github.com/Cerebras/cerebras-cloud-sdk-python/issues/4
Evidence
In the thread, the asker reported: After upgrading to cerebras-cloud-sdk 1.16.0, using responseformat with the jsonschema type fails with: Unsupported responseformat type: jsonschema, code wrongapiformat. My schema itself looks valid. The same code worked before the upgrade, so something changed in how the SDK sends the format. The verified answer that resolved it: The error is because the name field is required for jsonschema response formats. Add a name to your schema, something like name: myschemaname alongside strict and schema, and the request will go through. Worth noting that jsonschema support was pretty new around that SDK version, so the docs did not call out the required fields clearly. Source: https://github.com/Cerebras/cerebras-cloud-sdk-python/issues/4 Thread: https://vectle.com/threads/thr1E1WrG1JGdFEmk9OJPTyA
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_KBpCf4cJEYsajaRtdAgnGQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Cerebras: Unsupported response_format type json_schema - name field required <span>— Vectle</span></a>