[PR #4135] [MERGED] Fix multimodal chats via openai compat api #4535

Closed
opened 2026-02-22 18:36:01 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/4135
Author: @shatfield4
Created: 7/11/2025
Status: Merged
Merged: 7/22/2025
Merged by: @timothycarambat

Base: masterHead: 4088-bug-multi-modal-content-array-not-supported-in-database-storage


📝 Commits (10+)

  • 56d6b31 fix multimodal chats via openai compat api
  • 05efc5a lint
  • 58f1bcf Merge branch 'master' into 4088-bug-multi-modal-content-array-not-supported-in-database-storage
  • e54e594 add tests for multi-modal content in openai compat endpoint
  • e4042d2 Merge branch 'master' into 4088-bug-multi-modal-content-array-not-supported-in-database-storage
  • 162b9af refactor to normalize how openai attachments are handled
  • b097f80 uncheck file
  • e661660 rewrite tests, autodetect mime from dataurl, and spread attachments from prompt
  • a20041f lint
  • 297152c revert and fix tests

📊 Changes

6 files changed (+457 additions, -12 deletions)

View changed files

server/__tests__/utils/chats/openaiCompatible.test.js (+249 -0)
server/__tests__/utils/chats/openaiHelpers.test.js (+128 -0)
server/endpoints/api/openai/helpers.js (+50 -0)
📝 server/endpoints/api/openai/index.js (+5 -2)
📝 server/utils/AiProviders/openAi/index.js (+1 -1)
📝 server/utils/chats/openaiCompatible.js (+24 -9)

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

resolves #4088

What is in this change?

  • Patch bug in OpenAI compatible endpoint to allow for multi-modal chats
  • Add tests for util created

Additional Information

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 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/Mintplex-Labs/anything-llm/pull/4135 **Author:** [@shatfield4](https://github.com/shatfield4) **Created:** 7/11/2025 **Status:** ✅ Merged **Merged:** 7/22/2025 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `4088-bug-multi-modal-content-array-not-supported-in-database-storage` --- ### 📝 Commits (10+) - [`56d6b31`](https://github.com/Mintplex-Labs/anything-llm/commit/56d6b318e1def3ab42bedb3e4c2a72a4b698c8e1) fix multimodal chats via openai compat api - [`05efc5a`](https://github.com/Mintplex-Labs/anything-llm/commit/05efc5a301d1b9e1c3096d3e9697f68b536fda41) lint - [`58f1bcf`](https://github.com/Mintplex-Labs/anything-llm/commit/58f1bcf3f1cc4e052d83d09c5c6aa38424328575) Merge branch 'master' into 4088-bug-multi-modal-content-array-not-supported-in-database-storage - [`e54e594`](https://github.com/Mintplex-Labs/anything-llm/commit/e54e5942f8f483076444612dcf2cd8f42cb9611a) add tests for multi-modal content in openai compat endpoint - [`e4042d2`](https://github.com/Mintplex-Labs/anything-llm/commit/e4042d29805d11d69bc7ed39f2888e893c881a3e) Merge branch 'master' into 4088-bug-multi-modal-content-array-not-supported-in-database-storage - [`162b9af`](https://github.com/Mintplex-Labs/anything-llm/commit/162b9afa04c693cb0024aa09941880e8a3ae1a54) refactor to normalize how openai attachments are handled - [`b097f80`](https://github.com/Mintplex-Labs/anything-llm/commit/b097f802e9f1415a2ce14eccbb0d4297ad26a547) uncheck file - [`e661660`](https://github.com/Mintplex-Labs/anything-llm/commit/e6616609a8c4c397401b75666a4f0ebb4ef46503) rewrite tests, autodetect mime from dataurl, and spread attachments from prompt - [`a20041f`](https://github.com/Mintplex-Labs/anything-llm/commit/a20041f795cd52d857348b56c04bec0f2927bd9d) lint - [`297152c`](https://github.com/Mintplex-Labs/anything-llm/commit/297152c85c007aeba39dafb5b6e0996ac1a1de60) revert and fix tests ### 📊 Changes **6 files changed** (+457 additions, -12 deletions) <details> <summary>View changed files</summary> ➕ `server/__tests__/utils/chats/openaiCompatible.test.js` (+249 -0) ➕ `server/__tests__/utils/chats/openaiHelpers.test.js` (+128 -0) ➕ `server/endpoints/api/openai/helpers.js` (+50 -0) 📝 `server/endpoints/api/openai/index.js` (+5 -2) 📝 `server/utils/AiProviders/openAi/index.js` (+1 -1) 📝 `server/utils/chats/openaiCompatible.js` (+24 -9) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [ ] ✨ feat - [x] 🐛 fix - [ ] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #4088 ### What is in this change? <!-- Describe the changes in this PR that are impactful to the repo. --> - Patch bug in OpenAI compatible endpoint to allow for multi-modal chats - Add tests for util created ### Additional Information <!-- Add any other context about the Pull Request here that was not captured above. --> ### Developer Validations <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] Relevant documentation has been updated - [x] I have tested my code functionality - [x] Docker build succeeds locally --- <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-22 18:36:01 -05:00
yindo closed this issue 2026-02-22 18:36:01 -05:00
yindo changed title from [PR #4135] Fix multimodal chats via openai compat api to [PR #4135] [MERGED] Fix multimodal chats via openai compat api 2026-06-05 15:19:03 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4535