JSON Schema for structured output unavailable #134

Closed
opened 2026-02-16 10:18:11 -05:00 by yindo · 1 comment
Owner

Originally created by @DhavalThkkar on GitHub (Mar 27, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.1.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Image

Followed the instructions for getting it up locally using docker compose instructions, and I am using Azure OpenAI GPT 4o and o3-mini models

✔️ Expected Behavior

JSON schema should be available for getting structured outputs

Actual Behavior

No JSON schema option avaiable at all

Originally created by @DhavalThkkar on GitHub (Mar 27, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.1.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ![Image](https://github.com/user-attachments/assets/2ad3e2da-c593-4b6b-a4e1-8c6f7fe981f3) Followed the instructions for getting it up locally using `docker compose` instructions, and I am using Azure OpenAI GPT 4o and o3-mini models ### ✔️ Expected Behavior JSON schema should be available for getting structured outputs ### ❌ Actual Behavior No JSON schema option avaiable at all
yindo closed this issue 2026-02-16 10:18:11 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 27, 2025):

I found a similar unsolved discussion regarding support for OpenAI structured outputs [1].

For your issue, ensure that you are using a model that supports JSON Schema, such as gpt-4o-mini-2024-07-18 or later versions. You need to enable the JSON Schema setting in the configuration and fill in the JSON Schema template. Additionally, make sure the response_format is set to json_schema instead of json_object [2][3].

If you are using Azure OpenAI models, be aware of known issues where JSON schema functionality might not work correctly. The recommended solution is to upgrade the OpenAI plugin to the latest version and reconfigure the plugin settings [4].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Mar 27, 2025): <!-- Answer --> I found a similar unsolved discussion regarding support for OpenAI structured outputs <sup>[[1]](https://github.com/langgenius/dify/discussions/7170)</sup>. For your issue, ensure that you are using a model that supports JSON Schema, such as `gpt-4o-mini-2024-07-18` or later versions. You need to enable the `JSON Schema` setting in the configuration and fill in the JSON Schema template. Additionally, make sure the `response_format` is set to `json_schema` instead of `json_object` <sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/jp/learn-more/how-to-use-json-schema-in-dify.md)</sup><sup>[[3]](https://github.com/langgenius/dify-docs/blob/main/jp/learn-more/extended-reading/how-to-use-json-schema-in-dify.md)</sup>. If you are using Azure OpenAI models, be aware of known issues where JSON schema functionality might not work correctly. The recommended solution is to upgrade the OpenAI plugin to the latest version and reconfigure the plugin settings <sup>[[4]](https://github.com/langgenius/dify/issues/14475)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/b78a32bb-4b3e-4b08-a89d-be2c5fc9566b?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/b78a32bb-4b3e-4b08-a89d-be2c5fc9566b?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/b78a32bb-4b3e-4b08-a89d-be2c5fc9566b?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/b78a32bb-4b3e-4b08-a89d-be2c5fc9566b?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/b78a32bb-4b3e-4b08-a89d-be2c5fc9566b?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/b78a32bb-4b3e-4b08-a89d-be2c5fc9566b?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/b78a32bb-4b3e-4b08-a89d-be2c5fc9566b?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#134