[PR #521] [MERGED] fix(azure_openai): add workaround to json_schema mode before fundamental fix will be merged #1420

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

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-official-plugins/pull/521
Author: @kurokobo
Created: 3/20/2025
Status: Merged
Merged: 3/21/2025
Merged by: @crazywoola

Base: mainHead: aoai_json_workaround


📝 Commits (3)

  • da48229 fix: add workaround to json_schema mode before fundamental fix will be merged
  • ea87fd3 fix: correct support for response_format and json_schema to align with the actual API and documentation
  • 181390f fix: bump plugin version

📊 Changes

3 files changed (+62 additions, -45 deletions)

View changed files

📝 models/azure_openai/manifest.yaml (+1 -1)
📝 models/azure_openai/models/constants.py (+22 -44)
📝 models/azure_openai/models/llm/llm.py (+39 -0)

📄 Description

This PR makes response_format: "json_schema" work correctly through the following changes:

  • Override _code_block_mode_wrapper to skip it if response_format is NOT JSON or XML
  • Update parameter rules for each models
    • The latest gpt-4o and gpt-4o-mini supports json_schema, so I added it
    • o1-mini and o1-preview do not support response_format and json_schema, so I removed it (refer to the official doc)
  • Bump plugin version from 0.0.8 to 0.0.10
    • I've already bump its version to 0.0.9 in another PR https://github.com/langgenius/dify-official-plugins/pull/505, so this PR bump it to 0.0.10
    • I think it would be better to change the version with each PR, but please let me know if it should be set to 0.0.9 in this PR. Alternatively, feel free to edit my branch directly.

Closes https://github.com/langgenius/dify-official-plugins/issues/477, closes https://github.com/langgenius/dify-official-plugins/issues/425, closes https://github.com/langgenius/dify/issues/14475


🔄 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/521 **Author:** [@kurokobo](https://github.com/kurokobo) **Created:** 3/20/2025 **Status:** ✅ Merged **Merged:** 3/21/2025 **Merged by:** [@crazywoola](https://github.com/crazywoola) **Base:** `main` ← **Head:** `aoai_json_workaround` --- ### 📝 Commits (3) - [`da48229`](https://github.com/langgenius/dify-official-plugins/commit/da4822994c46489ace2e698f5a36f61f1beac79e) fix: add workaround to json_schema mode before fundamental fix will be merged - [`ea87fd3`](https://github.com/langgenius/dify-official-plugins/commit/ea87fd304d16e151736ee81df7057da86cc03d9c) fix: correct support for response_format and json_schema to align with the actual API and documentation - [`181390f`](https://github.com/langgenius/dify-official-plugins/commit/181390f229e1f89c9dc29b70a92751d7abcd0bcd) fix: bump plugin version ### 📊 Changes **3 files changed** (+62 additions, -45 deletions) <details> <summary>View changed files</summary> 📝 `models/azure_openai/manifest.yaml` (+1 -1) 📝 `models/azure_openai/models/constants.py` (+22 -44) 📝 `models/azure_openai/models/llm/llm.py` (+39 -0) </details> ### 📄 Description This PR makes `response_format: "json_schema"` work correctly through the following changes: - ✅ Override `_code_block_mode_wrapper` to skip it if `response_format` is NOT `JSON` or `XML` - The fundamental fix is here: https://github.com/langgenius/dify-plugin-sdks/pull/57 - This is a temporary workaround before merging langgenius/dify-plugin-sdks#57 - ✅ Update parameter rules for each models - The latest `gpt-4o` and `gpt-4o-mini` supports `json_schema`, so I added it - `o1-mini` and `o1-preview` do not support `response_format` and `json_schema`, so I removed it ([refer to the official doc](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/reasoning#api--feature-support)) - ✅ Bump plugin version from 0.0.8 to **0.0.10** - I've already bump its version to **0.0.9** in another PR https://github.com/langgenius/dify-official-plugins/pull/505, so this PR bump it to **0.0.10** - I think it would be better to change the version with each PR, but please let me know if it should be set to 0.0.9 in this PR. Alternatively, feel free to edit my branch directly. Closes https://github.com/langgenius/dify-official-plugins/issues/477, closes https://github.com/langgenius/dify-official-plugins/issues/425, closes https://github.com/langgenius/dify/issues/14475 --- <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:22:53 -05:00
yindo closed this issue 2026-02-16 10:22:53 -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#1420