openAI的2024.08.06模型会报JSON_Schema的错误 #6581

Closed
opened 2026-02-21 18:16:24 -05:00 by yindo · 2 comments
Owner

Originally created by @Vampxgg on GitHub (Nov 5, 2024).

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

0.11.0

Cloud or Self Hosted

Cloud

Steps to reproduce

1b407c637375d0faa663536271b5654

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @Vampxgg on GitHub (Nov 5, 2024). ### 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 0.11.0 ### Cloud or Self Hosted Cloud ### Steps to reproduce ![1b407c637375d0faa663536271b5654](https://github.com/user-attachments/assets/9aa89a5f-8860-47b0-9896-310e4374f89e) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-21 18:16:24 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 5, 2024):

I found some relevant information regarding JSON schema errors in Dify when using OpenAI models. Common causes of these errors include mismatches in data types, missing required fields, additional properties not defined in the schema, incorrect enum values, and invalid nested structures. These issues can arise if the model's output does not strictly adhere to the JSON schema, especially when strict: true is set [1][2].

To troubleshoot, ensure that the JSON schema is correctly defined with all fields marked as required, and additionalProperties: false is set. Also, make sure you are using a model that supports JSON Schema output, such as gpt-4o-2024-08-06 or later versions [1][2].

If you are experiencing issues with Dify version 0.11.0, there might be specific changes in this version affecting JSON schema validation, but I couldn't find detailed information on this. It might be helpful to review any recent updates or changes in the handling of JSON schema validation in Dify that could impact OpenAI model integration.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Nov 5, 2024): <!-- Answer --> I found some relevant information regarding JSON schema errors in Dify when using OpenAI models. Common causes of these errors include mismatches in data types, missing required fields, additional properties not defined in the schema, incorrect enum values, and invalid nested structures. These issues can arise if the model's output does not strictly adhere to the JSON schema, especially when `strict: true` is set <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/en/learn-more/how-to-use-json-schema-in-dify.md)</sup><sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/en/learn-more/extended-reading/how-to-use-json-schema-in-dify.md)</sup>. To troubleshoot, ensure that the JSON schema is correctly defined with all fields marked as required, and `additionalProperties: false` is set. Also, make sure you are using a model that supports JSON Schema output, such as `gpt-4o-2024-08-06` or later versions <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/en/learn-more/how-to-use-json-schema-in-dify.md)</sup><sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/en/learn-more/extended-reading/how-to-use-json-schema-in-dify.md)</sup>. If you are experiencing issues with Dify version 0.11.0, there might be specific changes in this version affecting JSON schema validation, but I couldn't find detailed information on this. It might be helpful to review any recent updates or changes in the handling of JSON schema validation in Dify that could impact OpenAI model integration. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@Vampxgg commented on GitHub (Nov 14, 2024):

我一直都是使用的gpt-4o-2024-08-06,以前的0.8.0或者0.9.0的时候没有出现过问题, 但是现在还是会提示错误,我已经换用gpt-4omini了

@Vampxgg commented on GitHub (Nov 14, 2024): 我一直都是使用的gpt-4o-2024-08-06,以前的0.8.0或者0.9.0的时候没有出现过问题, 但是现在还是会提示错误,我已经换用gpt-4omini了
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#6581