[PR #3691] [MERGED] Replace @azure/openai with openai, and update openai to version 4.95.1 #4359

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

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/3691
Author: @suzuki-shm
Created: 4/21/2025
Status: Merged
Merged: 4/29/2025
Merged by: @timothycarambat

Base: masterHead: 3689-aoaiLib


📝 Commits (9)

  • 0552612 Replace @azure/openai to OpenAI lib
  • 501086e Merge branch 'master' into feature/aoaiLib
  • 61a3d1f Remove @azure/openai dependency and update openai to version 4.95.1
  • 356220d linting
  • 6b601d3 Merge branch 'master' into 3689-aoaiLib
  • e8775ba update logging
  • 3e5e5f8 remove bad ENV key that DNE
  • 247b439 unset
  • 12c1701 migrate azure to use default OAI stream handler

📊 Changes

10 files changed (+142 additions, -216 deletions)

View changed files

📝 frontend/src/components/Modals/ManageWorkspace/Documents/WorkspaceDirectory/index.jsx (+1 -1)
📝 frontend/src/index.css (+1 -1)
📝 server/package.json (+1 -2)
📝 server/utils/AiProviders/azureOpenAi/index.js (+22 -76)
📝 server/utils/AiProviders/openAi/index.js (+1 -0)
📝 server/utils/EmbeddingEngines/azureOpenAi/index.js (+22 -13)
📝 server/utils/EmbeddingEngines/openAi/index.js (+6 -0)
📝 server/utils/agents/aibitat/providers/azure.js (+70 -72)
📝 server/utils/agents/index.js (+1 -1)
📝 server/yarn.lock (+17 -50)

📄 Description

Pull Request Type

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

Relevant Issues

resolves #3689

What is in this change?

  • Updated the implementation to use the openai library instead of @azure/openai
    • Since the Embeddings API requires an API version to be specified, set it to 2024-12-01-preview to match the ChatCompletion API
  • Removed @azure/openai
  • Upgraded the openai library to the latest version
  • Since gpt-3.5-turbo, which is used by default in OPEN_MODEL_PREF, has already been deprecated, I replaced it with gpt-4o-mini, a lightweight model.

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
    • Checked talking with LLM on AOAI
    • Test using Embedding Engine on AOAI
  • 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/3691 **Author:** [@suzuki-shm](https://github.com/suzuki-shm) **Created:** 4/21/2025 **Status:** ✅ Merged **Merged:** 4/29/2025 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `3689-aoaiLib` --- ### 📝 Commits (9) - [`0552612`](https://github.com/Mintplex-Labs/anything-llm/commit/055261202052991b51fa9cd4168550e330bf4246) Replace @azure/openai to OpenAI lib - [`501086e`](https://github.com/Mintplex-Labs/anything-llm/commit/501086e8901c16250866a7794474663a94eedf3a) Merge branch 'master' into feature/aoaiLib - [`61a3d1f`](https://github.com/Mintplex-Labs/anything-llm/commit/61a3d1fcfb102771ebde0f93ff2b21a75ae8807d) Remove @azure/openai dependency and update openai to version 4.95.1 - [`356220d`](https://github.com/Mintplex-Labs/anything-llm/commit/356220db4ecb8665ac7d3021af5b2cc5cbc871f6) linting - [`6b601d3`](https://github.com/Mintplex-Labs/anything-llm/commit/6b601d3f858edd4467cd086e1eda06e983ab5815) Merge branch 'master' into 3689-aoaiLib - [`e8775ba`](https://github.com/Mintplex-Labs/anything-llm/commit/e8775ba0153c2a785ed6dc9e657750b53a049fdd) update logging - [`3e5e5f8`](https://github.com/Mintplex-Labs/anything-llm/commit/3e5e5f8ed587737d0f042f9553a58ab4c4c65809) remove bad ENV key that DNE - [`247b439`](https://github.com/Mintplex-Labs/anything-llm/commit/247b439fa89b5fa12be1f449f1286c7c19179fc1) unset - [`12c1701`](https://github.com/Mintplex-Labs/anything-llm/commit/12c1701895b2495509c1837e1446864f91abf001) migrate azure to use default OAI stream handler ### 📊 Changes **10 files changed** (+142 additions, -216 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/Modals/ManageWorkspace/Documents/WorkspaceDirectory/index.jsx` (+1 -1) 📝 `frontend/src/index.css` (+1 -1) 📝 `server/package.json` (+1 -2) 📝 `server/utils/AiProviders/azureOpenAi/index.js` (+22 -76) 📝 `server/utils/AiProviders/openAi/index.js` (+1 -0) 📝 `server/utils/EmbeddingEngines/azureOpenAi/index.js` (+22 -13) 📝 `server/utils/EmbeddingEngines/openAi/index.js` (+6 -0) 📝 `server/utils/agents/aibitat/providers/azure.js` (+70 -72) 📝 `server/utils/agents/index.js` (+1 -1) 📝 `server/yarn.lock` (+17 -50) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [ ] ✨ feat - [ ] 🐛 fix - [ ] ♻️ refactor - [ ] 💄 style - [x] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #3689 ### What is in this change? - Updated the implementation to use the openai library instead of @azure/openai - Since the Embeddings API requires an API version to be specified, set it to 2024-12-01-preview to match the ChatCompletion API - Removed @azure/openai - Upgraded the openai library to the latest version - Since gpt-3.5-turbo, which is used by default in OPEN_MODEL_PREF, has already been deprecated, I replaced it with gpt-4o-mini, a lightweight model. ### 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] Checked talking with LLM on AOAI - [x] Test using Embedding Engine on AOAI - [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:35:40 -05:00
yindo closed this issue 2026-02-22 18:35:40 -05:00
yindo changed title from [PR #3691] Replace @azure/openai with openai, and update openai to version 4.95.1 to [PR #3691] [MERGED] Replace @azure/openai with openai, and update openai to version 4.95.1 2026-06-05 15:18:10 -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#4359