New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 fix: Azure OpenAI Vision models issue #2429
Conversation
@AnoyiX is attempting to deploy a commit to the LobeHub Team on Vercel. A member of the Team first needs to authorize it. |
👍 @AnoyiX Thank you for raising your pull request and contributing to our Community |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2429 +/- ##
==========================================
+ Coverage 92.79% 92.80% +0.01%
==========================================
Files 302 302
Lines 17621 17648 +27
Branches 1267 2041 +774
==========================================
+ Hits 16352 16379 +27
Misses 1269 1269 ☔ View full report in Codecov by Sentry. |
这个问题不算是 azure-openai 官方 SDK 的问题么? |
Is this problem not a problem with the azure-openai official SDK? |
也不能完全说是官方 SDK 的问题,官方的 SDK 中字段的定义基本都是驼峰格式的, 如果单独使用官方的 SDK 去测试,按官方的格式来,是没有问题的。现在 LobeChat 传的 messages 字段格式不转换成驼峰格式的话,就和官方不兼容。 |
It cannot be said that it is entirely a problem with the official SDK. The definitions of fields in the official SDK are basically in camel case format. If you use the official SDK alone for testing and follow the official format, there will be no problem. If the format of the messages field passed by LobeChat is not converted into camel case format, it will be incompatible with the official version. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
代码中,给 这应该是 Azure 官方 API 的问题,这里给 |
In the code, a default value is added to This should be a problem with the official Azure API. A default value is added to |
合理的 👍 |
Reasonable 👍 |
@AnoyiX 跑下 lint 的 fix,构建没通过 |
@AnoyiX 跑下 lint 的 fix,构建没通过 正在处理,等我几分钟 |
@AnoyiX ran lint’s fix and the build failed. Processing, wait a few minutes |
❤️ Great PR @AnoyiX ❤️ The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world. |
### [Version 0.156.1](v0.156.0...v0.156.1) <sup>Released on **2024-05-10**</sup> #### 🐛 Bug Fixes - **misc**: Azure OpenAI Vision models issue. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's fixed * **misc**: Azure OpenAI Vision models issue, closes [#2429](#2429) ([9b8a4b1](9b8a4b1)) </details> <div align="right"> [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) </div>
🎉 This PR is included in version 0.156.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
### [Version 1.36.1](v1.36.0...v1.36.1) <sup>Released on **2024-05-10**</sup> #### 🐛 Bug Fixes - **misc**: Azure OpenAI Vision models issue. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's fixed * **misc**: Azure OpenAI Vision models issue, closes [lobehub#2429](https://github.com/bentwnghk/lobe-chat/issues/2429) ([9b8a4b1](9b8a4b1)) </details> <div align="right"> [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) </div>
### [Version 0.156.1](lobehub/lobe-chat@v0.156.0...v0.156.1) <sup>Released on **2024-05-10**</sup> #### 🐛 Bug Fixes - **misc**: Azure OpenAI Vision models issue. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's fixed * **misc**: Azure OpenAI Vision models issue, closes [lobehub#2429](lobehub#2429) ([9b8a4b1](lobehub@9b8a4b1)) </details> <div align="right"> [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) </div>
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
Fixed an issue where the server side was abnormal when using the Vision model in Azure OpenAI.
修复 Azure OpenAI 在使用 Vision 模型时,服务端异常的问题。
📝 补充信息 | Additional Information
在使用 Vision 模型时,如果用户上传图片,那么 Messages 中会存在 type 为
image_url
的内容,示例如下:然而,官方的 SDK
@azure/openai
在序列化 Message 时,用的imageUrl
这个键值,从而导致报错 ISSUE #2207官方 SDK 源码:
node_modules/@azure/openai/dist/index.cjs
中的函数serializeChatMessageImageContentItem