-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
-
None
-
QDS Oulu - 2025 Week 39/40, QDS Oulu - 2025 Week 41/42
Lots of models support json schema.
It can be defined to get a structured result from AI.
Here's a tested schema:
{ "json_schema": { "name": "QtDesignStudioAiResponse", "schema": { "type": "object", "properties": { "qml": { "description": "Generated Qml", "type": "string" }, "selectedNodes": { "description": "ID of the selected nodes", "type": "array", "items": { "type": "string" } }, "textMessage": { "description": "Text explanation", "type": "string" } }, "required": [], "additionalProperties": false } }, "type": "json_schema" }
This works on the following models:
- meta-llama/llama-4-maverick-17b-128e-instruct
- openai/gpt-oss-120b
- openai/gpt-oss-20b
- gpt-4o-mini
The benefit is that the API respects the schema, and we shouldn't be concerned about the response structure. Also, we shouldn't define it in the manifests, and it prevents confusion.
For Gerrit Dashboard: QDS-15906 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
681212,7 | AiAssistant: Provide the model with json_schema | qds/dev | qt-creator/qt-creator | Status: NEW | 0 | +1 |