[PR #1417] [CLOSED] chore: GPT4.1 does not support JSON mode #1877

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

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-official-plugins/pull/1417
Author: @DavideDelbianco
Created: 8/5/2025
Status: Closed

Base: mainHead: chore/gpt-4.1-no-json-mode


📝 Commits (3)

  • ecc9365 chore: GPT4.1 does not support JSON mode
  • ce541b6 Merge branch 'main' into chore/gpt-4.1-no-json-mode
  • 0172ee7 Merge branch 'main' into chore/gpt-4.1-no-json-mode

📊 Changes

15 files changed (+8 additions, -20 deletions)

View changed files

📝 models/aihubmix/models/llm/gpt-4.1-mini.yaml (+0 -1)
📝 models/aihubmix/models/llm/gpt-4.1-nano.yaml (+0 -1)
📝 models/aihubmix/models/llm/gpt-4.1.yaml (+0 -1)
📝 models/azure_openai/manifest.yaml (+1 -1)
📝 models/azure_openai/models/constants.py (+3 -3)
📝 models/openai/manifest.yaml (+1 -1)
📝 models/openai/models/llm/gpt-4.1-2025-04-14.yaml (+0 -1)
📝 models/openai/models/llm/gpt-4.1-mini-2025-04-14.yaml (+0 -1)
📝 models/openai/models/llm/gpt-4.1-mini.yaml (+0 -1)
📝 models/openai/models/llm/gpt-4.1-nano-2025-04-14.yaml (+0 -1)
📝 models/openai/models/llm/gpt-4.1-nano.yaml (+0 -1)
📝 models/openai/models/llm/gpt-4.1.yaml (+0 -1)
📝 models/openrouter/models/llm/gpt-4.1-mini.yaml (+1 -2)
📝 models/openrouter/models/llm/gpt-4.1-nano.yaml (+1 -2)
📝 models/openrouter/models/llm/gpt-4.1.yaml (+1 -2)

📄 Description

Related Issues or Context

This PR removes support for json_object response mode in GPT 4.1 as it is not supported:
image
https://platform.openai.com/docs/guides/structured-outputs?api-mode=responses#structured-outputs-vs-json-mode

Resolves #22506

This PR contains Changes to Non-Plugin

  • Documentation
  • Other

This PR contains Changes to Non-LLM Models Plugin

  • I have Run Comprehensive Tests Relevant to My Changes

This PR contains Changes to LLM Models Plugin

  • My Changes Affect Message Flow Handling (System Messages and User→Assistant Turn-Taking)
  • My Changes Affect Tool Interaction Flow (Multi-Round Usage and Output Handling, for both Agent App and Agent Node)
  • My Changes Affect Multimodal Input Handling (Images, PDFs, Audio, Video, etc.)
  • My Changes Affect Multimodal Output Generation (Images, Audio, Video, etc.)
  • My Changes Affect Structured Output Format (JSON, XML, etc.)
  • My Changes Affect Token Consumption Metrics
  • My Changes Affect Other LLM Functionalities (Reasoning Process, Grounding, Prompt Caching, etc.)
  • Other Changes (Add New Models, Fix Model Parameters etc.)

Version Control (Any Changes to the Plugin Will Require Bumping the Version)

  • [x ] I have Bumped Up the Version in Manifest.yaml (Top-Level Version Field, Not in Meta Section)

Dify Plugin SDK Version

  • I have Ensured dify_plugin>=0.3.0,<0.5.0 is in requirements.txt (SDK docs)

Environment Verification (If Any Code Changes)

Local Deployment Environment

  • Dify Version is: 1.7.1, I have Tested My Changes on Local Deployment Dify with a Clean Environment That Matches the Production Configuration.
  • This change might affect users that enabled json_output mode expecting it did something in 4.1 models

SaaS Environment

  • I have Tested My Changes on cloud.dify.ai with a Clean Environment That Matches the Production Configuration

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langgenius/dify-official-plugins/pull/1417 **Author:** [@DavideDelbianco](https://github.com/DavideDelbianco) **Created:** 8/5/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `chore/gpt-4.1-no-json-mode` --- ### 📝 Commits (3) - [`ecc9365`](https://github.com/langgenius/dify-official-plugins/commit/ecc93659a52f930aeb42c6bc145e11f25fc128d6) chore: GPT4.1 does not support JSON mode - [`ce541b6`](https://github.com/langgenius/dify-official-plugins/commit/ce541b65902e3b5e561729431e957625533a1cb6) Merge branch 'main' into chore/gpt-4.1-no-json-mode - [`0172ee7`](https://github.com/langgenius/dify-official-plugins/commit/0172ee7d1ad992190b039e2adb6c03a8a1ee8cc0) Merge branch 'main' into chore/gpt-4.1-no-json-mode ### 📊 Changes **15 files changed** (+8 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `models/aihubmix/models/llm/gpt-4.1-mini.yaml` (+0 -1) 📝 `models/aihubmix/models/llm/gpt-4.1-nano.yaml` (+0 -1) 📝 `models/aihubmix/models/llm/gpt-4.1.yaml` (+0 -1) 📝 `models/azure_openai/manifest.yaml` (+1 -1) 📝 `models/azure_openai/models/constants.py` (+3 -3) 📝 `models/openai/manifest.yaml` (+1 -1) 📝 `models/openai/models/llm/gpt-4.1-2025-04-14.yaml` (+0 -1) 📝 `models/openai/models/llm/gpt-4.1-mini-2025-04-14.yaml` (+0 -1) 📝 `models/openai/models/llm/gpt-4.1-mini.yaml` (+0 -1) 📝 `models/openai/models/llm/gpt-4.1-nano-2025-04-14.yaml` (+0 -1) 📝 `models/openai/models/llm/gpt-4.1-nano.yaml` (+0 -1) 📝 `models/openai/models/llm/gpt-4.1.yaml` (+0 -1) 📝 `models/openrouter/models/llm/gpt-4.1-mini.yaml` (+1 -2) 📝 `models/openrouter/models/llm/gpt-4.1-nano.yaml` (+1 -2) 📝 `models/openrouter/models/llm/gpt-4.1.yaml` (+1 -2) </details> ### 📄 Description ## Related Issues or Context This PR removes support for json_object response mode in GPT 4.1 as it is not supported: <img width="845" height="649" alt="image" src="https://github.com/user-attachments/assets/01d5bcb0-bb66-4edc-9403-6a01043b8e1c" /> https://platform.openai.com/docs/guides/structured-outputs?api-mode=responses#structured-outputs-vs-json-mode Resolves [#22506](https://github.com/langgenius/dify/issues/22506) ## This PR contains Changes to *Non-Plugin* - [ ] Documentation - [ ] Other ## This PR contains Changes to *Non-LLM Models Plugin* - [ ] I have Run Comprehensive Tests Relevant to My Changes ## This PR contains Changes to *LLM Models Plugin* - [ ] My Changes Affect Message Flow Handling (System Messages and User→Assistant Turn-Taking) - [ ] My Changes Affect Tool Interaction Flow (Multi-Round Usage and Output Handling, for both Agent App and Agent Node) - [ ] My Changes Affect Multimodal Input Handling (Images, PDFs, Audio, Video, etc.) - [ ] My Changes Affect Multimodal Output Generation (Images, Audio, Video, etc.) - [x] My Changes Affect Structured Output Format (JSON, XML, etc.) - [ ] My Changes Affect Token Consumption Metrics - [ ] My Changes Affect Other LLM Functionalities (Reasoning Process, Grounding, Prompt Caching, etc.) - [ ] Other Changes (Add New Models, Fix Model Parameters etc.) ## Version Control (Any Changes to the Plugin Will Require Bumping the Version) - [x ] I have Bumped Up the Version in Manifest.yaml (Top-Level `Version` Field, Not in Meta Section) ## Dify Plugin SDK Version - [ ] I have Ensured `dify_plugin>=0.3.0,<0.5.0` is in requirements.txt ([SDK docs](https://github.com/langgenius/dify-plugin-sdks/blob/main/python/README.md)) ## Environment Verification (If Any Code Changes) ### Local Deployment Environment - [x] Dify Version is: 1.7.1, I have Tested My Changes on Local Deployment Dify with a Clean Environment That Matches the Production Configuration. - This change might affect users that enabled `json_output` mode expecting it did something in 4.1 models ### SaaS Environment - [ ] I have Tested My Changes on cloud.dify.ai with a Clean Environment That Matches the Production Configuration --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 10:24:15 -05:00
yindo closed this issue 2026-02-16 10:24:15 -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#1877