[Bug/feature reqeust] auto fill response mime type for json response #814

Closed
opened 2026-02-16 10:20:35 -05:00 by yindo · 0 comments
Owner

Originally created by @AlexChim1231 on GitHub (Nov 19, 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 Dify issues & Dify Official Plugins, 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.8.0

Plugin version

0.6.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

In the current implementation in gemini/llm.py, the application/json will only apply if the json_schema is enabled and it is not null or empty.
However, gemini allow output any json without json schema if only specific the response mime type.

I am not sure is this a feature or not.

Here is my approach with minimal change: PR, if user enable json_schema then assume that the response should be json, if user provide a json schema, then also pass it

otherwise we need to add a new parameters like response_mime_type, is_json_response, etc.

✔️ Error log

N/A

Originally created by @AlexChim1231 on GitHub (Nov 19, 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 [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/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.8.0 ### Plugin version 0.6.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce In the current implementation in `gemini/llm.py`, the `application/json` will only apply if the `json_schema` is enabled and it is not null or empty. However, gemini allow output any json without json schema if only specific the response mime type. I am not sure is this a feature or not. Here is my approach with minimal change: [PR](https://github.com/langgenius/dify-official-plugins/pull/2094), if user enable json_schema then assume that the response should be json, if user provide a json schema, then also pass it otherwise we need to add a new parameters like `response_mime_type`, `is_json_response`, etc. ### ✔️ Error log N/A
yindo added the bug label 2026-02-16 10:20:35 -05:00
yindo closed this issue 2026-02-16 10:20:36 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#814