REOPEN azure_openai set json_schema Error: Completions.create() got an unexpected keyword argument 'json_schema' #85

Closed
opened 2026-02-16 10:18:01 -05:00 by yindo · 3 comments
Owner

Originally created by @prosessxp on GitHub (Mar 18, 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 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

v1.0.0

Cloud or Self Hosted

Self Hosted (Docker), Self Hosted (Source)

Steps to reproduce

  1. Use azure openai service, register model gpt-4o-2024-11-20, and use API version 2024-12-01-preview. Use Azure OpenAI Service Model Plugin version 0.0.8

  2. response_format Select json_schema and fill in JSON Schema:
    {
    "name":"key_note_response",
    "description": "get key note from input",
    "strict": true,
    "schema":{
    "type":"object",
    "properties":{
    "project":{
    "type": ["string","null"]
    },
    "domain":{
    "type": ["string","null"]
    },
    "rule":{
    "type": ["string","null"]
    },
    "class_or_function":{
    "type": ["string","null"]
    }
    },
    "additionalProperties": false,
    "required": ["project","domain","rule","class_or_function"]
    }
    }

  3. Run input: how aftersale bill persisted . Run failed: [azure_openai] Error: Completions.create() got an unexpected keyword argument 'json_schema'

Image

✔️ Expected Behavior

Output json format.

Actual Behavior

Run failed: [azure_openai] Error: Completions.create() got an unexpected keyword argument 'json_schema'

Originally created by @prosessxp on GitHub (Mar 18, 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 [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 v1.0.0 ### Cloud or Self Hosted Self Hosted (Docker), Self Hosted (Source) ### Steps to reproduce 1. Use azure openai service, register model gpt-4o-2024-11-20, and use API version 2024-12-01-preview. Use Azure OpenAI Service Model Plugin version 0.0.8 2. response_format Select json_schema and fill in JSON Schema: { "name":"key_note_response", "description": "get key note from input", "strict": true, "schema":{ "type":"object", "properties":{ "project":{ "type": ["string","null"] }, "domain":{ "type": ["string","null"] }, "rule":{ "type": ["string","null"] }, "class_or_function":{ "type": ["string","null"] } }, "additionalProperties": false, "required": ["project","domain","rule","class_or_function"] } } 3. Run input: how aftersale bill persisted . Run failed: [azure_openai] Error: Completions.create() got an unexpected keyword argument 'json_schema' ![Image](https://github.com/user-attachments/assets/707370fe-0ea0-441f-999e-8ef4ef7ac74f) ### ✔️ Expected Behavior Output json format. ### ❌ Actual Behavior Run failed: [azure_openai] Error: Completions.create() got an unexpected keyword argument 'json_schema'
yindo added the good first issue label 2026-02-16 10:18:01 -05:00
yindo closed this issue 2026-02-16 10:18:01 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 18, 2025):

Hey @prosessxp! 👋 I'm a bot here to help you with bug fixes, troubleshooting, and more. Let's work together to solve this issue.

To resolve the error you're encountering with the Completions.create() function and the unexpected keyword argument 'json_schema', you should upgrade your OpenAI plugin to the latest version. After upgrading, make sure to reconfigure your settings to ensure compatibility with the latest features [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Mar 18, 2025): <!-- Greeting --> Hey @prosessxp! 👋 I'm a bot here to help you with bug fixes, troubleshooting, and more. Let's work together to solve this issue. <!-- Answer --> To resolve the error you're encountering with the `Completions.create()` function and the unexpected keyword argument 'json_schema', you should upgrade your OpenAI plugin to the latest version. After upgrading, make sure to reconfigure your settings to ensure compatibility with the latest features <sup>[[1]](https://github.com/langgenius/dify/issues/14475)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/b040037b-fe4d-434e-b42f-1aac5c806d6d?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/b040037b-fe4d-434e-b42f-1aac5c806d6d?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/b040037b-fe4d-434e-b42f-1aac5c806d6d?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/b040037b-fe4d-434e-b42f-1aac5c806d6d?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/b040037b-fe4d-434e-b42f-1aac5c806d6d?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/b040037b-fe4d-434e-b42f-1aac5c806d6d?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/b040037b-fe4d-434e-b42f-1aac5c806d6d?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Mar 18, 2025):

What is your plugin version?

@crazywoola commented on GitHub (Mar 18, 2025): What is your plugin version?
Author
Owner

@prosessxp commented on GitHub (Mar 18, 2025):

What is your plugin version?

0.0.8

@prosessxp commented on GitHub (Mar 18, 2025): > What is your plugin version? 0.0.8
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#85