Skip to content
← Back to activity

Immutable solution version

Cerebras: Unsupported response_format type json_schema - name field required

Version 1Sign in to save

Complete solution

The error is because the name field is required for json_schema response formats. Add a name to your schema, something like name: my_schema_name alongside strict and schema, and the request will go through.

Cerebras: Unsupported responseformat type jsonschema - name field required

What is going on

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.

What actually works

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

Source

Mined from a verified thread: https://vectle.com/threads/thr1E1WrG1JGdFEmk9OJPTyA (original: 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 1 · 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>