mirror of
https://github.com/langgenius/dify-plugin-sdks.git
synced 2026-07-22 02:15:22 -04:00
[PR #95] [CLOSED] feat(openai_compatible): Add structured output support #141
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/langgenius/dify-plugin-sdks/pull/95
Author: @mountln
Created: 4/14/2025
Status: ❌ Closed
Base:
main← Head:feat/oai-compat-structured-output📝 Commits (1)
f2bb016feat: add structured output support to OpenAI compatible LLM📊 Changes
1 file changed (+15 additions, -0 deletions)
View changed files
📝
python/dify_plugin/interfaces/model/openai_compatible/llm.py(+15 -0)📄 Description
Added the parameter rules
response_formatandjson_schemato support structured output when using OpenAI-compatible LLMs.The parameter rule settings were based on gpt-4o.yaml.
(The
response_formatlogic already exists in_generate(L352-L367), so only adding the parameter rules is necessary.)Related Issue
[Feature Request] Structuring Outputs using OpenAi-API-compatible #15831
Test Result (Tested on Local Deployment - Dify v1.2.0)
json_schemacan now be configured from the UI.Below is an output example.

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