mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-17 08:21:12 -05:00
[PR #13422] [CLOSED] refactor: integrate Axios for API client and enhance API structure #46246
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/13422
Author: @dasein108
Created: 5/2/2025
Status: ❌ Closed
Base:
dev← Head:dev📝 Commits (4)
ac01628feat: integrate Axios for API client and enhance API structure45604d3adjust error handling patterncd0cc12Remove console log from Axios response interceptor for cleaner error handlingc40a738missing user api methid📊 Changes
29 files changed (+2524 additions, -8909 deletions)
View changed files
📝
package-lock.json(+464 -184)📝
package.json(+2 -0)➕
src/lib/apis/apiClient.ts(+98 -0)📝
src/lib/apis/audio/index.ts(+21 -172)📝
src/lib/apis/auths/index.ts(+162 -694)➕
src/lib/apis/axios.ts(+63 -0)📝
src/lib/apis/channels/index.ts(+85 -412)📝
src/lib/apis/chats/index.ts(+87 -1013)➕
src/lib/apis/clients.ts(+19 -0)📝
src/lib/apis/configs/index.ts(+87 -397)📝
src/lib/apis/evaluations/index.ts(+27 -236)📝
src/lib/apis/files/index.ts(+22 -231)📝
src/lib/apis/folders/index.ts(+28 -257)📝
src/lib/apis/functions/index.ts(+45 -439)📝
src/lib/apis/groups/index.ts(+33 -162)📝
src/lib/apis/images/index.ts(+60 -230)📝
src/lib/apis/index.ts(+527 -1243)📝
src/lib/apis/knowledge/index.ts(+53 -337)📝
src/lib/apis/memories/index.ts(+18 -179)📝
src/lib/apis/models/index.ts(+21 -256)...and 9 more files
📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
ApiClientclass for structured API calls inapiClient.ts.clients.ts.ApiClientstructure.Description
Added
axios.ts.ApiClientclass for structured API calls inapiClient.ts.clients.ts.Changed
ApiClientstructure inside/apisdomain.Additional Information
token propagation can incaplulated inside axious interceptor and fully removed from out of this code
This commit marks the initial step in modernizing a codebase heavily burdened with legacy patterns, duplicated logic, and numerous linter warnings/errors. It lays the foundation for further refactoring aimed at improving maintainability, readability, and compatibility with AI-assisted development tools.
Over 6,500 lines of redundant or outdated code were removed with careful consideration to preserve existing behavior, though full end-to-end testing is still necessary.
Upcoming refactoring goals:
WebSocket functionality overhaul
DRY refactor of LLM interaction layers
Native integration of tool support for OpenAI/Anthropic models
Screenshots or Videos
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the CONTRIBUTOR_LICENSE_AGREEMENT, and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.