Why doesn't the openai_api_compatible API use the OpenAI SDK for invocation? #170

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

Originally created by @bluepeople1 on GitHub (Apr 3, 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

v1.1.3

Plugin version

0.0.11

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

mplementing an OpenAI-compatible API yourself can lead to inconsistencies with the official implementation, causing issues during invocation. For example, in streaming, the official OpenAI API automatically splits streams based on \n\n, \r\n\r\n, and \r\r, whereas your own implementation fails to achieve full compatibility with the official behavior.

✔️ Error log

No response

Originally created by @bluepeople1 on GitHub (Apr 3, 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 v1.1.3 ### Plugin version 0.0.11 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce mplementing an OpenAI-compatible API yourself can lead to inconsistencies with the official implementation, causing issues during invocation. For example, in streaming, the official OpenAI API automatically splits streams based on \n\n, \r\n\r\n, and \r\r, whereas your own implementation fails to achieve full compatibility with the official behavior. ### ✔️ Error log _No response_
yindo added the bug label 2026-02-16 10:18:19 -05:00
yindo closed this issue 2026-02-16 10:18:20 -05:00
Author
Owner

@Hisir0909 commented on GitHub (Apr 7, 2025):

Excellent question, I've been wanting to ask that myself for a long time.
非常好的问题,我也早想问了

@Hisir0909 commented on GitHub (Apr 7, 2025): Excellent question, I've been wanting to ask that myself for a long time. 非常好的问题,我也早想问了
Author
Owner

@dosubot[bot] commented on GitHub (Aug 16, 2025):

Hi, @bluepeople1. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You raised concerns about the openai_api_compatible API not using the official OpenAI SDK.
  • The main issue is potential inconsistencies, especially with streaming behavior, since the official SDK automatically handles stream splitting.
  • Another user, Hisir0909, shared the same concerns, indicating a broader interest in this topic.
  • The rationale behind not using the official SDK for compatibility remains unclear and unresolved.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of the dify-official-plugins repository by commenting below.
  • If I don’t hear back within 5 days, I will automatically close this issue.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 16, 2025): Hi, @bluepeople1. I'm [Dosu](https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale. **Issue Summary:** - You raised concerns about the openai_api_compatible API not using the official OpenAI SDK. - The main issue is potential inconsistencies, especially with streaming behavior, since the official SDK automatically handles stream splitting. - Another user, Hisir0909, shared the same concerns, indicating a broader interest in this topic. - The rationale behind not using the official SDK for compatibility remains unclear and unresolved. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of the dify-official-plugins repository by commenting below. - If I don’t hear back within 5 days, I will automatically close this issue. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#170