Compare commits

...

2336 Commits

Author SHA1 Message Date
Timothy Jaeryang Baek
c4ea31357f Merge pull request #7475 from open-webui/dev
0.4.7
2024-12-01 00:42:48 -08:00
Timothy Jaeryang Baek
19bcda2362 refac: styling 2024-12-01 00:42:14 -08:00
Timothy Jaeryang Baek
39c2f70778 refac 2024-12-01 00:23:06 -08:00
Timothy Jaeryang Baek
368e11e2b2 doc: changelog 2024-12-01 00:19:44 -08:00
Timothy Jaeryang Baek
430a79e177 refac 2024-12-01 00:15:43 -08:00
Timothy Jaeryang Baek
9b25efc3bb refac 2024-11-30 23:50:05 -08:00
Timothy Jaeryang Baek
746fe9ea16 refac: autocomplete 2024-11-30 23:46:29 -08:00
Timothy Jaeryang Baek
2fac9b45cd chore: format 2024-11-30 23:36:30 -08:00
Timothy Jaeryang Baek
370f97b44e refac 2024-11-30 23:33:19 -08:00
Timothy Jaeryang Baek
a26c5d9549 Merge pull request #7501 from open-webui/dependabot/pip/backend/dev/aiohttp-3.11.8
chore(deps): bump aiohttp from 3.10.8 to 3.11.8 in /backend
2024-11-30 22:58:10 -08:00
Timothy Jaeryang Baek
96cc8bf127 Merge pull request #7500 from open-webui/dependabot/pip/backend/dev/python-multipart-0.0.18
chore(deps): bump python-multipart from 0.0.17 to 0.0.18 in /backend
2024-11-30 22:58:03 -08:00
Timothy Jaeryang Baek
4bf9d071f0 Merge pull request #7499 from open-webui/dependabot/pip/backend/dev/pymilvus-2.5.0
chore(deps): bump pymilvus from 2.4.9 to 2.5.0 in /backend
2024-11-30 22:57:56 -08:00
Timothy Jaeryang Baek
1a74199656 Merge pull request #7498 from open-webui/dependabot/pip/backend/dev/sentence-transformers-3.3.1
chore(deps): bump sentence-transformers from 3.2.0 to 3.3.1 in /backend
2024-11-30 22:57:49 -08:00
Timothy Jaeryang Baek
4e19e66e7d Merge pull request #7497 from open-webui/dependabot/pip/backend/dev/alembic-1.14.0
chore(deps): bump alembic from 1.13.2 to 1.14.0 in /backend
2024-11-30 22:57:36 -08:00
Timothy Jaeryang Baek
27b1a35778 refac: styling 2024-11-30 22:32:40 -08:00
Timothy Jaeryang Baek
ba0b3a984d refac 2024-11-30 22:29:53 -08:00
dependabot[bot]
2f84e6b877 chore(deps): bump aiohttp from 3.10.8 to 3.11.8 in /backend
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.10.8 to 3.11.8.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.10.8...v3.11.8)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-01 02:40:53 +00:00
dependabot[bot]
f311c03a21 chore(deps): bump python-multipart from 0.0.17 to 0.0.18 in /backend
Bumps [python-multipart](https://github.com/Kludex/python-multipart) from 0.0.17 to 0.0.18.
- [Release notes](https://github.com/Kludex/python-multipart/releases)
- [Changelog](https://github.com/Kludex/python-multipart/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Kludex/python-multipart/compare/0.0.17...0.0.18)

---
updated-dependencies:
- dependency-name: python-multipart
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-01 02:40:36 +00:00
dependabot[bot]
ef3b6083ff chore(deps): bump pymilvus from 2.4.9 to 2.5.0 in /backend
Bumps [pymilvus](https://github.com/milvus-io/pymilvus) from 2.4.9 to 2.5.0.
- [Release notes](https://github.com/milvus-io/pymilvus/releases)
- [Commits](https://github.com/milvus-io/pymilvus/compare/v2.4.9...v2.5.0)

---
updated-dependencies:
- dependency-name: pymilvus
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-01 02:40:34 +00:00
dependabot[bot]
d23fac2a5b chore(deps): bump sentence-transformers from 3.2.0 to 3.3.1 in /backend
Bumps [sentence-transformers](https://github.com/UKPLab/sentence-transformers) from 3.2.0 to 3.3.1.
- [Release notes](https://github.com/UKPLab/sentence-transformers/releases)
- [Commits](https://github.com/UKPLab/sentence-transformers/compare/v3.2.0...v3.3.1)

---
updated-dependencies:
- dependency-name: sentence-transformers
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-01 02:40:29 +00:00
dependabot[bot]
8cb981c3f4 chore(deps): bump alembic from 1.13.2 to 1.14.0 in /backend
Bumps [alembic](https://github.com/sqlalchemy/alembic) from 1.13.2 to 1.14.0.
- [Release notes](https://github.com/sqlalchemy/alembic/releases)
- [Changelog](https://github.com/sqlalchemy/alembic/blob/main/CHANGES)
- [Commits](https://github.com/sqlalchemy/alembic/commits)

---
updated-dependencies:
- dependency-name: alembic
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-01 02:40:25 +00:00
Timothy Jaeryang Baek
81a8ad2762 refac: autocomplete settings 2024-11-30 18:30:59 -08:00
Timothy Jaeryang Baek
dbf6ec71fe enh: remove trailing slash from ollama
Co-Authored-By: hi-unc1e <67778054+hi-unc1e@users.noreply.github.com>
2024-11-30 18:13:10 -08:00
Timothy Jaeryang Baek
0b17ff6eef Merge pull request #7493 from diwakar-s-maurya/dev
feat: Feature to set HTTP header "Content-Security-Policy"
2024-11-30 18:11:20 -08:00
Timothy Jaeryang Baek
19663e539a enh: temporary chat shortcut 2024-11-30 18:07:49 -08:00
Timothy Jaeryang Baek
c192475528 refac: autocompletion 2024-11-30 18:02:21 -08:00
Timothy Jaeryang Baek
9e436fe6b0 refac: styling 2024-11-30 16:01:26 -08:00
Timothy Jaeryang Baek
96b9f81ca7 refac: styling 2024-11-30 15:53:36 -08:00
Timothy Jaeryang Baek
62622893a5 refac: styling 2024-11-30 15:46:42 -08:00
Timothy Jaeryang Baek
aed2caefe1 refac 2024-11-30 15:44:04 -08:00
Timothy Jaeryang Baek
acb61d3c42 enh: rich text input preserve breaks 2024-11-30 15:05:08 -08:00
Timothy Jaeryang Baek
d3778b0bda refac: styling 2024-11-30 14:16:39 -08:00
Timothy Jaeryang Baek
fda26b4ad0 refac: rich text input 2024-11-30 14:15:08 -08:00
Timothy Jaeryang Baek
5b879a2121 refac: autocompletion behaviour 2024-11-30 13:10:47 -08:00
Timothy Jaeryang Baek
51e344f5b2 refac 2024-11-30 12:24:23 -08:00
Timothy Jaeryang Baek
d0eb59ffdb refac: table styling 2024-11-30 12:22:07 -08:00
Diwakar
541ff6b41a Feature to set HTTP header "Content-Security-Policy"
Introduce CONTENT_SECURITY_POLICY environment variable to set HTTP header "Content-Security-Policy".

Content Security Policy (CSP) is a feature that helps to prevent or minimize the risk of certain types of security threats. It consists of a series of instructions from a website to a browser, which instruct the browser to place restrictions on the things that the code comprising the site is allowed to do.
https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
2024-11-30 21:31:54 +07:00
Timothy Jaeryang Baek
3792051604 enh: swipe to accept completion 2024-11-30 01:06:56 -08:00
Timothy Jaeryang Baek
684a7f0455 refac 2024-11-30 00:36:01 -08:00
Timothy Jaeryang Baek
1f53e0922e enh: autocompletion 2024-11-30 00:29:27 -08:00
Timothy Jaeryang Baek
ba6dc71810 refac: model editor 2024-11-30 00:10:30 -08:00
Timothy Jaeryang Baek
33e54a9d3b refac 2024-11-29 13:24:37 -08:00
Timothy Jaeryang Baek
9f981db0b9 Merge pull request #7422 from alpha-pet/feat-youtube-transscript-proxy
feat: Optional proxy setting for downloading Youtube transscripts
2024-11-29 12:40:46 -08:00
Timothy Jaeryang Baek
3e1c42bdc9 Merge pull request #7482 from TiancongLx/dev
i18n: Completed zh-TW
2024-11-29 11:46:23 -08:00
Tiancong Li
aba610ac29 i18n: Completed zh-TW
已盡力將大陸簡體中文翻譯映射到台灣正體中文,如有翻譯不當之處,還請諒解並提交修正。
2024-11-30 03:09:51 +08:00
Timothy Jaeryang Baek
b4fb0d1da2 refac 2024-11-29 01:10:46 -08:00
Timothy Jaeryang Baek
f547f1424c refac 2024-11-29 01:02:32 -08:00
Timothy Jaeryang Baek
a07213b5be feat: autocompletion 2024-11-29 00:16:49 -08:00
Timothy Jaeryang Baek
0e8e9820d0 feat: autocomplete backend endpoint 2024-11-28 23:53:52 -08:00
Timothy Jaeryang Baek
28ce102a79 refac: modal 2024-11-28 23:49:24 -08:00
Timothy Jaeryang Baek
c1fd1d3490 refac: auto completion 2024-11-28 23:26:09 -08:00
Timothy Jaeryang Baek
fa5e1f7452 refac 2024-11-28 23:24:16 -08:00
Timothy Jaeryang Baek
95000c7b15 feat: ai autocompletion 2024-11-28 23:22:53 -08:00
Timothy Jaeryang Baek
8300fa85b0 Merge pull request #7469 from TiancongLx/dev
i18n: update zh-CN
2024-11-28 22:17:07 -08:00
Timothy Jaeryang Baek
94235397cf Merge pull request #7466 from Slayingripper/main
feat: Added el-GR translation
2024-11-28 22:16:53 -08:00
Timothy Jaeryang Baek
99e20bfe82 Merge pull request #7453 from JonesJugHead/update-french-translation
i18n: Complete French translation for missing keys
2024-11-28 22:16:39 -08:00
Timothy Jaeryang Baek
6440d8629e Merge pull request #7451 from aleixdorca/dev
Update catalan translation.json
2024-11-28 22:16:28 -08:00
Tiancong Li
e5563ca435 i18n: update zh-CN 2024-11-29 11:44:00 +08:00
Timothy Jaeryang Baek
53fbb19fa0 fix: /embed endpoint 2024-11-28 17:56:02 -08:00
slayingripper
297b9470e8 updated languages.json 2024-11-29 00:27:20 +00:00
slayingripper
1346559227 Added Greek Translation 2024-11-28 14:17:54 +00:00
Gui
ac1ee888be Update french translation.json 2024-11-28 11:04:23 +01:00
Aleix Dorca
ff0a7f1cbb Update catalan translation.json 2024-11-28 08:53:13 +01:00
Timothy Jaeryang Baek
ea883b2ed4 refac 2024-11-27 19:38:57 -08:00
Timothy Jaeryang Baek
b85cfdc90f refac: textarea 2024-11-27 19:26:05 -08:00
Timothy Jaeryang Baek
17ed7351a4 refac 2024-11-27 19:24:20 -08:00
Timothy Jaeryang Baek
7be93d2a84 fix: tools export 2024-11-27 18:11:50 -08:00
Timothy Jaeryang Baek
5d724d0b84 Merge pull request #7420 from Xelaph/dev
**i18n** - Update Dutch translation.json
2024-11-27 14:32:45 -08:00
Timothy Jaeryang Baek
dbd6ac8080 refac: textarea 2024-11-27 11:25:54 -08:00
Thomas Rehn
53296c1005 [feat] Allow use of proxy for downloading Youtube transscripts 2024-11-27 15:20:48 +01:00
Alex
26615ba995 Update translation.json
Updated some translations for better consistency and accuracy. Also translated some newly added sentences
2024-11-27 15:04:54 +01:00
Timothy Jaeryang Baek
c5ef53a09f refac: disable empty model id 2024-11-26 21:28:49 -08:00
Timothy Jaeryang Baek
0a26c41c7b Merge pull request #7399 from open-webui/dev
0.4.6
2024-11-26 20:24:33 -08:00
Timothy Jaeryang Baek
da6535eeb4 refac: wording 2024-11-26 20:19:46 -08:00
Timothy Jaeryang Baek
2db35d5969 chore: format 2024-11-26 20:14:48 -08:00
Timothy Jaeryang Baek
582ce23bb5 doc: changelog 2024-11-26 20:12:01 -08:00
Timothy Jaeryang Baek
f42cc90a00 doc: changelogs 2024-11-26 20:03:10 -08:00
Timothy Jaeryang Baek
cbc7801b0e chore: format 2024-11-26 20:03:06 -08:00
Timothy Jaeryang Baek
22b5feb747 Merge pull request #7401 from walker-chen2024/main
bugfix - {{CURRENT_WEEKDAY}} is not working
2024-11-26 19:54:27 -08:00
Walker.Chen
4b536b5283 bugfix - {{CURRENT_WEEKDAY}} is not working
Signed-off-by: Walker.Chen <walker_chen@moremote.com>  https://uniwillai.net
2024-11-27 08:53:45 +08:00
Timothy Jaeryang Baek
ede29e98b7 refac 2024-11-26 15:30:35 -08:00
Timothy Jaeryang Baek
789e1db260 refac: textarea 2024-11-26 14:14:26 -08:00
Timothy Jaeryang Baek
4383306770 refac 2024-11-26 14:00:49 -08:00
Timothy Jaeryang Baek
13796fe3b3 fix: legacy query generation support 2024-11-26 13:44:19 -08:00
Timothy Jaeryang Baek
63402c48a8 refac: query gen prompt 2024-11-26 10:23:29 -08:00
Timothy Jaeryang Baek
44efd4d372 refac 2024-11-26 10:17:17 -08:00
Timothy Jaeryang Baek
a18292da84 Merge pull request #7381 from panda44312/dev
i18n - Update Simplified Chinese translation
2024-11-26 08:59:40 -08:00
Timothy Jaeryang Baek
adba11ebeb Merge pull request #7382 from juananpe/dev
i18n: Add Basque (eu-ES, Euskara) translation
2024-11-26 08:59:30 -08:00
Timothy Jaeryang Baek
442f99e075 refac 2024-11-26 08:55:34 -08:00
Timothy Jaeryang Baek
dc7221816f fix: models configure 2024-11-26 08:55:06 -08:00
Juanan Pereira
bddc293d82 Add Basque (eu-ES, Euskara) translation 2024-11-26 14:18:59 +01:00
panda44312
3a2247b7a0 Update translation.json 更新翻译 2024-11-26 13:48:28 +01:00
Timothy Jaeryang Baek
4831c9e57e Merge pull request #7307 from open-webui/dev
0.4.5
2024-11-26 01:55:13 -08:00
Timothy Jaeryang Baek
e3236622f3 chore: format 2024-11-26 01:53:06 -08:00
Timothy Jaeryang Baek
83f1fa7bb9 Merge pull request #7373 from open-webui/main
dev
2024-11-26 01:52:45 -08:00
Timothy Jaeryang Baek
ba427bee3f Merge pull request #7369 from PieterBecking/fix/i18n-typo-groepen
fix(i18n): Correct capitalization typo in Dutch localization
2024-11-26 01:52:24 -08:00
Timothy Jaeryang Baek
b9458817b1 doc: changelogs 2024-11-26 01:51:04 -08:00
Timothy Jaeryang Baek
38eb6abbfc chore: version bump 2024-11-26 01:43:28 -08:00
Timothy Jaeryang Baek
b173f86690 fix: escape source id 2024-11-26 01:39:12 -08:00
Timothy Jaeryang Baek
9b8f9c689b refac 2024-11-26 01:22:09 -08:00
Timothy Jaeryang Baek
e40212a662 refac 2024-11-26 01:14:32 -08:00
Timothy Jaeryang Baek
a37cad2ecf chore: format 2024-11-26 01:05:50 -08:00
Timothy Jaeryang Baek
3b9e21ecf9 refac 2024-11-26 00:58:40 -08:00
Timothy Jaeryang Baek
5fac25a002 enh: reintroduce model order/default models 2024-11-26 00:55:58 -08:00
Pieter Becking
2b4e8f6cea fix(i18n): Correct capitalization typo in Dutch localization (GRoepen -> Groepen) 2024-11-26 09:42:13 +01:00
Timothy Jaeryang Baek
29fac5ecca refac: admin models settings 2024-11-25 22:57:54 -08:00
Timothy Jaeryang Baek
f9e24968e3 fix: input issue 2024-11-25 22:43:34 -08:00
Timothy Jaeryang Baek
c4f82309dc fix: min_p save issue 2024-11-25 16:11:49 -08:00
Timothy Jaeryang Baek
da4676de2e Merge pull request #7326 from bnodnarb/fix/ollama-authentication
fix: Include Authorization header in /api/pull and /api/chat requests
2024-11-25 15:38:43 -08:00
Timothy Jaeryang Baek
d870386d7d Update CODE_OF_CONDUCT.md 2024-11-24 23:48:02 -08:00
bnodnarb
8dc73e8744 Fix: Add authorization header with bearer token for remote Ollama server endpoints 2024-11-24 20:29:54 -10:00
Timothy Jaeryang Baek
840437e58f refac: o1 title generation issue 2024-11-24 19:07:51 -08:00
Timothy Jaeryang Baek
bd28e1ed7d refac: rag prompt template 2024-11-24 18:49:56 -08:00
Timothy Jaeryang Baek
50c3be2136 refac 2024-11-24 18:11:48 -08:00
Timothy Jaeryang Baek
907cf61da7 refac: query generation 2024-11-24 18:03:58 -08:00
Timothy Jaeryang Baek
a3a205abd1 fix: function list 2024-11-24 15:45:23 -08:00
Timothy Jaeryang Baek
fac8c3259c refac: rich text input behaviour 2024-11-23 23:57:05 -08:00
Timothy Jaeryang Baek
e67fdce727 enh: model editor reset image 2024-11-23 23:26:11 -08:00
Timothy Jaeryang Baek
c465a37597 fix: textarea auto height issue 2024-11-23 23:10:12 -08:00
Timothy Jaeryang Baek
f5bda4bc27 chore: pyproject bump 2024-11-23 23:00:04 -08:00
Timothy Jaeryang Baek
9ff580b8ca fix: textarea input new line issue 2024-11-23 22:58:09 -08:00
Timothy Jaeryang Baek
d3acb5cbaa Merge pull request #7286 from houcheng/tts-aiofiles
Tts aiofiles
2024-11-23 22:37:05 -08:00
Timothy Jaeryang Baek
2a5506a9cd fix: textarea input height issue 2024-11-23 22:27:01 -08:00
Timothy Jaeryang Baek
c567185cb1 refac: rich text input behaviour 2024-11-23 20:31:33 -08:00
Timothy Jaeryang Baek
5ed5e532a9 Merge pull request #7279 from Luceurre/fix/missing-tool-description
fix: add missing tool description
2024-11-23 10:39:47 -08:00
houcheng
a83f89d430 fix: prevent TTS blocking using aiohttp and aiofiles 2024-11-24 00:28:14 +08:00
Pierre Glandon
b2d3bfa3a8 feat: add description in Tool 2024-11-23 11:22:12 +01:00
Timothy Jaeryang Baek
8744a12abb Merge pull request #7274 from DmitriyAlergant-T1A/fix/logging_cleanup
Fix: logging cleanup
2024-11-22 20:16:47 -08:00
DmitriyAlergant-T1A
374d6cad18 Python Formatting (Failed CI - fixed) 2024-11-22 23:11:46 -05:00
DmitriyAlergant-T1A
d24c21b40f Fix
Logging cleanup: removed some extraneous hard prints (including some that revealed message content!); improved debug logging a bit.

+ added chat_id to task metadata (helpful for logging/tracking in some pipe functions)
2024-11-22 23:05:45 -05:00
Timothy Jaeryang Baek
db929b5d5e Merge pull request #7262 from open-webui/dev
0.4.4
2024-11-22 19:27:41 -08:00
Timothy Jaeryang Baek
47ae5221f7 doc: wording 2024-11-22 19:27:20 -08:00
Timothy Jaeryang Baek
79e988b281 doc: changelogs 2024-11-22 19:26:42 -08:00
Timothy Jaeryang Baek
9412f51c19 chore: version bump 2024-11-22 19:22:35 -08:00
Timothy Jaeryang Baek
320cf06333 Merge pull request #7266 from s1adem4n/update-german-translation
i18n: Add missing German translations and fix existing ones
2024-11-22 16:23:51 -08:00
Jonathan
cede8a966f add missing translations and fix existing ones 2024-11-23 01:17:22 +01:00
Timothy Jaeryang Baek
c561a4c42b Merge pull request #7263 from michaelpoluektov/fix/docstring-event-emitter
fix: docstring event emitter
2024-11-22 16:06:46 -08:00
Michael Poluektov
b4e7957a00 docstring quickfix 2024-11-22 20:51:48 +00:00
Timothy Jaeryang Baek
c4eacbfc0f refac: rm print statement 2024-11-22 12:39:08 -08:00
Timothy Jaeryang Baek
429fa2befa fix: query generation 2024-11-22 12:31:06 -08:00
Timothy Jaeryang Baek
3cfd4f8993 fix: controls not being shown in mobile 2024-11-22 11:21:53 -08:00
Timothy Jaeryang Baek
1c3bc99b86 refac: accept legacy 'citation' type 2024-11-22 10:49:30 -08:00
Timothy Jaeryang Baek
335337fc75 Merge pull request #7233 from iamcristi/patch-1
Fix: LDAP integration used None for image and that broke Authentication
2024-11-22 10:42:49 -08:00
Timothy Jaeryang Baek
1ea03cc156 Merge pull request #7228 from OriginalSimon/main
18n: Update Ukrainian translation
2024-11-22 10:42:37 -08:00
Timothy Jaeryang Baek
3923c4df65 Merge pull request #7225 from hilam/translate_pt_br
i18b: Translate missing pt-BR strings and enhancements
2024-11-22 10:42:21 -08:00
Timothy Jaeryang Baek
70ea85484c Merge pull request #7238 from aleixdorca/dev
i18n: Update Catalan translation.json
2024-11-22 10:41:46 -08:00
Timothy Jaeryang Baek
35d75e733d refac: file handling 2024-11-22 10:35:59 -08:00
Aleix Dorca
259881f0b6 Update Catalan translation.json 2024-11-22 17:41:35 +01:00
iamcristi
b4cd685795 Update auths.py
changed Auths.insert_new_auth for LDAP accounts. Previously setting image to "None" was causing an error.
2024-11-22 17:23:49 +02:00
SimonOriginal
2d5e1a8c6f fix 2024-11-22 14:51:45 +01:00
SimonOriginal
f07ba60f2a Update uk translation.json 2024-11-22 14:43:11 +01:00
Hildeberto
e12cf77553 Update pt-BR translation.json 2024-11-22 09:35:25 -03:00
Timothy Jaeryang Baek
c13bcfdfc9 Merge pull request #7202 from open-webui/dev
chore: version bump
2024-11-21 22:47:45 -08:00
Timothy Jaeryang Baek
9aac02824d chore: version bump 2024-11-21 22:47:29 -08:00
Timothy Jaeryang Baek
edd224d542 Merge pull request #7180 from open-webui/dev
0.4.3
2024-11-21 22:46:34 -08:00
Timothy Jaeryang Baek
5c49740aa5 doc: changelog 2024-11-21 22:45:49 -08:00
Timothy Jaeryang Baek
20f31b5bc8 refac 2024-11-21 22:20:57 -08:00
Timothy Jaeryang Baek
b23600b49d refac 2024-11-21 22:15:04 -08:00
Timothy Jaeryang Baek
7b9b0f23fe refac 2024-11-21 22:12:40 -08:00
Timothy Jaeryang Baek
2e7af7bdbf fix 2024-11-21 22:03:51 -08:00
Timothy Jaeryang Baek
12c8257c92 refac 2024-11-21 21:32:19 -08:00
Timothy Jaeryang Baek
9a2dd5b126 refac: optimisation 2024-11-21 21:04:35 -08:00
Timothy Jaeryang Baek
4b83a83576 fix: openai connection config 2024-11-21 20:49:40 -08:00
Timothy Jaeryang Baek
e18a43aec8 fix: styling 2024-11-21 20:39:00 -08:00
Timothy Jaeryang Baek
ea28747baa fix: knowledge base reset 2024-11-21 20:29:54 -08:00
Timothy Jaeryang Baek
3816e3c2ef refac: styling 2024-11-21 20:20:46 -08:00
Timothy Jaeryang Baek
9bc0de2c6a refac 2024-11-21 20:03:30 -08:00
Timothy Jaeryang Baek
81386e9b04 refac: citations -> sources 2024-11-21 19:46:09 -08:00
Timothy Jaeryang Baek
7062e637e8 refac: inline citations 2024-11-21 18:26:38 -08:00
Timothy Jaeryang Baek
714ed248fb refac: styling 2024-11-21 18:05:45 -08:00
Timothy Jaeryang Baek
7b675a1488 refac: styling 2024-11-21 18:02:33 -08:00
Timothy Jaeryang Baek
386c976e9a enh: inline citations 2024-11-21 17:58:29 -08:00
Timothy Jaeryang Baek
5be7cbfdf5 Merge pull request #7182 from michaelpoluektov/fix/tools-metadata
fix: Fix tools metadata
2024-11-21 16:32:08 -08:00
Timothy Jaeryang Baek
0217c044c9 Merge pull request #7195 from michaelpoluektov/remove-unused-router
refactor: Remove unused router
2024-11-21 16:30:22 -08:00
Michael Poluektov
26efc76d40 remove unused router 2024-11-22 00:15:11 +00:00
Michael Poluektov
8abf5d57c1 remove unused schemas file 2024-11-21 23:49:58 +00:00
Timothy Jaeryang Baek
948b65e43f refac 2024-11-21 12:16:50 -08:00
Michael Poluektov
e1a85c99ab format 2024-11-21 17:52:19 +00:00
Michael Poluektov
6783c98539 Merge branch 'dev' of https://github.com/open-webui/open-webui into fix/tools-metadata 2024-11-21 17:46:44 +00:00
Michael Poluektov
c03bfd141e fix optional args not present 2024-11-21 17:41:35 +00:00
Michael Poluektov
70838148e7 fix tools metadata 2024-11-21 17:19:56 +00:00
Timothy Jaeryang Baek
d587206929 refac: add suffix field to ollama generate form 2024-11-21 08:12:19 -08:00
Timothy Jaeryang Baek
1c0327ed7f Merge pull request #7163 from igorbrai/main
feat: Add Mojeek as web search provider
2024-11-21 08:10:14 -08:00
Timothy Jaeryang Baek
b0162dfee0 refac 2024-11-21 08:10:05 -08:00
Timothy Jaeryang Baek
1fcde2272b Merge pull request #7162 from morgan55555/dev
LDAP auth fixes: do not store LDAP password, use default user role on first auth, allow ldap only form.
2024-11-21 08:08:47 -08:00
Timothy Jaeryang Baek
48c03ef551 Merge pull request #7147 from aindriu80/main
i18n: Updated Irish translations
2024-11-21 08:06:33 -08:00
Igor Brai
d16b09bee5 Merge branch 'open-webui:main' into main 2024-11-21 15:25:41 +02:00
alexey_rechkalov
b9e637ee2b Now ENABLE_LOGIN_FORM=False disabling only email form.
LDAP form will be showed instead.
Also added "name" property to inputs for Chrome autocompletion.
2024-11-21 18:11:12 +05:00
alexey_rechkalov
b1237cf389 Fixed security vulnerability: now LDAP password hashes are not stored, same as trusted header auth.
LDAP users role now getting DEFAULT_USER_ROLE, not "pending".
2024-11-21 18:09:29 +05:00
Michael Poluektov
3dfea834ca Merge branch 'dev' of https://github.com/open-webui/open-webui into dev 2024-11-21 13:02:39 +00:00
Aindriú Mac Giolla Eoin
c03cae811d Updated Irish translations 2024-11-21 10:15:37 +00:00
Timothy Jaeryang Baek
6088acf36d refac: styling 2024-11-20 23:31:46 -08:00
Timothy Jaeryang Baek
c5cd1e4403 refac: rich text input 2024-11-20 23:14:06 -08:00
Timothy Jaeryang Baek
aca06f92e8 enh: rich text input 2024-11-20 22:56:26 -08:00
Timothy Jaeryang Baek
e30c5e628c refac: rich text input 2024-11-20 22:46:51 -08:00
Timothy Jaeryang Baek
6f4bc9864c Merge pull request #7119 from open-webui/dev
doc
2024-11-20 12:24:35 -08:00
Timothy Jaeryang Baek
9b03b1a453 doc: readme 2024-11-20 12:24:07 -08:00
Timothy Jaeryang Baek
99c5cf1a00 doc: wording 2024-11-20 12:23:31 -08:00
Timothy Jaeryang Baek
639bea64d8 Merge pull request #7097 from open-webui/dev
0.4.2
2024-11-20 12:15:14 -08:00
Timothy Jaeryang Baek
02d02b0518 doc: changelog 2024-11-20 12:11:38 -08:00
Timothy Jaeryang Baek
bc57acb3a6 Merge pull request #7113 from Xelaph/patch-1
**i18n** Update Dutch translation.json
2024-11-20 10:03:04 -08:00
Timothy Jaeryang Baek
2b890cf747 fix: knowledge files issue 2024-11-20 10:02:14 -08:00
Timothy Jaeryang Baek
4156b62811 refac 2024-11-20 10:02:07 -08:00
Timothy Jaeryang Baek
c0055afdb3 refac: youtube loader 2024-11-20 10:01:58 -08:00
Alex
882a070cc9 Update translation.json
Added all new translations and changed a lot to better represent Dutch language rules
2024-11-20 18:47:01 +01:00
Timothy Jaeryang Baek
d68aa5c708 chore: requirements 2024-11-20 06:53:11 -08:00
Timothy Jaeryang Baek
2450953080 refac 2024-11-20 06:34:52 -08:00
Timothy Jaeryang Baek
db1a71c753 fix: usage capability in model editor 2024-11-20 06:24:09 -08:00
Timothy Jaeryang Baek
822a43c53d fix: arena model access control 2024-11-20 06:21:08 -08:00
Timothy Jaeryang Baek
d5c65e36c9 fix: prefix issue 2024-11-20 06:12:20 -08:00
Timothy Jaeryang Baek
bd1dae2c66 Merge branch 'dev' of https://github.com/open-webui/open-webui into dev 2024-11-20 06:09:53 -08:00
Timothy Jaeryang Baek
0dd1d6de2a fix: import 2024-11-20 06:09:48 -08:00
Timothy Jaeryang Baek
505bee066e Merge pull request #7069 from KarlLee830/translate
i18n: Update Chinese translation
2024-11-20 06:07:25 -08:00
Timothy Jaeryang Baek
54cabc9776 Merge pull request #7072 from antpyykk-kone/feature/fix-pipeline-middleware-http-exception-handling
fix: handle uncaught HTTP exceptions in PipelineMiddleware
2024-11-20 06:07:15 -08:00
Antti Pyykkönen
4f6ae8239d fix: handle http exceptions 2024-11-20 09:25:50 +02:00
KarlLee830
3531cf827a i18n: Update Chinese translation 2024-11-20 12:39:22 +08:00
Timothy Jaeryang Baek
02e94c8264 Merge pull request #7057 from open-webui/dev
0.4.1
2024-11-19 20:17:05 -08:00
Timothy Jaeryang Baek
31f00bbc69 doc: changelog 2024-11-19 20:16:34 -08:00
Timothy Jaeryang Baek
cb19dbf72b chore: format 2024-11-19 20:15:37 -08:00
Timothy Jaeryang Baek
e54879aeb1 enh: detailed 1-10 rating 2024-11-19 20:12:22 -08:00
Timothy Jaeryang Baek
7966367107 refac: models api 2024-11-19 18:45:26 -08:00
Timothy Jaeryang Baek
7c5b845d16 refac: add citations to outlet/actions form
Co-Authored-By: Alex Morgan <alxmrg55@gmail.com>
2024-11-19 18:26:01 -08:00
Timothy Jaeryang Baek
cbcd14cdbf doc: changelog 2024-11-19 18:22:45 -08:00
Timothy Jaeryang Baek
0e0a9b4b27 Merge pull request #7061 from zhoubinxin/dev
ci: fix huggingface deploy errors and track .jpg file types
2024-11-19 18:22:35 -08:00
Timothy Jaeryang Baek
70c6d3bf9f fix 2024-11-19 18:21:55 -08:00
Timothy Jaeryang Baek
206a4877c7 fix: api key creation 2024-11-19 18:17:38 -08:00
bx
2c2c2ea9e1 fix(workflow): fix huggingface deploy errors and track .jpg file types 2024-11-20 10:15:40 +08:00
Timothy Jaeryang Baek
7f7b1b18cd doc: changelog 2024-11-19 17:27:34 -08:00
Timothy Jaeryang Baek
00e41790bf enh: show tool description on hover 2024-11-19 17:10:43 -08:00
Timothy Jaeryang Baek
9d9a60afec refac 2024-11-19 16:50:45 -08:00
Timothy Jaeryang Baek
eefb2926d8 Merge pull request #7056 from open-webui/dev
fix: deleted user handling
2024-11-19 16:48:30 -08:00
Timothy Jaeryang Baek
0c43c1edf6 fix: deleted user handling 2024-11-19 16:47:35 -08:00
Timothy Jaeryang Baek
3c33432092 Merge pull request #6522 from open-webui/dev
0.4
2024-11-19 14:28:03 -08:00
Timothy Jaeryang Baek
011b8ea3a8 doc: wording 2024-11-19 14:27:43 -08:00
Timothy Jaeryang Baek
321aa2a027 refac: styling 2024-11-19 14:26:53 -08:00
Timothy Jaeryang Baek
dd5e500e01 enh: reintroduce update all ollama models feature 2024-11-19 14:23:19 -08:00
Timothy Jaeryang Baek
e3b968de26 refac: styling 2024-11-19 14:18:32 -08:00
Timothy Jaeryang Baek
014d5b83d3 doc: wording 2024-11-19 14:13:16 -08:00
Timothy Jaeryang Baek
065517e8b7 chore: bump 2024-11-19 14:05:55 -08:00
Timothy Jaeryang Baek
83f0ab3e10 chore: requirements bump 2024-11-19 14:05:00 -08:00
Timothy Jaeryang Baek
d8c5262161 fix: function community import 2024-11-19 14:00:58 -08:00
Timothy Jaeryang Baek
450f5292ef doc: wording 2024-11-19 13:53:10 -08:00
Timothy Jaeryang Baek
abe349dab6 doc: changelog 2024-11-19 13:30:23 -08:00
Timothy Jaeryang Baek
8aa2d09cee chore: format 2024-11-19 12:22:58 -08:00
Timothy Jaeryang Baek
0cbb4572f6 Merge pull request #7041 from antpyykk-kone/feature/configure-private-api-key-usage
feat: Ability to configure the use of private API keys in an environment
2024-11-19 12:20:48 -08:00
Timothy Jaeryang Baek
7a585fbaf3 enh: option to disable api auth 2024-11-19 12:17:23 -08:00
Timothy Jaeryang Baek
a2476eb1b5 refac: styling 2024-11-19 11:09:02 -08:00
Timothy Jaeryang Baek
81bb2750e0 enh: reset models 2024-11-19 11:03:36 -08:00
Timothy Jaeryang Baek
d76e1319ff Merge pull request #7036 from DiegoRodriguez83/#7035
i18n: Brazilian portuguese translation (pt-BR)
2024-11-19 08:13:34 -08:00
Antti Pyykkönen
979e6e5a79 feat: support for configuring private api key use 2024-11-19 16:14:52 +02:00
Diego Rodriguez
aa152bd758 i18n: Brazilian portuguese translation (pt-BR) 2024-11-19 08:55:50 -03:00
Timothy Jaeryang Baek
5c4124ebe5 refac 2024-11-19 03:18:40 -08:00
Timothy Jaeryang Baek
53103c3bd7 refac: styling 2024-11-19 03:04:49 -08:00
Timothy Jaeryang Baek
6aa837a8a2 refac: styling 2024-11-19 02:37:27 -08:00
Timothy Jaeryang Baek
d2a462a3ad refac 2024-11-19 02:26:12 -08:00
Timothy Jaeryang Baek
dbb67a12ca enh: retrieval query generation 2024-11-19 02:24:32 -08:00
Timothy Jaeryang Baek
09c6e4b92f enh: citations option in model editor 2024-11-19 01:12:47 -08:00
Timothy Jaeryang Baek
da8f7cff2f refac 2024-11-18 22:49:38 -08:00
Timothy Jaeryang Baek
5ad64c7998 refac 2024-11-18 22:39:55 -08:00
Timothy Jaeryang Baek
67f7ac8bb5 refac 2024-11-18 22:27:42 -08:00
Timothy Jaeryang Baek
6b410ca56a fix: models workspace 2024-11-18 21:10:34 -08:00
Timothy Jaeryang Baek
e2d20896b6 enh: model id tooltip in selector 2024-11-18 21:10:28 -08:00
Timothy Jaeryang Baek
6ba2c84c65 fix: styling 2024-11-18 21:00:53 -08:00
Timothy Jaeryang Baek
9ea1c45641 enh: make large text as file toggleable 2024-11-18 20:58:18 -08:00
Timothy Jaeryang Baek
11e78eac91 enh: large pasted text as file
Co-Authored-By: Taylor Wilsdon <6508528+taylorwilsdon@users.noreply.github.com>
2024-11-18 20:50:12 -08:00
Timothy Jaeryang Baek
8bb3061101 Merge pull request #7025 from yeounhak/dev
fix: Enable RAG_WEB_SEARCH_CONCURRENT_REQUESTS
2024-11-18 20:34:27 -08:00
yeounhak
8c161c797b Enable RAG_WEB_SEARCH_CONCURRENT_REQUESTS with asynchronous optimization for improved performance 2024-11-19 01:14:26 +00:00
Timothy Jaeryang Baek
e4e4110ec0 refac: config 2024-11-18 14:25:36 -08:00
Timothy Jaeryang Baek
d8693c3c74 refac: styling 2024-11-18 14:25:24 -08:00
Timothy Jaeryang Baek
20321e5271 refac: ollama setting for rag 2024-11-18 14:19:56 -08:00
Timothy Jaeryang Baek
e3485d2d88 enh: __metadata__ param for tools & functions
Co-Authored-By: DmitriyAlergant-T1A <93501479+dmitriyalergant-t1a@users.noreply.github.com>
2024-11-18 10:12:54 -08:00
Timothy Jaeryang Baek
7da29b6798 fix: rm print statement
Co-Authored-By: Krishan Bhasin <164889026+krishanbhasin-px@users.noreply.github.com>
2024-11-18 10:06:11 -08:00
Timothy Jaeryang Baek
02cafca584 refac 2024-11-18 09:00:51 -08:00
Timothy Jaeryang Baek
a77d1aef91 refac: styling 2024-11-18 08:55:09 -08:00
Timothy Jaeryang Baek
f37d847521 fix: arena access control 2024-11-18 07:40:37 -08:00
Timothy Jaeryang Baek
269151cd2c enh: arena model access control 2024-11-18 07:18:47 -08:00
Timothy Jaeryang Baek
1ab47a1ff9 refac 2024-11-18 07:06:22 -08:00
Timothy Jaeryang Baek
43f58098f8 refac 2024-11-18 07:05:11 -08:00
Timothy Jaeryang Baek
9525d4279c refac: admin model setting include ollama info 2024-11-18 07:04:21 -08:00
Timothy Jaeryang Baek
db6858582f refac: sidebar component 2024-11-18 06:52:41 -08:00
Timothy Jaeryang Baek
8ad1aa3c2e chore: format 2024-11-18 06:39:27 -08:00
Timothy Jaeryang Baek
ccdafa8718 refac: styling 2024-11-18 06:38:29 -08:00
Timothy Jaeryang Baek
13a84435e2 refac: styling 2024-11-18 06:34:25 -08:00
Timothy Jaeryang Baek
f68e2b2edb refac: styling 2024-11-18 06:32:42 -08:00
Timothy Jaeryang Baek
169ca33b48 refac: styling 2024-11-18 06:24:44 -08:00
Timothy Jaeryang Baek
6dc5efeb19 refac: styling 2024-11-18 06:21:54 -08:00
Timothy Jaeryang Baek
c50b678dce enh: tools user info 2024-11-18 06:19:34 -08:00
Timothy Jaeryang Baek
43ffd61aeb refac: model workspace styling 2024-11-18 06:02:14 -08:00
Timothy Jaeryang Baek
6c3e6710ef enh: knowledge author info 2024-11-18 05:51:01 -08:00
Timothy Jaeryang Baek
a2a25fb571 enh: models display author name 2024-11-18 05:37:04 -08:00
Timothy Jaeryang Baek
03b606925e refac 2024-11-18 05:24:18 -08:00
Timothy Jaeryang Baek
8eaff8033a refac: arena model modal 2024-11-18 05:22:13 -08:00
Timothy Jaeryang Baek
dc8c85c33d fix: shared chat not updating 2024-11-18 05:17:35 -08:00
Timothy Jaeryang Baek
bca9c71ed6 refac: styling 2024-11-17 22:09:18 -08:00
Timothy Jaeryang Baek
ecf21de28f fix: file drop 2024-11-17 22:06:58 -08:00
Timothy Jaeryang Baek
0faa39ace9 fix 2024-11-17 21:39:52 -08:00
Timothy Jaeryang Baek
b0a19d0dda chore: duckduckgo-search bump 2024-11-17 19:20:12 -08:00
Timothy Jaeryang Baek
3faf9d2067 refac: model access control behaviour 2024-11-17 19:15:09 -08:00
Timothy Jaeryang Baek
85731f400c refac: access control 2024-11-17 17:40:31 -08:00
Timothy Jaeryang Baek
07a9b37737 fix: knowledge update issue 2024-11-17 17:37:26 -08:00
Timothy Jaeryang Baek
dd8bc65d03 refac 2024-11-17 17:30:53 -08:00
Timothy Jaeryang Baek
0edd4c2263 refac: wording share -> access 2024-11-17 16:13:59 -08:00
Timothy Jaeryang Baek
6589f75b2d fix: ollama custom model 2024-11-17 16:01:47 -08:00
Timothy Jaeryang Baek
3fa23481c8 refac 2024-11-17 15:58:06 -08:00
Timothy Jaeryang Baek
70c9d6fb86 refac: user menu 2024-11-17 15:51:34 -08:00
Timothy Jaeryang Baek
7858be7fda refac: admin models setting toast 2024-11-17 15:50:18 -08:00
Timothy Jaeryang Baek
6906a0bd26 fix: access control 2024-11-17 14:03:51 -08:00
Timothy Jaeryang Baek
17c9a92767 Merge pull request #6996 from Peter-De-Ath/fix_get_groups_by_member_id-postgres-sqlite
fix get groups by member id postgres
2024-11-17 14:01:15 -08:00
Timothy Jaeryang Baek
9779bbfd8e fix: functions redirect 2024-11-17 14:00:37 -08:00
Peter De-Ath
80e2d4d4ee fix: user ID filtering in GroupTable query 2024-11-17 19:53:51 +00:00
Timothy Jaeryang Baek
37f19f68eb refac: user permissions validation 2024-11-17 03:04:31 -08:00
Timothy Jaeryang Baek
fbdda55564 fix: styling 2024-11-17 02:58:24 -08:00
Timothy Jaeryang Baek
1d4c3a8c58 fix: access control behaviour 2024-11-17 02:51:57 -08:00
Timothy Jaeryang Baek
892f6ba42b fix: user workspace behaviour 2024-11-17 02:43:43 -08:00
Timothy Jaeryang Baek
e65ec1c6cc fix: knowledge 2024-11-17 02:40:47 -08:00
Timothy J. Baek
4a34ca35f0 refac: access control 2024-11-17 01:46:51 -08:00
Timothy Jaeryang Baek
a2dcbc41e5 chore: bump 2024-11-17 00:01:20 -08:00
Timothy Jaeryang Baek
0028285361 refac: fuzzy search threshold 2024-11-17 00:00:03 -08:00
Timothy Jaeryang Baek
465e16d282 refac 2024-11-16 23:58:23 -08:00
Timothy Jaeryang Baek
c338f2cae1 chore: format 2024-11-16 23:46:12 -08:00
Timothy Jaeryang Baek
c24bc60d35 Merge pull request #6989 from Peter-De-Ath/fix-action-button
fix action buttons
2024-11-16 23:44:26 -08:00
Timothy Jaeryang Baek
ae2936c8a1 Merge pull request #6981 from aleixdorca/dev
i18n: Update catalan translation.json
2024-11-16 23:44:10 -08:00
Timothy Jaeryang Baek
fda3af68ce Merge pull request #6966 from sakiphan/dev
i18n: Update translation.json for Turkish language
2024-11-16 23:43:14 -08:00
Timothy Jaeryang Baek
4e61ff8955 Merge pull request #6949 from oyve/dev
i18n: Update translation.json for Norwegian language
2024-11-16 23:42:36 -08:00
Timothy Jaeryang Baek
24e98bb9d7 Merge pull request #6954 from matthewhand/feature/qdrant-auth
feat: add API key support for Qdrant Cloud authentication
2024-11-16 23:42:16 -08:00
Timothy Jaeryang Baek
034674c19c Merge pull request #6931 from open-webui/groups
feat: user groups
2024-11-16 21:51:42 -08:00
Timothy Jaeryang Baek
a47ebd468e refac: dropzone 2024-11-16 21:50:31 -08:00
Timothy Jaeryang Baek
d4388a53f4 fix 2024-11-16 21:43:57 -08:00
Timothy Jaeryang Baek
f5df0625e3 enh: file upload user permission 2024-11-16 21:41:34 -08:00
Timothy Jaeryang Baek
cf2dcf1dc3 feat: user permissions 2024-11-16 21:31:57 -08:00
Timothy Jaeryang Baek
057c957f5d enh: access control 2024-11-16 21:26:10 -08:00
Timothy Jaeryang Baek
07e0712b87 refac: get permissions 2024-11-16 21:16:42 -08:00
Timothy Jaeryang Baek
c0371f6525 enh: user permissions 2024-11-16 21:07:56 -08:00
Timothy Jaeryang Baek
79fbab7341 refac 2024-11-16 21:00:20 -08:00
Timothy Jaeryang Baek
19a23a5b7d refac: prompt editor styling 2024-11-16 20:53:14 -08:00
Timothy Jaeryang Baek
e78657f07e refac: prompts frontend 2024-11-16 20:53:05 -08:00
Timothy Jaeryang Baek
b81cd15ced refac: prompts 2024-11-16 20:52:57 -08:00
Timothy Jaeryang Baek
41bad9abcb refac: access control 2024-11-16 20:47:45 -08:00
Timothy Jaeryang Baek
b41e456c4f enh: workspace loading indicator 2024-11-16 18:35:14 -08:00
Timothy Jaeryang Baek
b562067e91 refac: tools 2024-11-16 18:31:13 -08:00
Timothy Jaeryang Baek
393ab5d457 refac: tools behaviour 2024-11-16 18:10:01 -08:00
Timothy Jaeryang Baek
c35f8c9673 refac: knowledge access control 2024-11-16 18:00:57 -08:00
Timothy Jaeryang Baek
6ebf027613 refac: prompts access control 2024-11-16 18:00:49 -08:00
Timothy Jaeryang Baek
90d283c85e refac: tools access control 2024-11-16 17:57:19 -08:00
Timothy Jaeryang Baek
0a8f69285c refac: toolkit -> tools 2024-11-16 17:54:38 -08:00
Timothy Jaeryang Baek
a1ce8422fd refac 2024-11-16 17:49:13 -08:00
Timothy Jaeryang Baek
af0ba53715 refac: styling 2024-11-16 17:20:55 -08:00
Timothy Jaeryang Baek
060a2791ba refac: rm print statement 2024-11-16 17:18:18 -08:00
Timothy Jaeryang Baek
c3aa09b95c refac 2024-11-16 17:17:18 -08:00
Timothy Jaeryang Baek
73fe77c2da enh: access control 2024-11-16 17:09:15 -08:00
Timothy Jaeryang Baek
227cca35e8 enh: knowledge access control 2024-11-16 16:51:55 -08:00
Timothy Jaeryang Baek
8da24d81a4 refac 2024-11-16 16:01:02 -08:00
Timothy Jaeryang Baek
6ac503413f refac: model tools behaviour 2024-11-16 15:54:07 -08:00
Timothy Jaeryang Baek
7fe10763c1 fix 2024-11-16 15:26:01 -08:00
Timothy Jaeryang Baek
c8a3c42ea8 refac: filter out arena models from base models 2024-11-16 15:13:33 -08:00
Timothy Jaeryang Baek
345c9d12a9 refac: migration 2024-11-16 14:56:00 -08:00
Timothy Jaeryang Baek
243e187f0b refac 2024-11-16 14:52:07 -08:00
Peter De-Ath
6332e46e7b fix: update actionMessage to include message parameter 2024-11-16 22:17:55 +00:00
Timothy Jaeryang Baek
facb4fdf6b refac 2024-11-16 04:43:10 -08:00
Timothy Jaeryang Baek
932de8f1e2 refac 2024-11-16 04:41:07 -08:00
Timothy Jaeryang Baek
931e03bd9e refac 2024-11-16 02:37:37 -08:00
Timothy Jaeryang Baek
646d926f70 enh: chat file upload permission 2024-11-16 02:31:04 -08:00
Timothy Jaeryang Baek
f9412f72f1 refac: styling 2024-11-16 01:54:40 -08:00
Timothy Jaeryang Baek
cd655b128f refac 2024-11-16 01:38:20 -08:00
Timothy Jaeryang Baek
240c91e79d wip: access control 2024-11-16 01:24:34 -08:00
Aleix Dorca
2980246cb6 Update catalan translation.json 2024-11-16 07:12:02 +01:00
Timothy Jaeryang Baek
4eb8b1450c refac 2024-11-15 22:09:06 -08:00
Timothy Jaeryang Baek
d5f84d6234 refac: model preset handling behaviour 2024-11-15 22:04:33 -08:00
Timothy Jaeryang Baek
19c98b74fa refac: base models endpoint 2024-11-15 19:14:24 -08:00
Timothy Jaeryang Baek
7e78889e33 refac: styling 2024-11-15 18:56:13 -08:00
Timothy Jaeryang Baek
7f8c70b04a wip: admin models setting 2024-11-15 18:53:50 -08:00
Timothy Jaeryang Baek
9dae7d0572 refac: models 2024-11-15 18:21:41 -08:00
Timothy Jaeryang Baek
1c16920dba refac 2024-11-15 17:36:46 -08:00
Sakıp Han Dursun
fc789b0cb8 Update translation.json 2024-11-15 15:05:03 +03:00
Timothy Jaeryang Baek
147bd0717d refac 2024-11-15 03:02:08 -08:00
Timothy Jaeryang Baek
a0f1164af7 refac 2024-11-15 03:00:18 -08:00
Timothy Jaeryang Baek
bf2087c67b refac 2024-11-15 02:06:02 -08:00
Timothy Jaeryang Baek
d9dc04f1a1 refac: frontend 2024-11-15 02:05:43 -08:00
Timothy Jaeryang Baek
2ab5b2fd71 wip: access control backend 2024-11-15 01:29:07 -08:00
Timothy Jaeryang Baek
b80ec76435 refac 2024-11-14 20:51:49 -08:00
Timothy Jaeryang Baek
dff85c733d refac 2024-11-14 20:13:43 -08:00
Timothy Jaeryang Baek
150d0adea2 refac: access_control field 2024-11-14 18:57:25 -08:00
Timothy Jaeryang Baek
dae764fa5a feat: groups integration 2024-11-14 18:37:42 -08:00
Timothy Jaeryang Baek
2f893fd373 refac 2024-11-14 18:37:29 -08:00
Timothy Jaeryang Baek
659f3dac44 feat: groups backend 2024-11-14 18:35:14 -08:00
Timothy Jaeryang Baek
716520275b feat: groups db migration 2024-11-14 18:33:16 -08:00
Timothy Jaeryang Baek
947444949a refac: move functions (plugin) to admin panel 2024-11-14 18:32:23 -08:00
Timothy Jaeryang Baek
0cf1969adc refac: rm unused file 2024-11-14 18:31:29 -08:00
Matthew Hand
ca63ae649c Enable Qdrant authentication support 2024-11-15 07:06:46 +11:00
Øyvind
fb582e44a2 Fix JSON
Update JSON typos
2024-11-14 13:35:32 +01:00
Øyvind
56b0092f43 Update translation.json
Update blanks and polish Norwegian translations
2024-11-14 13:29:01 +01:00
Timothy Jaeryang Baek
73cdf90527 refac: styling 2024-11-14 03:20:35 -08:00
Timothy Jaeryang Baek
85d7f1c6ed refac 2024-11-14 03:16:26 -08:00
Timothy Jaeryang Baek
0e8c0b452e wip: frontend 2024-11-14 02:20:34 -08:00
Timothy Jaeryang Baek
aaba41339e Merge pull request #6938 from open-webui/dev
dev
2024-11-13 21:22:42 -08:00
Timothy Jaeryang Baek
f5f2215348 enh: sort functions list by type 2024-11-13 21:22:13 -08:00
Timothy Jaeryang Baek
ce9aef900c wip: frontend 2024-11-13 21:21:50 -08:00
Timothy Jaeryang Baek
9cdd66ca59 Merge pull request #6909 from sakiphan/dev
i18n- Update the translation of tr-TR
2024-11-13 11:26:31 -08:00
Timothy Jaeryang Baek
4174738b1c Merge pull request #6907 from clang88/patch-1
Update calculatePercentage CitationsModal.svelte (high percentage for high relevance)
2024-11-13 11:21:56 -08:00
Sakıp Han Dursun
ee703dfc91 i18n- Update the translation of tr-TR 2024-11-13 17:16:16 +03:00
clang88
67cb3455ad Update CitationsModal.svelte 2024-11-13 14:54:39 +01:00
clang88
ad0b599940 Update calculatePercentage CitationsModal.svelte
Fixes #6904 : Percentage score is high when low relevance and vice-versa.
2024-11-13 14:35:08 +01:00
Timothy Jaeryang Baek
baea26d9ca wip: user groups frontend 2024-11-13 03:09:46 -08:00
Timothy Jaeryang Baek
6caf838964 feat: user groups frontend 2024-11-13 02:00:00 -08:00
Timothy Jaeryang Baek
046cf19d27 Merge pull request #6899 from Menghuan1918/dev
i18n: Update the translation of zh-CN
2024-11-13 00:51:06 -08:00
Menghuan1918
baf4d5d7ba i18n: Finish the translation of zh-CN 2024-11-13 16:44:28 +08:00
Timothy Jaeryang Baek
46be83e921 chore: i18n 2024-11-13 00:35:18 -08:00
Timothy Jaeryang Baek
1e7a10842c refac: settings 2024-11-13 00:33:15 -08:00
Timothy Jaeryang Baek
f160d278b2 refac: stylign 2024-11-12 23:21:31 -08:00
Timothy Jaeryang Baek
86942d207f refac: icons 2024-11-12 23:17:37 -08:00
Timothy Jaeryang Baek
36d8061b4d refac: evaluations 2024-11-12 23:14:25 -08:00
Timothy Jaeryang Baek
57550cbf56 refac: styling 2024-11-12 23:00:47 -08:00
Timothy Jaeryang Baek
94a0bf90ce refac 2024-11-12 22:50:11 -08:00
Timothy Jaeryang Baek
d5435cb8b9 refac: styling 2024-11-12 22:43:18 -08:00
Timothy Jaeryang Baek
17925361dd refac: styling 2024-11-12 22:21:20 -08:00
Timothy Jaeryang Baek
ec0680a89f refac: styling 2024-11-12 22:00:37 -08:00
Timothy Jaeryang Baek
fae6731137 refac: settings styling 2024-11-12 21:57:41 -08:00
Timothy Jaeryang Baek
c260274538 refac: admin users page 2024-11-12 21:51:42 -08:00
Timothy Jaeryang Baek
5a9d61266f refac 2024-11-12 21:09:13 -08:00
Timothy Jaeryang Baek
faf3e81bf0 fix 2024-11-12 21:04:07 -08:00
Timothy Jaeryang Baek
81f497c6e3 refac: env var defaults 2024-11-12 20:44:14 -08:00
Timothy Jaeryang Baek
9f58d00727 refac: styling 2024-11-12 20:36:29 -08:00
Timothy Jaeryang Baek
8cfab0216e refac 2024-11-12 20:33:22 -08:00
Timothy Jaeryang Baek
1588477ca3 enh: tool usage indicator 2024-11-12 20:33:12 -08:00
Timothy Jaeryang Baek
760652c4cc refac 2024-11-12 20:26:33 -08:00
Timothy Jaeryang Baek
816b5977a7 Merge pull request #6893 from dannyl1u/enh/settings-search
feat: add more search keywords for settings search
2024-11-12 20:07:24 -08:00
dannyl1u
6bed45a456 enh: add more search keywords for settings search 2024-11-12 19:43:20 -08:00
Timothy Jaeryang Baek
90b40c82dd Merge pull request #6890 from michaelpoluektov/revert-6879-fix/render-html-in-citations
feat: DOMPurify to iframe to render HTML in citations
2024-11-12 16:15:05 -08:00
Timothy Jaeryang Baek
8248e0c216 refac 2024-11-12 16:08:18 -08:00
Michael Poluektov
63ee69a900 sandbox in iframe 2024-11-13 00:07:39 +00:00
Timothy Jaeryang Baek
3d923a15a2 refac 2024-11-12 16:04:03 -08:00
Timothy Jaeryang Baek
f470f3fce2 refac 2024-11-12 15:53:16 -08:00
Timothy Jaeryang Baek
ee05455155 refac 2024-11-12 15:46:44 -08:00
Timothy Jaeryang Baek
3a541460df refac 2024-11-12 15:32:49 -08:00
Timothy Jaeryang Baek
f10d0df490 refac: lazy load prompts/tools/functions/tags 2024-11-12 15:31:11 -08:00
Michael Poluektov
f3210ec7db bring html back 2024-11-12 23:17:22 +00:00
Michael Poluektov
d0f13d7c07 Revert "fix/feat: add HTML rendering to citations back" 2024-11-12 23:09:18 +00:00
Timothy Jaeryang Baek
fb464800e4 Merge pull request #6879 from michaelpoluektov/fix/render-html-in-citations
fix/feat: add HTML rendering to citations back
2024-11-12 14:00:49 -08:00
Timothy Jaeryang Baek
b1d31d9b8e refac 2024-11-12 14:00:32 -08:00
Timothy Jaeryang Baek
0f704f1809 refac 2024-11-12 13:57:25 -08:00
Michael Poluektov
330a3535e6 fix: add HTML rendering to citations back 2024-11-12 16:42:17 +00:00
Timothy Jaeryang Baek
5c1b3693cf refac 2024-11-11 23:04:02 -08:00
Timothy Jaeryang Baek
08b5e7ef5b refac: ollama connections 2024-11-11 22:46:47 -08:00
Timothy Jaeryang Baek
99446c4b76 feat: ollama auth support 2024-11-11 22:33:18 -08:00
Timothy Jaeryang Baek
607a8b2109 refac: ollama connections 2024-11-11 22:25:08 -08:00
Timothy Jaeryang Baek
f8f36f298a refac 2024-11-11 22:03:57 -08:00
Timothy Jaeryang Baek
3ba7b6f0e5 fix 2024-11-11 21:52:39 -08:00
Timothy Jaeryang Baek
1277579f71 refac 2024-11-11 21:24:30 -08:00
Timothy Jaeryang Baek
0809eb79b8 refac: openai connections 2024-11-11 21:18:51 -08:00
Timothy Jaeryang Baek
b82e25cac8 refac: openai /models 2024-11-11 14:11:20 -08:00
Timothy Jaeryang Baek
cdc2b4dd61 refac: styling 2024-11-11 13:56:33 -08:00
Timothy Jaeryang Baek
61f29a6531 Merge branch 'main' into dev 2024-11-11 13:45:13 -08:00
Timothy Jaeryang Baek
38a550092e refac: styling 2024-11-11 00:50:43 -08:00
Timothy Jaeryang Baek
ad49ad8fa4 refac 2024-11-11 00:49:43 -08:00
Timothy Jaeryang Baek
3b4ee0f127 refac 2024-11-11 00:44:46 -08:00
Timothy Jaeryang Baek
b2928975dc refac: styling 2024-11-10 21:01:28 -08:00
Timothy Jaeryang Baek
af12f07973 refac 2024-11-10 19:58:49 -08:00
Timothy Jaeryang Baek
b903ee835a refac: styling 2024-11-10 19:55:06 -08:00
Timothy Jaeryang Baek
655745ee0c refac: styling 2024-11-10 19:47:55 -08:00
Timothy Jaeryang Baek
3435de5af6 refac: citations 2024-11-10 19:24:53 -08:00
Timothy Jaeryang Baek
7bcb430008 enh: web search indicator 2024-11-10 19:11:06 -08:00
Timothy Jaeryang Baek
19fc83a12b refac: styling 2024-11-10 18:48:54 -08:00
Timothy Jaeryang Baek
317f5df34e refac: settings order 2024-11-10 18:44:52 -08:00
Timothy Jaeryang Baek
466e1fecb4 refac: styling 2024-11-10 18:42:52 -08:00
Timothy Jaeryang Baek
9a546c34bb refac: confirm dialog z index 2024-11-10 18:35:18 -08:00
Timothy Jaeryang Baek
8d1e6f331b refac: prompt editor styling 2024-11-10 18:33:21 -08:00
Timothy Jaeryang Baek
0cc6e20d65 refac: prompt editor 2024-11-10 18:20:46 -08:00
Timothy Jaeryang Baek
c92091721b refac: sticky new chat selected models behaviour 2024-11-10 18:01:10 -08:00
Timothy Jaeryang Baek
36712c1597 refac: styling 2024-11-10 17:27:39 -08:00
Timothy Jaeryang Baek
c173d275dc Merge pull request #6753 from silentoplayz/silentoplayz-unarchive-all
feat: Unarchive All Archived Chats Button with Confirmation
2024-11-10 16:39:20 -08:00
Timothy Jaeryang Baek
f7b98e8c84 refac 2024-11-10 16:39:11 -08:00
Timothy Jaeryang Baek
6ed085b90b chore: format 2024-11-10 16:34:35 -08:00
Timothy Jaeryang Baek
be22332fd6 Merge pull request #6841 from konmeo/patch-1
Fix DuckDuckGo's RateLimit
2024-11-10 16:27:15 -08:00
Timothy Jaeryang Baek
24f2152493 Merge pull request #6840 from Peter-De-Ath/fix-translation-uk-UA
Fix missing comma in Ukrainian translation.json
2024-11-10 16:26:55 -08:00
Peter De-Ath
94e432d599 update fomatting and i18n 2024-11-10 22:10:28 +00:00
konmeo
e4d35a9478 Fix DuckDuckGo's RateLimit exception (#6624) 2024-11-10 14:05:40 -08:00
Peter De-Ath
638b350b5c Fix missing comma in Ukrainian translation.json 2024-11-10 22:02:03 +00:00
Timothy Jaeryang Baek
ff9fdc2f88 refac 2024-11-09 23:57:19 -08:00
Timothy Jaeryang Baek
96c865404d refac: disable openapi.json 2024-11-09 18:01:23 -08:00
Timothy Jaeryang Baek
3ba9f2aae2 Merge pull request #6811 from OriginalSimon/dev
18n: Update Ukrainian translation
2024-11-09 13:58:29 -08:00
Simon
0a027aaa14 Update translation.json 2024-11-09 11:02:05 +01:00
Simon
20d671df39 Update translation.json 2024-11-09 10:59:45 +01:00
Timothy Jaeryang Baek
2fdbab6640 Merge pull request #6761 from diegmonti/feat/permissions-policy
feat: Add permissions-policy to security headers
2024-11-09 00:30:48 -08:00
Timothy J. Baek
aa80df1431 refac: styling 2024-11-08 20:14:33 -08:00
Timothy J. Baek
f258f44136 refac: styling 2024-11-07 01:30:51 -08:00
Timothy J. Baek
cbf6004c76 refac: styling 2024-11-07 01:07:28 -08:00
Timothy J. Baek
b1a941ee6f refac: styling 2024-11-07 01:00:30 -08:00
Timothy J. Baek
9ea9e8478a refac: styling 2024-11-07 00:53:39 -08:00
Timothy J. Baek
f6fb522269 refac: model editor 2024-11-07 00:18:48 -08:00
Timothy J. Baek
a4abd32e4a fix 2024-11-06 23:01:10 -08:00
Timothy J. Baek
c9a59f5d51 refac: styling 2024-11-06 22:52:06 -08:00
Timothy J. Baek
f8c2bedf53 fix: hybrid search 2024-11-06 22:51:36 -08:00
Timothy J. Baek
24b7716241 refac: workspace styling 2024-11-06 21:45:48 -08:00
Timothy J. Baek
d961e8943e refac: styling 2024-11-06 21:13:37 -08:00
Timothy J. Baek
6dc429504a fix: continue message 2024-11-06 20:53:36 -08:00
Timothy Jaeryang Baek
580cf6a02c Merge pull request #6757 from KarlLee830/translate
i18n: Update Chinese translation
2024-11-06 13:54:27 -08:00
Diego Monti
b1805380dc feat: Add permissions-policy to security headers 2024-11-06 18:16:22 +01:00
KarlLee830
d88b55e65e i18n: Update Chinese translation 2024-11-06 19:04:07 +08:00
Timothy J. Baek
02269a21a9 refac 2024-11-06 02:58:44 -08:00
Timothy J. Baek
ccbf5a08f3 refac 2024-11-06 02:19:04 -08:00
Timothy J. Baek
056f24dc57 refac 2024-11-06 00:32:08 -08:00
silentoplayz
f39a523ec0 Update ArchivedChatsModal.svelte
feat: Unarchive All Archived Chats button
2024-11-06 00:58:41 -05:00
Timothy J. Baek
4616b508b1 refac: token handling 2024-11-05 21:14:02 -08:00
Timothy J. Baek
60df959875 chore: format 2024-11-05 21:10:22 -08:00
Timothy J. Baek
926033ba52 chore: format 2024-11-05 21:10:14 -08:00
Timothy J. Baek
df85b93b53 refac 2024-11-05 21:05:14 -08:00
Timothy Jaeryang Baek
be079e7ea2 Merge pull request #6749 from dannyl1u/feat/settings-search
feat: search in settings
2024-11-05 20:56:35 -08:00
Timothy Jaeryang Baek
69311fec71 Merge pull request #6750 from Sebastriani/main
feat: Possibility to globaly disable Tags generation.
2024-11-05 20:53:10 -08:00
Timothy J. Baek
ad462f0a11 refac: ldap settings 2024-11-05 20:52:02 -08:00
Timothy J. Baek
547682c674 refac 2024-11-05 20:47:23 -08:00
Timothy J. Baek
75b169e11d refac: ldap auth page 2024-11-05 20:32:09 -08:00
dannyl1u
9e6595705e feat: settings search - no results found 2024-11-05 20:06:37 -08:00
dannyl1u
2f921859ee lower debounce timer for settings search 2024-11-05 19:59:34 -08:00
Timothy J. Baek
2910cbe9a9 refac: disable ldap by default 2024-11-05 19:58:54 -08:00
dannyl1u
420053b709 run format 2024-11-05 19:16:22 -08:00
dannyl1u
2e645d3303 feat: search in settings 2024-11-05 18:50:58 -08:00
Sebastián D. Gauna
e1114bfa4c feat: Possibility to globaly disable Tags generation. 2024-11-05 23:32:08 -03:00
Timothy J. Baek
040449be01 chore: format 2024-11-05 17:41:24 -08:00
Timothy Jaeryang Baek
2d943e784b Merge pull request #6745 from DiegoRodriguez83/#6744
i18n: Translations Brazilian Portuguese (pt-BR)
2024-11-05 17:27:49 -08:00
Diego Rodriguez
739c263e94 i18n: Translations Brazilian Portuguese (pt-BR) 2024-11-05 21:43:18 -03:00
Timothy J. Baek
28b541a692 refac 2024-11-05 15:15:32 -08:00
Timothy Jaeryang Baek
1ee7730fac Merge pull request #6645 from jk-f5/feat/pgvector
feat: Intial support for pgvector as backing vector database
2024-11-05 15:14:55 -08:00
Timothy Jaeryang Baek
1f36cad9ef Fix code scanning alert no. 129: LDAP query built from user-controlled sources
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-11-05 18:10:16 -05:00
Timothy J. Baek
fe68a0776c refac
Co-Authored-By: ziweiwang <47988425+wilsonziweiwang@users.noreply.github.com>
2024-11-05 15:09:09 -08:00
Timothy Jaeryang Baek
2777620527 Merge pull request #6743 from morgan55555/dev
feat: LDAP User management
2024-11-05 15:05:50 -08:00
morgan55555
5d934d7d15 feat: LDAP User management
LDAP will be used as default if no other auth form is enabled.
LDAP now will work with ENABLE_LOGIN_FORM = false.
Fixed exception "User does not match the record."
Now LDAP login is case insensitive.
Integrated with onboarding feature.
2024-11-06 03:30:23 +05:00
Timothy J. Baek
2cc2694eba refac: styling 2024-11-05 14:05:13 -08:00
Timothy Jaeryang Baek
3e52e95b2c Merge pull request #6724 from silentoplayz/silentoplayz-tooltips
feat: Add tooltips to provide contextual information for each parameter
2024-11-05 13:59:51 -08:00
Timothy Jaeryang Baek
b6bebd76f0 Merge pull request #6737 from aleixdorca/dev
i18n: Updated the catalan translation.json
2024-11-05 12:59:55 -08:00
silentoplayz
cd6e05d43c Update AdvancedParams.svelte
fix
2024-11-05 13:10:51 -05:00
Aleix Dorca
665cdffedc Update catalan translation.json 2024-11-05 18:53:26 +01:00
silentoplayz
634be4a97a Update AdvancedParams.svelte
i18n.t
2024-11-05 12:51:40 -05:00
silentoplayz
e5f9ef4515 Update AdvancedParams.svelte
Added missing tooltips
2024-11-05 12:27:00 -05:00
Timothy J. Baek
eb56614b58 refac: wording 2024-11-05 00:18:35 -08:00
silentoplayz
8c1983cfda Update AdvancedParams.svelte
Added Advanced Parameters tooltips
2024-11-05 01:39:54 -05:00
Timothy J. Baek
d4b60b1bac refac: styling 2024-11-04 19:52:12 -08:00
Timothy Jaeryang Baek
ea1d512ee3 Merge pull request #6719 from DiegoRodriguez83/#6717
i18n: Added labels in 2 components + translation and adjustments for pt-BR
2024-11-04 19:36:25 -08:00
Timothy Jaeryang Baek
c29b283f5d Merge branch 'dev' into #6717 2024-11-04 19:35:49 -08:00
Timothy J. Baek
3afc34928f refac: onboarding 2024-11-04 19:31:56 -08:00
Diego Rodriguez
573b63c06b CHANGELOG 2024-11-04 23:52:08 -03:00
Diego Rodriguez
7aeedda634 i18n: Implementing label [SearchInput] and [CreateCollection] | Translation and adjustments pt-BR 2024-11-04 23:37:53 -03:00
Jason Kidd
319ea8cb7f feat: Add ability to set URI for pgvector 2024-11-04 14:27:33 -08:00
Jason Kidd
701f40aedd feat: Initial support for pgvector 2024-11-04 14:26:41 -08:00
Timothy J. Baek
5d3da6dcc8 Merge branch 'dev' of https://github.com/open-webui/open-webui into dev 2024-11-04 14:25:41 -08:00
Timothy J. Baek
88ea53bd6a fix 2024-11-04 14:25:35 -08:00
Timothy Jaeryang Baek
6c1d0a8e39 Merge pull request #6598 from dtaivpp/main
feat: OpenSearch vector db support
2024-11-04 14:04:55 -08:00
Timothy J. Baek
7c0545fd39 chore: requirements 2024-11-04 14:02:55 -08:00
Timothy J. Baek
224b555de5 Merge branch 'dev' of https://github.com/open-webui/open-webui into dev 2024-11-04 14:01:26 -08:00
Timothy J. Baek
151b3cf8e7 chore: i18n 2024-11-04 14:01:19 -08:00
Timothy Jaeryang Baek
8234036001 Merge pull request #6701 from davizucon/dev
Small Fix: variable from ssl_verification to: web_loader_ssl_verification
2024-11-04 14:00:25 -08:00
David Tippett
705e3129b6 Updating config format. 2024-11-04 15:14:53 -05:00
David Tippett
afca48028f Moving new config to under retreval 2024-11-04 15:10:14 -05:00
David Tippett
4baab4bce8 Merge branch 'open-webui:main' into main 2024-11-04 15:04:30 -05:00
David Tippett
16089ab947 Fix formatting in pyproject.toml dependencies list 2024-11-04 14:59:50 -05:00
Davi Sclifo Zucon
a70e5a0f30 When UI "Bypass SSL verification for Websites"=True then ENABLE_RAG_WEB_LOADER_SSL_VERIFICATION=False 2024-11-04 16:29:29 -03:00
Davi Sclifo Zucon
35a9140567 Added parameter to: app.state.config.ENABLE_RAG_WEB_LOADER_SSL_VERIFICATION to get_web_loader(verify_ssl).
Invert variable value to send to UI , not ENABLE_RAG_WEB_LOADER_SSL_VERIFICATION.
2024-11-04 16:21:26 -03:00
Davi Sclifo Zucon
5306b49be0 Small Fix variable ssl_verification -> web_loader_ssl_verification (following python entity)
When changed via the web interface in Admin's WebSearch, the bypass option is not being persisted.
This change adjusts it to the same name as the one related in the python entity.
2024-11-04 15:40:16 -03:00
Timothy J. Baek
0b47387081 refac: styling 2024-11-04 02:32:06 -08:00
Timothy J. Baek
630d1397ad refac: styling 2024-11-04 01:57:01 -08:00
Timothy J. Baek
1fd67d7e5d feat: native speecht5 support 2024-11-04 01:16:51 -08:00
Timothy J. Baek
835eeb6433 fix: playground styling 2024-11-03 23:05:41 -08:00
Timothy J. Baek
5c60081c1f refac: web search 2024-11-03 17:07:24 -08:00
Timothy J. Baek
70498d7bbe enh: export table as csv
Co-Authored-By: Muhammad Afzaal <mafzaal@gmail.com>
2024-11-03 14:09:57 -08:00
Timothy J. Baek
5ae6d05a53 fix 2024-11-03 04:05:46 -08:00
Timothy J. Baek
f1065115aa fix: youtube loader issue 2024-11-03 03:18:17 -08:00
Timothy J. Baek
d3ac439000 refac: styling 2024-11-03 03:04:35 -08:00
Timothy J. Baek
194b924a96 feat: onboarding screen 2024-11-03 03:00:28 -08:00
Timothy J. Baek
cfe255bb95 refac: styling 2024-11-03 02:31:12 -08:00
Timothy J. Baek
dbf14afa32 refac: styling 2024-11-03 02:00:31 -08:00
Timothy J. Baek
330ad0131c refac 2024-11-03 01:39:03 -08:00
Timothy J. Baek
39bfc4c8e9 refac 2024-11-03 01:38:07 -08:00
Timothy J. Baek
4e7951d5fc fix: allow openai list message format 2024-11-03 01:34:45 -08:00
Timothy J. Baek
0925c6b33b refac: remove unused dependency 2024-11-03 01:26:16 -08:00
Timothy J. Baek
98cea8aaa4 refac: automatically disable new sign ups after first user 2024-11-03 01:25:41 -08:00
Timothy J. Baek
503019b28d fix: web stt issue 2024-11-03 01:21:58 -08:00
Timothy J. Baek
380e080f6d fix: do not crash on invalid embedding model 2024-11-03 01:08:04 -08:00
Timothy J. Baek
6027c13227 fix: s3 file path 2024-11-03 01:07:43 -08:00
Timothy J. Baek
0c6453078e refac: orientation 2024-11-03 01:59:53 -07:00
Timothy J. Baek
230e2f8f82 fix: remove tags gen print 2024-11-03 01:54:23 -07:00
Timothy J. Baek
8c5206018c fix: respect case sensitivity 2024-11-03 01:43:14 -07:00
Timothy Jaeryang Baek
c315a7d9dd Merge pull request #6631 from open-webui/dependabot/pip/backend/dev/python-multipart-0.0.17
build(deps): bump python-multipart from 0.0.9 to 0.0.17 in /backend
2024-11-02 23:25:25 -07:00
Timothy Jaeryang Baek
01887098ac Merge pull request #6629 from open-webui/dependabot/pip/backend/dev/boto3-1.35.53
build(deps): bump boto3 from 1.35.0 to 1.35.53 in /backend
2024-11-02 23:25:09 -07:00
Timothy Jaeryang Baek
e89e17b654 Merge pull request #6628 from open-webui/dependabot/pip/backend/dev/pymilvus-2.4.9
build(deps): bump pymilvus from 2.4.7 to 2.4.9 in /backend
2024-11-02 23:24:57 -07:00
Timothy Jaeryang Baek
dead5cdd4e Merge pull request #6589 from DucNgn/dn_forward_user_info_in_headers
feat: Add option to forward user info as headers to OpenAI API
2024-11-02 17:24:04 -07:00
David Tippett
ef7a9e2467 Update chromadb and pymilvus versions
Fixing botched merge change.
2024-11-01 21:47:05 -04:00
Timothy Jaeryang Baek
c44036e2b8 Merge pull request #6646 from s1adem4n/fix-popover-text
fix: Truncate text in UserMenu so it doesn't break into multiple lines
2024-11-01 18:22:21 -07:00
Timothy Jaeryang Baek
f23ae8f7a0 Merge pull request #6636 from aindriu80/main
i18n: Translated new strings into Irish, edited some existing strings
2024-11-01 18:17:49 -07:00
Timothy Jaeryang Baek
2bace37890 Merge pull request #6644 from s1adem4n/improve-german-translation
i18n: Improve German translation, add missing strings
2024-11-01 18:17:34 -07:00
Timothy Jaeryang Baek
692c3f992f Merge pull request #6635 from ahangarha/improve-persian-translation
i18n: Improve persian (fa-IR) translation
2024-11-01 18:17:22 -07:00
Timothy Jaeryang Baek
89f62baa08 Merge pull request #6633 from t0ny-d3v/dev
Dev: cs-CZ fix translations
2024-11-01 18:17:07 -07:00
Jonathan
a8dfc0091c truncate text so it doesnt break and look weird 2024-11-02 00:32:12 +01:00
Jonathan
6e1b89b55a improve german translation 2024-11-01 23:18:17 +01:00
Mostafa Ahangarha
b8304d13a9 Improve persian (fa-IR) translation 2024-11-01 22:06:28 +03:30
Aindriú Mac Giolla Eoin
dad12067d8 Translated new strings into Irish, edited some existing strings 2024-11-01 17:25:49 +00:00
Duc Nguyen
06f44dc067 Minor comment 2024-11-01 11:24:10 -04:00
Duc Nguyen
a34d202ae8 move the config to env.py 2024-11-01 11:23:18 -04:00
Jozef Papai
9579208b37 Update translation.json
Update some texts
2024-11-01 11:25:02 +02:00
Jozef Papai
31348aa162 Update translation.json
Fix some translatios
2024-11-01 11:17:48 +02:00
dependabot[bot]
705316aef3 build(deps): bump python-multipart from 0.0.9 to 0.0.17 in /backend
Bumps [python-multipart](https://github.com/Kludex/python-multipart) from 0.0.9 to 0.0.17.
- [Release notes](https://github.com/Kludex/python-multipart/releases)
- [Changelog](https://github.com/Kludex/python-multipart/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Kludex/python-multipart/compare/0.0.9...0.0.17)

---
updated-dependencies:
- dependency-name: python-multipart
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-01 02:25:46 +00:00
dependabot[bot]
39f841ce34 build(deps): bump boto3 from 1.35.0 to 1.35.53 in /backend
Bumps [boto3](https://github.com/boto/boto3) from 1.35.0 to 1.35.53.
- [Release notes](https://github.com/boto/boto3/releases)
- [Commits](https://github.com/boto/boto3/compare/1.35.0...1.35.53)

---
updated-dependencies:
- dependency-name: boto3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-01 02:25:39 +00:00
dependabot[bot]
b6372a4cb2 build(deps): bump pymilvus from 2.4.7 to 2.4.9 in /backend
Bumps [pymilvus](https://github.com/milvus-io/pymilvus) from 2.4.7 to 2.4.9.
- [Release notes](https://github.com/milvus-io/pymilvus/releases)
- [Commits](https://github.com/milvus-io/pymilvus/compare/v2.4.7...v2.4.9)

---
updated-dependencies:
- dependency-name: pymilvus
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-01 02:25:32 +00:00
Timothy Jaeryang Baek
c3faed71ef Merge pull request #6611 from open-webui/main
dev
2024-10-30 21:08:48 -07:00
Timothy Jaeryang Baek
255109d341 Merge pull request #6604 from Peter-De-Ath/update-langchain-community
fix/enh: update langchain-community
2024-10-30 16:13:42 -07:00
Peter De-Ath
7c6fa64c05 fix/enh: update langchain-community 2024-10-30 22:46:06 +00:00
David Tippett
6aec971ddb Updating requirements.txt 2024-10-30 15:53:21 -04:00
David Tippett
a39ddfd4f1 Adding OpenSearch python dependancy 2024-10-30 15:52:41 -04:00
David Tippett
fb30b667e2 First pass at an OpenSearch connector 2024-10-30 15:51:56 -04:00
Timothy Jaeryang Baek
9d6cfe64ba Merge pull request #6585 from t0ny-d3v/dev
Rename cs_CZ to cs-CZ
2024-10-30 10:28:17 -07:00
Timothy J. Baek
7228b39064 Update README.md 2024-10-30 10:16:28 -07:00
Duc Nguyen
3f0b3ea90e feat: Add option to forward user info as headers to OpenAI API 2024-10-30 11:29:18 -04:00
Jozef Papai
91180864a7 Rename cs_CZ to cs-CZ
Fix dir name
2024-10-30 09:16:26 +02:00
Timothy Jaeryang Baek
785497a34a Merge pull request #6567 from open-webui/dependabot/pip/pip-1185b3d527
build(deps): bump the pip group across 2 directories with 1 update
2024-10-29 23:27:03 -07:00
Timothy Jaeryang Baek
adfce28732 Merge pull request #6543 from execgit/main
fix: omit document contents in logging document embedding
2024-10-29 19:17:53 -07:00
Timothy Jaeryang Baek
4765dfd28c Merge pull request #6574 from mafzaal/ur-PK-translation_v2
i18n - Urdu PK translation
2024-10-29 17:10:38 -07:00
Muhammad Afzaal
a2d72deaae Added Urdu Pakistan (ur-PK) translations 2024-10-29 18:13:56 -05:00
dependabot[bot]
3a713aea18 build(deps): bump the pip group across 2 directories with 1 update
Bumps the pip group with 1 update in the / directory: [langchain](https://github.com/langchain-ai/langchain).
Bumps the pip group with 1 update in the /backend directory: [langchain](https://github.com/langchain-ai/langchain).


Updates `langchain` from 0.2.15 to 0.3.0
- [Release notes](https://github.com/langchain-ai/langchain/releases)
- [Commits](https://github.com/langchain-ai/langchain/compare/langchain==0.2.15...langchain==0.3.0)

Updates `langchain` from 0.2.15 to 0.3.0
- [Release notes](https://github.com/langchain-ai/langchain/releases)
- [Commits](https://github.com/langchain-ai/langchain/compare/langchain==0.2.15...langchain==0.3.0)

---
updated-dependencies:
- dependency-name: langchain
  dependency-type: direct:production
  dependency-group: pip
- dependency-name: langchain
  dependency-type: direct:production
  dependency-group: pip
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-29 20:23:44 +00:00
Timothy Jaeryang Baek
4cf5a165bc Merge pull request #6537 from t0ny-d3v/main
i18n Add new language - CZ, add missing translations to RO
2024-10-29 10:04:24 -07:00
Igor Brai
b7d730e244 add mojeek as websearch option 2024-10-29 16:45:38 +02:00
execgit
03e9add96d retrieval.utils: omit logging file contents at level INFO 2024-10-29 14:33:37 +02:00
execgit
bc7622c0fe Avoid logging file contents at level INFO
I had problems with document handling in rootless containers. Long documents caused the container to hang. Reducing the verbosity of logging from retrieval.main seemed to fix the issues I was experiencing.
2024-10-29 14:31:47 +02:00
Timothy Jaeryang Baek
b36a1eef4a Merge pull request #6523 from open-webui/main
refac: feedback base_models
2024-10-28 15:21:07 -07:00
Timothy J. Baek
09935d191f refac: feedback base_models 2024-10-28 15:19:02 -07:00
Timothy Jaeryang Baek
489a69673f Merge pull request #6521 from open-webui/main
enh: include base model id in feedback metadata
2024-10-28 15:09:31 -07:00
Timothy Jaeryang Baek
46b2505fbd Merge pull request #6520 from turbra/main
fix: automatic1111 typo
2024-10-28 15:09:01 -07:00
Timothy J. Baek
e03e22dd1f enh: include base model id in feedback metadata 2024-10-28 15:07:40 -07:00
turbra
572526c1bb Update config.py 2024-10-28 17:02:18 -04:00
Timothy J. Baek
8f2f4747e7 fix 2024-10-28 13:29:44 -07:00
Timothy Jaeryang Baek
b32fbf7c58 Merge pull request #6504 from jeeteshchel/fork/dev
feat: enable bing support
2024-10-28 12:30:11 -07:00
Jeetesh Chellani
f7d8a6ccba feat: enable bing support 2024-10-28 16:51:31 +02:00
Timothy Jaeryang Baek
90759bc89a Merge pull request #6495 from andrewbbaek/dev
Korean Translation Update
2024-10-28 05:52:28 -07:00
Timothy J. Baek
491cff8c63 refac: parse md files with TextLoader 2024-10-28 05:50:56 -07:00
Timothy J. Baek
bcf88585de fix: pdf issue w/ markdown 2024-10-28 05:47:53 -07:00
Timothy J. Baek
25a2c6ee52 fix/refac: use user prompt for title gen fallback 2024-10-28 05:34:50 -07:00
Jozef Papai
046d8d04aa Update translation.json
added missing translations
2024-10-28 11:40:23 +02:00
Jozef Papai
4a4dce3a33 Update languages.json
Add czech
2024-10-28 11:16:11 +02:00
Jozef Papai
88c27dc1df Create translation.json
Czech translate file
2024-10-28 11:15:23 +02:00
Andrew Baek
dd88882ad4 Update translation.json 2024-10-28 15:04:32 +09:00
Andrew Baek
b92d530cf3 Merge branch 'dev' of https://github.com/andrewbbaek/open-webui into dev 2024-10-28 14:09:56 +09:00
Timothy Jaeryang Baek
a64cc8f8e0 Merge pull request #6474 from KarlLee830/translate
i18n: Update Chinese translation
2024-10-27 16:27:03 -07:00
Timothy Jaeryang Baek
9a81e34fe1 Merge pull request #6473 from HaldiH/patch-1
fix: generate endpoint form model
2024-10-27 16:26:51 -07:00
Timothy Jaeryang Baek
206a9cba93 Merge pull request #6470 from Xelaph/patch-1
i18n: Added and changed Dutch translations
2024-10-27 16:26:13 -07:00
Timothy Jaeryang Baek
b4d116475b Merge pull request #6468 from diwakar-s-maurya/main
feat: support authentication for chromadb
2024-10-27 16:25:55 -07:00
KarlLee830
38ae5cc0d5 i18n: Update Chinese translation 2024-10-27 20:58:37 +08:00
Hugo Haldi
b596b8f0cb Fix: generate endpoint form model
According to the [Ollama documentation] the parameter `context` should be an array of int, if specified.
2024-10-27 13:41:50 +01:00
Andrew Baek
9c299625d3 Update translation.json (ko-KR)
ko-KR
2024-10-27 20:42:14 +09:00
Alex
1eeac56ce2 Merge branch 'open-webui:main' into patch-1 2024-10-27 09:53:10 +01:00
Alex
bc6104a6f9 Update translation.json
Added last translations and changed some into clearer or better language (in my opinion)
2024-10-27 09:46:43 +01:00
Alex
fd9c3b0a5b Update translation.json
Added more translations
2024-10-27 09:27:05 +01:00
Diwakar Singh Maurya
3d0c32f366 feature to support authentication in chromadb 2024-10-27 14:01:00 +07:00
Timothy J. Baek
e35be175fc fix 2024-10-26 22:05:19 -07:00
Timothy J. Baek
effcbd6301 feat: airdrop chats between windows 2024-10-26 21:25:48 -07:00
Timothy J. Baek
e6ca994c92 feat: option to disable what's new modal 2024-10-26 19:44:46 -07:00
Timothy Jaeryang Baek
21b8ca3459 Merge pull request #6465 from open-webui/dev
refac: migration
2024-10-26 19:01:32 -07:00
Timothy J. Baek
5537b2dc2c refac: migration 2024-10-26 19:01:01 -07:00
Alex
5542a9707c Update translation.json
Added what I could easily translate and changed some translations that were obviously wrong
2024-10-26 23:29:53 +02:00
Timothy Jaeryang Baek
f1f068f458 Merge pull request #6460 from open-webui/dev
0.3.35
2024-10-26 13:17:35 -07:00
Timothy J. Baek
53e772df2f doc: changelog 2024-10-26 13:16:49 -07:00
Timothy J. Baek
e36acd6217 enh: empty file handling behaviour 2024-10-26 13:05:54 -07:00
Timothy J. Baek
25a37baeec chore: format 2024-10-26 13:05:37 -07:00
Timothy Jaeryang Baek
dab2308fe2 Merge pull request #6450 from superzazu/fr_fixes
i18n: update french translation fr-FR
2024-10-26 12:58:14 -07:00
Timothy J. Baek
15cfdc69a8 refac: chat input file handling 2024-10-26 12:56:37 -07:00
Timothy Jaeryang Baek
032abba88e Merge pull request #6458 from duroakos/dev
i18n: added hungarian translation hu-HU
2024-10-26 12:43:35 -07:00
Timothy J. Baek
f03629de61 fix: merged response should be used in messages payload 2024-10-26 12:41:54 -07:00
Timothy J. Baek
badbe4ea06 fix: tools not working 2024-10-26 12:21:05 -07:00
duroakos
c162e7074e i18n: added hungarian translation hu-Hu 2024-10-26 21:14:08 +02:00
Nicolas Allemand
f5c74837b1 i18n: update french translation fr-FR 2024-10-26 18:50:28 +02:00
Timothy Jaeryang Baek
565ea92693 Merge pull request #6434 from open-webui/main
dev
2024-10-26 01:50:40 -07:00
Timothy J. Baek
d056923479 Update CHANGELOG.md 2024-10-26 01:45:30 -07:00
Timothy Jaeryang Baek
1cd7d83f50 Merge pull request #6433 from open-webui/dev
fix: knowledge issue
2024-10-26 01:19:38 -07:00
Timothy J. Baek
f1c123c819 fix: knowledge issue 2024-10-26 01:19:17 -07:00
Timothy Jaeryang Baek
f10c729e3d Merge pull request #6413 from open-webui/dev
0.3.34
2024-10-26 00:44:16 -07:00
Timothy J. Baek
488d7f10b3 doc: wording 2024-10-26 00:44:08 -07:00
Timothy J. Baek
bbc7e2776d doc: changelog 2024-10-26 00:42:27 -07:00
Timothy J. Baek
07c9ace061 chore: version bump 2024-10-26 00:27:35 -07:00
Timothy J. Baek
b6f548035c chore: format 2024-10-26 00:24:10 -07:00
Timothy Jaeryang Baek
554e181ccb Merge pull request #6432 from diwakar-s-maurya/main
fix: Prevent crash while setting Strict-Transport-Security security header
2024-10-26 00:23:15 -07:00
Timothy J. Baek
0cf8f58efe refac: voice input styling 2024-10-26 00:21:46 -07:00
Diwakar
0a7bc50279 Prevent crash while setting Strict-Transport-Security security header 2024-10-26 13:45:28 +07:00
Timothy J. Baek
1cd036e768 refac 2024-10-25 22:33:26 -07:00
Timothy J. Baek
f2c78ac0fb refac 2024-10-25 22:23:21 -07:00
Timothy J. Baek
925a903e38 chore: format 2024-10-25 22:18:48 -07:00
Timothy J. Baek
47e4250f58 refac 2024-10-25 22:12:46 -07:00
Timothy J. Baek
21a28e3bf0 enh: more robust knowledge file info retrieval 2024-10-25 21:58:29 -07:00
Timothy J. Baek
5d2714bc92 fix: s3 file upload 2024-10-25 21:50:31 -07:00
Timothy J. Baek
076c54c486 refac 2024-10-25 21:47:47 -07:00
Timothy J. Baek
780591e991 refac 2024-10-25 21:46:14 -07:00
Timothy J. Baek
50dcad0f73 fix: tiktoken encoding model issue 2024-10-25 21:38:28 -07:00
Timothy J. Baek
adede5480d enh: rich text input toggle option 2024-10-25 21:31:18 -07:00
Timothy J. Baek
8b61b39c75 enh: feedback exports 2024-10-25 21:17:47 -07:00
Timothy J. Baek
58d929fd65 enh: lazy load embedding model for leaderboard 2024-10-25 21:07:16 -07:00
Timothy Jaeryang Baek
04babeb45a Merge pull request #6424 from Peter-De-Ath/add-user-name-slash-prompt
feat: add user_name to slash prompt template
2024-10-25 18:20:27 -07:00
Peter De-Ath
5c3c00f9fb add user_name slash prompt template 2024-10-26 00:37:38 +01:00
Timothy Jaeryang Baek
3df1ee9954 Merge pull request #6423 from Peter-De-Ath/fix-chat-rename-firefox
fix: folder rename not save on enter - firefox
2024-10-25 15:21:09 -07:00
Peter De-Ath
b0e83ccea0 Merge remote-tracking branch 'personal/fix-chat-rename-firefox' into dev 2024-10-25 23:14:14 +01:00
Peter De-Ath
40764d91cf fix: folders not renamed on enter key 2024-10-25 22:54:12 +01:00
Timothy J. Baek
37853d6a26 enh: more robust tool calling 2024-10-25 14:36:44 -07:00
Timothy J. Baek
0b38584e52 refac: rich text input paste behaviour 2024-10-25 11:51:49 -07:00
Timothy Jaeryang Baek
af3456511b Merge pull request #6409 from MarcRevo/nl-translations-mb
i18n: Update Dutch Translation nl-NL
2024-10-25 11:15:13 -07:00
Timothy Jaeryang Baek
9b030f6ad6 Merge pull request #6392 from nodomain/patch-1
fix: boolean values don't need to be accessed by .value
2024-10-25 11:12:53 -07:00
Timothy Jaeryang Baek
ad952b9394 Merge pull request #6399 from Natedorr/main
Update api/chat stream to default to true
2024-10-25 11:12:29 -07:00
MarcRevo
a1469cae59 Add: i18n Dutch translations 2024-10-25 19:50:51 +02:00
MarcRevo
bbc98259a5 Add: nl-NL Translations 2024-10-25 19:45:46 +02:00
MarcRevo
44433929e7 Modify and Add Dutch translations 2024-10-25 19:33:05 +02:00
Nate.Dorr
b4acf689e3 update the GenerateChatCompletionForm stream to be defaulted to true.
This defaults the /api/chat/ endpoint to default to streaming being true
2024-10-25 08:00:37 -05:00
Fabian Fischer
23461332b9 fix: boolean values don't need to be accessed by .value 2024-10-25 09:44:03 +02:00
Timothy J. Baek
46a97e62c7 fix: tags custom prompt issue 2024-10-25 00:05:04 -07:00
Timothy J. Baek
d905bda000 refac: template notes 2024-10-24 16:46:35 -07:00
Timothy Jaeryang Baek
144dc0ed2f Merge pull request #6383 from open-webui/dev
refac
2024-10-24 15:04:36 -07:00
Timothy J. Baek
1472f12f5e refac 2024-10-24 15:02:26 -07:00
Timothy Jaeryang Baek
68916f7ec4 Merge pull request #6382 from open-webui/dev
fix
2024-10-24 14:57:25 -07:00
Timothy J. Baek
4282b20495 fix 2024-10-24 14:53:14 -07:00
Timothy Jaeryang Baek
9b12b75df6 Merge pull request #6380 from open-webui/dev
fix: arena model exclude filter
2024-10-24 14:23:26 -07:00
Timothy J. Baek
856c00bc2f fix: arena model exclude filter 2024-10-24 14:22:04 -07:00
Timothy Jaeryang Baek
99dd7fb5a8 Merge pull request #6002 from open-webui/dev
0.3.33
2024-10-24 13:36:19 -07:00
Timothy J. Baek
e9e49babf8 enh: remove token cookie on signout 2024-10-24 13:35:29 -07:00
Timothy J. Baek
6b620d93a9 refac 2024-10-24 03:13:35 -07:00
Timothy J. Baek
c5d974606f refac 2024-10-24 03:10:17 -07:00
Timothy J. Baek
587dab23f0 fix 2024-10-24 02:35:17 -07:00
Timothy J. Baek
a4f29e1e55 chore: format 2024-10-24 02:26:52 -07:00
Timothy J. Baek
205402e096 refac 2024-10-24 01:01:00 -07:00
Timothy J. Baek
42a58da487 refac 2024-10-24 00:56:24 -07:00
Timothy J. Baek
d160d0351f refac 2024-10-24 00:48:34 -07:00
Timothy J. Baek
744139d2ce refac 2024-10-24 00:35:27 -07:00
Timothy J. Baek
a28ef8acc5 refac 2024-10-24 00:34:44 -07:00
Timothy J. Baek
9c2d592c73 enh: include message_turn metadata 2024-10-24 00:23:31 -07:00
Timothy J. Baek
160e63e509 refac: feedback history share support 2024-10-24 00:00:49 -07:00
Timothy J. Baek
056950b4f9 enh: leaderboard notice 2024-10-23 23:07:44 -07:00
Timothy J. Baek
d7151fe6fa refac: similarity operation 2024-10-23 22:38:58 -07:00
Timothy J. Baek
cde33002c7 feat: topic leaderboard 2024-10-23 22:35:12 -07:00
Timothy J. Baek
0f4b6cdb67 refac 2024-10-23 20:49:18 -07:00
Timothy J. Baek
d0662e2518 refac: do not use arena model for tasks 2024-10-23 20:33:08 -07:00
Timothy J. Baek
ec37d801be refac: feedback optimisation 2024-10-23 20:27:32 -07:00
Timothy J. Baek
b5d7e57d3c refac 2024-10-23 20:19:42 -07:00
Timothy J. Baek
076f9fd9c0 enh: auto tag feedback 2024-10-23 20:18:51 -07:00
Timothy J. Baek
73ab84efe6 fix: leaderboard
Co-Authored-By: silentoplayz <50341825+silentoplayz@users.noreply.github.com>
2024-10-23 18:54:49 -07:00
Timothy J. Baek
0c6e9e3e86 refac: rating 2024-10-23 16:59:54 -07:00
Timothy J. Baek
c1a054de4a fix 2024-10-23 15:35:40 -07:00
Timothy J. Baek
51265b4683 refac 2024-10-23 15:33:13 -07:00
Timothy J. Baek
d4c42dcfa9 fix 2024-10-23 15:09:20 -07:00
Timothy J. Baek
d85480b4d6 fix: bypass_filter for arena models 2024-10-23 15:05:43 -07:00
Timothy J. Baek
ee2f8d3552 fix: folder migration 2024-10-23 14:58:28 -07:00
Timothy J. Baek
0e56ef20cb fix: selectedModels 2024-10-23 14:51:25 -07:00
Timothy J. Baek
b16c4bc1df refac 2024-10-23 12:41:41 -07:00
Timothy J. Baek
68a47f6a9f enh: arena model filter 2024-10-23 12:40:47 -07:00
Timothy J. Baek
affb0e5c37 refac 2024-10-23 12:33:00 -07:00
Timothy Jaeryang Baek
15c3bdf7af Merge pull request #6361 from KarlLee830/translate
i18n: Update Chinese translation
2024-10-23 10:03:45 -07:00
KarlLee830
42914a162f i18n: Update Chinese translation 2024-10-23 21:46:28 +08:00
Timothy Jaeryang Baek
928a5e747c Merge pull request #6358 from OriginalSimon/dev
18n: Update Ukrainian translation
2024-10-23 05:04:48 -07:00
Simon
a494ef8a99 Update translation.json 2024-10-23 13:50:56 +02:00
Timothy J. Baek
8d2089e5b8 refac: styling 2024-10-23 02:17:10 -07:00
Timothy J. Baek
4557f4d165 chore: version bump 2024-10-23 02:15:11 -07:00
Timothy J. Baek
b9af35be4c refac 2024-10-23 01:48:26 -07:00
Timothy J. Baek
a41a5cc0c8 refac 2024-10-23 01:27:32 -07:00
Timothy J. Baek
4a1bf6d6c4 refac 2024-10-23 01:23:49 -07:00
Timothy J. Baek
0d924a1cba enh: feedback delete support 2024-10-23 01:05:45 -07:00
Timothy J. Baek
01651ee0a6 enh: feedback history pagination 2024-10-23 00:51:27 -07:00
Timothy J. Baek
3531e009ce chore: format 2024-10-23 00:42:13 -07:00
Timothy Jaeryang Baek
6edbbde2eb Merge pull request #6348 from MadsLang/main
Adding Danish language
2024-10-23 00:39:31 -07:00
Timothy J. Baek
8514ed148a refac: show changelog behaviour 2024-10-23 00:38:59 -07:00
Timothy J. Baek
2897c25b99 refac 2024-10-22 23:55:36 -07:00
Timothy J. Baek
58261a7b83 refac: styling 2024-10-22 23:54:37 -07:00
Timothy Jaeryang Baek
40d5082b9f Merge pull request #6345 from open-webui/leaderboard
feat: leaderboard
2024-10-22 23:45:16 -07:00
Timothy J. Baek
6536c5b7f7 enh: leaderboard percentage 2024-10-22 23:44:13 -07:00
Timothy J. Baek
139136e700 refac: styling 2024-10-22 23:31:51 -07:00
Timothy J. Baek
5101b440a8 refac: styling 2024-10-22 23:28:41 -07:00
Timothy J. Baek
75980010a9 refac: styling 2024-10-22 23:27:07 -07:00
Timothy J. Baek
f6893edcc2 feat: leaderboard rating 2024-10-22 23:24:49 -07:00
Timothy J. Baek
ce85400817 refac: feedback 2024-10-22 22:55:34 -07:00
Timothy J. Baek
bc95e62600 feat: leaderboard 2024-10-22 20:14:10 -07:00
Timothy J. Baek
4c691c0edb refac: rich text input behaviour 2024-10-22 18:34:07 -07:00
Timothy J. Baek
5499b5acc8 enh: arena models toggle tooltip
Co-Authored-By: silentoplayz <50341825+silentoplayz@users.noreply.github.com>
2024-10-22 18:28:08 -07:00
Timothy J. Baek
0a765744b8 refac 2024-10-22 18:12:08 -07:00
Timothy J. Baek
00e9362c2c enh: arena model rate to reveal 2024-10-22 18:05:30 -07:00
Timothy J. Baek
6d52f913d2 enh: arena model send selected model id 2024-10-22 17:43:39 -07:00
Timothy J. Baek
2d99f275a3 refac: multi response scroll behaviour 2024-10-22 17:34:53 -07:00
Timothy Jaeryang Baek
170ec2f9d0 Merge pull request #6339 from Cyb4Black/fix-not-rely-on-id-token-for-user-info
fix: get userinfo from endpoint, not only from token
2024-10-22 13:36:30 -07:00
Willnow, Patrick
1b5ac834ef fix: get userinfo from endpoint, not only from token
as was suggested by @alvarolopez in #6262
2024-10-22 21:55:12 +02:00
Timothy Jaeryang Baek
c57ef980fb Merge pull request #6337 from open-webui/dependabot/npm_and_yarn/npm_and_yarn-dd9e89fd33
build(deps): bump mermaid from 10.9.1 to 10.9.3 in the npm_and_yarn group across 1 directory
2024-10-22 12:30:31 -07:00
Timothy J. Baek
04b324996c fix 2024-10-22 12:05:48 -07:00
Timothy J. Baek
b31d314638 refac 2024-10-22 12:04:45 -07:00
Timothy J. Baek
424062d75f fix: emoji generation 2024-10-22 11:23:38 -07:00
dependabot[bot]
00b2038efb build(deps): bump mermaid in the npm_and_yarn group across 1 directory
Bumps the npm_and_yarn group with 1 update in the / directory: [mermaid](https://github.com/mermaid-js/mermaid).


Updates `mermaid` from 10.9.1 to 10.9.3
- [Release notes](https://github.com/mermaid-js/mermaid/releases)
- [Changelog](https://github.com/mermaid-js/mermaid/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/mermaid-js/mermaid/compare/v10.9.1...v10.9.3)

---
updated-dependencies:
- dependency-name: mermaid
  dependency-type: direct:production
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-22 18:23:33 +00:00
Timothy J. Baek
24e7ae8767 refac: multi response styling 2024-10-22 03:46:24 -07:00
Timothy J. Baek
8d38af8ddd refac 2024-10-22 03:44:54 -07:00
Timothy J. Baek
a0692a434d refac 2024-10-22 03:40:03 -07:00
Timothy J. Baek
a89d29db9c fix 2024-10-22 03:38:28 -07:00
Timothy Jaeryang Baek
b759f488b4 Merge pull request #6324 from RocketRider/patch-2
feat: Allow URL in citations to be different from the displayed name
2024-10-22 03:27:49 -07:00
Timothy Jaeryang Baek
645657e307 Merge pull request #6327 from aleixdorca/dev
i18n: Update catalan translation.json
2024-10-22 03:27:23 -07:00
Timothy J. Baek
3c8944cb12 refac 2024-10-22 03:22:45 -07:00
Timothy J. Baek
9f285fb2fb feat: arena models 2024-10-22 03:16:48 -07:00
MadsLang
8497db9f43 added Danish language 2024-10-22 11:57:28 +02:00
Aleix Dorca
ac09d59a3f Update translation.json 2024-10-22 11:17:06 +02:00
Timothy J. Baek
ee16177924 refac: playground styling 2024-10-21 21:50:34 -07:00
Michael Möbius
9153525c84 use url if available as document link 2024-10-22 06:35:01 +02:00
Timothy J. Baek
a7aa669038 refac: styling 2024-10-21 21:32:45 -07:00
Michael Möbius
41bd16acbe don't overwrite name, keep url separate 2024-10-22 06:32:08 +02:00
Timothy J. Baek
ae44445464 refac: styling 2024-10-21 16:10:29 -07:00
Timothy J. Baek
09f7cdc272 fix 2024-10-21 15:43:15 -07:00
Timothy J. Baek
b11c48ac16 refac: playground 2024-10-21 15:37:50 -07:00
Timothy J. Baek
e0b7d95429 refac 2024-10-21 15:30:30 -07:00
Timothy J. Baek
c03cccfd14 refac: playground 2024-10-21 15:24:59 -07:00
Timothy Jaeryang Baek
39e3afd55d Merge pull request #6309 from OriginalSimon/dev
18n: Update Ukrainian translation
2024-10-21 13:58:59 -07:00
Timothy J. Baek
fc71f441c4 refac 2024-10-21 13:45:28 -07:00
Simon
117bdfcb70 Update translation.json 2024-10-21 15:02:14 +02:00
Timothy J. Baek
3dd10f2ca0 refac: playground 2024-10-21 05:09:28 -07:00
Timothy J. Baek
e2d4a69750 refac: title generation 2024-10-21 04:24:17 -07:00
Timothy J. Baek
24885a2e38 refac 2024-10-21 04:14:49 -07:00
Timothy J. Baek
b4e73c7f19 refac: convert_payload_openai_to_ollama 2024-10-21 04:10:28 -07:00
Timothy J. Baek
f99facf383 fix: message input issue 2024-10-21 03:17:30 -07:00
Timothy J. Baek
d105be9ca2 refac: styling 2024-10-21 02:02:33 -07:00
Timothy J. Baek
e1baa9cc3f refac 2024-10-21 02:00:22 -07:00
Timothy J. Baek
ec17bbc867 refac: styling 2024-10-21 01:57:19 -07:00
Timothy J. Baek
f1b0d7eb41 refac: styling 2024-10-21 01:54:43 -07:00
Timothy J. Baek
fc6dc43a19 refac: tagging behaviour 2024-10-21 01:30:22 -07:00
Timothy J. Baek
8d71323009 refac: model workspace styling 2024-10-21 00:50:08 -07:00
Timothy J. Baek
ded22b3204 refac: do not check for empty keys 2024-10-21 00:40:01 -07:00
Timothy J. Baek
e3b1b717be refac: styling 2024-10-21 00:35:51 -07:00
Timothy J. Baek
2bb82f258a refac: styling 2024-10-21 00:33:21 -07:00
Timothy J. Baek
6cb41a38a6 enh: option to disable update toast 2024-10-21 00:30:29 -07:00
Timothy J. Baek
47e377967e refac: styling 2024-10-21 00:05:27 -07:00
Timothy J. Baek
f27c0f7dcf refac: styling 2024-10-20 23:53:36 -07:00
Timothy J. Baek
cd8271eb95 fix 2024-10-20 23:48:28 -07:00
Timothy J. Baek
e43e91edd3 refac 2024-10-20 23:45:15 -07:00
Timothy J. Baek
7984980619 feat: s3 support 2024-10-20 23:38:26 -07:00
Timothy J. Baek
cb86e09005 feat: s3 support (cherry-picked from #6117)
Co-Authored-By: ssnnow <ssnnow@gmail.com>
2024-10-20 22:53:45 -07:00
Timothy J. Baek
822024f44e refac: artifacts panel behaviour 2024-10-20 22:04:21 -07:00
Timothy J. Baek
f02ef01e0c refac: wording 2024-10-20 21:43:19 -07:00
Timothy J. Baek
d5c1c2f0a7 enh: faster whisper custom model support 2024-10-20 21:34:36 -07:00
Timothy J. Baek
145a7bbda5 refac: wording 2024-10-20 20:43:10 -07:00
Timothy Jaeryang Baek
de1e29eed0 Merge pull request #6109 from JoeyShapiro/dev
fix: disallow empty files
2024-10-20 20:41:56 -07:00
Timothy J. Baek
438b277be0 refac: styling 2024-10-20 19:04:30 -07:00
Timothy J. Baek
2f5c65bd1f refac: styling 2024-10-20 18:54:08 -07:00
Timothy J. Baek
4b357a7b62 refac: styling 2024-10-20 18:49:30 -07:00
Timothy J. Baek
3f598ee5c9 chore: format 2024-10-20 18:42:34 -07:00
Timothy Jaeryang Baek
c023afac8c Merge pull request #6238 from Cyb4Black/dev
feat: oauth based role management
2024-10-20 18:40:21 -07:00
Timothy J. Baek
9936583477 chore: format 2024-10-20 18:38:06 -07:00
Timothy Jaeryang Baek
768b7e139c Merge branch 'dev' into dev 2024-10-20 18:37:20 -07:00
Timothy J. Baek
b529212a2d refac: styling 2024-10-20 18:35:19 -07:00
Timothy J. Baek
b38ed4221a refac: styling 2024-10-20 18:31:24 -07:00
Timothy J. Baek
254c6ca709 refac: tools & functions styling 2024-10-20 18:24:50 -07:00
Timothy J. Baek
e378f70f34 refac: tag restoration 2024-10-20 18:04:46 -07:00
Timothy J. Baek
d23252b8a9 enh: restore tags from chat import 2024-10-20 18:02:41 -07:00
Timothy J. Baek
30eb43f5b8 fix 2024-10-20 17:50:30 -07:00
Timothy J. Baek
4d46bfe03b refac: file table migration 2024-10-20 17:45:37 -07:00
Timothy J. Baek
c5787a2b55 refac: placeholder 2024-10-20 17:44:57 -07:00
Timothy J. Baek
67647c8747 refac 2024-10-20 14:45:47 -07:00
Patrick Willnow
d14443a4ba Update Dockerfile
Removed as requested in PR
2024-10-20 14:44:31 +02:00
Timothy J. Baek
da9a6c1078 refac: styling 2024-10-20 02:10:15 -07:00
Timothy J. Baek
e8591b57b4 enh: allow file download from collection view 2024-10-20 01:58:27 -07:00
Timothy Jaeryang Baek
15cbb66e5e Merge pull request #6292 from KarlLee830/translate
i18n: Update Chinese translation
2024-10-20 01:57:59 -07:00
Timothy J. Baek
05c18cd664 enh: voice input support for knowledge text content 2024-10-20 01:49:44 -07:00
Timothy J. Baek
b9b670fcfb refac: styling 2024-10-20 01:24:31 -07:00
Timothy J. Baek
a0b58e244e refac: styling 2024-10-20 01:22:20 -07:00
Timothy J. Baek
875e75b8c2 refac 2024-10-20 01:20:27 -07:00
KarlLee830
a850a60a23 i18n: Update Chinese translation 2024-10-20 16:14:15 +08:00
KarlLee830
8102bdbed1 i18n: Update Chinese translation 2024-10-20 16:12:27 +08:00
Timothy J. Baek
97b6fb4766 refac: styling 2024-10-20 00:56:01 -07:00
Timothy J. Baek
146a9d7f05 refac 2024-10-20 00:51:01 -07:00
Timothy J. Baek
c5952d62ad refac 2024-10-20 00:47:43 -07:00
Timothy J. Baek
a922f4b2e7 refac 2024-10-20 00:42:45 -07:00
Timothy J. Baek
03282da45c refac: collection styling 2024-10-20 00:36:43 -07:00
Timothy J. Baek
e8c629a2e2 refac: styling 2024-10-19 23:17:47 -07:00
Timothy J. Baek
e530914328 enh: custom tags generation prompt support 2024-10-19 21:27:10 -07:00
Timothy J. Baek
7476bcaa2b enh: filter by untagged chat 2024-10-19 21:16:59 -07:00
Timothy J. Baek
86999157de refac: disable 'none' tag 2024-10-19 21:04:56 -07:00
Timothy J. Baek
54b843c367 refac 2024-10-19 20:58:19 -07:00
Timothy J. Baek
8330fcdb5c refac 2024-10-19 20:47:30 -07:00
Timothy J. Baek
d795940ced feat: chat auto tag 2024-10-19 20:34:17 -07:00
Timothy J. Baek
2db0f58dcb refac: user message edit 2024-10-19 18:42:26 -07:00
Timothy J. Baek
3069452210 refac 2024-10-19 17:55:57 -07:00
Timothy J. Baek
7ce51f2b4c refac 2024-10-19 17:49:28 -07:00
Timothy J. Baek
335b6b6c7a refac 2024-10-19 17:29:58 -07:00
Timothy J. Baek
953a8285f7 refac 2024-10-19 16:18:14 -07:00
Timothy J. Baek
73b33c3781 fix: rich text input width styling 2024-10-19 15:03:20 -07:00
Timothy J. Baek
60dd3230ae fix: rich input space behaviour 2024-10-19 14:56:30 -07:00
Timothy J. Baek
3436523b79 fix: input commands 2024-10-19 13:40:20 -07:00
Timothy J. Baek
211c41843c fix: sidebar search 2024-10-19 13:28:27 -07:00
Timothy J. Baek
e252ca1dc4 refac: rich text input styling 2024-10-19 03:15:40 -07:00
Timothy J. Baek
6d25d23326 refac: styling 2024-10-19 03:04:12 -07:00
Timothy J. Baek
82edd0e3d9 refac: hide pipelines save button if not present 2024-10-19 02:53:50 -07:00
Timothy J. Baek
f6e7af346e refac: unescape rich text input 2024-10-19 02:50:49 -07:00
Timothy J. Baek
7d322a7238 enh: folder export 2024-10-19 02:42:12 -07:00
Timothy J. Baek
3c1afa97af refac: styling 2024-10-19 02:23:10 -07:00
Timothy J. Baek
545f2a0fe2 enh: hide made by community 2024-10-19 02:12:34 -07:00
Timothy J. Baek
e153108b51 refac 2024-10-19 01:45:17 -07:00
Timothy J. Baek
971e54d7b4 refac: selector styling 2024-10-19 01:44:45 -07:00
Timothy J. Baek
c993cc5515 refac: styling 2024-10-19 01:42:07 -07:00
Timothy J. Baek
fb84fc8e77 refac: selector styling 2024-10-19 01:34:03 -07:00
Timothy J. Baek
ce917eba81 enh: model url search param 2024-10-19 01:30:49 -07:00
Timothy J. Baek
81f62d5bff refac 2024-10-19 01:07:30 -07:00
Timothy J. Baek
0556479cbe enh: ctrl+shift+delete chat delete support 2024-10-19 01:06:30 -07:00
Timothy J. Baek
99f70cac8b fix: model w/ custom name delete issue 2024-10-19 00:50:00 -07:00
Timothy J. Baek
94c4aa8ddb refac: styling 2024-10-19 00:48:16 -07:00
Timothy J. Baek
ca6a624534 refac: styling 2024-10-19 00:45:29 -07:00
Timothy J. Baek
28d6425f87 refac: styling 2024-10-19 00:41:58 -07:00
Timothy J. Baek
6b43cc97d2 chore: format 2024-10-19 00:37:21 -07:00
Timothy J. Baek
6c0d3ce736 refac: tab text variable select 2024-10-19 00:23:59 -07:00
Timothy J. Baek
0107a70343 refac: styling 2024-10-18 23:54:41 -07:00
Timothy J. Baek
f46b95300b feat: rich text input for chat 2024-10-18 23:54:35 -07:00
Timothy J. Baek
5e96922eba refac: styling 2024-10-18 22:56:04 -07:00
Timothy J. Baek
a3728e6957 refac 2024-10-18 22:40:15 -07:00
Timothy J. Baek
353dc83542 enh: rich text input space behaviour 2024-10-18 22:16:18 -07:00
Timothy Jaeryang Baek
2fc8fa1869 Merge pull request #6274 from open-webui/main
dev
2024-10-18 21:33:54 -07:00
Timothy Jaeryang Baek
c2d1a3164e Merge pull request #6261 from monotykamary/main
fix: default to False if stream is unavailable
2024-10-18 21:33:38 -07:00
Timothy J. Baek
79cb9383d9 refac 2024-10-18 21:30:55 -07:00
Timothy J. Baek
670441f548 feat: rich text input 2024-10-18 14:55:39 -07:00
Timothy J. Baek
988a5e2b8d refac: folder/pinned behaviour 2024-10-18 14:18:13 -07:00
Timothy J. Baek
8648a330f2 refac 2024-10-18 14:11:13 -07:00
Timothy J. Baek
cad31f6f2b fix 2024-10-18 14:08:43 -07:00
Timothy Jaeryang Baek
8ce5c2eaf0 Merge pull request #6263 from aleixdorca/dev
i18n: Update catalan translation
2024-10-18 14:06:42 -07:00
Aleix Dorca
001788b6e4 Minor Update to translation.json 2024-10-18 12:35:38 +02:00
Aleix Dorca
f0fbc586c8 Update catalan translation.json 2024-10-18 12:33:29 +02:00
Tom X Nguyen
11588af34c fix: default to False if stream is unavailable 2024-10-18 11:33:08 +07:00
Timothy J. Baek
2962aa9f06 fix 2024-10-17 20:29:31 -07:00
Timothy J. Baek
f821de9470 enh: drag and drop import to folders 2024-10-17 20:13:28 -07:00
Timothy J. Baek
590dc0895f refac 2024-10-17 19:46:37 -07:00
Timothy J. Baek
e6f4da2bfc refac 2024-10-17 19:45:18 -07:00
Timothy J. Baek
c171e624eb enh: export chat from chat item 2024-10-17 19:30:20 -07:00
Timothy J. Baek
b877bc0086 enh: folder delete confirmation
Co-Authored-By: silentoplayz <50341825+silentoplayz@users.noreply.github.com>
2024-10-17 19:19:26 -07:00
Timothy J. Baek
351c29917b refac 2024-10-17 19:09:01 -07:00
Timothy J. Baek
6e4820cad8 refac 2024-10-17 18:42:36 -07:00
Timothy J. Baek
7ffa3cb022 refac: folder deletion 2024-10-17 18:24:58 -07:00
Timothy J. Baek
42d048741c fix: disable file item click during upload 2024-10-17 18:15:59 -07:00
Timothy J. Baek
dff9254e34 chore: format 2024-10-17 13:30:21 -07:00
Timothy Jaeryang Baek
e6fea74b60 Merge pull request #5989 from jannikstdl/dev
enh: citations show relevance score - compact citation view
2024-10-17 13:26:20 -07:00
Timothy Jaeryang Baek
c9c79852a5 Merge branch 'dev' into dev 2024-10-17 13:25:39 -07:00
Timothy J. Baek
186923210b refac: styling 2024-10-17 13:17:37 -07:00
Timothy J. Baek
6336d34b59 fix: web attachment issue 2024-10-17 13:08:10 -07:00
Timothy J. Baek
f54ab7e551 fix 2024-10-17 00:55:53 -07:00
Timothy J. Baek
4dcbf1af07 enh: share rating to community 2024-10-17 00:51:46 -07:00
Timothy J. Baek
86adcf33b0 refac: styling 2024-10-17 00:33:53 -07:00
Timothy Jaeryang Baek
87d2738864 Merge pull request #6247 from open-webui/folders
feat: folders
2024-10-17 00:18:18 -07:00
Timothy J. Baek
3578c85e39 feat: folder menu 2024-10-17 00:17:50 -07:00
Timothy J. Baek
b402061546 enh: open folder on drop 2024-10-16 23:50:06 -07:00
Timothy J. Baek
d8b513023c feat: chat folder drag and drop support 2024-10-16 23:45:50 -07:00
Timothy J. Baek
36a541d6b0 enh: drag and drop folders 2024-10-16 23:06:53 -07:00
Timothy J. Baek
d5bf32f240 enh: save isExpanded state 2024-10-16 22:58:28 -07:00
Timothy J. Baek
e421be5759 refac: ui optimisation 2024-10-16 22:41:16 -07:00
Timothy J. Baek
29c39d44e1 fix: collapsible space toggle issue 2024-10-16 22:36:44 -07:00
Timothy J. Baek
7b97d7a718 enh: disable drag event listener if parent dragged 2024-10-16 22:04:21 -07:00
Timothy J. Baek
9df9f4a990 refac 2024-10-16 21:55:25 -07:00
Timothy J. Baek
dea12360f4 refac: folder id -> uuid 2024-10-16 21:49:22 -07:00
Timothy J. Baek
a942c30ca8 feat: folder ui 2024-10-16 21:05:03 -07:00
Timothy J. Baek
ede71740d2 feat: folders table 2024-10-16 15:13:38 -07:00
Patrick Willnow
8e807bcf8a Merge branch 'open-webui:dev' into dev 2024-10-16 21:43:30 +02:00
Willnow, Patrick
ea070e34f9 Remove pending from allowed roles 2024-10-16 21:41:47 +02:00
Timothy Jaeryang Baek
de442792ca Merge pull request #6235 from tklk-forks/add-python-dep
chore: add googleapis-common-protos dep
2024-10-16 12:13:21 -07:00
Willnow, Patrick
9ad07ad0ce Add WEBUI_SESSION_COOKIE-settings missing from merge conflict 2024-10-16 20:30:35 +02:00
Willnow, Patrick
b888ee17ff Merge branch 'main' into dev
# Conflicts:
#	backend/open_webui/main.py
2024-10-16 20:16:05 +02:00
techknowlogick
e6802c7e98 chore: add googleapis-common-protos dep 2024-10-16 13:38:48 -04:00
Willnow, Patrick
b1554be3f2 Fix imports 2024-10-16 16:58:03 +02:00
Willnow, Patrick
57d54160d3 Merge branch 'implement-oauth-role-management'
# Conflicts:
#	backend/open_webui/main.py
2024-10-16 16:54:43 +02:00
Willnow, Patrick
8eebd6bce1 Finish reorganizing oauth code 2024-10-16 16:32:57 +02:00
Timothy J. Baek
c797c2e18b refac 2024-10-16 03:35:26 -07:00
Timothy J. Baek
dedb26fd5c feat: folders db migration 2024-10-16 02:53:16 -07:00
Willnow, Patrick
08ff494754 WIP
- refactoring oauth functions to enable refresh functionality
2024-10-16 09:42:47 +02:00
Timothy J. Baek
eef9045dcc chore: format 2024-10-15 09:22:03 -07:00
Timothy Jaeryang Baek
2f2af94d73 Merge pull request #6194 from OriginalSimon/dev
18n: Update Ukrainian translation
2024-10-15 09:17:41 -07:00
Simon
2af9727bd3 Merge branch 'open-webui:dev' into dev 2024-10-15 14:17:30 +02:00
Simon
b5f46023d4 Update translation.json 2024-10-15 14:17:09 +02:00
Timothy J. Baek
0131afe667 refac: styling 2024-10-15 05:12:56 -07:00
Timothy J. Baek
69d0472898 refac: styling 2024-10-15 05:00:36 -07:00
Timothy J. Baek
86c961e342 fix 2024-10-15 03:30:02 -07:00
Timothy J. Baek
bf0043881a refac 2024-10-15 03:11:03 -07:00
Timothy J. Baek
98ba3f8428 refac: styling 2024-10-15 03:02:56 -07:00
Timothy J. Baek
24f149f686 refac: pinned chat behaviour 2024-10-15 02:52:56 -07:00
Timothy J. Baek
b4cd503a02 refac 2024-10-15 02:51:08 -07:00
Timothy J. Baek
97bb9d41a6 refac 2024-10-15 02:48:41 -07:00
Timothy J. Baek
2f4c04055c enh: drag and drop chat to pin 2024-10-15 02:12:39 -07:00
Timothy J. Baek
b01f9e8ec3 refac: folder 2024-10-15 00:35:14 -07:00
Timothy J. Baek
73a251fc49 enh: drag ghost 2024-10-14 23:55:50 -07:00
Timothy J. Baek
cf24a65caa fix: duplicate tags 2024-10-14 23:04:10 -07:00
Timothy J. Baek
9d2d53bfb5 fix 2024-10-14 22:59:17 -07:00
Timothy J. Baek
6703cacb99 fix: tag unarchive/archive issue 2024-10-14 22:57:11 -07:00
Timothy J. Baek
d8a30bd6ae refac: sidebar tag add behaviour 2024-10-14 21:21:45 -07:00
Timothy J. Baek
4c7651c113 refac: pinned collapsible styling 2024-10-14 21:15:36 -07:00
Timothy J. Baek
2afc5f3339 refac 2024-10-14 21:10:04 -07:00
Timothy J. Baek
93dab86e8d refac: dragged overlay behaviour to only activate for files 2024-10-14 21:03:55 -07:00
Timothy J. Baek
f8bb77324d refac: styling 2024-10-14 20:36:16 -07:00
Timothy J. Baek
29e8e2d938 refac: rating submit -> save 2024-10-14 20:35:06 -07:00
Timothy J. Baek
90b7754cd6 refac: collapsible pinned chat list 2024-10-14 19:33:32 -07:00
Timothy J. Baek
bc75870289 fix: tag search 2024-10-14 19:02:08 -07:00
Timothy J. Baek
effa77379e refac 2024-10-14 18:53:29 -07:00
Timothy J. Baek
8eb45acf10 refac 2024-10-14 18:47:41 -07:00
Timothy J. Baek
1db1ef7c26 refac: tag search 2024-10-14 17:31:52 -07:00
Timothy J. Baek
0b2c7046cd fix: archived chats 2024-10-14 15:29:43 -07:00
Timothy J. Baek
466eea1a4c fix: voice note mic not stopping issue 2024-10-14 14:53:01 -07:00
Timothy J. Baek
f0179270e2 fix: tag migration 2024-10-14 13:45:09 -07:00
Timothy J. Baek
86bc3023b3 refac: styling 2024-10-14 12:52:20 -07:00
Timothy J. Baek
6f07afc79b refac: styling 2024-10-14 12:46:05 -07:00
Timothy Jaeryang Baek
7a0933a72f Merge pull request #6182 from aleixdorca/dev
i18n: Update catalan translation.json
2024-10-14 12:34:30 -07:00
Aleix Dorca
c5921dea58 Update catalan translation.json 2024-10-14 11:38:33 +02:00
Jannik Streidl
79c834d0e4 fix: do not show relevances it you have mixed collections (cosine + l2) 2024-10-14 11:18:13 +02:00
Jannik Streidl
33c3dbd9fa fix 2024-10-14 10:37:54 +02:00
Jannik Streidl
f0f4de59eb Merge branch 'upstream-dev' into dev 2024-10-14 09:50:40 +02:00
Timothy Jaeryang Baek
6233494ed1 Merge pull request #6179 from shirayu/fix_typos
fix: Fix typos
2024-10-14 00:29:59 -07:00
Timothy J. Baek
dce91a8557 fix: custom model action button issue 2024-10-14 00:28:21 -07:00
Yuta Hayashibe
12516c8a45 fix: Fix typos 2024-10-14 16:22:07 +09:00
Timothy J. Baek
1294ba9d61 refac: styling 2024-10-13 23:53:53 -07:00
Timothy J. Baek
ee079df8ed refac: code execution styling 2024-10-13 23:49:32 -07:00
Timothy J. Baek
e0e249c1b9 refac: convention 2024-10-13 23:16:51 -07:00
Timothy J. Baek
a4a5614de5 refac 2024-10-13 23:07:32 -07:00
Timothy J. Baek
55f14e37ea refac: code_execution.uuid -> id
convention
2024-10-13 23:04:04 -07:00
Timothy Jaeryang Baek
adb1bfcaa8 Merge pull request #5955 from EtiennePerot/code-execution-message
feat: add code execution status to chat messages.
2024-10-13 22:58:59 -07:00
Timothy Jaeryang Baek
67885c71dc Merge pull request #6176 from luochen1990/feat-openai-model-list-timeout
add: OPENAI_MODEL_LIST_TIMEOUT
2024-10-13 22:56:59 -07:00
Timothy J. Baek
ee8b8220f0 refac: OPENAI_MODEL_LIST_TIMEOUT -> AIOHTTP_CLIENT_TIMEOUT_OPENAI_MODEL_LIST 2024-10-13 22:56:33 -07:00
LuoChen
ebec6cd426 add: OPENAI_MODEL_LIST_TIMEOUT 2024-10-14 09:00:09 +08:00
Timothy J. Baek
6f3f5ff922 refac: styling 2024-10-13 04:36:27 -07:00
Timothy Jaeryang Baek
5c45643028 Merge pull request #6160 from shirayu/improve_translation_ja-JP
i18n: Update Japanese translation
2024-10-13 04:29:56 -07:00
Timothy J. Baek
586e005f0f enh: token text splitter support 2024-10-13 04:24:13 -07:00
Yuta Hayashibe
28892fe2d7 i18n: Update Japanese translation 2024-10-13 20:18:06 +09:00
Timothy J. Baek
8a0da6d376 enh: include file name to context 2024-10-13 03:58:51 -07:00
Timothy J. Baek
797afd0b72 fix: embedding metadata issue 2024-10-13 03:25:11 -07:00
Timothy J. Baek
92605fd59f refac 2024-10-13 03:16:18 -07:00
Timothy J. Baek
5ffd216fca refac 2024-10-13 03:02:02 -07:00
Timothy J. Baek
dff3732fcd enh: tiktoken/token splitter support 2024-10-13 02:07:50 -07:00
Timothy J. Baek
8ae605ec4b fix: multi-user tags issue 2024-10-13 01:00:38 -07:00
Timothy J. Baek
5273dc4535 refac 2024-10-13 00:21:06 -07:00
Timothy J. Baek
112cbdccbb revert: pdf gen 2024-10-13 00:05:28 -07:00
Timothy J. Baek
5dc05eac67 chore: pyproject bump 2024-10-12 23:07:36 -07:00
Timothy Jaeryang Baek
9c1820f785 Merge pull request #6156 from noczero/add-pdf-generator
Feat: Enhance PDF Downloader to Export Chat
2024-10-12 22:46:50 -07:00
noczero
c41261e72b feat: PDF generator to export chat 2024-10-13 11:20:09 +07:00
Timothy J. Baek
bb97535cad refac: sentence transformers bump 2024-10-12 18:32:04 -07:00
Timothy J. Baek
333317a7ce refac: add embedding metadata 2024-10-12 18:30:21 -07:00
Etienne Perot
9fbff16a08 feat: add code execution status to chat messages.
This adds `code_executions` as an array of code execution statuses to
chat messages. The intent of this data is to be displayed in a similar
manner as citations: at the bottom of the message, with buttons that open
a modal for more info. However, code execution data doesn't fit well in
citation modals, because they fundamentally differ in their formatting.
Code execution status includes the code that was run (which benefits from
being syntax-highlighted), and the output and generated files. This
differs from citations which are just list of document names and links.

Additionally, code execution is a process, whereas citations are only
emitted once. This is why code execution data uses an ID-based approach,
where each code execution instance is identified by a unique ID and can
be updated by emitting a new `code_execution` message with the same ID.
This allows the code execution status to be updated as code runs.
2024-10-12 16:14:12 -07:00
Jannik Streidl
f47c9c69e3 Merge branch 'upstream-dev' into dev 2024-10-12 15:18:59 +02:00
Jannik Streidl
0bebc898c8 finalizing fixes & additions 2024-10-12 15:18:56 +02:00
Jannik Streidl
9d4d96429f only show relevance pertentage score if distances are in cosinus silimarity range 2024-10-12 13:51:27 +02:00
Timothy J. Baek
5c48fce382 fix: async-timeout 2024-10-12 02:42:31 -07:00
Timothy J. Baek
e576ddce67 enh: tooltip 2024-10-12 02:37:09 -07:00
Timothy J. Baek
c5b670cccd refac: styling 2024-10-12 02:32:15 -07:00
Timothy J. Baek
5a96fcbeaf enh: enable selecting individual files from collection 2024-10-12 02:31:10 -07:00
Timothy J. Baek
0a08495fec refac: styling 2024-10-12 01:27:55 -07:00
Timothy J. Baek
5837dcbfd4 refac: chat controls resize behaviour 2024-10-12 01:10:10 -07:00
Timothy J. Baek
11d7aec61d fix 2024-10-11 16:21:56 -07:00
Timothy J. Baek
30d3d28b9f refac 2024-10-11 15:37:46 -07:00
Timothy J. Baek
1cad157071 fix 2024-10-11 15:29:58 -07:00
Timothy J. Baek
428fd202c5 fix: custom comfyui prompt issue 2024-10-11 13:11:17 -07:00
Timothy Jaeryang Baek
db35ea0ae1 Merge pull request #6129 from open-webui/main
refac
2024-10-11 12:11:47 -07:00
Willnow, Patrick
1c5b6987e2 add missing env mapping 2024-10-11 14:08:11 +02:00
Timothy J. Baek
5867ebb1ee refac 2024-10-11 00:28:26 -07:00
Timothy Jaeryang Baek
11afce7895 Merge pull request #6112 from djismgaming/dev
**i18n** Spanish translation update
2024-10-11 00:14:23 -07:00
Timothy J. Baek
63d297756a enh: mermaid copy content button 2024-10-11 00:10:00 -07:00
Timothy J. Baek
ba2df1c33a refac 2024-10-11 00:00:13 -07:00
Timothy J. Baek
9658c2559a refac 2024-10-10 23:43:08 -07:00
Timothy J. Baek
acb5dcf30a refac: tags 2024-10-10 23:22:53 -07:00
Ismael
7f586f1c3d Added missing new lines on two other translations (non-Spanish) to fix some Format & Build Frontend action issues for them. 2024-10-10 22:25:56 -04:00
Ismael
b2c492ce1f Spanish translation update
Updated the new keys added and some minor fixes based on text context.
2024-10-10 21:58:11 -04:00
Timothy Jaeryang Baek
4adc57fd34 Merge pull request #6104 from Peter-De-Ath/hotfix/ollama-embed
fix: ollama embed support list[str] or str on input
2024-10-10 15:10:39 -07:00
Peter De-Ath
c748d33192 support list[str] | str as input 2024-10-10 22:41:57 +01:00
Willnow, Patrick
edc15d0d7c rewrite oauth role management logic to allow any custom roles to be used for oauth role to open webui role mapping 2024-10-10 23:00:05 +02:00
JoeyShapiro
df824db042 fix: disallow empty files 2024-10-10 15:33:27 -05:00
Timothy J. Baek
e8babe62bc refac 2024-10-10 12:51:00 -07:00
Jannik Streidl
741230bcdb fix 2024-10-10 17:20:50 +02:00
Jannik Streidl
89c77f05a8 chromadb switch to cosine similarity 2024-10-10 16:46:14 +02:00
Timothy J. Baek
ad31bd51fd refac 2024-10-09 12:36:52 -07:00
Timothy Jaeryang Baek
7e253df175 Merge pull request #6054 from jeeteshchel/bugfix/secure-cookie
fix: set token cookie secure and samesite per config
2024-10-09 12:15:19 -07:00
Timothy Jaeryang Baek
d7a71f3b34 Merge pull request #6050 from RobinBially/main
feat: add qdrant vector db connector
2024-10-09 12:12:48 -07:00
Timothy Jaeryang Baek
36c9371227 Merge pull request #6062 from KarlLee830/translate
i18n: Update Chinese translation
2024-10-09 12:11:15 -07:00
Timothy J. Baek
c157004e07 refac 2024-10-09 12:05:16 -07:00
Timothy J. Baek
451f1bae15 refac: embeddings function 2024-10-09 11:41:35 -07:00
Robin Bially
34150fc3ed add NO_LIMIT var 2024-10-09 18:34:04 +02:00
Robin Bially
54dc94317c improvements 2024-10-09 18:29:14 +02:00
KarlLee830
ce5143c535 i18n: Update Chinese translation 2024-10-09 23:14:14 +08:00
Jeetesh Chellani
a2e889c8bb fix: set oauth token secure and samesite per config 2024-10-09 14:50:48 +03:00
Robin Bially
2c59f2dcaf fix critical bug 2024-10-09 13:23:04 +02:00
Robin Bially
b56f77ed47 improvements 2024-10-09 13:10:23 +02:00
Robin Bially
b185524a8c Merge branch 'open-webui:main' into main 2024-10-09 12:52:13 +02:00
Robin Bially
878a570a2c add qdrant as vector db 2024-10-09 12:51:43 +02:00
Timothy J. Baek
b38e2fab32 enh: drag and drop chat exports 2024-10-09 00:13:54 -07:00
Timothy J. Baek
3516eea189 refac 2024-10-08 23:57:36 -07:00
Timothy J. Baek
a3f2b7045c refac: dropzone body -> chat-container 2024-10-08 23:55:38 -07:00
Timothy J. Baek
37fdb0ea2e refac: move search to backend 2024-10-08 23:37:37 -07:00
Timothy J. Baek
e66619262a refac 2024-10-08 22:34:17 -07:00
Timothy J. Baek
d7a00af576 refac: convert chat.chat to json data type 2024-10-08 22:02:48 -07:00
Timothy Jaeryang Baek
a04f22d55f Merge pull request #6044 from open-webui/main
dev
2024-10-08 20:30:00 -07:00
Timothy J. Baek
caeca9d300 refac: styling 2024-10-08 20:29:33 -07:00
Timothy J. Baek
0da0e12096 refac: file download 2024-10-08 20:16:17 -07:00
Timothy J. Baek
d48f54f7b2 enh: show both model id and hash 2024-10-08 19:32:53 -07:00
Timothy J. Baek
3391a855f0 fix 2024-10-08 17:03:42 -07:00
Timothy J. Baek
a4870f4c91 fix 2024-10-08 16:35:21 -07:00
Timothy J. Baek
7f37b9340d enh: artifacts, overview back button
Co-Authored-By: Thomas Nordentoft <60035638+nordwestt@users.noreply.github.com>
2024-10-08 15:35:35 -07:00
Timothy Jaeryang Baek
187ea38beb Merge pull request #6020 from PeterDaveHello/Update-locale-zh-TW
i18n: Update and improve zh-TW Traditional Chinese translation
2024-10-08 15:21:20 -07:00
Timothy J. Baek
07a556df55 refac: landing page styling 2024-10-08 13:45:34 -07:00
Timothy J. Baek
0feaf6f649 refac 2024-10-08 13:39:27 -07:00
Timothy J. Baek
595cf191fb chore: rm documents 2024-10-08 13:38:16 -07:00
Timothy J. Baek
dcab991d44 fix: model dump issue 2024-10-08 11:05:57 -07:00
Timothy J. Baek
457360dae7 refac 2024-10-07 22:53:36 -07:00
Timothy J. Baek
9bd5567552 enh: 'execute' event type 2024-10-07 22:50:57 -07:00
Timothy Jaeryang Baek
d2a1f4a93d Merge pull request #6005 from Kazu-zamasu/dev
Up to date ja-JP translation.
2024-10-07 22:46:27 -07:00
Kazumichi Aoki
69bf610b17 Up to date ja-JP translation. 2024-10-08 14:42:04 +09:00
Timothy Jaeryang Baek
89a29653b8 Merge pull request #6003 from saravanan30erd/dev
add offline_mode and disable version check
2024-10-07 22:18:07 -07:00
Timothy J. Baek
345090c769 chore: i18n 2024-10-07 22:14:37 -07:00
Saravanan Palanisamy
16dd352524 add offline_mode and disable version check 2024-10-08 09:13:49 +04:00
Timothy J. Baek
8c677ff7a1 chore: i18n 2024-10-07 22:13:45 -07:00
Timothy Jaeryang Baek
929e665c5e Merge pull request #5998 from KarlLee830/translate
i18n: Update Chinese translation
2024-10-07 20:14:45 -07:00
Karl Lee
4d45083b5d i18n: Update Chinese translation 2024-10-08 10:39:45 +08:00
Karl Lee
3b88ba8812 i18n: Update Chinese translation 2024-10-08 10:36:39 +08:00
Timothy J. Baek
133ff406d7 i18n: french update
Co-Authored-By: Moguiy <101116631+moblangeois@users.noreply.github.com>
2024-10-07 18:33:14 -07:00
Timothy Jaeryang Baek
d05c2f56ea Merge pull request #4715 from Peter-De-Ath/ollama-batch-embeddings
feat: support ollama batch processing embeddings
2024-10-07 18:32:08 -07:00
Timothy J. Baek
3c5b216612 fix 2024-10-07 18:26:03 -07:00
Timothy J. Baek
f099b277c8 enh: youtube watch param support 2024-10-07 18:19:13 -07:00
Timothy J. Baek
e7ae9a2107 refac 2024-10-07 17:39:06 -07:00
Peter De-Ath
b242460874 formatting 2024-10-08 00:04:35 +01:00
Peter De-Ath
3fcdca2f28 backwards comp: use RAG_EMBEDDING_OPENAI_BATCH_SIZE 2024-10-08 00:04:35 +01:00
Peter De-Ath
885b9f1ece refactor: Update GenerateEmbeddingsForm to support batch processing
refactor: Update embedding batch size handling in RAG configuration

refactor: add query_doc query caching

refactor: update logging statements in generate_chat_completion function

change embedding_batch_size to Optional
2024-10-08 00:04:35 +01:00
Timothy J. Baek
09f34a7561 refac 2024-10-07 14:57:56 -07:00
Timothy J. Baek
cf544b9e60 refac: styling 2024-10-07 14:51:41 -07:00
Timothy J. Baek
5a78f1d915 refac: collection styling 2024-10-07 14:49:26 -07:00
Timothy J. Baek
854024cdf8 refac: show chat menu in temp chat 2024-10-07 14:28:28 -07:00
Timothy Jaeryang Baek
fe872aa3fc Merge pull request #5963 from aleixdorca/dev
i18n: Update catalan translation.json
2024-10-07 14:07:26 -07:00
Timothy J. Baek
d9ccef8150 refac 2024-10-07 14:05:45 -07:00
Timothy J. Baek
958d882ff9 refac: knowledge file handling ui behaviour 2024-10-07 14:04:06 -07:00
Timothy J. Baek
48e7f47558 refac 2024-10-07 14:03:42 -07:00
Jannik Streidl
73c291193b fix: do not toggle collapsible if you click on a citation 2024-10-07 21:22:36 +02:00
Jannik Streidl
209948af6f styling 2024-10-07 21:15:10 +02:00
Jannik Streidl
9fc813cfa6 fix: only append if distances are available 2024-10-07 21:13:13 +02:00
Jannik Streidl
b105efa05f enh: append citations with distance scores 2024-10-07 21:11:04 +02:00
Jannik Streidl
86caca495b enh: show source documents vector distance + cleaner source view 2024-10-07 21:04:06 +02:00
Peter Dave Hello
4eb47716e2 i18n: Update and improve zh-TW Traditional Chinese translation 2024-10-08 01:51:50 +08:00
Timothy Jaeryang Baek
3f892583c3 Merge pull request #5965 from open-webui/dev
fix: update info toast dismiss issue
2024-10-07 08:42:55 +02:00
Timothy J. Baek
ed9fbe153b fix: update info toast dismiss issue 2024-10-06 23:41:50 -07:00
Aleix Dorca
d255f5cf8d Update catalan translation.json 2024-10-07 08:20:36 +02:00
Timothy Jaeryang Baek
ad7bc624c2 Merge pull request #5961 from open-webui/dev
refac: floating buttons
2024-10-07 07:55:39 +02:00
Timothy J. Baek
6e8e0454e4 refac: floating buttons 2024-10-06 22:55:10 -07:00
Timothy Jaeryang Baek
7cebcf064a Merge pull request #5958 from open-webui/dev
refac: floating buttons behaviour
2024-10-07 07:10:54 +02:00
Timothy J. Baek
1fc1bf5f0d refac: floating buttons behaviour 2024-10-06 22:09:58 -07:00
Timothy Jaeryang Baek
bc29d5d3c3 Merge pull request #5956 from open-webui/dev
0.3.32
2024-10-07 07:06:48 +02:00
Timothy J. Baek
fe18aebdd9 doc: changelog 2024-10-06 22:06:24 -07:00
Timothy J. Baek
57df49274c refac: tools url param handling 2024-10-06 22:00:23 -07:00
Timothy J. Baek
9193c9bd7d refac: update info url 2024-10-06 21:52:13 -07:00
Timothy J. Baek
656e75372c enh: workspace models, prompts, tools, functions count 2024-10-06 21:51:03 -07:00
Timothy J. Baek
6f9080dfe0 fix: call mode not working in landing page 2024-10-06 21:42:47 -07:00
Timothy J. Baek
86f822fd9a chore: pyproject bumps 2024-10-06 21:06:47 -07:00
Timothy Jaeryang Baek
8b3972c6df Merge pull request #5954 from open-webui/dev
refac: url param tool_ids -> tools/tool-ids
2024-10-07 05:43:56 +02:00
Timothy J. Baek
58ca5e42c2 refac: url param tool_ids -> tools/tool-ids 2024-10-06 20:41:56 -07:00
Timothy Jaeryang Baek
cd62d89dd9 Merge pull request #5953 from open-webui/dev
enh: floating buttons styling
2024-10-07 05:31:44 +02:00
Timothy J. Baek
3686cf7365 enh: esc to close floating buttons 2024-10-06 20:29:30 -07:00
Timothy J. Baek
aaa4350eb4 refac: floating buttons styling 2024-10-06 20:26:35 -07:00
Timothy Jaeryang Baek
2113c2f57f Merge pull request #5952 from open-webui/dev
fix: web, youtube attachment issue
2024-10-07 04:44:45 +02:00
Timothy J. Baek
ee22ba9676 fix: web, youtube attachment issue 2024-10-06 19:44:02 -07:00
Timothy Jaeryang Baek
466974f344 Merge pull request #5950 from open-webui/dev
refac: styling
2024-10-07 04:09:51 +02:00
Timothy J. Baek
95616e92d7 refac: styling 2024-10-06 19:09:27 -07:00
Timothy Jaeryang Baek
c8c41e07e9 Merge pull request #5744 from open-webui/dev
0.3.31
2024-10-07 03:50:06 +02:00
Timothy J. Baek
d195b83c9e doc: changelog 2024-10-06 18:48:56 -07:00
Timothy J. Baek
0bff6d38ee doc: changelog 2024-10-06 18:35:04 -07:00
Timothy J. Baek
b0bf6b5d31 doc: changelog 2024-10-06 18:29:57 -07:00
Timothy J. Baek
7abdf8e342 refac: wording 2024-10-06 18:28:41 -07:00
Timothy J. Baek
cfb7357103 doc: changelog 2024-10-06 18:27:49 -07:00
Timothy J. Baek
05c15b017d fix: milvus 2024-10-06 17:58:09 -07:00
Timothy J. Baek
c8e609c3d1 chore: format 2024-10-06 16:51:07 -07:00
Timothy J. Baek
4623fdfce2 refac: styling 2024-10-06 16:40:27 -07:00
Timothy J. Baek
1c1e6a7172 refac 2024-10-06 16:39:46 -07:00
Timothy J. Baek
297835628a refac 2024-10-06 16:32:44 -07:00
Timothy J. Baek
7b6723a955 refac: styling 2024-10-06 16:22:19 -07:00
Timothy J. Baek
a40eb87c31 refac: styling 2024-10-06 16:17:38 -07:00
Timothy J. Baek
53954e4c05 feat: ask floating button 2024-10-06 16:14:12 -07:00
Timothy J. Baek
50b1a3471c refac 2024-10-06 15:30:16 -07:00
Timothy J. Baek
dc6e68bd60 refac 2024-10-06 15:27:19 -07:00
Timothy J. Baek
da1e88a427 enh: __task_body__ param 2024-10-06 14:56:49 -07:00
Timothy J. Baek
d23f05fe0a refac 2024-10-06 14:52:12 -07:00
Timothy J. Baek
90effa925e fix 2024-10-06 13:14:35 -07:00
Timothy J. Baek
8a3c9b9a3e refac 2024-10-06 13:07:41 -07:00
Timothy J. Baek
a7f543d737 refac 2024-10-06 13:00:53 -07:00
Timothy J. Baek
4b00036dbf refac: styling 2024-10-06 12:54:20 -07:00
Timothy J. Baek
babfc97c90 enh: svg zoom pan 2024-10-06 12:51:29 -07:00
Timothy J. Baek
913620ff0c refac 2024-10-06 12:07:45 -07:00
Timothy J. Baek
e6265897c8 refac: styling 2024-10-06 11:54:57 -07:00
Timothy J. Baek
91e1b548a9 refac: styling 2024-10-06 11:52:19 -07:00
Timothy J. Baek
8ad44cd690 enh: chat landing ui option 2024-10-06 11:45:13 -07:00
Timothy J. Baek
5f74cfaa51 enh: artifacts fullscreen 2024-10-06 11:26:02 -07:00
Timothy Jaeryang Baek
9ef3fb0bc7 Merge pull request #5940 from JEleniel/voice_i18n_sort
fix: sort the list of TTS voices and reformat the names
2024-10-06 20:12:47 +02:00
Timothy Jaeryang Baek
7d1890c7d1 Merge pull request #5938 from Nowheresly/fix5930
feat: db pool config #5935
2024-10-06 20:11:50 +02:00
JEleniel
eb2aaea6cb fix, i18n - sort the list of TTS voices and reformat the names returned by the built in speech syntehsis 2024-10-06 12:56:30 -04:00
Sylvere Richard
9706b76b36 feat: db pool config #5935 2024-10-06 17:20:10 +02:00
Timothy J. Baek
059ac466e0 refac: styling 2024-10-06 02:49:16 -07:00
Timothy J. Baek
75780256d1 refac: styling 2024-10-06 02:04:41 -07:00
Timothy J. Baek
b5efe15f73 refac 2024-10-06 01:58:33 -07:00
Timothy J. Baek
be657f45e4 refac: styling 2024-10-06 01:50:06 -07:00
Timothy J. Baek
f295e26f25 chore: bump 2024-10-06 01:39:22 -07:00
Timothy J. Baek
0591cd82d4 chore: format 2024-10-06 01:35:58 -07:00
Timothy J. Baek
70ca6527f6 enh: copy artifacts 2024-10-06 01:27:21 -07:00
Timothy J. Baek
cdd024db81 refac: close artifacts if html codeblock is not found 2024-10-06 01:20:10 -07:00
Timothy J. Baek
3082d0de7a enh: apply edit to artifacts 2024-10-06 01:12:30 -07:00
Timothy J. Baek
f5e10704c0 refac 2024-10-06 00:50:38 -07:00
Timothy J. Baek
c90cd6019a refac 2024-10-06 00:46:43 -07:00
Timothy J. Baek
c26d7ff463 refac 2024-10-06 00:42:24 -07:00
Timothy J. Baek
b21af908a7 refac 2024-10-06 00:33:01 -07:00
Timothy J. Baek
097e90f1de refac 2024-10-06 00:30:50 -07:00
Timothy J. Baek
ed47e24494 refac 2024-10-06 00:28:33 -07:00
Timothy J. Baek
aeaf761ecd enh: automatic artifacts toggle 2024-10-06 00:14:05 -07:00
Timothy J. Baek
6d2eaaf602 refac 2024-10-06 00:09:37 -07:00
Timothy J. Baek
1815cfe99d refac 2024-10-06 00:03:58 -07:00
Timothy J. Baek
539e95a206 refac 2024-10-06 00:00:39 -07:00
Timothy J. Baek
de59ecf8a3 feat: artifacts
Co-Authored-By: Andrew Tait Gehrhardt <134739775+atgehrhardt@users.noreply.github.com>
2024-10-05 23:58:02 -07:00
Timothy J. Baek
2981212dfa refac 2024-10-05 23:55:44 -07:00
Timothy J. Baek
7ee07df26a refac 2024-10-05 22:23:06 -07:00
Timothy J. Baek
008febb6d7 refac: styling 2024-10-05 22:18:05 -07:00
Timothy J. Baek
6417ccef00 chore: format 2024-10-05 21:29:08 -07:00
Timothy J. Baek
198749aed1 refac: styling 2024-10-05 21:27:47 -07:00
Timothy J. Baek
46bd97c100 refac: styling 2024-10-05 21:25:04 -07:00
Timothy J. Baek
1086a0e662 refac: styling 2024-10-05 21:16:20 -07:00
Timothy J. Baek
9586749314 refac: styling 2024-10-05 21:14:35 -07:00
Timothy J. Baek
54552c3d13 refac 2024-10-05 21:02:37 -07:00
Timothy J. Baek
ed337b94e1 refac: styling 2024-10-05 20:50:58 -07:00
Timothy J. Baek
0f287c8a09 enh: floating codeblock buttons 2024-10-05 20:48:55 -07:00
Timothy J. Baek
dc2e75017d refac 2024-10-05 20:16:46 -07:00
Timothy J. Baek
c3862bc387 refac: code rendering 2024-10-05 19:58:27 -07:00
Timothy J. Baek
6fdfa62845 refac 2024-10-05 19:53:19 -07:00
Timothy J. Baek
e0fc3e89a7 refac: i18n 2024-10-05 19:42:04 -07:00
Timothy Jaeryang Baek
ed5669410b Merge pull request #5927 from KarlLee830/translate
i18n: Update Chinese translation
2024-10-06 04:38:24 +02:00
Timothy Jaeryang Baek
6d3d80b347 Merge pull request #5926 from Nowheresly/useNode22
Update to node 22
2024-10-06 04:37:42 +02:00
Karl Lee
d84368a8f6 i18n: Update Chinese translation 2024-10-06 10:29:43 +08:00
Timothy J. Baek
5adf9ed445 refac 2024-10-05 19:03:39 -07:00
Timothy J. Baek
49e9275c5b refac: styling 2024-10-05 18:57:19 -07:00
Timothy J. Baek
c746fd94cb refac 2024-10-05 18:43:17 -07:00
Timothy J. Baek
0bfe28711a enh: dark theme scrollbar 2024-10-05 18:28:40 -07:00
Timothy J. Baek
c09e51c1bf fix: banner styling 2024-10-05 17:09:49 -07:00
Timothy J. Baek
3dd1d1bc4a fix 2024-10-05 17:05:26 -07:00
Timothy J. Baek
a860e98ab9 refac: remember sidebar status 2024-10-05 17:00:56 -07:00
Timothy J. Baek
ed1a2ab5e8 refac: explain button behaviour 2024-10-05 16:50:06 -07:00
Timothy J. Baek
bbbd94f69c refac 2024-10-05 16:16:51 -07:00
Timothy J. Baek
2e067b0541 refac 2024-10-05 16:00:25 -07:00
Timothy J. Baek
a0a79fbc5b refac: styling 2024-10-05 15:55:30 -07:00
Timothy J. Baek
ecd6a135cd refac: styling 2024-10-05 15:47:51 -07:00
Timothy J. Baek
9c18cf204d refac 2024-10-05 15:10:55 -07:00
Timothy J. Baek
a571ae4ec2 refac: only show resizer when controls is open 2024-10-05 14:54:15 -07:00
Timothy J. Baek
1558f64c48 refac: only show floating buttons when message.done 2024-10-05 14:51:28 -07:00
Timothy J. Baek
1739313c13 refac 2024-10-05 14:49:39 -07:00
Timothy J. Baek
1b8acc42b4 refac 2024-10-05 14:27:16 -07:00
Timothy J. Baek
1397bfa84c refac: navbar styling 2024-10-05 14:26:54 -07:00
Sylvere Richard
c09af435ac WIP node 22
https://github.com/cypress-io/github-action/pull/1189
2024-10-05 22:39:24 +02:00
Timothy J. Baek
f5004fd9d4 refac: styling 2024-10-05 13:26:52 -07:00
Timothy J. Baek
fb58e842b7 refac: styling 2024-10-05 13:25:30 -07:00
Timothy Jaeryang Baek
dcf8d9c7eb Merge pull request #5923 from Nowheresly/fixIntegTests
fix: fix cypress test on CI
2024-10-05 21:46:02 +02:00
Timothy Jaeryang Baek
a61c54531c Merge pull request #5925 from Nowheresly/pythonActionUpd
Update to actions/setup-python@v5
2024-10-05 21:45:43 +02:00
Timothy J. Baek
e184a65dea refac 2024-10-05 12:43:58 -07:00
Sylvere Richard
fafeec3d86 Update to actions/setup-python@v5 2024-10-05 21:42:01 +02:00
Timothy J. Baek
55d0ecc879 refac 2024-10-05 12:41:18 -07:00
Timothy J. Baek
614f3d5f80 fix 2024-10-05 12:40:13 -07:00
Timothy J. Baek
46328333c7 refac 2024-10-05 12:38:44 -07:00
Sylvere Richard
582036fb3f fix: fix cypress test on CI 2024-10-05 21:38:20 +02:00
Timothy J. Baek
28602b12ea refac: dynamic lang support 2024-10-05 12:38:09 -07:00
Timothy J. Baek
f5b6785e53 refac 2024-10-05 12:07:45 -07:00
Timothy J. Baek
81440460f2 feat: editable code block 2024-10-05 12:04:36 -07:00
Timothy Jaeryang Baek
82ac2e4edb Merge pull request #5920 from Nowheresly/baseImgDockerUpd
fix: ensure Dockerfile and github actions use the same nodejs version
2024-10-05 19:54:27 +02:00
Sylvere Richard
fc44924256 fix: ensure Dockerfile and github actions use the same nodejs version 2024-10-05 19:48:56 +02:00
Timothy J. Baek
9ca2350a13 fix: call tts issue 2024-10-05 10:42:06 -07:00
Timothy J. Baek
12a6216477 refac: styling 2024-10-05 10:23:47 -07:00
Timothy J. Baek
fb5fb27ebe fix 2024-10-05 10:20:11 -07:00
Timothy J. Baek
cb0f759420 refac: knowledge collection uploading indicator 2024-10-05 10:18:43 -07:00
Timothy J. Baek
378223aedb refac: comments 2024-10-05 10:08:48 -07:00
Timothy J. Baek
61b147441c refac 2024-10-05 10:05:12 -07:00
Timothy J. Baek
1f9b5b6456 refac: retain metadata for collection 2024-10-05 09:58:46 -07:00
Timothy Jaeryang Baek
4ca870bf6d Merge pull request #5919 from Nowheresly/dockerwarn
refac: remove docker warnings during image build
2024-10-05 18:33:11 +02:00
Sylvere Richard
52a3ab5333 refac: remove docker warnings during image build 2024-10-05 12:30:47 +02:00
Timothy J. Baek
ff22e2156d refac: styling 2024-10-05 03:29:55 -07:00
Timothy J. Baek
e0c775f6e3 refac 2024-10-05 03:24:00 -07:00
Timothy J. Baek
7036166535 refac 2024-10-05 03:22:17 -07:00
Timothy J. Baek
2e231982a3 refac 2024-10-05 03:21:22 -07:00
Timothy J. Baek
fe7e7abf15 refac 2024-10-05 03:19:55 -07:00
Timothy J. Baek
3e7a163660 refac: styling 2024-10-05 03:15:39 -07:00
Timothy J. Baek
0319e63999 enh: new landing page 2024-10-05 03:07:56 -07:00
Timothy J. Baek
0bd88090bb refac: DOCS_DIR deprecated 2024-10-05 01:45:22 -07:00
Timothy J. Baek
ed3e1397ca refac 2024-10-05 01:40:10 -07:00
Timothy J. Baek
0ad35ffad9 feat: text select quick actions 2024-10-05 01:37:39 -07:00
Timothy J. Baek
1f488a0072 enh: sync confirm 2024-10-04 19:38:24 -07:00
Timothy J. Baek
493745a70b refac 2024-10-04 19:32:33 -07:00
Timothy J. Baek
c400f40663 enh: knowledge search in model editor 2024-10-04 19:24:36 -07:00
Timothy J. Baek
bc6113f4ba refac 2024-10-04 19:10:52 -07:00
Timothy J. Baek
b6703be859 chore: format 2024-10-04 19:00:48 -07:00
Timothy Jaeryang Baek
62f30ce098 Merge pull request #5917 from KarlLee830/translate
i18n: Update Chinese translation
2024-10-05 03:59:17 +02:00
Timothy J. Baek
9f812e7022 enh: support non chrome browsers 2024-10-04 18:54:40 -07:00
Timothy J. Baek
a909aa1c20 enh: sync directory 2024-10-04 18:44:57 -07:00
Timothy J. Baek
e3889522d6 refac 2024-10-04 18:28:48 -07:00
Timothy J. Baek
79c005a041 refac: deprecate docs_dir 2024-10-04 18:22:55 -07:00
Timothy J. Baek
a6c797d4c2 refac: process docs dir 2024-10-04 17:22:00 -07:00
Karl Lee
0e50c8bb31 i18n: Update Chinese translation 2024-10-05 08:12:14 +08:00
Timothy J. Baek
9ad5ffb8c1 chore: endpoint naming 2024-10-04 17:03:56 -07:00
Timothy J. Baek
f052010d8e refac 2024-10-04 16:58:45 -07:00
Timothy J. Baek
ee6e41b144 refac: legacy support 2024-10-04 16:56:20 -07:00
Timothy J. Baek
2e267b420a fix: model knowledge 2024-10-04 16:53:25 -07:00
Timothy J. Baek
0c618b8145 refac: legacy detection 2024-10-04 16:43:41 -07:00
Timothy J. Baek
8f41db2f2e refac: styling 2024-10-04 16:43:25 -07:00
Timothy J. Baek
a53537ccde fix: disable empty fields 2024-10-04 16:18:44 -07:00
Timothy J. Baek
5017ca90ff refac 2024-10-04 16:16:16 -07:00
Timothy J. Baek
f3ee07a8a2 enh: knowledge collection search 2024-10-04 12:35:06 -07:00
Timothy Jaeryang Baek
263cc71dd3 Merge pull request #5913 from calvarez8922/fr-translation
i18n: fix fr year translation on date
2024-10-04 21:02:39 +02:00
Timothy J. Baek
8f5e426a13 enh: important note 2024-10-04 11:26:06 -07:00
Timothy Jaeryang Baek
87700d02a7 Merge pull request #5911 from aleixdorca/dev
i18n: Updated Catalan Translation
2024-10-04 20:18:47 +02:00
Timothy J. Baek
8f22e911e0 fix: empty knowledge delete issue 2024-10-04 11:11:53 -07:00
Aleix Dorca
1647cbef21 Update catalan translation.json 2024-10-04 15:06:06 +02:00
Aleix Dorca
528ac51ba9 Update translation.json 2024-10-04 15:00:49 +02:00
Willnow, Patrick
f751d22a20 Refinement 2024-10-04 13:26:49 +02:00
Timothy J. Baek
650ca95784 fix 2024-10-04 01:21:33 -07:00
Patrick Willnow
6ddd8c7241 fix logic 2024-10-04 10:14:20 +02:00
Timothy J. Baek
d1b8af6220 chore: format 2024-10-04 01:04:04 -07:00
Timothy Jaeryang Baek
332ef045ee Merge pull request #5870 from KarlLee830/translate
i18n: Update Chinese translation
2024-10-04 10:01:56 +02:00
Timothy Jaeryang Baek
0876c9b5ef Merge pull request #5829 from jannikstdl/query-embedding-perf-fix
fix:  performance issues on large collections
2024-10-04 10:01:17 +02:00
Timothy Jaeryang Baek
ebc7da6f82 Merge pull request #5861 from open-webui/projects
feat: knowledge/projects
2024-10-04 10:00:47 +02:00
Timothy J. Baek
1fe1c27220 refac: legacy support 2024-10-04 00:59:19 -07:00
Timothy J. Baek
8013c152d0 feat: edit file content support 2024-10-04 00:46:32 -07:00
Timothy J. Baek
630a78cead fix 2024-10-04 00:24:51 -07:00
Timothy J. Baek
17c772831d refac 2024-10-04 00:23:14 -07:00
Timothy J. Baek
6147f41589 refac: styling 2024-10-03 23:45:20 -07:00
Timothy J. Baek
5e70afc054 refac: styling 2024-10-03 23:43:41 -07:00
Timothy J. Baek
75fae69def refac: styling 2024-10-03 23:41:17 -07:00
Timothy J. Baek
90ef9f751a fix 2024-10-03 23:32:20 -07:00
Timothy J. Baek
544251a7fd feat: add text content 2024-10-03 23:24:44 -07:00
Timothy J. Baek
05970157f6 refac 2024-10-03 23:06:47 -07:00
Timothy J. Baek
d834bd2a18 refac 2024-10-03 22:35:43 -07:00
Timothy J. Baek
e9b68524e8 refac 2024-10-03 22:24:05 -07:00
Timothy J. Baek
b291271df3 refac 2024-10-03 22:22:22 -07:00
Timothy J. Baek
9dd76b72b4 refac: styling 2024-10-03 21:34:53 -07:00
Timothy J. Baek
12977e07f3 feat: collection file content editor 2024-10-03 21:31:42 -07:00
Timothy J. Baek
29467a7057 fix 2024-10-03 21:12:35 -07:00
Timothy J. Baek
b862dff185 refac 2024-10-03 21:10:33 -07:00
Timothy J. Baek
6747478f67 refac 2024-10-03 21:05:55 -07:00
Timothy J. Baek
124a17e826 refac 2024-10-03 20:58:56 -07:00
Timothy J. Baek
57360b7a61 refac 2024-10-03 20:51:21 -07:00
jose.c.alvarez.diaz
2d40efe9d6 bug: fix fr year translation 2024-10-03 20:27:30 -06:00
Willnow, Patrick
79b9c8a677 handling no claim received when nested expected 2024-10-04 00:05:36 +02:00
Willnow, Patrick
8e4776ada1 add handling nested claims... 2024-10-03 23:25:00 +02:00
Willnow, Patrick
5b2e1ca7cd add more logging 2024-10-03 23:06:05 +02:00
Willnow, Patrick
0a7373dae1 add pending as role fallback
add logging to determine correct handling of oauth roles
2024-10-03 22:56:52 +02:00
Willnow, Patrick
c9d948f284 Remove copy pasta error of calling value on bool 2024-10-03 21:38:56 +02:00
Willnow, Patrick
dc92178641 Fix missing key mapping 2024-10-03 20:55:32 +02:00
Timothy J. Baek
2fc07fd6a2 enh: vector db hash collision check 2024-10-03 06:53:21 -07:00
Timothy J. Baek
78413d0c2e enh: add/remove file from knowledge 2024-10-03 06:46:20 -07:00
Timothy J. Baek
1c01e52f7c refac: fileItem styling 2024-10-03 06:45:29 -07:00
Timothy J. Baek
15a3c6b171 refac 2024-10-03 06:45:15 -07:00
Timothy J. Baek
d394f8b7be enh: add to vector db support 2024-10-03 06:44:17 -07:00
Timothy J. Baek
325ca98773 enh: vector db delete filter support 2024-10-03 06:43:50 -07:00
Patrick Willnow
9a691c0387 Add oauth role mapping
also add node env to allow local build to succeed
2024-10-03 11:12:14 +02:00
Timothy J. Baek
351b1dbf31 refac 2024-10-02 21:14:58 -07:00
Timothy J. Baek
a2eadb30f5 refac 2024-10-02 20:42:10 -07:00
Timothy Jaeryang Baek
2e7e346e19 Merge pull request #5871 from tcgumus/dev
fix: Unsupported JSON schema type {type_}
2024-10-03 05:07:30 +02:00
Timothy Jaeryang Baek
7c145ce5d5 Merge pull request #5879 from cheahjs/feat/arbitrary-usage-info
feat: show the user the entirety of the usage response
2024-10-03 05:06:56 +02:00
Timothy Jaeryang Baek
f19b61307d Merge pull request #5878 from cheahjs/feat/lazy-load-new-imports-for-mem
perf: lazy load big dependencies to reduce min memory usage
2024-10-03 00:15:03 +02:00
Jun Siang Cheah
a8ec73d01e feat: show the user the entirety of the usage response 2024-10-02 23:14:08 +01:00
Jun Siang Cheah
318f61161e refac: lazy load big dependencies to reduce min memory usage 2024-10-02 22:18:42 +01:00
Timothy J. Baek
1a26e67611 refac: styling 2024-10-02 07:44:07 -07:00
Timothy J. Baek
6974cb248c refac 2024-10-02 07:37:01 -07:00
Timothy J. Baek
dd5da10d2a feat: knowledge page 2024-10-02 07:35:43 -07:00
Timothy J. Baek
9c4b55c86a refac: knowledge fuzzy search 2024-10-02 06:21:16 -07:00
Timothy J. Baek
4aca1e86ad refac 2024-10-02 06:19:09 -07:00
Tuna Çağlar Gümüş
b2f09e4623 Merge pull request #1 from tcgumus/dev-fix-unsupported-json-error
fix: Unsupported JSON schema type {type_}
2024-10-02 15:40:22 +03:00
t
bdb2ce9448 fix: Unsupported JSON schema type {type_} 2024-10-02 15:34:48 +03:00
Karl Lee
973c08babd i18n: Update Chinese translation 2024-10-02 17:51:45 +08:00
Timothy J. Baek
7f51ef1838 refac 2024-10-01 23:21:33 -07:00
Timothy J. Baek
08969ecf89 refac: rename projects -> knowledge 2024-10-01 22:45:04 -07:00
Timothy J. Baek
3e012f0219 refac 2024-10-01 21:48:15 -07:00
Timothy J. Baek
5933d7a216 enh: sort by descending order 2024-10-01 21:35:18 -07:00
Timothy J. Baek
1b7d363d32 refac 2024-10-01 21:32:59 -07:00
Timothy J. Baek
c2732a0990 refac 2024-10-01 17:46:56 -07:00
Timothy J. Baek
c5eb0a9732 refac: documents -> projects 2024-10-01 17:35:35 -07:00
Timothy J. Baek
bf57dd808e feat: project migration 2024-10-01 17:35:10 -07:00
Timothy Jaeryang Baek
d353ea449a Merge pull request #5864 from sebdanielsson/remove-bun
build: Remove bun
2024-10-02 00:42:50 +02:00
Sebastian
c85cdbde46 Delete bun.lockb 2024-10-02 00:00:46 +02:00
Timothy J. Baek
fb083237cd refac 2024-10-01 14:00:19 -07:00
Timothy J. Baek
a0fb4a9b84 refac 2024-10-01 13:13:39 -07:00
Timothy J. Baek
5c9dd25459 refac: files migration 2024-10-01 11:01:26 -07:00
Timothy J. Baek
0907c32e10 refac 2024-10-01 09:51:58 -07:00
Timothy J. Baek
4752df9bd8 refac 2024-10-01 09:40:08 -07:00
Timothy J. Baek
7b9b29253f Merge branch 'dev' of https://github.com/open-webui/open-webui into dev 2024-10-01 09:18:15 -07:00
Timothy Jaeryang Baek
126aff7a7d Merge pull request #5839 from open-webui/dependabot/pip/backend/dev/langchain-chroma-0.1.4
chore(deps): bump langchain-chroma from 0.1.2 to 0.1.4 in /backend
2024-10-01 17:58:14 +02:00
Timothy Jaeryang Baek
6ca1de3601 Merge pull request #5838 from open-webui/dependabot/pip/backend/dev/duckduckgo-search-approx-eq-6.2.13
chore(deps): update duckduckgo-search requirement from ~=6.2.11 to ~=6.2.13 in /backend
2024-10-01 17:57:59 +02:00
Timothy Jaeryang Baek
fb8af637e1 Merge pull request #5837 from open-webui/dependabot/pip/backend/dev/aiohttp-3.10.8
chore(deps): bump aiohttp from 3.10.5 to 3.10.8 in /backend
2024-10-01 17:57:51 +02:00
Timothy Jaeryang Baek
ab983887cc Merge pull request #5836 from open-webui/dependabot/pip/backend/dev/pandas-2.2.3
chore(deps): bump pandas from 2.2.2 to 2.2.3 in /backend
2024-10-01 17:57:40 +02:00
Timothy Jaeryang Baek
75c1f47500 Merge pull request #5835 from open-webui/dependabot/pip/backend/dev/pydantic-2.9.2
chore(deps): bump pydantic from 2.8.2 to 2.9.2 in /backend
2024-10-01 17:57:29 +02:00
Timothy Jaeryang Baek
3da981d9cd Merge pull request #5831 from aindriu80/main
Added Irish language support
2024-10-01 17:57:11 +02:00
Timothy Jaeryang Baek
8a0e30a901 Merge pull request #5830 from FINNSEEFLY/task/adjust-ru-localization
i18n: Update ru-RU localization
2024-10-01 17:56:46 +02:00
dependabot[bot]
736cbb961f chore(deps): bump langchain-chroma from 0.1.2 to 0.1.4 in /backend
Bumps [langchain-chroma](https://github.com/langchain-ai/langchain) from 0.1.2 to 0.1.4.
- [Release notes](https://github.com/langchain-ai/langchain/releases)
- [Commits](https://github.com/langchain-ai/langchain/compare/langchain-chroma==0.1.2...langchain-chroma==0.1.4)

---
updated-dependencies:
- dependency-name: langchain-chroma
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-01 02:22:25 +00:00
dependabot[bot]
8d8c2752dc chore(deps): update duckduckgo-search requirement in /backend
Updates the requirements on [duckduckgo-search](https://github.com/deedy5/duckduckgo_search) to permit the latest version.
- [Release notes](https://github.com/deedy5/duckduckgo_search/releases)
- [Commits](https://github.com/deedy5/duckduckgo_search/compare/v6.2.12...v6.2.13)

---
updated-dependencies:
- dependency-name: duckduckgo-search
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-01 02:22:21 +00:00
dependabot[bot]
d78a7d431d chore(deps): bump aiohttp from 3.10.5 to 3.10.8 in /backend
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.10.5 to 3.10.8.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.10.5...v3.10.8)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-01 02:22:18 +00:00
dependabot[bot]
91ca5c424b chore(deps): bump pandas from 2.2.2 to 2.2.3 in /backend
Bumps [pandas](https://github.com/pandas-dev/pandas) from 2.2.2 to 2.2.3.
- [Release notes](https://github.com/pandas-dev/pandas/releases)
- [Commits](https://github.com/pandas-dev/pandas/compare/v2.2.2...v2.2.3)

---
updated-dependencies:
- dependency-name: pandas
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-01 02:22:08 +00:00
dependabot[bot]
7e1c55d2ed chore(deps): bump pydantic from 2.8.2 to 2.9.2 in /backend
Bumps [pydantic](https://github.com/pydantic/pydantic) from 2.8.2 to 2.9.2.
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md)
- [Commits](https://github.com/pydantic/pydantic/compare/v2.8.2...v2.9.2)

---
updated-dependencies:
- dependency-name: pydantic
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-01 02:22:04 +00:00
Aindriú Mac Giolla Eoin
3a2c241450 Added Irish language support 2024-09-30 17:47:01 +01:00
FINNSEEFLY
13b6b43cea Adjust ru-RU localization 2024-09-30 18:36:02 +03:00
Timothy J. Baek
c7a0e45bea refac 2024-09-30 16:32:38 +02:00
Jannik Streidl
6bff5a4d09 fix: do not embed the query every single time 2024-09-30 16:18:02 +02:00
Timothy J. Baek
37e0d47082 refac 2024-09-30 13:13:19 +02:00
Timothy J. Baek
e6b91036e1 refac 2024-09-30 13:12:41 +02:00
Timothy J. Baek
79a83adc89 refac 2024-09-30 13:03:47 +02:00
Timothy J. Baek
ffd598c5d7 enh: summary tag support 2024-09-30 12:50:53 +02:00
Timothy Jaeryang Baek
d255251e5f Merge pull request #5813 from res0Nanz/patch-1
feat: add `apple-touch-icon`
2024-09-30 12:17:06 +02:00
Eman Lear
49fe04a627 frontend: add apple-touch-icon
With `apple-touch-icon`, mobile devices of particular OS can properly show icon when bookmarking the web page as a home screen application.
2024-09-30 15:20:57 +08:00
Timothy J. Baek
21c919988d refac 2024-09-30 01:01:39 +02:00
Timothy J. Baek
1c4b6b9cd9 refac 2024-09-30 01:00:13 +02:00
Timothy J. Baek
3899405864 refac 2024-09-30 00:39:30 +02:00
Timothy J. Baek
209828c7c3 refac: styling 2024-09-30 00:37:31 +02:00
Timothy J. Baek
7152af949b feat: compress audio
Co-Authored-By: Beck Bekmyradov <47065940+bekmuradov@users.noreply.github.com>
2024-09-30 00:30:12 +02:00
Timothy J. Baek
8206c47a47 refac 2024-09-29 23:20:37 +02:00
Timothy J. Baek
f7aba20d79 refac 2024-09-29 23:11:22 +02:00
Timothy J. Baek
6afc686e17 refac 2024-09-29 23:08:55 +02:00
Timothy J. Baek
677c36c3aa refac 2024-09-29 22:55:53 +02:00
Timothy J. Baek
6d764ee55e feat: retrieval whole document mode 2024-09-29 22:52:27 +02:00
Timothy J. Baek
1d8b3b8c51 refac 2024-09-29 22:11:50 +02:00
Timothy J. Baek
92dd173b27 refac 2024-09-29 18:55:26 +02:00
Timothy J. Baek
f2ec020b64 refac: styling 2024-09-29 18:41:27 +02:00
Timothy J. Baek
d784d5c367 refac 2024-09-29 18:33:16 +02:00
Timothy J. Baek
b3517c63e8 fix: multi model chat infinite loop issue 2024-09-29 18:29:50 +02:00
Timothy J. Baek
550075bba4 fix: action button not working 2024-09-29 18:24:44 +02:00
Timothy J. Baek
c93a10388b refac 2024-09-28 19:51:28 +02:00
Timothy J. Baek
5a168ecc2a refac 2024-09-28 19:25:41 +02:00
Timothy J. Baek
276ce3374d refac 2024-09-28 19:17:21 +02:00
Timothy J. Baek
e77c3ab043 refac 2024-09-28 19:16:52 +02:00
Timothy J. Baek
d2e2e535dd refac 2024-09-28 10:55:52 +02:00
Timothy J. Baek
90ec458c4c enh: show extracted file content 2024-09-28 10:53:25 +02:00
Timothy Jaeryang Baek
9636913de0 Merge pull request #5777 from smonux/dev
Fix: sanitize function calling json
2024-09-28 10:07:52 +02:00
smonux
e039b4ec54 Merge branch 'open-webui:dev' into dev 2024-09-28 06:01:26 +02:00
Timothy J. Baek
9d2ed3d2be refac 2024-09-28 02:56:56 +02:00
Timothy J. Baek
b8b994a820 refac 2024-09-28 02:49:18 +02:00
Timothy J. Baek
00eb022450 refac 2024-09-28 02:38:59 +02:00
Timothy J. Baek
2428878f42 refac 2024-09-28 02:29:08 +02:00
Timothy J. Baek
af57a2c153 refac 2024-09-28 02:23:09 +02:00
Timothy J. Baek
1b349016ff refac 2024-09-28 01:36:35 +02:00
Timothy J. Baek
c1b4fbf5c2 refac 2024-09-28 01:35:52 +02:00
Timothy J. Baek
a52e8cd537 refac 2024-09-28 01:35:31 +02:00
Timothy J. Baek
5b7cf88915 refac 2024-09-28 01:28:45 +02:00
Timothy J. Baek
e1103305f5 refac: "rag" endpoints renamed to "retrieval" 2024-09-28 01:27:46 +02:00
Timothy Jaeryang Baek
6e9db3e3c8 Merge pull request #5773 from HaldiH/main
fix: Chat completion 401 when no Authorization header
2024-09-27 21:34:58 +02:00
Hugo Haldi
eab30781e0 Chat completion 401 when no Authorization header
When we send a request to `/api/chat/completions` without the `Authorization` header, the server just crashes and creates a stack trace, returning "Internal Server Error" to the calling client. With this fix, the server sends a 401 to the client with the content `{"detail": "Not authenticated"}`.
2024-09-27 20:04:45 +02:00
Timothy Jaeryang Baek
c30c876659 Merge pull request #5758 from kivvi3412/fix_o1_system_message
Fix: O1 does not support the system parameter
2024-09-27 19:44:16 +02:00
Timothy J. Baek
4ead3c5b80 chore: format 2024-09-27 19:43:40 +02:00
Timothy Jaeryang Baek
f0f176b80f Merge pull request #5765 from aleixdorca/dev
Update catalan translation.json
2024-09-27 19:42:18 +02:00
kivvi
5b3ee30ca9 Merge remote-tracking branch 'origin/fix_o1_system_message' into fix_o1_system_message
# Conflicts:
#	backend/open_webui/apps/openai/main.py
2024-09-27 22:48:36 +08:00
kivvi
e13614e11b Fix: O1 does not support the system parameter 2024-09-27 22:47:24 +08:00
Aleix Dorca
464b6a329e Update catalan translation.json 2024-09-27 16:11:52 +02:00
Timothy J. Baek
44d768ecf3 refac: do not wait for update check 2024-09-27 14:41:29 +02:00
Timothy J. Baek
0bd9d59c78 refac: update check timeout 2024-09-27 14:38:56 +02:00
kivvi
be74a4c9c1 Fix: O1 does not support the system parameter 2024-09-27 20:18:13 +08:00
Timothy J. Baek
719f4da1dc fix: milvus collection creation issue 2024-09-26 22:59:09 +02:00
Timothy Jaeryang Baek
fbc9634ffc Merge pull request #5742 from not-a-ethan/corrected-link
FIX: Migration link updated
2024-09-26 22:41:04 +02:00
Ethan
619c81472b Migration link updated 2024-09-26 16:27:49 -04:00
smonux
d8f71e1d7f Some models produce almost correct json during function calling, but with additional data before of after it. This solves it. 2024-09-26 22:02:56 +02:00
Timothy J. Baek
1715446b13 fix: call mode persisting after width change issue 2024-09-26 21:45:19 +02:00
Timothy Jaeryang Baek
8204f06485 Merge pull request #5741 from open-webui/main
dev
2024-09-26 21:34:16 +02:00
Timothy J. Baek
4c92a0f571 chore: chromadb, pymilvus bump 2024-09-26 21:33:37 +02:00
Timothy J. Baek
1d225dd804 fix: chat pdf, txt export issue 2024-09-26 20:59:25 +02:00
Timothy J. Baek
15bd5ebd7b Update README.md
Co-Authored-By: Aam Surganda <74174455+aamsur-933@users.noreply.github.com>
2024-09-26 15:57:43 +02:00
Timothy Jaeryang Baek
3af50f08bd Merge pull request #5728 from sp301415/dev
fix: Fix OpenAI batch embedding
2024-09-26 14:08:11 +02:00
Hwang In Tak
4fe1f2487d fix: Fix OpenAI batch embedding 2024-09-26 20:48:14 +09:00
Hwang In Tak
a4bc0b2829 fix: Fix OpenAI batch embedding 2024-09-26 20:39:40 +09:00
Timothy Jaeryang Baek
7b8f923981 Merge pull request #5711 from open-webui/dev
0.3.30
2024-09-26 04:13:54 +02:00
Timothy J. Baek
be41994d40 Update CHANGELOG.md 2024-09-26 04:12:19 +02:00
Timothy J. Baek
5361896411 doc: changelog 2024-09-26 04:11:13 +02:00
Timothy J. Baek
c754c53906 refac 2024-09-26 04:05:28 +02:00
Timothy J. Baek
78d6647885 refac 2024-09-26 03:25:44 +02:00
Timothy J. Baek
4eeb669ac3 refac 2024-09-26 03:21:37 +02:00
Timothy J. Baek
26465f3e92 chore: bump 2024-09-26 03:14:06 +02:00
Timothy J. Baek
9d25207b83 refac 2024-09-26 03:13:38 +02:00
Timothy Jaeryang Baek
cc19b8049a Merge pull request #5710 from kivvi3412/fix_o1_max_tokens
Fix: o1 input parameter must be max_completion_tokens
2024-09-26 03:03:15 +02:00
Timothy J. Baek
3a163b6392 fix: pip install database save issue 2024-09-26 03:02:08 +02:00
kivvi
405d0561df Fix: o1 input parameter must be max_completion_tokens 2024-09-26 08:49:59 +08:00
Timothy J. Baek
ee33b4e2a3 fix: ollama /embed form_data 2024-09-25 22:34:02 +02:00
Timothy J. Baek
888479aaf0 refac: update toast dismiss behaviour 2024-09-25 20:47:04 +02:00
Timothy Jaeryang Baek
82cda6e522 Merge pull request #5699 from open-webui/dev
0.3.29
2024-09-25 15:46:39 +02:00
Timothy J. Baek
119a7f1933 doc: changelog 2024-09-25 15:45:36 +02:00
Timothy J. Baek
6c4445d545 fix: filter outlet issue 2024-09-25 13:44:06 +02:00
Timothy J. Baek
92b1acd6fb fix: RESET_CONFIG_ON_START not working 2024-09-25 01:06:11 +02:00
Timothy J. Baek
1767b64135 fix: 'call' url search param not working 2024-09-25 01:02:48 +02:00
Timothy Jaeryang Baek
e030f261d1 Merge pull request #5675 from sp301415/dev
fix: Fix KaTeX Rendering (Followup)
2024-09-24 20:58:22 +02:00
Hwang In Tak
d501ece247 fix: Fix KaTeX corner cases 2024-09-25 02:15:53 +09:00
Timothy Jaeryang Baek
534e4c90ca Merge pull request #5674 from open-webui/dev
0.3.28
2024-09-24 18:52:23 +02:00
Timothy J. Baek
40f2c3521b doc: changelog 2024-09-24 18:50:47 +02:00
Timothy J. Baek
07b1327708 fix 2024-09-24 18:32:14 +02:00
Timothy J. Baek
525095b3de fix: websearch not working issue
#5672
2024-09-24 18:25:21 +02:00
Timothy Jaeryang Baek
f84513e856 Merge pull request #5673 from open-webui/dev
refac: readme
2024-09-24 18:19:09 +02:00
Timothy J. Baek
bf423b8577 refac: readme 2024-09-24 18:18:32 +02:00
Timothy Jaeryang Baek
ba20c71963 Merge pull request #5661 from open-webui/dev
0.3.27
2024-09-24 18:13:08 +02:00
Timothy J. Baek
7bbc57f225 doc: changelog 2024-09-24 18:12:47 +02:00
Timothy J. Baek
e703e172e2 chore: format 2024-09-24 18:10:14 +02:00
Timothy Jaeryang Baek
3ff52fd1ad Merge pull request #5655 from sp301415/dev
fix: Fix KaTeX Rendering
2024-09-24 17:44:08 +02:00
Timothy J. Baek
e19406cdd7 fix 2024-09-24 17:43:43 +02:00
Hwang In Tak
30e65b33f6 fix: Add comments 2024-09-25 00:41:08 +09:00
Hwang In Tak
3f1255b39e fix: Change inline and block delimiters 2024-09-25 00:10:49 +09:00
Timothy J. Baek
71743b25fe chore: format 2024-09-24 16:42:42 +02:00
Timothy Jaeryang Baek
c7e93b32c5 Merge pull request #5660 from open-webui/pypi-release
fix: open-webui serve
2024-09-24 16:36:37 +02:00
Timothy J. Baek
3cee507687 fix: dev2 2024-09-24 16:19:24 +02:00
Timothy J. Baek
ff651ddc36 fix: dev1 2024-09-24 16:07:49 +02:00
Timothy Jaeryang Baek
c0738cef26 Merge pull request #5659 from open-webui/dev
0.3.26
2024-09-24 15:41:42 +02:00
Timothy J. Baek
a44e9a8dda refac 2024-09-24 15:41:23 +02:00
Timothy J. Baek
38b9a63fa5 refac 2024-09-24 15:40:37 +02:00
Timothy J. Baek
2d60e42258 doc: changelog 2024-09-24 15:40:01 +02:00
Timothy Jaeryang Baek
60ac69eb27 Merge pull request #5656 from OriginalSimon/dev
i18n: Update Ukrainian translation
2024-09-24 15:33:15 +02:00
Timothy J. Baek
504d910557 fix: no running event loop issue 2024-09-24 15:31:55 +02:00
Hwang In Tak
e48d66f918 fix: Remove unnecessary logging 2024-09-24 22:11:05 +09:00
Hwang In Tak
0bfbace9aa fix: Simplify regex 2024-09-24 22:00:01 +09:00
Timothy Jaeryang Baek
019cf8199f Merge pull request #5657 from open-webui/dev
0.3.25
2024-09-24 14:07:23 +02:00
Timothy J. Baek
c5f85eed92 doc: changelog 2024-09-24 14:07:13 +02:00
Timothy J. Baek
21719ccdf1 chore: format 2024-09-24 14:05:44 +02:00
Timothy J. Baek
299b3d72cf fix: rate responses 2024-09-24 14:02:41 +02:00
Timothy J. Baek
85e9e231ed fix: image generation 2024-09-24 13:54:34 +02:00
Simon
f382a78e31 Update translation.json 2024-09-24 13:47:51 +02:00
Hwang In Tak
377cc427b6 fix: Remove unnecessary logging 2024-09-24 20:40:50 +09:00
Timothy Jaeryang Baek
7ec72679f0 Merge pull request #5599 from open-webui/dev
0.3.24
2024-09-24 13:32:00 +02:00
Timothy J. Baek
31b311c3c9 refac
Co-Authored-By: MicroDev <70126934+microdev1@users.noreply.github.com>
2024-09-24 13:28:00 +02:00
Timothy J. Baek
e24ab4c6d2 doc: changelog 2024-09-24 13:23:34 +02:00
Timothy J. Baek
6739983cf1 refac: deprecate interface "stream response" settings for advanced params 2024-09-24 12:49:35 +02:00
Timothy J. Baek
ff00815b61 chore: format 2024-09-24 12:41:44 +02:00
Timothy J. Baek
8f6a927be3 enh: update info toast 2024-09-24 12:40:13 +02:00
Timothy J. Baek
f6add92702 chore: format 2024-09-24 11:35:51 +02:00
Timothy Jaeryang Baek
deedfdceae Merge pull request #5632 from jannikstdl/dev
enh: open PDF citations on the associated page
2024-09-24 11:27:53 +02:00
Timothy J. Baek
e268ee5675 enh: audio/x-m4a support 2024-09-24 11:00:47 +02:00
Timothy J. Baek
33d8d818bd fix 2024-09-24 10:54:49 +02:00
Timothy Jaeryang Baek
9a81a37008 Merge pull request #5645 from kivvi3412/main
[feat] Set whether to stream individually for the model
2024-09-24 10:52:00 +02:00
Timothy Jaeryang Baek
8e620b0c2c Merge pull request #5649 from EtiennePerot/temp-file-close
fix: close temporary file after creating it
2024-09-24 10:49:38 +02:00
Hwang In Tak
214546399a fix: fix katex rendering 2024-09-24 16:58:15 +09:00
Etienne Perot
fdd27aa321 fix: close temporary file after creating it.
This fixes "The process cannot access the file
because it is being used by another process"
errors on Windows.

The file is still automatically deleted by the
`os.unlink` call later in the function.

Updates #5606
Fixes #5642
2024-09-23 23:22:47 -07:00
kivvi
4ebff2c5ce Merge remote-tracking branch 'origin/main' 2024-09-24 12:29:36 +08:00
kivvi
8266d343bf Merge remote-tracking branch 'origin/main' 2024-09-24 12:29:11 +08:00
kivvi
36ddb19023 Merge remote-tracking branch 'origin/main' 2024-09-24 12:17:40 +08:00
kivvi
ebc410d8d4 Merge remote-tracking branch 'origin/main' 2024-09-24 12:17:33 +08:00
kivvi
1772db4712 Merge remote-tracking branch 'origin/main' 2024-09-24 12:14:58 +08:00
kivvi
40d7d7d6dd Set whether to stream responses for this model individually, overriding the global setting 2024-09-24 12:14:51 +08:00
kivvi
0d01ea5f2f Set whether to stream responses for this model individually, overriding the global setting 2024-09-24 11:51:47 +08:00
Timothy J. Baek
822c47c171 fix 2024-09-24 01:35:34 +02:00
Timothy J. Baek
fdf02c4e86 fix 2024-09-24 01:12:49 +02:00
Timothy J. Baek
398bc96b1a refac 2024-09-24 01:05:46 +02:00
Timothy J. Baek
ad82eae6a9 feat: create new message pair on cmd+shift+enter 2024-09-24 00:57:28 +02:00
Timothy J. Baek
d7b64ff447 enh: infinite scroll messages 2024-09-24 00:27:22 +02:00
Timothy J. Baek
93cb2be35d refac 2024-09-23 23:55:18 +02:00
Timothy J. Baek
8f1b9bdf8a refac 2024-09-23 23:52:45 +02:00
Jannik S.
f69956bda8 fix: only append link with page attribute if metatada.page is available 2024-09-23 23:43:50 +02:00
Timothy J. Baek
e06667ead8 refac 2024-09-23 23:39:33 +02:00
Timothy Jaeryang Baek
35f64cc53f Merge pull request #5640 from open-webui/messages-render-optimisation
refac: messages render optimisation
2024-09-23 23:27:08 +02:00
Timothy J. Baek
12f95555fc fix 2024-09-23 23:23:08 +02:00
Timothy J. Baek
84c1810b6e refac 2024-09-23 23:20:27 +02:00
Timothy J. Baek
ba39f9bf56 refac 2024-09-23 17:40:24 +02:00
Jannik Streidl
8eb82265d0 Remove animation import - unsure if animations are desired 2024-09-23 15:50:46 +02:00
Jannik Streidl
ac277e8e9e enh: CitationsModal 2024-09-23 15:48:12 +02:00
Timothy J. Baek
b1521cacad refac: WIP 2024-09-23 14:24:50 +02:00
Timothy J. Baek
5978e7c9a6 refac: wip 2024-09-23 01:36:46 +02:00
Timothy J. Baek
fd5e8b4fcf refac: deprecate messages for history 2024-09-23 00:55:13 +02:00
Timothy Jaeryang Baek
291b6dd744 Merge pull request #5613 from cevheri/dev
Turkish Language Support has been updated
2024-09-22 20:33:29 +02:00
Timothy J. Baek
73ff524a8f refac 2024-09-22 20:31:53 +02:00
cevheri
c2b5bf2130 Turkish Language Support has been fixed. 2024-09-22 21:20:43 +03:00
Timothy J. Baek
8532f9da03 fix: many model chat save as copy issue 2024-09-22 20:16:45 +02:00
Timothy Jaeryang Baek
2cfe6830df Merge pull request #5595 from sebdanielsson/dev
feat: Add more variables to prompts
2024-09-22 16:47:51 +02:00
Timothy J. Baek
44355a4bdc enh: 'model' url search param added 2024-09-22 14:52:30 +02:00
Timothy J. Baek
47a858393b fix: hide mobile sidebar after menu button click 2024-09-22 14:50:24 +02:00
Timothy J. Baek
d3e80f515d enh: hide pinned chats when searching 2024-09-22 14:49:53 +02:00
Timothy Jaeryang Baek
c5b93ca631 Merge pull request #5601 from JamesClarke7283/extend-num-predict-param
fix: Extend num predict param
2024-09-22 14:28:00 +02:00
Timothy J. Baek
3335eee1b9 refac: do not set max for input 2024-09-22 14:27:52 +02:00
Sebastian
29175405a6 Add weekday, timezone, language variables to system prompts 2024-09-22 12:24:05 +02:00
Sebastian
d53062a9b0 Add more variables to prompts 2024-09-22 11:49:18 +02:00
James Clarke
96ef15362a Increased max_tokens (num_predict) to 131072, fixes #5600 2024-09-22 05:43:04 +01:00
Timothy J. Baek
d6d6098378 refac 2024-09-22 02:57:51 +02:00
Timothy J. Baek
620e629edc refac 2024-09-22 02:57:38 +02:00
Timothy J. Baek
c292fd89f9 refac 2024-09-22 02:55:45 +02:00
Timothy J. Baek
c346130774 feat: overview favourite response 2024-09-22 02:53:38 +02:00
Timothy J. Baek
768717aaf9 refac 2024-09-22 02:35:25 +02:00
Timothy J. Baek
d055e1f888 refac 2024-09-22 02:14:59 +02:00
Timothy J. Baek
5f84145a2d enh: socket full redis support 2024-09-22 02:12:55 +02:00
Timothy J. Baek
47a9395a22 refac: styling 2024-09-22 01:42:18 +02:00
Timothy J. Baek
8dbac0f7e3 enh: show model hash and modified ts 2024-09-21 22:12:41 +02:00
Timothy Jaeryang Baek
6b463164f4 Merge pull request #5584 from open-webui/dev
fix: node tooltip xss issue
2024-09-21 21:44:25 +02:00
Timothy J. Baek
5f15e9ee68 fix: node tooltip xss issue
Co-Authored-By: Valentino Stillhardt <4715129+Fusseldieb@users.noreply.github.com>
2024-09-21 21:43:54 +02:00
Timothy Jaeryang Baek
54d63ece6f Merge pull request #5583 from open-webui/dev
refac
2024-09-21 21:35:54 +02:00
Timothy J. Baek
e35883ca9c fix: openai payload issue 2024-09-21 21:35:00 +02:00
Timothy Jaeryang Baek
19e49e43cb Merge pull request #5578 from aleixdorca/dev
i18n: Update catalan translation.json
2024-09-21 17:37:41 +02:00
Aleix Dorca
e429b5548c Update catalan translation.json 2024-09-21 17:27:32 +02:00
Timothy J. Baek
839dacc4a4 refac 2024-09-21 15:53:29 +02:00
Timothy J. Baek
4225591a26 fix 2024-09-21 15:48:52 +02:00
Timothy J. Baek
b4adffc3af fix 2024-09-21 15:48:16 +02:00
Timothy J. Baek
8fc178ae91 refac: chat controls size 2024-09-21 15:46:39 +02:00
Timothy J. Baek
580ad46036 refac: speedRate -> playbackRate 2024-09-21 15:42:39 +02:00
Timothy Jaeryang Baek
f47dffe6e1 Merge pull request #5576 from open-webui/dev
fix: WEBUI_AUTH=False not working issue
2024-09-21 15:35:55 +02:00
Timothy J. Baek
00f6b4bf09 refac 2024-09-21 15:35:35 +02:00
Timothy J. Baek
9126ceac08 fix: WEBUI_AUTH=False not working issue 2024-09-21 15:33:34 +02:00
Timothy Jaeryang Baek
ff8a2da751 Merge pull request #5565 from open-webui/dev
0.3.23
2024-09-21 04:55:29 +02:00
Timothy J. Baek
2f028b45fe refac 2024-09-21 04:53:44 +02:00
Timothy J. Baek
d3ef9d980b refac 2024-09-21 04:36:18 +02:00
Timothy J. Baek
cb81dfe4ba fix: voice recording not stopping 2024-09-21 04:27:18 +02:00
Timothy J. Baek
426de76690 refac 2024-09-21 04:24:38 +02:00
Timothy J. Baek
16a767e04e doc: changelog 2024-09-21 04:14:10 +02:00
Timothy J. Baek
2adaf9ba3d refac 2024-09-21 04:10:24 +02:00
Timothy J. Baek
f381850bb2 refac 2024-09-21 04:04:34 +02:00
Timothy Jaeryang Baek
273787fe78 Merge pull request #5541 from kivvi3412/fix-title-generate
[fix] Fix title generate
2024-09-21 03:58:28 +02:00
Timothy J. Baek
70d16c3904 refac: styling 2024-09-21 03:55:17 +02:00
Timothy J. Baek
ee6b1376c3 fix: rag duplicate collection issue 2024-09-21 03:53:53 +02:00
Timothy J. Baek
aed8e2156f refac 2024-09-21 03:44:44 +02:00
Timothy J. Baek
5d848ad130 refac 2024-09-21 03:39:30 +02:00
Timothy J. Baek
98928f6bd7 enh: save chat controls width 2024-09-21 03:37:28 +02:00
Timothy J. Baek
692f04d457 enh: width adjustable chat controls 2024-09-21 03:33:06 +02:00
kivvi
e1ea0c23eb Fixed the issue of being unable to generate titles 2024-09-21 09:06:28 +08:00
Timothy J. Baek
657d443a3e fix 2024-09-21 02:24:30 +02:00
Timothy J. Baek
95985e7bbb refac 2024-09-21 02:03:58 +02:00
Timothy J. Baek
3a0a1aca11 refac: task ollama stream support 2024-09-21 01:07:57 +02:00
Timothy J. Baek
41926172d3 fix/refac: use ollama /api/chat endpoint for tasks 2024-09-21 00:30:13 +02:00
Timothy J. Baek
585b9eb84a refac 2024-09-20 23:48:03 +02:00
Timothy J. Baek
ffd7d74f77 enh: websocket redis support 2024-09-20 23:43:22 +02:00
Timothy Jaeryang Baek
578d52b89d Merge pull request #5562 from open-webui/dev
fix: chat download as plain text issue
2024-09-20 23:19:51 +02:00
Timothy J. Baek
e599d5db3c fix: chat download as plain text issue 2024-09-20 23:19:20 +02:00
Timothy Jaeryang Baek
79b5430a9e Merge pull request #5546 from itaybar/bugfix/downgrade_authlib
downgrade authlib to 1.3.1
2024-09-20 17:41:19 +02:00
Timothy J. Baek
9b05fe3c54 Update pyproject.toml 2024-09-20 17:40:30 +02:00
Timothy Jaeryang Baek
5fe2795db8 Merge pull request #5556 from open-webui/dev
refac
2024-09-20 15:44:31 +02:00
Timothy J. Baek
732f730213 refac: click to focus on mesage node 2024-09-20 15:43:18 +02:00
Timothy Jaeryang Baek
c89bb01db9 Merge pull request #5554 from KarlLee830/translate
i18n: Update Chinese translation
2024-09-20 15:34:58 +02:00
Karl Lee
1cbbf75807 i18n: Update Chinese translation 2024-09-20 21:06:10 +08:00
itaybar
bd81fc8bff downgrade authlib to 1.3.1 2024-09-20 15:13:03 +03:00
Timothy Jaeryang Baek
d4df552076 Merge pull request #5537 from open-webui/dev
refac
2024-09-20 03:18:40 +02:00
Timothy J. Baek
b7ad82757d refac 2024-09-20 03:18:14 +02:00
Timothy J. Baek
d12b6cda4e refac: openai image async gen 2024-09-20 03:16:08 +02:00
Timothy Jaeryang Baek
83855b713b Merge pull request #5362 from open-webui/dev
0.3.22
2024-09-20 00:25:27 +02:00
Timothy J. Baek
bd09b6dbad doc: changelog 2024-09-20 00:25:09 +02:00
Timothy J. Baek
eb9ad47ef8 refac: temp tools & functions files 2024-09-20 00:12:52 +02:00
Timothy J. Baek
5b46a252ff doc: changelog 2024-09-20 00:00:45 +02:00
Timothy J. Baek
39c57c0e94 refac 2024-09-19 22:40:06 +02:00
Timothy J. Baek
619dbbe9f5 refac 2024-09-19 22:21:35 +02:00
Timothy J. Baek
9be73ea94a refac 2024-09-19 22:17:32 +02:00
Timothy J. Baek
4e43663448 refac 2024-09-19 22:12:54 +02:00
Timothy J. Baek
cd117f5b67 refac 2024-09-19 21:51:45 +02:00
Timothy J. Baek
2dad9b9432 refac 2024-09-19 20:56:13 +02:00
Timothy J. Baek
b0bc36f2af fix 2024-09-19 18:47:02 +02:00
Timothy J. Baek
1688f5ecaf refac 2024-09-19 18:42:01 +02:00
Timothy J. Baek
cba2d31175 refac 2024-09-19 18:40:23 +02:00
Timothy J. Baek
a2b77fd072 refac 2024-09-19 18:08:52 +02:00
Timothy J. Baek
9b83e57372 refac 2024-09-19 17:46:11 +02:00
Timothy J. Baek
687cae9b79 refac 2024-09-19 17:31:59 +02:00
Timothy J. Baek
f8fffdd288 refac: max_tokens -> max_completion_tokens 2024-09-19 17:19:31 +02:00
Timothy J. Baek
60d6279055 chore: format 2024-09-19 17:09:05 +02:00
Timothy J. Baek
7b330d1490 refac 2024-09-19 17:05:49 +02:00
Timothy J. Baek
7078af635c refac 2024-09-19 17:02:59 +02:00
Timothy J. Baek
e1b57d80a4 chore: format 2024-09-19 16:57:34 +02:00
Timothy J. Baek
8426874426 fix 2024-09-19 16:54:34 +02:00
Timothy J. Baek
70dd790afc refac: default rag params 2024-09-19 16:44:33 +02:00
Timothy J. Baek
e99cba53fe enh: stream=false support 2024-09-19 16:25:59 +02:00
Timothy J. Baek
628d7ae72d refac 2024-09-19 16:20:07 +02:00
Timothy J. Baek
ff737a9e25 enh: openai error message handling 2024-09-19 16:20:00 +02:00
Timothy J. Baek
5c16631ec5 refac 2024-09-19 15:35:01 +02:00
Timothy Jaeryang Baek
d52eaf19d6 Merge pull request #5511 from EtiennePerot/import-file
fix: restore `__file__` variable for imported toolkits and functions
2024-09-19 15:29:34 +02:00
Timothy J. Baek
27dd6ef14e refac 2024-09-19 05:15:06 +02:00
Timothy J. Baek
ed75f72358 refac 2024-09-19 03:53:07 +02:00
Timothy J. Baek
276d629a14 fix: message delete 2024-09-19 03:49:35 +02:00
Timothy J. Baek
aedd77b81d refac 2024-09-19 03:27:54 +02:00
Timothy J. Baek
1053863175 chore: format 2024-09-19 03:24:39 +02:00
Timothy J. Baek
f448341211 chore: format 2024-09-19 03:24:34 +02:00
Timothy Jaeryang Baek
9fc6b999d0 Merge pull request #5509 from open-webui/dev-playback-controls
feat: playback controls
2024-09-19 03:23:16 +02:00
Timothy J. Baek
ff2fff857a refac: styling 2024-09-19 03:22:55 +02:00
Timothy Jaeryang Baek
dd4cf102cc Merge pull request #5313 from zabirauf/u/zabirauf/speech-speed
feat: Added speech playback speed control for Call mode
2024-09-19 02:44:27 +02:00
Timothy Jaeryang Baek
5d3a89dd25 Merge pull request #5496 from pawel-ochman/azure-tts
Integrate Azure Speech service for TTS
2024-09-19 02:42:45 +02:00
Timothy J. Baek
b4f1a0b5a6 refac 2024-09-19 02:42:24 +02:00
Timothy J. Baek
afa42dd2e4 refac 2024-09-19 02:40:54 +02:00
Timothy J. Baek
be44af4680 enh: focus on current message 2024-09-19 01:25:46 +02:00
Timothy J. Baek
e6b6f42139 refac: display error content on node 2024-09-18 16:46:13 +02:00
Pawel Ochman
4d9677e808 Update configuration page, expose all Azure settings through ENV variables 2024-09-18 14:13:42 +01:00
Pawel Ochman
eacb69074e remove dependency and migrate to raw rest calls 2024-09-18 12:24:55 +01:00
Etienne Perot
6477bf37fe fix: restore __file__ variable for imported toolkits and functions
Commit cf86ba7786 changed the way toolkits
and functions were imported to use `exec`, whereas they previously were
written to files and `import`ed. The use of `exec` means that
module-global variables such as `__file__` are no longer defined.

This breaks https://github.com/EtiennePerot/open-webui-code-execution
(code execution tool for Open WebUI), as the module needs to re-execute
its own code in a subprocess in order to properly sandbox itself. This
is done using `__file__` in order to know where the module's code is
located.

This PR creates a temporary in-memory file that contains the imported
toolkit or function's code and exists only during the import process.
Then it injects the path to this in-memory file as the `__file__`
variable in the `exec` context. This restores the ability for the
toolkit or function being imported to rely on `__file__`.
2024-09-18 01:08:30 -07:00
Timothy J. Baek
1743d3c6c1 fix 2024-09-18 03:47:04 +02:00
Timothy J. Baek
e723b2a4c6 refac 2024-09-18 03:19:32 +02:00
Timothy J. Baek
67f704c98d enh: scroll to message from overview 2024-09-18 03:13:37 +02:00
Timothy J. Baek
8d92093570 enh: node show content as tooltip 2024-09-18 02:55:25 +02:00
Timothy J. Baek
1ccac9111b refac: only animate active edges 2024-09-18 02:42:19 +02:00
Timothy J. Baek
98984166f9 refac: styling 2024-09-18 02:11:25 +02:00
Timothy J. Baek
d1bf18eeb0 fix 2024-09-18 01:57:27 +02:00
Timothy J. Baek
2018a6c000 fix: styling 2024-09-18 01:53:08 +02:00
Timothy J. Baek
56152230f8 refac 2024-09-18 01:39:22 +02:00
Timothy J. Baek
7e8cf5504a refac: styling 2024-09-18 01:35:22 +02:00
Timothy J. Baek
3c03d5069d refac: styling 2024-09-18 01:31:49 +02:00
Timothy J. Baek
705508a674 refac: allow chat menu in mobile 2024-09-18 01:30:09 +02:00
Timothy J. Baek
771482c6e6 refac 2024-09-18 01:25:28 +02:00
Timothy J. Baek
d25ccfba5f refac: styling 2024-09-18 01:21:32 +02:00
Timothy J. Baek
614c219010 enh: prepend image filename with prompt 2024-09-18 01:04:20 +02:00
Timothy J. Baek
63b3076d64 refac 2024-09-18 00:52:06 +02:00
Timothy J. Baek
8e3ad45ce4 enh: model move to top 2024-09-18 00:49:27 +02:00
Timothy J. Baek
984e0c533e refac 2024-09-18 00:18:47 +02:00
Timothy J. Baek
5065291f72 feat: save as new response message 2024-09-17 23:36:48 +02:00
Timothy J. Baek
8c273ba58a refac 2024-09-17 23:23:38 +02:00
Timothy J. Baek
7a9c0946a4 refac 2024-09-17 23:13:51 +02:00
Timothy J. Baek
7e0a26ef4e refac 2024-09-17 23:07:04 +02:00
Timothy J. Baek
65b7c9898b fix 2024-09-17 23:02:41 +02:00
Timothy J. Baek
67f95ddfdc refac 2024-09-17 22:58:06 +02:00
Timothy J. Baek
d1dbb9a3be feat: chat overview 2024-09-17 22:05:19 +02:00
Timothy J. Baek
bb087a5989 enh: chat copy button 2024-09-17 21:32:39 +02:00
Timothy Jaeryang Baek
a0d24105fc Merge pull request #5473 from aleixdorca/dev
i18n: Update Catalan Translation
2024-09-17 17:18:40 +02:00
Timothy Jaeryang Baek
a5c9160b7d Merge pull request #5466 from phil-ogb/add-security-response-headers
feat: security response headers
2024-09-17 17:18:28 +02:00
Aleix Dorca
0e2cdbe9fb Minor typo 2024-09-17 16:49:05 +02:00
Aleix Dorca
3c55a46484 i18n: Update Catalan translation.json 2024-09-17 16:46:52 +02:00
Pawel Ochman
d6b68f405e added azure speech service support 2024-09-17 09:13:10 +01:00
Pawel Ochman
351bbdb36c Added Azure speach service option (UI) 2024-09-17 08:47:30 +01:00
Phil Ogbonna
896baf021b update comment block 2024-09-16 22:02:55 -03:00
Phil Ogbonna
499e5e4f60 feat: security response headers 2024-09-16 21:53:30 -03:00
Timothy J. Baek
3ad003bccb fix 2024-09-16 16:42:18 +02:00
Timothy J. Baek
af92184c93 chore: colbert-ai requirement 2024-09-16 16:19:40 +02:00
Timothy J. Baek
06debb322b refac: colbert cuda support 2024-09-16 12:42:48 +02:00
Timothy J. Baek
b7f0759485 refac 2024-09-16 12:36:43 +02:00
Timothy J. Baek
bc6f23f82f fix 2024-09-16 12:33:55 +02:00
Timothy J. Baek
cb9e76c7f9 refac: default rag template 2024-09-16 12:01:04 +02:00
Timothy J. Baek
b38986a0aa enh: colbert rerank support 2024-09-16 11:46:39 +02:00
Timothy J. Baek
db0c576f48 refac 2024-09-16 07:14:17 +02:00
Timothy Jaeryang Baek
40d7e5089d Merge pull request #5436 from khanh-alice/fix-transparent-icons
fix: model transparent icons
2024-09-16 07:05:17 +02:00
Timothy Jaeryang Baek
9b8d42c670 Merge pull request #5440 from cheahjs/feat/capabilities-help
feat: add help text for capabilities
2024-09-16 05:17:32 +02:00
Jun Siang Cheah
bed3b71860 feat: add help text for capabilities 2024-09-15 14:14:09 +01:00
Khanh Le
253791b92c save model icon as png 2024-09-15 16:43:42 +07:00
Timothy J. Baek
5dd6ae6ec4 chore: npm 2024-09-14 23:30:56 +01:00
Timothy J. Baek
902f30c123 enh: table view allow overflow 2024-09-14 23:23:52 +01:00
Timothy J. Baek
fa8d7bd9c6 enh: allow new lines in default prompts 2024-09-14 23:17:58 +01:00
Timothy J. Baek
d0df2cbe53 fix: disable "enable new sign ups" not working issue 2024-09-14 23:13:52 +01:00
Timothy Jaeryang Baek
27baa00afb Merge pull request #5419 from cheahjs/fix/remove-doc-support
fix: remove unsupported .doc file ingest
2024-09-14 22:52:40 +01:00
Timothy J. Baek
869063c743 refac: better reranking model error handling 2024-09-14 20:58:42 +01:00
Timothy Jaeryang Baek
2f9f568dd9 Merge pull request #5400 from thiswillbeyourgithub/fix_fallback_cuda
fix: if cuda is not available fallback to cpu
2024-09-14 20:57:14 +01:00
Timothy Jaeryang Baek
937ce5f797 Merge pull request #5411 from KarlLee830/translate
i18n: Update Chinese translation
2024-09-14 20:56:13 +01:00
Timothy Jaeryang Baek
1b612209a3 Merge pull request #5429 from OriginalSimon/dev
i18n: Update Ukrainian translation
2024-09-14 20:56:03 +01:00
Simon
d00d3341af Update translation.json 2024-09-14 20:32:04 +02:00
Jun Siang Cheah
3199e26500 fix: remove unsupported .doc file ingest 2024-09-14 12:44:51 +01:00
Karl Lee
bc06e7a282 i18n: Update Chinese translation 2024-09-14 10:10:15 +08:00
Timothy Jaeryang Baek
1eec9e2b59 Merge pull request #5407 from Peter-De-Ath/citations-page-no
feat: add page no to citations
2024-09-13 21:55:45 +01:00
Peter De-Ath
d46f652f7e enh: show page number in citation if known 2024-09-13 21:05:28 +01:00
Timothy Jaeryang Baek
d75d638b9a Merge pull request #5406 from open-webui/main
refac
2024-09-13 19:26:51 +01:00
Timothy J. Baek
b64c9d966a refac 2024-09-13 14:26:32 -04:00
Timothy Jaeryang Baek
8a928e5356 Merge pull request #5405 from open-webui/main
refac: filter non chat completions models
2024-09-13 19:23:02 +01:00
Timothy J. Baek
adf958559b refac: filter non chat completions models 2024-09-13 14:20:27 -04:00
thiswillbeyourgithub
82b35492af pep8 2024-09-13 17:18:44 +02:00
thiswillbeyourgithub
a7ea07036e fix: if cuda is not available fallback to cpu 2024-09-13 17:12:00 +02:00
Timothy Jaeryang Baek
c1d3481c41 Merge pull request #5399 from open-webui/main
fix: allow o1
2024-09-13 15:01:48 +01:00
Timothy J. Baek
bc0baa35e6 fix: allow o1 2024-09-13 09:59:41 -04:00
Timothy J. Baek
f549cb1f87 fix 2024-09-13 01:30:30 -04:00
Timothy J. Baek
823093eea6 fix: hybrid search 2024-09-13 01:21:47 -04:00
Timothy J. Baek
939bfd153e refac 2024-09-13 01:18:20 -04:00
Timothy J. Baek
b943b7d337 refac 2024-09-13 01:08:02 -04:00
Timothy J. Baek
a1f3ece528 refac 2024-09-13 01:07:03 -04:00
Timothy J. Baek
8a4b3e6bc9 refac: allow multiple [context] in prompt 2024-09-13 01:06:51 -04:00
Timothy J. Baek
a9c497612b refac: rm assert 2024-09-13 00:56:50 -04:00
Timothy J. Baek
7df997c992 chore: format 2024-09-13 00:49:23 -04:00
Timothy J. Baek
bebc0d2073 chore: format 2024-09-13 00:48:54 -04:00
Timothy Jaeryang Baek
857fc3ce99 Merge pull request #5276 from sebdanielsson/add-theme-color
fix: Set theme colors to fix white top bar for PWA
2024-09-13 05:43:25 +01:00
Timothy J. Baek
47e9c12fc2 refac 2024-09-13 00:41:20 -04:00
Timothy Jaeryang Baek
5970dadead Merge pull request #5256 from Bazsalanszky/main
feat: More options for AUTOMATIC1111
2024-09-13 05:40:09 +01:00
Timothy Jaeryang Baek
7dc4cb30b2 Merge pull request #5378 from thiswillbeyourgithub/fix_RAG_and_web
fix: RAG and Web Search + RAG enhancements
2024-09-13 05:38:53 +01:00
Timothy Jaeryang Baek
fb122e67d0 Merge pull request #5382 from Peter-De-Ath/hotfix/chroma-metadata-s
fix: change metadata to metadatas
2024-09-12 22:30:08 +01:00
Peter De-Ath
ca9874757f fix: change metadata to metadatas 2024-09-12 20:14:14 +01:00
thiswillbeyourgithub
65d5545cf0 added a few type hints 2024-09-12 17:22:22 +02:00
thiswillbeyourgithub
e872f5dc78 log: added a debug log if detecting a potential prompt injection attack 2024-09-12 17:22:22 +02:00
thiswillbeyourgithub
b4ad64586a fix: add check that the context for RAG is not empty if the threshold is 0 2024-09-12 17:22:22 +02:00
thiswillbeyourgithub
9661fee554 fix: handle case where [query] happens in the RAG context 2024-09-12 17:22:22 +02:00
thiswillbeyourgithub
adf26789b8 logs: crash if rag_template would be wrong 2024-09-12 17:22:22 +02:00
thiswillbeyourgithub
209e246e6f fix: much improved RAG template 2024-09-12 17:22:22 +02:00
thiswillbeyourgithub
ed2a1e7db9 enh: use non hybrid search as fallback if hybrid search failed 2024-09-12 17:22:22 +02:00
Timothy J. Baek
143ac08c35 refac 2024-09-12 10:56:16 -04:00
thiswillbeyourgithub
53f03f6556 fix: log exception when issues of collection querying 2024-09-12 16:51:37 +02:00
Timothy J. Baek
62f1933e3c refac: audio input (audio/ogg support) 2024-09-12 09:18:20 -04:00
Timothy J. Baek
0b30dc357c refac: remove prints 2024-09-12 09:13:21 -04:00
Timothy J. Baek
d5b595a842 fix: ol numbering 2024-09-12 09:11:45 -04:00
Balazs Toldi
d05ba042c0 Make the optional AUTOMATIC1111 values nullable
This commit makes the optional AUTOMATIC1111 options default to None, and if the value is removed, it resets to None.

Signed-off-by: Balazs Toldi <balazs@toldi.eu>
2024-09-12 14:00:24 +02:00
Timothy J. Baek
eed2d735a1 refac 2024-09-12 02:06:02 -04:00
Timothy Jaeryang Baek
675403d26d Merge pull request #5364 from open-webui/multiple-vector-dbs
refac: vector db clients
2024-09-12 07:00:55 +01:00
Timothy J. Baek
8be6e16513 refac: vector db clients 2024-09-12 02:00:31 -04:00
Timothy Jaeryang Baek
c7fc17da69 Merge pull request #5312 from open-webui/multiple-vector-dbs
feat: various vector db support
2024-09-12 06:53:47 +01:00
Timothy J. Baek
4775fe43d8 feat: milvus support 2024-09-12 01:52:19 -04:00
Sebastian
2a04dd0f9b Set theme colors to fix white top bar for PWA 2024-09-11 01:46:39 +02:00
Timothy Jaeryang Baek
61ee4bd629 Merge pull request #5319 from Liuzhch1/fix-openai_timeout
fix: get OpenAI models only if OpenAI API Enabled; timeout for querying OpenAI models
2024-09-10 23:03:20 +01:00
Timothy Jaeryang Baek
dbd661a417 Merge pull request #5318 from moblangeois/french-translation
i18n: Update French (fr-FR) translation
2024-09-10 23:02:34 +01:00
Liuzhch1
26700ac4ac fix: get OpenAI models only if OpenAI Enabled;timeout for query OpenAI models 2024-09-10 19:22:05 +08:00
Morgan Blangeois
b0defe5524 i18n: Update French (fr-FR) translation 2024-09-10 12:54:47 +02:00
Zohaib Rauf
91cd8c7608 Undid a unnecessary change 2024-09-09 21:59:13 -07:00
Zohaib Rauf
62b01c5f8e Cleaned up 2024-09-09 21:57:53 -07:00
Zohaib Rauf
b33ab6c5fd Updated to use Dropdown menu which is being used elsewhere in app 2024-09-09 21:33:48 -07:00
Timothy J. Baek
0886b3a0a4 refac: comments 2024-09-10 04:46:40 +01:00
Timothy J. Baek
522afbb0a0 refac 2024-09-10 04:37:06 +01:00
Timothy Jaeryang Baek
d5f13dd9e0 Merge pull request #5311 from open-webui/dev
dev
2024-09-10 02:30:02 +01:00
Timothy Jaeryang Baek
3d6d8c91dd Merge branch 'multiple-vector-dbs' into dev 2024-09-10 02:29:55 +01:00
Timothy J. Baek
4354f270ce refac 2024-09-10 02:27:50 +01:00
Timothy J. Baek
28087ccf40 refac 2024-09-10 01:37:36 +01:00
Timothy J. Baek
eb0e683b47 refac 2024-09-10 01:34:27 +01:00
Timothy Jaeryang Baek
1023ff8454 Merge pull request #5270 from cheahjs/fix/websocket-take-2
fix: socket.io connections failing when websockets are not available
2024-09-09 23:19:05 +01:00
Jun Siang Cheah
9401f6c821 fix: workaround socketio upstream bug when websockets are not available 2024-09-09 23:17:34 +01:00
Jun Siang Cheah
827c419251 feat: add ENABLE_WEBSOCKET_SUPPORT to force socket.io to ignore websocket upgrades 2024-09-09 23:17:17 +01:00
Timothy Jaeryang Baek
82db64a700 Merge pull request #5279 from afritzler/enh/kustomization
feat: Improve `kustomization` usage
2024-09-09 23:04:29 +01:00
Timothy J. Baek
f1fae805a2 fix: separate /embed and /embedding ollama endpoint 2024-09-09 23:02:26 +01:00
Timothy Jaeryang Baek
272e2386dd Merge pull request #5300 from FINNSEEFLY/task/adjust-ru-localization
i18n: Update ru-RU localization
2024-09-09 22:59:44 +01:00
FINNSEEFLY
67e1c0a10b Adjust ru-RU localization 2024-09-09 22:49:55 +03:00
Zohaib Rauf
f88a86f9b0 Fixed build error 2024-09-08 22:57:33 -07:00
Timothy J. Baek
601982f52b fix: lengthy chat title delete ui issue 2024-09-09 04:52:12 +01:00
Timothy Jaeryang Baek
fc839011f6 Merge pull request #5275 from sebdanielsson/safe-area
fix: Add padding to compensate for iPhone nav bar
2024-09-09 04:42:45 +01:00
Timothy Jaeryang Baek
b407f24950 Merge pull request #5277 from msurma/dev
fix: incorrect casting of top_p and frequency_penalty
2024-09-09 04:36:22 +01:00
Timothy Jaeryang Baek
d15f57cfff Merge pull request #5266 from KarlLee830/translate
i18n: Update Chinese translation
2024-09-09 04:34:47 +01:00
Andreas Fritzler
82fbfd69a5 Improve kustomization usage
Ensure that the `manifest/base` folder can be used as a standalone
kustomization resource.

Add a new subfolder `manifest/gpu` which uses `manifest/base` with
additional GPU related patches.
2024-09-08 20:43:00 +02:00
Michał Surmaczewski
8e6ea49e0e fix: incorrect casting of top_p and frequency_penalty 2024-09-08 17:52:58 +02:00
Sebastian
83a3e53d8d Add padding to compensate for iPhone nav bar 2024-09-08 17:52:10 +02:00
Jun Siang Cheah
698976add0 feat: add ENABLE_WEBSOCKET_SUPPORT to force socket.io to ignore websocket upgrades 2024-09-08 12:00:36 +01:00
Karl Lee
cc1d3c48e0 i18n: Update Chinese translation 2024-09-08 16:51:14 +08:00
Timothy Jaeryang Baek
e510c8b11f Merge pull request #5263 from open-webui/dev
refac
2024-09-08 01:52:27 +01:00
Timothy J. Baek
666086a806 refac 2024-09-08 01:17:02 +01:00
Timothy J. Baek
9bdbe88bda refac: default search query prompt 2024-09-08 01:04:57 +01:00
Timothy Jaeryang Baek
50db51ebe0 Merge pull request #5262 from open-webui/dev
0.3.21
2024-09-08 00:59:40 +01:00
Timothy J. Baek
0beaab51ae doc: changelog 2024-09-08 00:57:59 +01:00
Timothy Jaeryang Baek
0e30b0f9b4 Merge pull request #5010 from jannikstdl/show-total-docs
feat: show total number of documents
2024-09-08 00:52:45 +01:00
Timothy J. Baek
214722d39e enh: search query generation prompt 2024-09-08 00:51:12 +01:00
Balazs Toldi
7f6dae41f0 More options for AUTOMATIC1111
This commit adds 3 new options to the AUTOMATIC1111 settings:
- CFG Scale
- Sampler
- Scheduler

These options allow users to configure these parameters directly through the admin settings, without needing to modify the source code, which was previously required to change the default values in  AUTOMATIC1111.

Signed-off-by: Balazs Toldi <balazs@toldi.eu>
2024-09-07 17:21:17 +02:00
Jannik S.
9aa8eff44e styling 2024-09-07 15:08:25 +02:00
Timothy Jaeryang Baek
2544f7eaf0 Merge pull request #5249 from open-webui/dev
refac: default search generation prompt
2024-09-07 06:42:12 +02:00
Timothy J. Baek
1a6ce1d5d9 refac: default search generation prompt 2024-09-07 05:41:55 +01:00
Timothy Jaeryang Baek
98eaec22d4 Merge pull request #5248 from open-webui/dev
fix
2024-09-07 06:20:35 +02:00
Timothy J. Baek
2e40719f4e fix 2024-09-07 05:18:52 +01:00
Timothy Jaeryang Baek
71a2bd2fea Merge pull request #5247 from open-webui/dev
refac: enable /api/embed
2024-09-07 06:13:02 +02:00
Timothy J. Baek
1c20db775c refac: enable /api/embed 2024-09-07 05:12:46 +01:00
Timothy Jaeryang Baek
e2ef36b582 Merge pull request #5238 from open-webui/dev
0.3.20
2024-09-07 06:08:23 +02:00
Timothy J. Baek
90a064972c fix 2024-09-07 05:07:37 +01:00
Timothy J. Baek
f4a0b845be doc: wording 2024-09-07 05:06:32 +01:00
Timothy J. Baek
1f22aa99d8 doc: changelog 2024-09-07 05:05:54 +01:00
Timothy J. Baek
4c9ea084d5 chore: format 2024-09-07 05:03:26 +01:00
Timothy J. Baek
a3094bcd1b fix: all response messages re-rendering on new message 2024-09-07 04:54:48 +01:00
Timothy J. Baek
5c8fb4b3d5 refac: web search 2024-09-07 04:50:29 +01:00
Timothy J. Baek
ff46fe2b4a refac 2024-09-07 03:09:57 +01:00
Timothy J. Baek
8d6a424604 fix: markdown proper spacing 2024-09-07 02:56:58 +01:00
Timothy J. Baek
8dfbdbd883 fix: mic kept alive after call issue 2024-09-07 01:28:07 +01:00
Timothy J. Baek
f533c9750b fix: close chat controls after call ends 2024-09-07 01:12:43 +01:00
Timothy J. Baek
2f841f9f5a fix: enable inline link image rendering 2024-09-06 23:40:35 +02:00
Timothy J. Baek
02d5bca44d fix: tools & function not installing requirements 2024-09-06 18:35:43 +02:00
Timothy J. Baek
14eda1bf5b fix: pdf download FONTS_DIR issue 2024-09-06 15:52:23 +02:00
Timothy Jaeryang Baek
2d4cdc5be9 Merge pull request #5209 from aleixdorca/dev
i18n: Update Catalan translation.json
2024-09-06 14:52:55 +02:00
Aleix Dorca
d038e831dc i18n: Update Catalan translation.json 2024-09-06 07:20:21 +02:00
Timothy J. Baek
9fe62fc80d refac 2024-09-06 05:30:16 +02:00
Timothy J. Baek
bfb12a7851 refac 2024-09-06 04:59:20 +02:00
Timothy Jaeryang Baek
4617f3a4e2 Merge pull request #5200 from open-webui/dev
fix
2024-09-05 21:01:12 +02:00
Timothy J. Baek
97e331632c fix: call overlay issue 2024-09-05 21:00:53 +02:00
Timothy J. Baek
4cf777ab5a refac: styling 2024-09-05 20:52:27 +02:00
Timothy Jaeryang Baek
05c0423d6e Merge pull request #5197 from open-webui/dev
0.3.19
2024-09-05 20:47:33 +02:00
Timothy J. Baek
377efc8a0c doc: changelog 2024-09-05 20:46:32 +02:00
Timothy J. Baek
b35bbaade2 fix: extract_frontmatter issue 2024-09-05 20:35:58 +02:00
Timothy J. Baek
c9107fa87f refac 2024-09-05 19:11:27 +02:00
Timothy J. Baek
0c1fab09ff refac 2024-09-05 18:55:31 +02:00
Timothy J. Baek
8b67959695 refac: styling 2024-09-05 18:44:52 +02:00
Timothy J. Baek
21e81d78d9 refac 2024-09-05 17:25:24 +02:00
Timothy J. Baek
31623ff330 refac: styling 2024-09-05 17:23:59 +02:00
Timothy J. Baek
7edfffdcc5 refac: styling 2024-09-05 17:11:55 +02:00
Timothy Jaeryang Baek
3b868be77b Merge pull request #5185 from open-webui/main
refac: styling
2024-09-05 17:04:10 +02:00
Timothy J. Baek
c3271e84ef refac: styling 2024-09-05 17:03:09 +02:00
Timothy Jaeryang Baek
1cac9fce46 Merge pull request #5182 from open-webui/main
dev
2024-09-05 16:26:15 +02:00
Timothy J. Baek
d0869bbfbc fix: migrations 2024-09-05 16:23:19 +02:00
Timothy J. Baek
ca4beb413b refac: styling 2024-09-05 16:21:34 +02:00
Timothy Jaeryang Baek
7b31ef60fb Merge pull request #5161 from KarlLee830/translate
i18n: Update Chinese translation
2024-09-05 16:15:46 +02:00
Timothy Jaeryang Baek
73576dfcaf Merge pull request #5180 from open-webui/main
dev
2024-09-05 16:14:11 +02:00
Timothy J. Baek
8a411decac fix 2024-09-05 16:13:40 +02:00
Timothy Jaeryang Baek
fa786c8e05 Merge pull request #5160 from vikrantrathore/main
fix: avoid overriding DATA_DIR and prevent errors when directories are the same
2024-09-05 16:11:42 +02:00
Timothy J. Baek
85fc35492d refac 2024-09-05 16:11:07 +02:00
Karl Lee
1c94f4dd71 i18n: Update Chinese translation 2024-09-05 15:28:13 +08:00
vikrantrathore
74169b0320 fix: avoid overriding DATA_DIR and prevent errors when directories are the same
Previously, the `DATA_DIR` environment variable was always overridden by defaulting to `OPEN_WEBUI_DIR / "data"`, which ignored user-defined `DATA_DIR` values. Additionally, when `DATA_DIR` and `NEW_DATA_DIR` were the same, the script attempted to copy files into themselves, leading to errors or redundant operations.

This commit ensures that:
1. The `DATA_DIR` environment variable is respected and not overridden.
2. Copy operations between `DATA_DIR` and `NEW_DATA_DIR` are only performed if the directories are different, preventing errors when they point to the same location.

These changes resolve potential file copy errors and preserve user configurations.
2024-09-05 14:17:58 +08:00
Timothy Jaeryang Baek
83574ccf6c Merge pull request #5159 from drupol/let-customize-pip-install
feat: add `OVERRIDE_PIP_INSTALL` env. variable
2024-09-04 23:01:01 +02:00
Timothy J. Baek
a0be3822bf refac 2024-09-04 23:00:01 +02:00
Pol Dellaiera
004700c125 feat: add OVERRIDE_PIP_INSTALL environment variable 2024-09-04 22:44:59 +02:00
Timothy Jaeryang Baek
19ee110b7d Merge pull request #5158 from pascallim/fix/start_scripts
fix scripts to point to correct path
2024-09-04 20:29:58 +02:00
Pascal Lim
998616c0fd fix scripts to point to correct path 2024-09-04 20:27:30 +02:00
Timothy Jaeryang Baek
9204498420 Merge pull request #5157 from open-webui/dev
0.3.18
2024-09-04 20:09:58 +02:00
Timothy J. Baek
b1957e5cfe doc: changelog 2024-09-04 20:08:14 +02:00
Timothy J. Baek
92a88df484 refac 2024-09-04 20:00:47 +02:00
Timothy J. Baek
f2f713023d refac 2024-09-04 19:57:41 +02:00
Timothy J. Baek
cf86ba7786 refac: tools & functions 2024-09-04 19:55:20 +02:00
Timothy J. Baek
94502d6494 fix: styling 2024-09-04 19:55:10 +02:00
Timothy Jaeryang Baek
5e3f9ec757 Merge pull request #5156 from open-webui/dev
fix
2024-09-04 19:04:03 +02:00
Timothy J. Baek
d6fc0ccf65 fix 2024-09-04 19:03:51 +02:00
Timothy Jaeryang Baek
a988c53949 Merge pull request #5155 from open-webui/dev
fix: tools & functions import
2024-09-04 19:00:52 +02:00
Timothy J. Baek
3afd66d50f fix: tools & functions import 2024-09-04 18:59:50 +02:00
Timothy Jaeryang Baek
a9801147b8 Merge pull request #5051 from open-webui/dev
0.3.17
2024-09-04 18:40:16 +02:00
Timothy J. Baek
f3d488fb0c doc: changelog 2024-09-04 18:37:09 +02:00
Timothy J. Baek
28e3701187 Update release-pypi.yml 2024-09-04 18:00:38 +02:00
Timothy J. Baek
8f6369374d refac: error handling 2024-09-04 17:52:59 +02:00
Timothy J. Baek
e5cfa6501b dev6 2024-09-04 17:47:51 +02:00
Timothy J. Baek
175ffc5c66 dev5 2024-09-04 17:33:39 +02:00
Timothy J. Baek
c0441ab2b8 dev4 2024-09-04 17:14:24 +02:00
Timothy J. Baek
6d1bd3ab66 dev4 2024-09-04 17:02:10 +02:00
Timothy J. Baek
1779e6fecc chore: format 2024-09-04 16:58:28 +02:00
Timothy J. Baek
03d5a670f6 refac: mv backend files to /open_webui dir 2024-09-04 16:54:48 +02:00
Timothy J. Baek
76806a998f fix: automatic1111 model update issue 2024-09-04 15:25:31 +02:00
Timothy J. Baek
9bcbf5e9b3 Update config.py 2024-09-03 21:46:40 +02:00
Timothy J. Baek
6bbb755997 feat: import/export config 2024-09-03 21:16:07 +02:00
Timothy Jaeryang Baek
aec7cd572c Merge pull request #5127 from open-webui/dependabot/pip/pip-5bab50f10f
build(deps): bump the pip group across 2 directories with 1 update
2024-09-03 20:17:04 +02:00
dependabot[bot]
856759d350 build(deps): bump the pip group across 2 directories with 1 update
Bumps the pip group with 1 update in the / directory: [flask-cors](https://github.com/corydolphin/flask-cors).
Bumps the pip group with 1 update in the /backend directory: [flask-cors](https://github.com/corydolphin/flask-cors).


Updates `flask-cors` from 4.0.1 to 5.0.0
- [Release notes](https://github.com/corydolphin/flask-cors/releases)
- [Changelog](https://github.com/corydolphin/flask-cors/blob/main/CHANGELOG.md)
- [Commits](https://github.com/corydolphin/flask-cors/compare/4.0.1...5.0.0)

Updates `flask-cors` from 4.0.1 to 5.0.0
- [Release notes](https://github.com/corydolphin/flask-cors/releases)
- [Changelog](https://github.com/corydolphin/flask-cors/blob/main/CHANGELOG.md)
- [Commits](https://github.com/corydolphin/flask-cors/compare/4.0.1...5.0.0)

---
updated-dependencies:
- dependency-name: flask-cors
  dependency-type: direct:production
  dependency-group: pip
- dependency-name: flask-cors
  dependency-type: direct:production
  dependency-group: pip
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-03 15:32:52 +00:00
Timothy J. Baek
5f92f7e41f enh: prevent trailing / from comfyui base url
Co-Authored-By: qwertyoriuop <41389168+qwertyoriuop@users.noreply.github.com>
2024-09-03 16:19:34 +02:00
Timothy J. Baek
890824ced4 fix: advanced params not being applied to ollama 2024-09-03 15:43:26 +02:00
Timothy J. Baek
2cd1207e73 fix: mermaid error on rating 2024-09-03 15:39:09 +02:00
Timothy J. Baek
1803c7adeb refac 2024-09-03 15:24:58 +02:00
Timothy J. Baek
fa8bb51b81 refac 2024-09-03 15:23:38 +02:00
Timothy J. Baek
9bea1950dc feat: web search url search param 2024-09-03 15:15:46 +02:00
Timothy Jaeryang Baek
df0bb4b4b0 Merge pull request #5070 from open-webui/dependabot/pip/backend/dev/authlib-1.3.2
build(deps): bump authlib from 1.3.1 to 1.3.2 in /backend
2024-09-03 14:51:30 +02:00
Timothy Jaeryang Baek
fdfa96ba51 Merge pull request #5069 from open-webui/dependabot/pip/backend/dev/duckduckgo-search-approx-eq-6.2.11
build(deps): update duckduckgo-search requirement from ~=6.2.1 to ~=6.2.11 in /backend
2024-09-03 14:51:24 +02:00
Timothy Jaeryang Baek
ff94a8e57f Merge pull request #5068 from open-webui/dependabot/pip/backend/dev/aiohttp-3.10.5
build(deps): bump aiohttp from 3.10.2 to 3.10.5 in /backend
2024-09-03 14:51:17 +02:00
Timothy Jaeryang Baek
41369aefdf Merge pull request #5067 from open-webui/dependabot/pip/backend/dev/langchain-0.2.15
build(deps): bump langchain from 0.2.14 to 0.2.15 in /backend
2024-09-03 14:51:11 +02:00
Timothy Jaeryang Baek
d5ad5c5422 Merge pull request #5066 from open-webui/dependabot/pip/backend/dev/unstructured-0.15.9
build(deps): bump unstructured from 0.15.7 to 0.15.9 in /backend
2024-09-03 14:51:03 +02:00
Timothy Jaeryang Baek
1357237a3e Merge pull request #5076 from cheahjs/fix/websocket-error-object
fix: chat errors when websocket unavailable
2024-09-03 14:50:50 +02:00
Jun Siang Cheah
4946f08671 fix: force socket.io to try websockets first, and explicit fallback to polling 2024-09-01 12:59:49 +01:00
dependabot[bot]
665c851f66 build(deps): bump authlib from 1.3.1 to 1.3.2 in /backend
Bumps [authlib](https://github.com/lepture/authlib) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/lepture/authlib/releases)
- [Changelog](https://github.com/lepture/authlib/blob/master/docs/changelog.rst)
- [Commits](https://github.com/lepture/authlib/compare/v1.3.1...v1.3.2)

---
updated-dependencies:
- dependency-name: authlib
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-01 02:56:51 +00:00
dependabot[bot]
115503098e build(deps): update duckduckgo-search requirement in /backend
Updates the requirements on [duckduckgo-search](https://github.com/deedy5/duckduckgo_search) to permit the latest version.
- [Release notes](https://github.com/deedy5/duckduckgo_search/releases)
- [Commits](https://github.com/deedy5/duckduckgo_search/compare/v6.2.1...v6.2.11)

---
updated-dependencies:
- dependency-name: duckduckgo-search
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-01 02:56:47 +00:00
dependabot[bot]
b7cda48a03 build(deps): bump aiohttp from 3.10.2 to 3.10.5 in /backend
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.10.2 to 3.10.5.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.10.2...v3.10.5)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-01 02:56:42 +00:00
dependabot[bot]
7780640938 build(deps): bump langchain from 0.2.14 to 0.2.15 in /backend
Bumps [langchain](https://github.com/langchain-ai/langchain) from 0.2.14 to 0.2.15.
- [Release notes](https://github.com/langchain-ai/langchain/releases)
- [Commits](https://github.com/langchain-ai/langchain/compare/langchain==0.2.14...langchain==0.2.15)

---
updated-dependencies:
- dependency-name: langchain
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-01 02:56:33 +00:00
dependabot[bot]
92488c254d build(deps): bump unstructured from 0.15.7 to 0.15.9 in /backend
Bumps [unstructured](https://github.com/Unstructured-IO/unstructured) from 0.15.7 to 0.15.9.
- [Release notes](https://github.com/Unstructured-IO/unstructured/releases)
- [Changelog](https://github.com/Unstructured-IO/unstructured/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Unstructured-IO/unstructured/compare/0.15.7...0.15.9)

---
updated-dependencies:
- dependency-name: unstructured
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-01 02:56:28 +00:00
Timothy Jaeryang Baek
bccc6e08cc Merge pull request #4957 from pascallim/fix/imports
fix: sort and fix backend imports
2024-08-31 20:09:04 +02:00
Timothy Jaeryang Baek
a8c15e1b54 Merge pull request #5060 from cheahjs/fix/missing-chat-completion-response-headers
fix: return proxied response headers during chat completion
2024-08-31 20:08:22 +02:00
Jun Siang Cheah
953beb369c fix: return proxied response headers during chat completion 2024-08-31 15:15:21 +01:00
Pascal Lim
9232e03102 fix imports 2024-08-30 22:29:45 +02:00
Pascal Lim
c386d0b1a5 sort and fix backend imports 2024-08-30 22:26:22 +02:00
Timothy J. Baek
08efabc696 refac 2024-08-30 10:56:31 -07:00
Timothy Jaeryang Baek
560b9228fd Merge pull request #4973 from sebdanielsson/ally-aria-labels
A11y: Add missing aria labels for buttons
2024-08-30 19:43:35 +02:00
Timothy Jaeryang Baek
d3bcfd4d5f Merge pull request #4974 from SearchApi/add-search-api
feat: Add support for SearchApi as alternative to WebSearch
2024-08-30 19:42:36 +02:00
Timothy Jaeryang Baek
3b21547c83 Merge pull request #4971 from sebdanielsson/lighthouse-seo-score
Lighthouse seo score and error fixes
2024-08-30 19:39:29 +02:00
Timothy Jaeryang Baek
62c475f6b4 Merge pull request #4976 from aleixdorca/dev
i18n: Update Catalan Translation
2024-08-30 19:38:58 +02:00
Timothy Jaeryang Baek
5367d5ec3b Merge pull request #5030 from Peter-De-Ath/fix-comfy-ui-403
fix: add useragent default headers comfyui
2024-08-30 19:38:50 +02:00
Timothy Jaeryang Baek
01a5569ee9 Merge pull request #5037 from KarlLee830/translate
i18n: Update Chinese translation
2024-08-30 19:37:35 +02:00
Timothy Jaeryang Baek
f75908ebe3 Merge pull request #4975 from sebdanielsson/automatic-theme-update
fix: Update color theme on system change
2024-08-30 19:37:24 +02:00
Timothy Jaeryang Baek
928326103c Merge pull request #4970 from daniel-code/feat/support-literal-type-in-tools
feat: support Literal type in Tools
2024-08-30 19:34:19 +02:00
Timothy Jaeryang Baek
8a11f12ffd Merge pull request #4945 from OriginalSimon/dev
i18n: Update Ukrainian translation
2024-08-30 19:34:03 +02:00
Karl Lee
a6b5bf8df2 i18n: Update Chinese translation 2024-08-30 18:23:27 +08:00
Peter De-Ath
a26f4306a4 fix: add useragent default headers comfyui 2024-08-29 23:38:37 +01:00
Jannik Streidl
0ead3ed37a feat: show total number of documents 2024-08-29 16:30:34 +02:00
Su YR
45363a2abb fix: type_ == "literal" 2024-08-29 15:55:12 +08:00
Aleix Dorca
a7b6d5507f i18n: Update Catalan translation.json 2024-08-28 13:06:52 +02:00
Aleix Dorca
2706b8c59c i18n: Update Catalan translation.json 2024-08-28 13:05:19 +02:00
Sebastian
fd1612935d Update color theme on system change 2024-08-28 12:43:43 +02:00
Rajendra Kadam
7e1923fcfe Add searchapi as an alternative web search
Add config changes for SearchApi api key and engine

Add searchapi results json in testdata
2024-08-28 15:26:33 +05:30
Sebastian
22117e06b5 A11y: Buttons do not have an accessible name 2024-08-28 10:13:02 +02:00
Sebastian
718d69b148 Add meta description 2024-08-28 10:10:22 +02:00
Sebastian
30e03cbac4 Add robots.txt to fix validation error 2024-08-28 10:10:22 +02:00
Su YR
0525dd2bb5 feat: support Literal type in Tools 2024-08-28 15:16:56 +08:00
Timothy Jaeryang Baek
6589450bd6 Merge pull request #4954 from open-webui/main
dev
2024-08-27 22:45:44 +02:00
Timothy Jaeryang Baek
f4df49e600 Merge pull request #4953 from open-webui/dev
fix: support list in json schema to pydantic
2024-08-27 22:45:28 +02:00
Timothy Jaeryang Baek
bc6d06b49e Merge pull request #4952 from Peter-De-Ath/support-list-json-schema-pydantic
fix: support list in json schema pydantic
2024-08-27 22:43:49 +02:00
Peter De-Ath
025f0f390e refac: support list in json schema to pydantic 2024-08-27 21:42:22 +01:00
Timothy J. Baek
0c0a860538 revert: docker build workflow 2024-08-27 22:40:23 +02:00
Simon
8994728d8b Update translation.json 2024-08-27 19:09:42 +02:00
Timothy Jaeryang Baek
693dc3107a Merge pull request #4811 from open-webui/dev
0.3.16
2024-08-27 18:49:04 +02:00
Timothy J. Baek
63c0772135 Update uv.lock 2024-08-27 18:48:56 +02:00
Timothy J. Baek
fb9b7275ad doc: changelog 2024-08-27 18:45:35 +02:00
Timothy J. Baek
7a024fbe1e refac 2024-08-27 18:18:40 +02:00
Timothy Jaeryang Baek
9dade91ef5 Merge pull request #4917 from Yanyutin753/upload_files_limit
🤖 Limit the size and number of uploaded files
2024-08-27 17:09:52 +02:00
Timothy J. Baek
35fa278b37 chore: format 2024-08-27 17:07:47 +02:00
Timothy J. Baek
6a21a77ee9 refac 2024-08-27 17:05:24 +02:00
Timothy J. Baek
628310b12b refac 2024-08-27 15:58:02 +02:00
Timothy J. Baek
ef28330c1a refac: do NOT change default behaviour in a PR 2024-08-27 15:56:47 +02:00
Timothy J. Baek
69c4687a53 refac 2024-08-27 15:53:29 +02:00
Timothy J. Baek
09cba5b87a refac: rm sub standard code 2024-08-27 15:51:40 +02:00
Timothy J. Baek
600409682e refac: do not change default behaviour 2024-08-27 15:30:57 +02:00
Timothy J. Baek
689b05a73d enh: add content-type: application/x-ndjson to ollama /api/chat 2024-08-27 14:06:58 +02:00
Timothy J. Baek
062649e483 refac: endpoints regarding db operations 2024-08-27 14:01:00 +02:00
Timothy Jaeryang Baek
bbeed7cd85 Merge pull request #4938 from KarlLee830/translate
i18n: Update Chinese translation
2024-08-27 13:30:42 +02:00
Karl Lee
6c49a15e20 i18n: Update Chinese translation 2024-08-27 19:12:47 +08:00
Timothy Jaeryang Baek
18a6b00083 Merge pull request #4929 from jannikstdl/improve-rag-status
fix: reset status on error + styling
2024-08-27 13:08:46 +02:00
Timothy Jaeryang Baek
7c841c9f63 Merge pull request #4924 from Peter-De-Ath/fix-duplicate-system-prompt
fix: stop system prompt being duplicated
2024-08-27 13:07:26 +02:00
Jannik Streidl
97d73d3d33 fix: reset status on error + styling 2024-08-27 11:24:05 +02:00
Peter De-Ath
b2e682e263 fix: stop system prompt being duplicated 2024-08-26 21:25:57 +01:00
Clivia
29cbdbcadd 💄Fix format 2024-08-26 23:59:53 +08:00
Clivia
ebca735f5e 💄Fix format 2024-08-26 23:53:51 +08:00
Clivia
775478534a 👀 Fix Common users cannot upload files
💄Fix format

💄Fix format i18

 Feat paste upload files and make restrictions

 Feat paste upload files and make restrictions
2024-08-26 23:36:13 +08:00
Clivia
b01d72ade3 💄Fix format
💄Fix format
2024-08-26 23:36:13 +08:00
Clivia
b6da4baa97 💄 Limit the size and number of uploaded files
💄 Limit the size and number of uploaded files
2024-08-26 23:36:13 +08:00
Timothy J. Baek
7fa9f381e1 chore: format 2024-08-26 15:38:42 +02:00
Timothy J. Baek
a9673c793a fix 2024-08-26 15:37:11 +02:00
Timothy Jaeryang Baek
b148865ee8 Merge pull request #4886 from kiosion/dev
feat: Add control for how message content is split for TTS generation requests
2024-08-26 15:02:30 +02:00
Timothy J. Baek
f4f7adb377 refac 2024-08-26 15:01:29 +02:00
Timothy J. Baek
b96239fb0b enh: block api user with model filter 2024-08-26 14:24:56 +02:00
Timothy J. Baek
7fc049a513 enh: codespan click to copy content 2024-08-26 14:17:33 +02:00
Timothy J. Baek
faeabfb3d4 fix: include __files__ param to pipe function 2024-08-26 12:36:04 +02:00
Timothy J. Baek
de6b5a7bbe refac 2024-08-26 12:27:00 +02:00
Timothy J. Baek
efd4b03f78 enh: repopulate tools & functions from db if non existent 2024-08-26 12:18:12 +02:00
Timothy J. Baek
e98a20fce9 fix: .md processing issue 2024-08-26 12:08:55 +02:00
Timothy J. Baek
5a0e1c5f75 refac: disable signups when ENABLE_LOGIN_FORM is set to false 2024-08-26 11:54:55 +02:00
Timothy Jaeryang Baek
c224f1105e Merge pull request #4859 from 0xThresh/main
Enhancement: Update Docker image metadata
2024-08-26 11:38:16 +02:00
Timothy Jaeryang Baek
95185aaaec Merge pull request #4904 from que-nguyen/dev
Fix and update Vietnamese translations for better accuracy.
2024-08-26 11:35:01 +02:00
Que Nguyen
cb7ee6212e Fix and update Vietnamese translations for better accuracy. 2024-08-26 14:14:00 +07:00
kiosion
d78c35c9ba refac: Tidy Chat.svelte 2024-08-25 20:27:50 -04:00
kiosion
73998a70cc i18n: Add new strings for en, fr locales 2024-08-25 20:03:58 -04:00
kiosion
3967c34261 feat: Add control for how message content is split for TTS generation reqs 2024-08-25 20:03:21 -04:00
kiosion
f30428754f fix: Safely retrieve settings from LocalStorage 2024-08-25 20:00:57 -04:00
James W.
56c9552ab3 Reset package.json to correct version 2024-08-25 14:46:21 -07:00
James W.
e414ba2d8c Merge pull request #28 from 0xThresh/dev
Test updating version with all images
2024-08-25 15:34:37 -06:00
0xThresh.eth
b1355e16bc Test updating version with all images 2024-08-25 15:33:08 -06:00
James W.
882b76cefa Merge pull request #27 from 0xThresh/dev
Add image updates to cuda and ollama image jobs
2024-08-25 15:28:51 -06:00
0xThresh.eth
63d82dbece Add image updates to cuda and ollama image jobs 2024-08-25 15:28:09 -06:00
Timothy J. Baek
f568389235 refac 2024-08-25 18:42:27 +02:00
Timothy Jaeryang Baek
814473878f Merge pull request #4899 from open-webui/config-db-migration
feat: config.json db migration
2024-08-25 17:59:01 +02:00
Timothy J. Baek
a44bae2d3a fix 2024-08-25 17:54:51 +02:00
Timothy J. Baek
fd0370d801 fix 2024-08-25 16:57:01 +02:00
Timothy J. Baek
58cf1be20c feat: config.json db migration 2024-08-25 16:52:36 +02:00
Timothy Jaeryang Baek
072945c40b Merge pull request #4867 from El-Tatane/improve-fr-translations
i18n: Improve French translations
2024-08-25 14:50:24 +02:00
El-Tatane
7c7d407f34 i18n: Improve French translations 2024-08-23 22:00:05 +02:00
James W.
c63a2dfbcd Merge pull request #26 from 0xThresh/dev
Test bumping the Open WebUI version
2024-08-23 12:11:24 -06:00
0xThresh.eth
e1022b3a28 Test bumping the Open WebUI version 2024-08-23 12:10:39 -06:00
James W.
0022902e8d Merge pull request #25 from 0xThresh/dev
Try removing push by digest
2024-08-23 12:03:42 -06:00
0xThresh.eth
9be7c8b969 Try removing push by digest 2024-08-23 12:03:06 -06:00
James W.
913b454fc3 Merge pull request #24 from 0xThresh/dev
Move version tags to latest when no new release is created
2024-08-23 11:54:09 -06:00
0xThresh.eth
ff1ea70dfa Only add version tag to main 2024-08-23 11:46:30 -06:00
0xThresh.eth
550386f52a Test moving tags in Actions 2024-08-23 11:40:02 -06:00
Timothy J. Baek
7a1fecbdb3 fix 2024-08-23 18:22:50 +02:00
Timothy J. Baek
8a99eaa68f fix 2024-08-23 18:21:19 +02:00
Timothy J. Baek
e442b3b169 fix: async image gen automatic1111 2024-08-23 16:51:34 +02:00
Timothy J. Baek
553293f4d5 refac: styling 2024-08-23 16:45:07 +02:00
Timothy J. Baek
48503573c1 refac: call overlay styling 2024-08-23 16:42:36 +02:00
Timothy J. Baek
4519ddd0e9 refac: files rbac 2024-08-23 16:19:04 +02:00
Timothy J. Baek
8b3d5e8b80 chore: format 2024-08-23 15:56:50 +02:00
Timothy J. Baek
0a5a2e67e8 fix: uploaded files leaking to other user chats issue
#4601
2024-08-23 15:02:23 +02:00
Timothy J. Baek
7b91be21b4 refac 2024-08-23 14:43:32 +02:00
Timothy J. Baek
591962d906 refac: input commands 2024-08-23 14:31:39 +02:00
Timothy Jaeryang Baek
64c0157271 Merge pull request #4842 from KarlLee830/translate
i18n: Update Chinese translation
2024-08-23 14:08:48 +02:00
Timothy Jaeryang Baek
f5c0e670aa Merge pull request #4847 from michaelpoluektov/fix-tools-param
fix: `__tools__` param
2024-08-23 14:08:32 +02:00
Michael Poluektov
83de28bac2 fix: tools param 2024-08-23 12:58:43 +01:00
Karl Lee
c6885a8bcf i18n: Update Chinese translation 2024-08-23 18:01:26 +08:00
Timothy J. Baek
5d8dbff486 refac 2024-08-22 17:37:47 +02:00
Timothy J. Baek
0939cb5ed6 refac: styling 2024-08-22 17:34:28 +02:00
Timothy J. Baek
153a2876b4 fix: mediaStream not stopping after exiting call mode 2024-08-22 17:27:22 +02:00
Timothy J. Baek
61503a654c enh: call=true url search param 2024-08-22 17:17:32 +02:00
Timothy J. Baek
c268a4e217 refac: only activate wakelock in call mode 2024-08-22 17:12:31 +02:00
Timothy J. Baek
70ab7735ba chore: format 2024-08-22 16:38:48 +02:00
Timothy J. Baek
25de3e753d fix 2024-08-22 16:34:12 +02:00
Timothy Jaeryang Baek
670672c067 Merge pull request #4813 from jannikstdl/rag-knowledge-status
feat: show rag status when using models with knowledge collections
2024-08-22 16:31:42 +02:00
Timothy J. Baek
85f8a80389 refac 2024-08-22 16:31:33 +02:00
Timothy J. Baek
673b893a8a refac 2024-08-22 16:11:19 +02:00
Timothy J. Baek
d8d2f3529f refac 2024-08-22 16:08:03 +02:00
Timothy J. Baek
63ba8145b9 refac 2024-08-22 16:02:29 +02:00
Timothy Jaeryang Baek
99db82a161 Merge pull request #4815 from michaelpoluektov/fix-user-valves
fix: Fix user valves
2024-08-22 15:25:45 +02:00
Timothy J. Baek
a3089e0472 fix 2024-08-22 15:24:48 +02:00
Timothy Jaeryang Baek
9186abf9c1 Merge branch 'dev' into fix-user-valves 2024-08-22 15:23:59 +02:00
Timothy J. Baek
97808ba1c3 refac 2024-08-22 15:23:32 +02:00
Timothy J. Baek
589420c208 refac 2024-08-22 15:20:19 +02:00
Timothy J. Baek
3bf7d569c6 refac 2024-08-22 15:11:31 +02:00
Timothy J. Baek
14187b027d refac 2024-08-22 15:09:06 +02:00
Timothy J. Baek
06f067fda9 refacfix 2024-08-22 15:03:39 +02:00
Michael Poluektov
9b5dfe64b7 fix: is not None 2024-08-22 13:58:10 +01:00
Timothy J. Baek
1c89c91f07 refac 2024-08-22 14:53:14 +02:00
Timothy J. Baek
ed5761f18f refac: rye -> uv 2024-08-22 14:38:05 +02:00
Michael Poluektov
16ec25d296 fix user valves 2024-08-22 13:34:35 +01:00
Jannik Streidl
abe17ab4b5 feat: show rag status when using models with knowledge collections 2024-08-22 14:30:11 +02:00
Timothy Jaeryang Baek
14f0e6a2ba Merge pull request #4783 from open-webui/dependabot/pip/backend/dev/langchain-community-0.2.12
chore(deps): bump langchain-community from 0.2.10 to 0.2.12 in /backend
2024-08-22 14:26:41 +02:00
Timothy Jaeryang Baek
f1f2f034f8 Merge pull request #4785 from open-webui/dependabot/pip/backend/dev/markdown-3.7
chore(deps): bump markdown from 3.6 to 3.7 in /backend
2024-08-22 14:26:33 +02:00
Timothy J. Baek
63418a583a fix: latex rendering issue 2024-08-22 14:24:49 +02:00
dependabot[bot]
4031cb9eda chore(deps): bump langchain-community from 0.2.10 to 0.2.12 in /backend
Bumps [langchain-community](https://github.com/langchain-ai/langchain) from 0.2.10 to 0.2.12.
- [Release notes](https://github.com/langchain-ai/langchain/releases)
- [Commits](https://github.com/langchain-ai/langchain/compare/langchain-community==0.2.10...langchain-community==0.2.12)

---
updated-dependencies:
- dependency-name: langchain-community
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-22 12:10:43 +00:00
dependabot[bot]
ee6b8c5b72 chore(deps): bump markdown from 3.6 to 3.7 in /backend
Bumps [markdown](https://github.com/Python-Markdown/markdown) from 3.6 to 3.7.
- [Release notes](https://github.com/Python-Markdown/markdown/releases)
- [Changelog](https://github.com/Python-Markdown/markdown/blob/master/docs/changelog.md)
- [Commits](https://github.com/Python-Markdown/markdown/compare/3.6...3.7)

---
updated-dependencies:
- dependency-name: markdown
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-22 12:07:04 +00:00
Timothy Jaeryang Baek
11aecbe79a Merge pull request #4768 from zhaofengli/db-url-fixes
fix: Fix parameter handling for PostgreSQL URLs
2024-08-22 14:01:28 +02:00
Timothy Jaeryang Baek
a9bace0f97 Merge pull request #4784 from open-webui/dependabot/pip/backend/dev/langchain-0.2.14
chore(deps): bump langchain from 0.2.12 to 0.2.14 in /backend
2024-08-22 13:59:27 +02:00
Timothy Jaeryang Baek
7e4fed2451 Merge pull request #4786 from open-webui/dependabot/pip/backend/dev/unstructured-0.15.7
chore(deps): bump unstructured from 0.15.5 to 0.15.7 in /backend
2024-08-22 13:59:03 +02:00
Timothy Jaeryang Baek
ac8a16ec5b Merge pull request #4787 from open-webui/dependabot/pip/backend/dev/langfuse-2.44.0
chore(deps): bump langfuse from 2.43.3 to 2.44.0 in /backend
2024-08-22 13:58:48 +02:00
Timothy Jaeryang Baek
95d016dea4 Merge pull request #4800 from aleixdorca/dev
i18n: Update catalan translation.json
2024-08-22 13:58:14 +02:00
Timothy Jaeryang Baek
abe36a3e67 Merge pull request #4803 from CJDaniel96/dev
fix: DeprecationWarning for datetime.utcnow() by using datetime.now(UTC)
2024-08-22 13:57:57 +02:00
USIGLOBAL\daniel_tsai
89ebbed67b fix: DeprecationWarning for datetime.utcnow() by using datetime.now(UTC) 2024-08-22 15:12:40 +08:00
Aleix Dorca
ec075e2612 Update catalan translation.json 2024-08-22 07:12:42 +02:00
Timothy Jaeryang Baek
e2b7296786 Merge pull request #4798 from open-webui/dev
fix: filter compatibility issue
2024-08-22 01:14:34 +02:00
Timothy J. Baek
6fcd40d4d8 fix: filter compatibility issue 2024-08-22 01:08:59 +02:00
Timothy Jaeryang Baek
847ca66001 Merge pull request #4795 from open-webui/dev
0.3.15
2024-08-22 00:28:30 +02:00
Timothy J. Baek
85b4129219 fix 2024-08-22 00:25:43 +02:00
Timothy J. Baek
c36f83df5b doc: changelog 2024-08-22 00:23:40 +02:00
Timothy J. Baek
bb026cdd9c fix: many model chat backward compatibility 2024-08-22 00:22:40 +02:00
Timothy J. Baek
8843898a8c fix: older many model chat compatibility 2024-08-22 00:03:58 +02:00
Timothy J. Baek
f036aa0a48 doc: changelog 2024-08-21 23:47:33 +02:00
Timothy J. Baek
1e928e463f chore: format 2024-08-21 23:35:54 +02:00
Timothy J. Baek
36e895c135 fix 2024-08-21 23:33:32 +02:00
Timothy J. Baek
3447f233fa fix 2024-08-21 23:27:23 +02:00
Timothy J. Baek
f3e8dd1f2e enh: comfyui logs 2024-08-21 23:22:12 +02:00
Timothy J. Baek
3f0b7b29db fix 2024-08-21 23:11:12 +02:00
Timothy J. Baek
95cf90d787 enh: comfyui seed node support 2024-08-21 23:05:20 +02:00
Timothy J. Baek
f3f6941205 fix: many model chat actions not working 2024-08-21 22:54:56 +02:00
Timothy J. Baek
4a21c5c5e7 refac 2024-08-21 22:42:25 +02:00
Timothy J. Baek
180f2b9a83 fix: functions 2024-08-21 22:39:36 +02:00
Timothy J. Baek
94eb91063c fix 2024-08-21 22:27:21 +02:00
Timothy J. Baek
dc4c6b3b14 enh: temporary-chat url search param 2024-08-21 18:55:12 +02:00
Timothy Jaeryang Baek
50d53c6f8d Merge pull request #4790 from open-webui/dev
fix
2024-08-21 18:33:57 +02:00
Timothy J. Baek
a93b0ac143 fix 2024-08-21 18:33:31 +02:00
Timothy Jaeryang Baek
ed92205d7d Merge pull request #4789 from open-webui/dev
fix
2024-08-21 18:30:10 +02:00
Timothy J. Baek
acaf135a2f fix 2024-08-21 18:29:52 +02:00
Timothy Jaeryang Baek
bf6c6afb21 Merge pull request #4788 from open-webui/main
dev
2024-08-21 17:41:15 +02:00
dependabot[bot]
f5994e3a44 chore(deps): bump langfuse from 2.43.3 to 2.44.0 in /backend
Bumps [langfuse](https://github.com/langfuse/langfuse) from 2.43.3 to 2.44.0.
- [Release notes](https://github.com/langfuse/langfuse/releases)
- [Commits](https://github.com/langfuse/langfuse/commits/v2.44.0)

---
updated-dependencies:
- dependency-name: langfuse
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-21 15:38:07 +00:00
dependabot[bot]
ccf5bd1492 chore(deps): bump unstructured from 0.15.5 to 0.15.7 in /backend
Bumps [unstructured](https://github.com/Unstructured-IO/unstructured) from 0.15.5 to 0.15.7.
- [Release notes](https://github.com/Unstructured-IO/unstructured/releases)
- [Changelog](https://github.com/Unstructured-IO/unstructured/blob/0.15.7/CHANGELOG.md)
- [Commits](https://github.com/Unstructured-IO/unstructured/compare/0.15.5...0.15.7)

---
updated-dependencies:
- dependency-name: unstructured
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-21 15:38:05 +00:00
dependabot[bot]
510a0f3a2f chore(deps): bump langchain from 0.2.12 to 0.2.14 in /backend
Bumps [langchain](https://github.com/langchain-ai/langchain) from 0.2.12 to 0.2.14.
- [Release notes](https://github.com/langchain-ai/langchain/releases)
- [Commits](https://github.com/langchain-ai/langchain/compare/langchain==0.2.12...langchain==0.2.14)

---
updated-dependencies:
- dependency-name: langchain
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-21 15:37:56 +00:00
Timothy Jaeryang Baek
8a620cab44 Merge pull request #4623 from open-webui/dev
0.3.14
2024-08-21 17:36:58 +02:00
Timothy J. Baek
fcffb0adf2 fix 2024-08-21 17:28:09 +02:00
Timothy J. Baek
efcb56f0dc refac 2024-08-21 17:27:39 +02:00
Timothy J. Baek
86ee19178e doc: changelog 2024-08-21 17:09:18 +02:00
Timothy J. Baek
1fc306acd0 chore: backend bump 2024-08-21 15:47:03 +02:00
Timothy J. Baek
da1d5ad917 fix 2024-08-21 15:42:33 +02:00
Timothy J. Baek
b45db22a17 chore: format 2024-08-21 15:16:37 +02:00
Timothy J. Baek
19455ab04e fix 2024-08-21 15:15:29 +02:00
Timothy J. Baek
71b1661f00 fix 2024-08-21 14:49:54 +02:00
Timothy J. Baek
99764bfd29 fix 2024-08-21 14:49:17 +02:00
Timothy J. Baek
063e006446 feat: custom comfyui workflow
Co-Authored-By: John Karabudak <hello@johnthenerd.com>
2024-08-21 14:44:47 +02:00
Timothy J. Baek
436f009dab refac 2024-08-21 14:20:52 +02:00
Timothy J. Baek
71a66ed4cf refac 2024-08-21 14:18:47 +02:00
Timothy J. Baek
29bef261be refac 2024-08-21 14:16:33 +02:00
Timothy J. Baek
e2291f7148 refac 2024-08-21 01:39:30 +02:00
Timothy J. Baek
8b5aed7a2b refac 2024-08-21 01:21:03 +02:00
Timothy J. Baek
95057d2368 refac: image gen 2024-08-21 00:35:42 +02:00
Timothy Jaeryang Baek
20dadf9b5a Merge pull request #4760 from michaelpoluektov/tools-refac-2.1
Fix: tools filter
2024-08-20 18:51:28 +02:00
Michael Poluektov
3d6ac3a7db Merge branch 'dev' of https://github.com/open-webui/open-webui into tools-refac-2.1 2024-08-20 17:42:25 +01:00
Michael Poluektov
bd47bbbce9 fix tools filter 2024-08-20 17:41:51 +01:00
Timothy Jaeryang Baek
ddebfc7413 Merge pull request #4757 from OriginalSimon/dev
i18n: Update of the Ukrainian translation
2024-08-20 18:17:40 +02:00
Timothy J. Baek
c5310e84db feat: custom COMFYUI_WORKFLOW
deprecates several comfyui env vars
2024-08-20 18:17:15 +02:00
Simon
0c8301e79c Update translation.json 2024-08-20 17:44:20 +02:00
Timothy J. Baek
73faa8dc80 refac: styling 2024-08-20 17:03:20 +02:00
Timothy Jaeryang Baek
ee526b4b07 Merge pull request #4724 from michaelpoluektov/tools-refac-2.1
feat: Add `__tools__` optional param for function pipes
2024-08-20 17:01:13 +02:00
Michael Poluektov
454f59d59a undo frontend change 2024-08-20 15:48:14 +01:00
Michael Poluektov
2e3146263c put tool_ids and files in metadata 2024-08-20 15:41:49 +01:00
Michael Poluektov
bcbcd5fde9 Merge branch 'dev' of https://github.com/open-webui/open-webui into tools-refac-2.1 2024-08-20 14:56:47 +01:00
Timothy J. Baek
83a596612a fix 2024-08-20 14:28:19 +02:00
Timothy J. Baek
2b896989b8 refac 2024-08-20 14:27:14 +02:00
Timothy Jaeryang Baek
27109d22e4 Merge pull request #4743 from 5E-324/add-num_gpu
fix: Changes to num_gpu made in Settings > General won't be saved
2024-08-20 13:38:11 +02:00
Timothy Jaeryang Baek
22d8f8f1ef Merge pull request #4746 from 5E-324/fix-type-errors
chore: Fix type errors.
2024-08-20 13:37:08 +02:00
Zhuoran
fd26e5635d Fix type errors. 2024-08-20 08:44:09 +08:00
Zhuoran
b350b0023f Add num_gpu in General.svelte 2024-08-20 07:47:20 +08:00
Timothy J. Baek
330eb0fbb1 enh: user message edit 2024-08-19 21:51:10 +02:00
Timothy J. Baek
d79d3f1352 enh: mermaid dark theme 2024-08-19 19:42:31 +02:00
Michael Poluektov
44966db505 avoid ugly exception 2024-08-19 17:04:57 +01:00
Timothy J. Baek
1e8abea753 refac 2024-08-19 17:58:54 +02:00
Timothy J. Baek
21d8ff61bb refac 2024-08-19 17:57:47 +02:00
Michael Poluektov
9652c8f8af dont delete files and tool_ids 2024-08-19 16:57:29 +01:00
Timothy J. Baek
de8f5b9c13 enh: default title gen prompt 2024-08-19 17:54:34 +02:00
Michael Poluektov
c89df923c5 fix import error 2024-08-19 16:52:42 +01:00
Michael Poluektov
556bc8669a remove config options for now 2024-08-19 16:50:52 +01:00
Timothy J. Baek
89ba98e927 enh: better pdf CJK language support 2024-08-19 17:50:42 +02:00
Timothy J. Baek
6c8a15fae2 refac 2024-08-19 17:47:28 +02:00
Timothy J. Baek
68d8fd69c0 fix 2024-08-19 17:44:14 +02:00
Timothy J. Baek
b31de299e4 fix: mermaid rendering issue 2024-08-19 17:28:38 +02:00
Michael Poluektov
9d7037b730 add pydantic model from json 2024-08-19 16:27:38 +01:00
Michael Poluektov
5edc211392 pass docstring to function 2024-08-19 16:27:21 +01:00
Timothy J. Baek
1329eea5e5 refac 2024-08-19 17:00:48 +02:00
Timothy J. Baek
28022b056b chore: format 2024-08-19 16:51:17 +02:00
Timothy J. Baek
cbadf39d7d enh: user chat edit permission 2024-08-19 16:49:40 +02:00
Timothy Jaeryang Baek
ec99ac7121 Update SECURITY.md 2024-08-19 09:18:40 -05:00
Timothy J. Baek
dfa5041b6f refac: styling 2024-08-19 15:30:41 +02:00
Timothy J. Baek
0fa85c5c64 enh: enable message rating setting 2024-08-19 15:16:49 +02:00
Timothy J. Baek
5abe1076ed enh: model workspace shiftKey quick actions 2024-08-19 14:58:15 +02:00
Timothy Jaeryang Baek
7feda56e7b Merge pull request #4718 from open-webui/dependabot/pip/backend/dev/bcrypt-4.2.0
chore(deps): bump bcrypt from 4.1.3 to 4.2.0 in /backend
2024-08-19 14:17:00 +02:00
dependabot[bot]
a54d3ad512 chore(deps): bump bcrypt from 4.1.3 to 4.2.0 in /backend
Bumps [bcrypt](https://github.com/pyca/bcrypt) from 4.1.3 to 4.2.0.
- [Changelog](https://github.com/pyca/bcrypt/blob/main/release.py)
- [Commits](https://github.com/pyca/bcrypt/compare/4.1.3...4.2.0)

---
updated-dependencies:
- dependency-name: bcrypt
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-19 12:05:37 +00:00
Timothy Jaeryang Baek
cdf9f5a4ec Merge pull request #4720 from open-webui/dependabot/pip/backend/dev/boto3-1.35.0
chore(deps): bump boto3 from 1.34.153 to 1.35.0 in /backend
2024-08-19 14:04:41 +02:00
Timothy Jaeryang Baek
a472bfe6dc Merge pull request #4719 from open-webui/dependabot/pip/backend/dev/faster-whisper-1.0.3
chore(deps): bump faster-whisper from 1.0.2 to 1.0.3 in /backend
2024-08-19 14:04:31 +02:00
Timothy Jaeryang Baek
f88d994c35 Merge pull request #4717 from open-webui/dependabot/pip/backend/dev/uvicorn-standard--0.30.6
chore(deps): bump uvicorn[standard] from 0.22.0 to 0.30.6 in /backend
2024-08-19 14:04:22 +02:00
Timothy Jaeryang Baek
ad92aded84 Merge pull request #4716 from open-webui/dependabot/pip/backend/dev/sqlalchemy-2.0.32
chore(deps): bump sqlalchemy from 2.0.31 to 2.0.32 in /backend
2024-08-19 14:03:43 +02:00
Timothy J. Baek
b4de0a52f8 fix
Co-Authored-By: elad_pt <124190990+elad-pticha@users.noreply.github.com>
2024-08-19 14:01:21 +02:00
Timothy Jaeryang Baek
bd23dac92e Merge pull request #4714 from crizCraig/set-cors
sec: Allow setting CORS origin
2024-08-19 13:55:28 +02:00
Michael Poluektov
528df12bf1 fix: nonetype error 2024-08-19 11:15:22 +01:00
Michael Poluektov
a933319adb import error? 2024-08-19 11:11:00 +01:00
Michael Poluektov
13c03bfd7d add __tools__ custom param 2024-08-19 11:08:27 +01:00
Michael Poluektov
18965dcdac delete keys if envvars are set 2024-08-19 11:03:55 +01:00
Michael Poluektov
a4a7d678f9 move tools utils to utils.tools 2024-08-19 10:53:12 +01:00
Michael Poluektov
fd422d2e3c use filters envvars 2024-08-19 10:46:52 +01:00
Michael Poluektov
ce7a1a73ac remove more nesting 2024-08-19 10:34:44 +01:00
Michael Poluektov
32874a816d add filter toggle envvars 2024-08-19 10:26:16 +01:00
Michael Poluektov
3164354c0b refactor into single wrapper 2024-08-19 10:23:40 +01:00
dependabot[bot]
f96aaf1177 chore(deps): bump boto3 from 1.34.153 to 1.35.0 in /backend
Bumps [boto3](https://github.com/boto/boto3) from 1.34.153 to 1.35.0.
- [Release notes](https://github.com/boto/boto3/releases)
- [Commits](https://github.com/boto/boto3/compare/1.34.153...1.35.0)

---
updated-dependencies:
- dependency-name: boto3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-19 03:07:09 +00:00
dependabot[bot]
589c79f3c2 chore(deps): bump faster-whisper from 1.0.2 to 1.0.3 in /backend
Bumps [faster-whisper](https://github.com/SYSTRAN/faster-whisper) from 1.0.2 to 1.0.3.
- [Release notes](https://github.com/SYSTRAN/faster-whisper/releases)
- [Commits](https://github.com/SYSTRAN/faster-whisper/compare/v1.0.2...v1.0.3)

---
updated-dependencies:
- dependency-name: faster-whisper
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-19 03:07:03 +00:00
dependabot[bot]
a0f6864216 chore(deps): bump uvicorn[standard] from 0.22.0 to 0.30.6 in /backend
Bumps [uvicorn[standard]](https://github.com/encode/uvicorn) from 0.22.0 to 0.30.6.
- [Release notes](https://github.com/encode/uvicorn/releases)
- [Changelog](https://github.com/encode/uvicorn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/encode/uvicorn/compare/0.22.0...0.30.6)

---
updated-dependencies:
- dependency-name: uvicorn[standard]
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-19 03:06:54 +00:00
dependabot[bot]
a4cc2c5c48 chore(deps): bump sqlalchemy from 2.0.31 to 2.0.32 in /backend
Bumps [sqlalchemy](https://github.com/sqlalchemy/sqlalchemy) from 2.0.31 to 2.0.32.
- [Release notes](https://github.com/sqlalchemy/sqlalchemy/releases)
- [Changelog](https://github.com/sqlalchemy/sqlalchemy/blob/main/CHANGES.rst)
- [Commits](https://github.com/sqlalchemy/sqlalchemy/commits)

---
updated-dependencies:
- dependency-name: sqlalchemy
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-19 03:06:51 +00:00
Craig Quiter
0550d12106 Black format 2024-08-18 15:04:01 -07:00
Craig Quiter
845628c100 Fix tab format causing build failure 2024-08-18 15:00:49 -07:00
Craig Quiter
7bcdc10539 Optimize imports 2024-08-18 14:19:29 -07:00
Craig Quiter
d2f10d50bf Allow seting CORS origin 2024-08-18 14:19:29 -07:00
Timothy Jaeryang Baek
446b2a334a Merge pull request #4713 from FINNSEEFLY/task/adjust-localization
i18n: Update ru-RU and uk-UA localizations
2024-08-18 22:57:34 +02:00
FINNSEEFLY
b0fd90ada9 Adjust controls to ensure proper display of localized strings 2024-08-18 22:42:58 +03:00
FINNSEEFLY
6bfd48e412 Adjust uk localization 2024-08-18 22:40:18 +03:00
FINNSEEFLY
07ffd6e231 Adjust ru localization 2024-08-18 22:39:36 +03:00
Timothy J. Baek
c675beeda4 refac 2024-08-18 21:14:22 +02:00
Timothy J. Baek
fe0cf9506c refac 2024-08-18 21:11:59 +02:00
Timothy J. Baek
7c81509804 feat: merge responses 2024-08-18 20:59:59 +02:00
Timothy J. Baek
65923006a8 chore: format 2024-08-18 18:29:30 +02:00
Timothy J. Baek
b02f6db475 refac 2024-08-18 18:28:58 +02:00
Timothy J. Baek
7f394f3f00 refac 2024-08-18 18:21:59 +02:00
Timothy J. Baek
fc8524bbfd refac: styling 2024-08-18 18:20:36 +02:00
Timothy J. Baek
c9505531fd refac: styling 2024-08-18 17:40:26 +02:00
Timothy J. Baek
1b809fe42e refac: styling 2024-08-18 17:16:22 +02:00
Timothy J. Baek
a1b4df1b85 fix: cloned many model chat freezing issue 2024-08-18 16:47:12 +02:00
Timothy Jaeryang Baek
079f37a2d6 Merge pull request #4701 from ndrsfel/fix-rag-embedding-openai-batch-size-environment-variable
fix: RAG with OpenAI embedding models and batch_size environment variable fails silently
2024-08-18 13:24:18 +02:00
Andreas Feldl
0980066363 fix conversion 2024-08-18 12:46:47 +02:00
Timothy Jaeryang Baek
a3b6654cbb Merge pull request #4688 from amirsubhi/dev
i18n: Updated ms-MY Translation
2024-08-17 21:57:52 +02:00
amirsubhi
f4328325be Update i18n ms-MY Translation
Update Bahasa Malaysia Translation to reflect new update, and some spelling error
2024-08-18 02:17:51 +08:00
Timothy J. Baek
7badff49d8 refac 2024-08-17 19:43:04 +02:00
Timothy J. Baek
176c689f8d fix: unstructured md file parsing issue 2024-08-17 17:20:35 +02:00
Timothy J. Baek
fa20b1dc09 chore: format 2024-08-17 17:17:45 +02:00
Timothy J. Baek
2ca9989d20 refac 2024-08-17 17:15:44 +02:00
Timothy J. Baek
3420818c52 refac 2024-08-17 17:11:58 +02:00
Timothy J. Baek
0ae6ca608c refac 2024-08-17 17:01:35 +02:00
Timothy J. Baek
536b40890a refac 2024-08-17 16:57:27 +02:00
Timothy J. Baek
d5337917db refac 2024-08-17 16:46:04 +02:00
Timothy J. Baek
15f3ebba93 refac 2024-08-17 16:41:34 +02:00
Timothy J. Baek
e71f55e58f refac 2024-08-17 16:32:39 +02:00
Timothy J. Baek
fe747382c1 refac 2024-08-17 16:27:11 +02:00
Timothy J. Baek
c4946d42e0 refac 2024-08-17 16:24:11 +02:00
Timothy J. Baek
c1823b4b73 refac 2024-08-17 16:02:46 +02:00
Timothy J. Baek
862a30842c refac: chat_completion_inlets_handler -> chat_completion_filter_functions_handler 2024-08-17 16:00:18 +02:00
Timothy Jaeryang Baek
cbb0940ff8 Merge pull request #4602 from michaelpoluektov/tools-refac-1
refactor, perf: Tools refactor (progress PR 1)
2024-08-17 15:50:40 +02:00
Timothy Jaeryang Baek
bd8df3583d Merge pull request #4674 from crizCraig/sanitize-11labs-voiceid
sec: Sanitize 11labs voice id to address semgrep security issue: tainted-path-traversal-stdlib-fastapi
2024-08-17 15:49:56 +02:00
Craig Quiter
5f36807dbe Note tts defaults are from openai 2024-08-16 15:42:15 -07:00
Craig Quiter
442f50303a Sanitize voice_id 2024-08-16 15:10:53 -07:00
Craig Quiter
4560f3b1ae Return a dict from get_available_voices 2024-08-16 15:10:51 -07:00
Craig Quiter
59d2c670ba Optimize imports 2024-08-16 15:10:47 -07:00
Craig Quiter
02577f6a45 Cache elevenlabs voice call (can take 1s) 2024-08-16 15:10:41 -07:00
Timothy J. Baek
094fdd8943 fix 2024-08-16 19:23:36 +02:00
Timothy J. Baek
17169dff1f fix 2024-08-16 19:00:10 +02:00
Timothy J. Baek
28e3e6e8cb refac: many model chat 2024-08-16 18:54:30 +02:00
Timothy J. Baek
4f47053e93 refac 2024-08-16 17:51:50 +02:00
Timothy J. Baek
9025e9dbb1 fix: pseudo html rendering issue 2024-08-16 15:44:18 +02:00
Timothy J. Baek
eee1dad217 refac: styling 2024-08-16 15:37:17 +02:00
Timothy J. Baek
769df698be fix: visible backtick in codespan 2024-08-16 15:37:11 +02:00
Timothy J. Baek
4ef042e966 refac 2024-08-16 15:33:14 +02:00
Timothy J. Baek
92062ff722 refac 2024-08-16 15:19:47 +02:00
Timothy J. Baek
623aa08b9e refac 2024-08-16 15:15:06 +02:00
Timothy J. Baek
a529343b2b refac 2024-08-16 15:10:21 +02:00
Timothy J. Baek
2161903163 refac 2024-08-16 14:42:51 +02:00
Timothy Jaeryang Baek
3de9a1a130 Merge pull request #4651 from KarlLee830/translate
i18n: Update Chinese translation
2024-08-16 14:12:47 +02:00
Karl Lee
587c1a3ca2 i18n: Update Chinese translation 2024-08-16 16:37:02 +08:00
Timothy J. Baek
d224566957 refac: styling 2024-08-16 00:21:57 +02:00
Timothy J. Baek
8ea1a10525 enh: action __event_emitter__ support 2024-08-15 23:55:31 +02:00
Michael Poluektov
b6d6094018 Merge branch 'dev' into tools-refac-1 2024-08-15 21:35:31 +01:00
Timothy J. Baek
e5e1bac242 chore: format 2024-08-15 17:31:47 +02:00
Timothy J. Baek
8c2ba7f7ea enh: Actions __webui__ flag support 2024-08-15 17:28:43 +02:00
Timothy J. Baek
dc6ca61548 enh: temp chat
deprecates chat history setting and introduces temp chat from model selector
2024-08-15 16:54:16 +02:00
Timothy Jaeryang Baek
723caf2a09 Merge pull request #4621 from nthe/main
feat: Set content-type header in Ollama backend
2024-08-15 15:45:51 +02:00
Timothy J. Baek
439cb66672 refac: fuzzy search threshold 2024-08-15 15:44:38 +02:00
Timothy J. Baek
dbd5b4c9f1 enh: render markdown user message 2024-08-15 15:41:02 +02:00
Timothy Jaeryang Baek
4dd404ac3b Merge pull request #4614 from sebdanielsson/pwa-maskable-icon
fix: Make PWA icon maskable
2024-08-15 13:25:00 +02:00
Timothy J. Baek
ba370438b2 refac: "any maskable" is discouraged 2024-08-15 13:24:47 +02:00
Juraj Onuska
f73a60d96c fix: set content-type header in ollama backend 2024-08-15 13:15:12 +02:00
Sebastian
afe1f13c5b Make PWA icon maskable 2024-08-15 00:46:22 +02:00
Timothy J. Baek
0554cc6128 enh: shiftkey quick delete for tools and functions 2024-08-15 00:44:23 +02:00
Timothy J. Baek
5a6ece9513 refac: enhanced response content sanitisation
'<' and '>' can be correctly displayed now
2024-08-15 00:08:15 +02:00
Michael Poluektov
4042219b3e minor refac 2024-08-14 21:40:00 +01:00
Michael Poluektov
fdc89cbcee tool calling refactor 2024-08-14 21:40:00 +01:00
Michael Poluektov
6df6170c44 add get_configured_tools 2024-08-14 21:40:00 +01:00
Michael Poluektov
d598d4bb93 typing and tweaks 2024-08-14 21:40:00 +01:00
Michael Poluektov
790bdcf9fc rename tool calling helpers to use 'tool' instead of 'function' 2024-08-14 21:40:00 +01:00
Michael Poluektov
2efcda837c add try: except back 2024-08-14 21:40:00 +01:00
Michael Poluektov
e86688284a factor out get_function_calling_payload 2024-08-14 21:40:00 +01:00
Michael Poluektov
ff9d899f9c fix more LSP errors 2024-08-14 21:40:00 +01:00
Michael Poluektov
a68b918cbb refactor get_function_call_response 2024-08-14 21:40:00 +01:00
Michael Poluektov
9fb70969d7 factor out get_content_from_response 2024-08-14 21:40:00 +01:00
Michael Poluektov
0c9119d619 move task to metadata 2024-08-14 21:40:00 +01:00
Michael Poluektov
556141cdd8 refactor task 2024-08-14 21:40:00 +01:00
Michael Poluektov
60003c976a rename to chat_completions_inlet_handler for clarity 2024-08-14 21:40:00 +01:00
Michael Poluektov
23f1bee7bd cleanup 2024-08-14 21:40:00 +01:00
Michael Poluektov
589efcdc5f is_chat_completion_request helper, remove nesting 2024-08-14 21:40:00 +01:00
Michael Poluektov
3befadb29f remove unnecessary nesting, remove unused endpoint 2024-08-14 21:40:00 +01:00
Timothy Jaeryang Baek
13b0e7d64a Merge pull request #4434 from open-webui/dev
0.3.13
2024-08-14 21:45:19 +02:00
Timothy J. Baek
c8badfe21f refac 2024-08-14 21:42:43 +02:00
Timothy J. Baek
2a1b9cae91 doc: changelog 2024-08-14 21:39:11 +02:00
Timothy J. Baek
5ba7bbdd98 refac 2024-08-14 21:34:08 +02:00
Timothy J. Baek
9435d2044a refac: more robust mermaid chart rendering 2024-08-14 21:16:07 +02:00
Timothy J. Baek
609a42c29c refac: mermaid chart rendering 2024-08-14 17:34:44 +02:00
Timothy J. Baek
6a1e7ab038 chore: version bump 2024-08-14 17:13:37 +02:00
Timothy J. Baek
53daa15b9a chore: format 2024-08-14 17:07:16 +02:00
Timothy J. Baek
55097410f6 feat: haptic feedback on support devices (android)
Co-Authored-By: Danny Liu <dannyjialiliu@gmail.com>
2024-08-14 17:05:43 +02:00
Timothy J. Baek
04e2b6e2bd chore: format 2024-08-14 16:39:02 +02:00
Timothy Jaeryang Baek
9f0c9d973c Merge pull request #4597 from michaelpoluektov/cleanup
refactor: search and replace-able cleanup
2024-08-14 16:30:27 +02:00
Timothy J. Baek
1597e33a74 refac: mermaid chart rendering 2024-08-14 16:27:55 +02:00
Timothy Jaeryang Baek
0b218bbb72 Merge pull request #4598 from michaelpoluektov/cleanup-frontend
refactor: Remove unused frontend functions migrated to backend
2024-08-14 16:13:39 +02:00
Timothy J. Baek
7b21b718fe refac 2024-08-14 16:09:16 +02:00
Timothy J. Baek
6e5b557a1f refac 2024-08-14 16:08:23 +02:00
Timothy J. Baek
6aefc79807 refac: latex 2024-08-14 16:07:39 +02:00
Michael Poluektov
ec9e0dadea remove frontend functions migrated to backend 2024-08-14 14:33:20 +01:00
Michael Poluektov
0470146d7b replace Tuple with tuple 2024-08-14 13:58:37 +01:00
Michael Poluektov
a518d50477 format backend 2024-08-14 13:49:18 +01:00
Michael Poluektov
29f904db45 remove List imports 2024-08-14 13:46:31 +01:00
Michael Poluektov
038fc48ac0 replace == None with is None 2024-08-14 13:39:53 +01:00
Michael Poluektov
6f72def1ac replace except: with except Exception: 2024-08-14 13:38:19 +01:00
Timothy J. Baek
0ec1f9e331 fix: ENABLE_ADMIN_CHAT_ACCESS disabling user deletion 2024-08-14 12:23:24 +02:00
Timothy Jaeryang Baek
9682806476 Merge pull request #4372 from JTHesse/main
build: Adding ability to install requirements from frontmatter for tools and functions
2024-08-13 18:18:26 +02:00
Timothy Jaeryang Baek
fc6fa7887b Merge pull request #4579 from alexandregodard/main
Update main.py
2024-08-13 18:17:27 +02:00
Timothy J. Baek
e1e69cfbcb refac: sft -> default to safetensors 2024-08-13 17:15:20 +01:00
Alexandre GODARD
7a8f8960c5 Update main.py
Fix typo in update_reranking_model
2024-08-13 17:51:25 +02:00
Timothy Jaeryang Baek
30c44d431b Merge pull request #4538 from open-webui/dependabot/pip/backend/dev/chromadb-0.5.5
chore(deps): bump chromadb from 0.5.4 to 0.5.5 in /backend
2024-08-13 12:22:56 +02:00
Timothy Jaeryang Baek
b177976f29 Merge pull request #4539 from open-webui/dependabot/pip/backend/dev/langchain-0.2.12
chore(deps): bump langchain from 0.2.11 to 0.2.12 in /backend
2024-08-13 12:22:48 +02:00
Timothy J. Baek
af6b92a6fa chore: format 2024-08-13 11:22:08 +01:00
Timothy J. Baek
a1888b3757 refac 2024-08-13 11:21:17 +01:00
Timothy Jaeryang Baek
c75e77cdde Merge pull request #4554 from 5E-324/add-num_gpu
feat: Add advanced parameter num_gpu (Ollama)
2024-08-13 12:15:44 +02:00
Timothy Jaeryang Baek
6447b484c1 Merge pull request #4555 from 5E-324/ollama-params-fix
fix: Ollama parameters not shown in Chat Controls even if the current user is admin.
2024-08-13 12:13:40 +02:00
Timothy Jaeryang Baek
0c5236ac27 Merge pull request #4562 from simonaszilinskas/patch-5
Update Lithuanian translations
2024-08-13 12:13:11 +02:00
Timothy J. Baek
7ef5aa520c chore: format 2024-08-13 11:12:35 +01:00
Simonas
d620bcf516 Update Lithuanian translations 2024-08-13 03:10:08 -05:00
Zhuoran
b0c2e607b8 Set property "admin" of AdvancedParams in Controls 2024-08-13 10:06:51 +08:00
Zhuoran
56e2d579f2 Add advanced parameter num_gpu (Ollama) 2024-08-13 09:46:38 +08:00
Zhaofeng Li
e63d5778a8 fix: Decode URL-encoded characters in passwords
This enables using passwords containing special characters.
2024-08-12 08:52:16 -06:00
Zhaofeng Li
a53c2a8c6b fix: Pass all parsed options to ReconnectingPostgresqlDatabase 2024-08-12 08:52:16 -06:00
Timothy J. Baek
70f580ec45 fix 2024-08-12 15:10:08 +01:00
Timothy J. Baek
eae35dddc2 refac 2024-08-12 12:47:54 +01:00
Timothy Jaeryang Baek
bb979c9a78 Merge pull request #4540 from open-webui/dependabot/pip/backend/dev/pytest-approx-eq-8.3.2
chore(deps): update pytest requirement from ~=8.2.2 to ~=8.3.2 in /backend
2024-08-12 13:31:02 +02:00
Timothy Jaeryang Baek
4f959c31de Merge pull request #4537 from open-webui/dependabot/pip/backend/dev/langfuse-2.43.3
chore(deps): bump langfuse from 2.39.2 to 2.43.3 in /backend
2024-08-12 13:30:52 +02:00
Timothy Jaeryang Baek
3bbe065db1 Merge pull request #4541 from open-webui/dependabot/pip/backend/dev/pyjwt-crypto--2.9.0
chore(deps): bump pyjwt[crypto] from 2.8.0 to 2.9.0 in /backend
2024-08-12 13:30:43 +02:00
dependabot[bot]
41460e1335 chore(deps): bump pyjwt[crypto] from 2.8.0 to 2.9.0 in /backend
Bumps [pyjwt[crypto]](https://github.com/jpadilla/pyjwt) from 2.8.0 to 2.9.0.
- [Release notes](https://github.com/jpadilla/pyjwt/releases)
- [Changelog](https://github.com/jpadilla/pyjwt/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/jpadilla/pyjwt/compare/2.8.0...2.9.0)

---
updated-dependencies:
- dependency-name: pyjwt[crypto]
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-12 03:15:42 +00:00
dependabot[bot]
ffdb44f887 chore(deps): update pytest requirement in /backend
Updates the requirements on [pytest](https://github.com/pytest-dev/pytest) to permit the latest version.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.2.2...8.3.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-12 03:15:40 +00:00
dependabot[bot]
549d3b4d10 chore(deps): bump langchain from 0.2.11 to 0.2.12 in /backend
Bumps [langchain](https://github.com/langchain-ai/langchain) from 0.2.11 to 0.2.12.
- [Release notes](https://github.com/langchain-ai/langchain/releases)
- [Commits](https://github.com/langchain-ai/langchain/compare/langchain==0.2.11...langchain==0.2.12)

---
updated-dependencies:
- dependency-name: langchain
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-12 03:15:35 +00:00
dependabot[bot]
879f85802a chore(deps): bump chromadb from 0.5.4 to 0.5.5 in /backend
Bumps [chromadb](https://github.com/chroma-core/chroma) from 0.5.4 to 0.5.5.
- [Release notes](https://github.com/chroma-core/chroma/releases)
- [Changelog](https://github.com/chroma-core/chroma/blob/main/RELEASE_PROCESS.md)
- [Commits](https://github.com/chroma-core/chroma/compare/0.5.4...0.5.5)

---
updated-dependencies:
- dependency-name: chromadb
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-12 03:15:30 +00:00
dependabot[bot]
d652a1bbb1 chore(deps): bump langfuse from 2.39.2 to 2.43.3 in /backend
Bumps [langfuse](https://github.com/langfuse/langfuse) from 2.39.2 to 2.43.3.
- [Release notes](https://github.com/langfuse/langfuse/releases)
- [Commits](https://github.com/langfuse/langfuse/commits)

---
updated-dependencies:
- dependency-name: langfuse
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-12 03:15:25 +00:00
Timothy Jaeryang Baek
9c2429ff97 Merge pull request #4402 from michaelpoluektov/remove-ollama
refactor: re-use utils in Ollama
2024-08-12 00:45:15 +02:00
Timothy Jaeryang Baek
d0645d3c4f Merge pull request #4503 from open-webui/dependabot/pip/pip-621ce9c937
chore(deps): bump the pip group across 2 directories with 1 update
2024-08-12 00:40:46 +02:00
Timothy Jaeryang Baek
748be3e637 Merge pull request #4529 from cheahjs/fix/integration-tests
ci: fix cypress integration tests
2024-08-11 23:41:01 +02:00
Jun Siang Cheah
153ba168a0 tests: update share test to actually share 2024-08-11 22:30:25 +01:00
Jun Siang Cheah
c70b18b2ef tests: change how cypress detects chat messages 2024-08-11 16:22:33 +01:00
Jun Siang Cheah
af6420e06d ci: increase usable disk space for integration test 2024-08-11 14:17:32 +01:00
Michael Poluektov
547611b703 Merge branch 'dev' of https://github.com/open-webui/open-webui into remove-ollama 2024-08-10 11:47:20 +01:00
Timothy Jaeryang Baek
1b2ae7bb77 Merge pull request #4504 from OriginalSimon/dev
i18n: Update of the Ukrainian translation
2024-08-09 21:28:07 +02:00
Simon
5cd8011d53 Update translation.json 2024-08-09 21:03:19 +02:00
dependabot[bot]
208833d9f2 chore(deps): bump the pip group across 2 directories with 1 update
Bumps the pip group with 1 update in the / directory: [aiohttp](https://github.com/aio-libs/aiohttp).
Bumps the pip group with 1 update in the /backend directory: [aiohttp](https://github.com/aio-libs/aiohttp).


Updates `aiohttp` from 3.9.5 to 3.10.2
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.9.5...v3.10.2)

Updates `aiohttp` from 3.9.5 to 3.10.2
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.9.5...v3.10.2)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
  dependency-group: pip
- dependency-name: aiohttp
  dependency-type: direct:production
  dependency-group: pip
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-09 18:21:50 +00:00
Timothy Jaeryang Baek
6863028540 Merge pull request #4500 from KarlLee830/translate
i18n: Update Chinese translation
2024-08-09 17:13:42 +02:00
Karl Lee
5e97a52cbe i18n: Update Chinese translation 2024-08-09 22:04:33 +08:00
Timothy Jaeryang Baek
af865ab035 Merge pull request #4474 from aleixdorca/dev
i18n: Updated catalan translation
2024-08-09 12:01:43 +02:00
Timothy J. Baek
01f622866f fix 2024-08-09 00:14:41 +02:00
Timothy J. Baek
e9d14601a1 refac 2024-08-09 00:08:20 +02:00
Timothy J. Baek
92e77d7b33 refac: katex 2024-08-09 00:01:38 +02:00
Timothy J. Baek
3b370bbcb3 fix 2024-08-08 20:46:39 +02:00
Aleix Dorca
20b1753a91 i18n: Update catalan translation.json 2024-08-08 17:18:59 +02:00
Aleix Dorca
b2379c7104 i18n: Update catalan translation.json 2024-08-08 17:16:52 +02:00
Timothy J. Baek
e491e96f88 fix: markdown '$$' rendering issue 2024-08-08 15:27:51 +02:00
Timothy J. Baek
8afc8c5714 chore: format 2024-08-08 15:07:59 +02:00
Timothy J. Baek
d388c20373 enh: codeblock i18n 2024-08-08 15:07:24 +02:00
Timothy J. Baek
13403cd7dc enh: codeblock i18n 2024-08-08 14:24:47 +02:00
Timothy Jaeryang Baek
52fd701f2e Merge pull request #4465 from open-webui/main
dev
2024-08-08 14:23:33 +02:00
Michael Poluektov
204a4fbe7a fix: backend format test 2024-08-08 12:45:23 +01:00
Michael Poluektov
549817627f Merge branch 'dev' into remove-ollama 2024-08-08 12:42:37 +01:00
Michael Poluektov
fa4d1d42a5 fix: backend format test 2024-08-08 12:41:41 +01:00
Michael Poluektov
309cd645f1 undo del 2024-08-08 12:30:07 +01:00
Michael Poluektov
a725801e55 fix: formatting test errors, remove print, merge dev 2024-08-08 11:34:48 +01:00
Michael Poluektov
8cdf9814bd fix: name differences 2024-08-08 11:01:00 +01:00
Michael Poluektov
e6bbce439d fix: repeat_penalty 2024-08-08 10:52:09 +01:00
Timothy Jaeryang Baek
8d257ed596 Merge commit from fork
SSRF Fix
2024-08-08 11:47:33 +02:00
Timothy Jaeryang Baek
a7063a598d Merge pull request #4448 from JohnTheNerd/comfyui-async-fix
fix: ComfyUI generation no longer causes FastAPI to stall for all users
2024-08-08 11:36:19 +02:00
Jan-Timo Hesse
367fa039a0 added install_frontmatter_requirements 2024-08-08 09:46:14 +02:00
Jan-Timo Hesse
71d88fe35d revert 2024-08-08 09:45:52 +02:00
John Karabudak
958fe9639a fix: ComfyUI generation no longer causes FastAPI to stall for all users
as the get_images() function involves a `while True` loop while waiting for a response from ComfyUI and is not async, when image generation is running the entire UI becomes unresponsive for all users.

furthermore, when image generation takes too long, the Docker health check starts failing.

this is certainly a bad fix as it does not convert everything to async, but rather just puts the blocking loop in a separate thread. however, it works and it at least fixes the problem for now.
2024-08-07 22:24:55 -02:30
Timothy Jaeryang Baek
670f28d694 Merge branch 'dev' into remove-ollama 2024-08-07 23:06:11 +02:00
Timothy Jaeryang Baek
3715994c25 Merge pull request #4439 from cdgco/dev
feat: Add OAuth Email Claim Variable
2024-08-07 22:13:10 +02:00
Carter Roeser
d72d5d0e8e feat: Add OAuth Email Claim Variable
Add an `OAUTH_EMAIL_CLAIM` variable to override the default "email" claim value.
2024-08-07 11:39:51 -07:00
Timothy J. Baek
dbe463a53d fix 2024-08-07 17:39:54 +02:00
Timothy J. Baek
678dd780ee chore: package 2024-08-07 17:39:00 +02:00
Timothy Jaeryang Baek
44c870447f Merge pull request #4385 from candidosales/sveltekit-2v
build: Migrated to SvelteKit 2v
2024-08-07 17:37:08 +02:00
Timothy Jaeryang Baek
70a8f6e707 Merge pull request #4431 from Nowheresly/fix4158_reconnect
feat: #4158 allow reconnection when websocket is closed
2024-08-07 17:13:57 +02:00
Sylvere Richard
2fb4d3356c fix: #4158 allow reconnection when websocket is closed
log reconnection attempts
mark session_id as mandatory on client-side
2024-08-07 17:05:55 +02:00
root
590fd129c8 SSRF Fix Updated 2024-08-07 10:59:22 -04:00
Timothy Jaeryang Baek
99d10d1189 Merge pull request #4430 from open-webui/dev
fix
2024-08-07 15:53:11 +02:00
Timothy J. Baek
ad9a7cb1e2 refac 2024-08-07 15:52:03 +02:00
Timothy J. Baek
8187922ef1 fix: "metadata" issue 2024-08-07 15:49:48 +02:00
Michael Poluektov
f62281a0c7 Merge branch 'dev' of https://github.com/open-webui/open-webui into remove-ollama 2024-08-07 11:47:46 +01:00
root
1f8d08eaa2 SSRF Fix 2024-08-07 03:30:21 -04:00
Candido Sales Gomes
4105c9735e revert files 2024-08-06 09:38:42 -04:00
Michael Poluektov
ed205d82e8 fix: pop 2024-08-06 12:25:00 +01:00
Michael Poluektov
fc31267a54 refac: re-use utils.misc 2024-08-06 11:31:45 +01:00
Michael Poluektov
44c781f414 cleanup 2024-08-06 10:50:22 +01:00
Michael Poluektov
831fe9f509 cleanup 2024-08-06 10:15:29 +01:00
Candido Sales Gomes
b289eef523 typo 2024-08-05 11:16:28 -04:00
Candido Sales Gomes
5315fb201d changelod updated 2024-08-05 11:10:31 -04:00
Candido Sales Gomes
6a012d290e migration to SvelteKit 2 2024-08-05 11:00:30 -04:00
Jan-Timo Hesse
cec5fdd144 Added EXTRA_MODULES argument 2024-08-05 09:42:16 +02:00
553 changed files with 83968 additions and 34678 deletions

View File

@@ -16,4 +16,5 @@ _old
uploads
.ipynb_checkpoints
**/*.db
_test
_test
backend/data/*

View File

@@ -8,6 +8,20 @@ assignees: ''
# Bug Report
## Important Notes
- **Before submitting a bug report**: Please check the Issues or Discussions section to see if a similar issue or feature request has already been posted. It's likely we're already tracking it! If youre unsure, start a discussion post first. This will help us efficiently focus on improving the project.
- **Collaborate respectfully**: We value a constructive attitude, so please be mindful of your communication. If negativity is part of your approach, our capacity to engage may be limited. Were here to help if youre open to learning and communicating positively. Remember, Open WebUI is a volunteer-driven project managed by a single maintainer and supported by contributors who also have full-time jobs. We appreciate your time and ask that you respect ours.
- **Contributing**: If you encounter an issue, we highly encourage you to submit a pull request or fork the project. We actively work to prevent contributor burnout to maintain the quality and continuity of Open WebUI.
- **Bug reproducibility**: If a bug cannot be reproduced with a `:main` or `:dev` Docker setup, or a pip install with Python 3.11, it may require additional help from the community. In such cases, we will move it to the "issues" Discussions section due to our limited resources. We encourage the community to assist with these issues. Remember, its not that the issue doesnt exist; we need your help!
Note: Please remove the notes above when submitting your post. Thank you for your understanding and support!
---
## Installation Method
[Describe the method you used to install the project, e.g., git clone, Docker, pip, etc.]

View File

@@ -6,6 +6,22 @@ labels: ''
assignees: ''
---
# Feature Request
## Important Notes
- **Before submitting a report**: Please check the Issues or Discussions section to see if a similar issue or feature request has already been posted. It's likely we're already tracking it! If youre unsure, start a discussion post first. This will help us efficiently focus on improving the project.
- **Collaborate respectfully**: We value a constructive attitude, so please be mindful of your communication. If negativity is part of your approach, our capacity to engage may be limited. Were here to help if youre open to learning and communicating positively. Remember, Open WebUI is a volunteer-driven project managed by a single maintainer and supported by contributors who also have full-time jobs. We appreciate your time and ask that you respect ours.
- **Contributing**: If you encounter an issue, we highly encourage you to submit a pull request or fork the project. We actively work to prevent contributor burnout to maintain the quality and continuity of Open WebUI.
- **Bug reproducibility**: If a bug cannot be reproduced with a `:main` or `:dev` Docker setup, or a pip install with Python 3.11, it may require additional help from the community. In such cases, we will move it to the "issues" Discussions section due to our limited resources. We encourage the community to assist with these issues. Remember, its not that the issue doesnt exist; we need your help!
Note: Please remove the notes above when submitting your post. Thank you for your understanding and support!
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

View File

@@ -3,10 +3,10 @@ updates:
- package-ecosystem: pip
directory: '/backend'
schedule:
interval: weekly
interval: monthly
target-branch: 'dev'
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
# Check for updates to GitHub Actions every week
interval: 'weekly'
interval: monthly

View File

@@ -10,61 +10,63 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4
- name: Check for changes in package.json
run: |
git diff --cached --diff-filter=d package.json || {
echo "No changes to package.json"
exit 1
}
- name: Get version number from package.json
id: get_version
run: |
VERSION=$(jq -r '.version' package.json)
echo "::set-output name=version::$VERSION"
- name: Check for changes in package.json
run: |
git diff --cached --diff-filter=d package.json || {
echo "No changes to package.json"
exit 1
}
- name: Extract latest CHANGELOG entry
id: changelog
run: |
CHANGELOG_CONTENT=$(awk 'BEGIN {print_section=0;} /^## \[/ {if (print_section == 0) {print_section=1;} else {exit;}} print_section {print;}' CHANGELOG.md)
CHANGELOG_ESCAPED=$(echo "$CHANGELOG_CONTENT" | sed ':a;N;$!ba;s/\n/%0A/g')
echo "Extracted latest release notes from CHANGELOG.md:"
echo -e "$CHANGELOG_CONTENT"
echo "::set-output name=content::$CHANGELOG_ESCAPED"
- name: Get version number from package.json
id: get_version
run: |
VERSION=$(jq -r '.version' package.json)
echo "::set-output name=version::$VERSION"
- name: Create GitHub release
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const changelog = `${{ steps.changelog.outputs.content }}`;
const release = await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: `v${{ steps.get_version.outputs.version }}`,
name: `v${{ steps.get_version.outputs.version }}`,
body: changelog,
})
console.log(`Created release ${release.data.html_url}`)
- name: Extract latest CHANGELOG entry
id: changelog
run: |
CHANGELOG_CONTENT=$(awk 'BEGIN {print_section=0;} /^## \[/ {if (print_section == 0) {print_section=1;} else {exit;}} print_section {print;}' CHANGELOG.md)
CHANGELOG_ESCAPED=$(echo "$CHANGELOG_CONTENT" | sed ':a;N;$!ba;s/\n/%0A/g')
echo "Extracted latest release notes from CHANGELOG.md:"
echo -e "$CHANGELOG_CONTENT"
echo "::set-output name=content::$CHANGELOG_ESCAPED"
- name: Upload package to GitHub release
uses: actions/upload-artifact@v4
with:
name: package
path: .
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub release
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const changelog = `${{ steps.changelog.outputs.content }}`;
const release = await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: `v${{ steps.get_version.outputs.version }}`,
name: `v${{ steps.get_version.outputs.version }}`,
body: changelog,
})
console.log(`Created release ${release.data.html_url}`)
- name: Trigger Docker build workflow
uses: actions/github-script@v7
with:
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'docker-build.yaml',
ref: 'v${{ steps.get_version.outputs.version }}',
})
- name: Upload package to GitHub release
uses: actions/upload-artifact@v4
with:
name: package
path: |
.
!.git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Trigger Docker build workflow
uses: actions/github-script@v7
with:
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'docker-build.yaml',
ref: 'v${{ steps.get_version.outputs.version }}',
})

View File

@@ -28,6 +28,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
- name: Remove git history
run: rm -rf .git
@@ -52,7 +54,9 @@ jobs:
- name: Set up Git and push to Space
run: |
git init --initial-branch=main
git lfs install
git lfs track "*.ttf"
git lfs track "*.jpg"
rm demo.gif
git add .
git commit -m "GitHub deploy: ${{ github.sha }}"

View File

@@ -312,7 +312,7 @@ jobs:
merge-main-images:
runs-on: ubuntu-latest
needs: [ build-main-image ]
needs: [build-main-image]
steps:
# GitHub Packages requires the entire repository name to be in lowercase
# although the repository owner has a lowercase username, this prevents some people from running actions after forking
@@ -364,10 +364,9 @@ jobs:
run: |
docker buildx imagetools inspect ${{ env.FULL_IMAGE_NAME }}:${{ steps.meta.outputs.version }}
merge-cuda-images:
runs-on: ubuntu-latest
needs: [ build-cuda-image ]
needs: [build-cuda-image]
steps:
# GitHub Packages requires the entire repository name to be in lowercase
# although the repository owner has a lowercase username, this prevents some people from running actions after forking
@@ -423,7 +422,7 @@ jobs:
merge-ollama-images:
runs-on: ubuntu-latest
needs: [ build-ollama-image ]
needs: [build-ollama-image]
steps:
# GitHub Packages requires the entire repository name to be in lowercase
# although the repository owner has a lowercase username, this prevents some people from running actions after forking

View File

@@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

View File

@@ -21,7 +21,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20' # Or specify any other version you want to use
node-version: '22' # Or specify any other version you want to use
- name: Install Dependencies
run: npm install
@@ -48,7 +48,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '22'
- name: Install Dependencies
run: npm ci

View File

@@ -15,6 +15,13 @@ jobs:
name: Run Cypress Integration Tests
runs-on: ubuntu-latest
steps:
- name: Maximize build space
uses: AdityaGarg8/remove-unwanted-software@v4.1
with:
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
- name: Checkout Repository
uses: actions/checkout@v4
@@ -78,7 +85,7 @@ jobs:
# - uses: actions/checkout@v4
# - name: Set up Python
# uses: actions/setup-python@v4
# uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python-version }}
@@ -150,7 +157,7 @@ jobs:
GLOBAL_LOG_LEVEL: debug
run: |
cd backend
uvicorn main:app --port "8080" --forwarded-allow-ips '*' &
uvicorn open_webui.main:app --port "8080" --forwarded-allow-ips '*' &
UVICORN_PID=$!
# Wait up to 40 seconds for the server to start
for i in {1..40}; do
@@ -175,9 +182,12 @@ jobs:
WEBUI_SECRET_KEY: secret-key
GLOBAL_LOG_LEVEL: debug
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres
DATABASE_POOL_SIZE: 10
DATABASE_POOL_MAX_OVERFLOW: 10
DATABASE_POOL_TIMEOUT: 30
run: |
cd backend
uvicorn main:app --port "8081" --forwarded-allow-ips '*' &
uvicorn open_webui.main:app --port "8081" --forwarded-allow-ips '*' &
UVICORN_PID=$!
# Wait up to 20 seconds for the server to start
for i in {1..20}; do
@@ -223,7 +233,7 @@ jobs:
# DATABASE_URL: mysql://root:mysql@localhost:3306/mysql
# run: |
# cd backend
# uvicorn main:app --port "8083" --forwarded-allow-ips '*' &
# uvicorn open_webui.main:app --port "8083" --forwarded-allow-ips '*' &
# UVICORN_PID=$!
# # Wait up to 20 seconds for the server to start
# for i in {1..20}; do

View File

@@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Use Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
- name: Use Bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies

View File

@@ -4,6 +4,7 @@ on:
push:
branches:
- main # or whatever branch you want to use
- pypi-release
jobs:
release:

View File

@@ -5,6 +5,584 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.4.7] - 2024-12-01
### Added
- **✨ Prompt Input Auto-Completion**: Type a prompt and let AI intelligently suggest and complete your inputs. Simply press 'Tab' or swipe right on mobile to confirm. Available only with Rich Text Input (default setting). Disable via Admin Settings for full control.
- **🌍 Improved Translations**: Enhanced localization for multiple languages, ensuring a more polished and accessible experience for international users.
### Fixed
- **🛠️ Tools Export Issue**: Resolved a critical issue where exporting tools wasnt functioning, restoring seamless export capabilities.
- **🔗 Model ID Registration**: Fixed an issue where model IDs werent registering correctly in the model editor, ensuring reliable model setup and tracking.
- **🖋️ Textarea Auto-Expansion**: Corrected a bug where textareas didnt expand automatically on certain browsers, improving usability for multi-line inputs.
- **🔧 Ollama Embed Endpoint**: Addressed the /ollama/embed endpoint malfunction, ensuring consistent performance and functionality.
### Changed
- **🎨 Knowledge Base Styling**: Refined knowledge base visuals for a cleaner, more modern look, laying the groundwork for further enhancements in upcoming releases.
## [0.4.6] - 2024-11-26
### Added
- **🌍 Enhanced Translations**: Various language translations improved to make the WebUI more accessible and user-friendly worldwide.
### Fixed
- **✏️ Textarea Shifting Bug**: Resolved the issue where the textarea shifted unexpectedly, ensuring a smoother typing experience.
- **⚙️ Model Configuration Modal**: Fixed the issue where the models configuration modal introduced in 0.4.5 wasnt working for some users.
- **🔍 Legacy Query Support**: Restored functionality for custom query generation in RAG when using legacy prompts, ensuring both default and custom templates now work seamlessly.
- **⚡ Improved General Reliability**: Various minor fixes improve platform stability and ensure a smoother overall experience across workflows.
## [0.4.5] - 2024-11-26
### Added
- **🎨 Model Order/Defaults Reintroduced**: Brought back the ability to set model order and default models, now configurable via Admin Settings > Models > Configure (Gear Icon).
### Fixed
- **🔍 Query Generation Issue**: Resolved an error in web search query generation, enhancing search accuracy and ensuring smoother search workflows.
- **📏 Textarea Auto Height Bug**: Fixed a layout issue where textarea input height was shifting unpredictably, particularly when editing system prompts.
- **🔑 Ollama Authentication**: Corrected an issue with Ollamas authorization headers, guaranteeing reliable authentication across all endpoints.
- **⚙️ Missing Min_P Save**: Resolved an issue where the 'min_p' parameter was not being saved in configurations.
- **🛠️ Tools Description**: Fixed a key issue that omitted tool descriptions in tools payload.
## [0.4.4] - 2024-11-22
### Added
- **🌐 Translation Updates**: Refreshed Catalan, Brazilian Portuguese, German, and Ukrainian translations, further enhancing the platform's accessibility and improving the experience for international users.
### Fixed
- **📱 Mobile Controls Visibility**: Resolved an issue where the controls button was not displaying on the new chats page for mobile users, ensuring smoother navigation and functionality on smaller screens.
- **📷 LDAP Profile Image Issue**: Fixed an LDAP integration bug related to profile images, ensuring seamless authentication and a reliable login experience for users.
- **⏳ RAG Query Generation Issue**: Addressed a significant problem where RAG query generation occurred unnecessarily without attached files, drastically improving speed and reducing delays during chat completions.
### Changed
- **⚙️ Legacy Event Emitter Support**: Reintroduced compatibility with legacy "citation" types for event emitters in tools and functions, providing smoother workflows and broader tool support for users.
## [0.4.3] - 2024-11-21
### Added
- **📚 Inline Citations for RAG Results**: Get seamless inline citations for Retrieval-Augmented Generation (RAG) responses using the default RAG prompt. Note: This feature only supports newly uploaded files, improving traceability and providing source clarity.
- **🎨 Better Rich Text Input Support**: Enjoy smoother and more reliable rich text formatting for chats, enhancing communication quality.
- **⚡ Faster Model Retrieval**: Implemented caching optimizations for faster model loading, providing a noticeable speed boost across workflows. Further improvements are on the way!
### Fixed
- **🔗 Pipelines Feature Restored**: Resolved a critical issue that previously prevented Pipelines from functioning, ensuring seamless workflows.
- **✏️ Missing Suffix Field in Ollama Form**: Added the missing "suffix" field to the Ollama generate form, enhancing customization options.
### Changed
- **🗂️ Renamed "Citations" to "Sources"**: Improved clarity and consistency by renaming the "citations" field to "sources" in messages.
## [0.4.2] - 2024-11-20
### Fixed
- **📁 Knowledge Files Visibility Issue**: Resolved the bug preventing individual files in knowledge collections from displaying when referenced with '#'.
- **🔗 OpenAI Endpoint Prefix**: Fixed the issue where certain OpenAI connections that deviate from the official API spec werent working correctly with prefixes.
- **⚔️ Arena Model Access Control**: Corrected an issue where arena model access control settings were not being saved.
- **🔧 Usage Capability Selector**: Fixed the broken usage capabilities selector in the model editor.
## [0.4.1] - 2024-11-19
### Added
- **📊 Enhanced Feedback System**: Introduced a detailed 1-10 rating scale for feedback alongside thumbs up/down, preparing for more precise model fine-tuning and improving feedback quality.
- ** Tool Descriptions on Hover**: Easily access tool descriptions by hovering over the message input, providing a smoother workflow with more context when utilizing tools.
### Fixed
- **🗑️ Graceful Handling of Deleted Users**: Resolved an issue where deleted users caused workspace items (models, knowledge, prompts, tools) to fail, ensuring reliable workspace loading.
- **🔑 API Key Creation**: Fixed an issue preventing users from creating new API keys, restoring secure and seamless API management.
- **🔗 HTTPS Proxy Fix**: Corrected HTTPS proxy issues affecting the '/api/v1/models/' endpoint, ensuring smoother, uninterrupted model management.
## [0.4.0] - 2024-11-19
### Added
- **👥 User Groups**: You can now create and manage user groups, making user organization seamless.
- **🔐 Group-Based Access Control**: Set granular access to models, knowledge, prompts, and tools based on user groups, allowing for more controlled and secure environments.
- **🛠️ Group-Based User Permissions**: Easily manage workspace permissions. Grant users the ability to upload files, delete, edit, or create temporary chats, as well as define their ability to create models, knowledge, prompts, and tools.
- **🔑 LDAP Support**: Newly introduced LDAP authentication adds robust security and scalability to user management.
- **🌐 Enhanced OpenAI-Compatible Connections**: Added prefix ID support to avoid model ID clashes, with explicit model ID support for APIs lacking '/models' endpoint support, ensuring smooth operation with custom setups.
- **🔐 Ollama API Key Support**: Now manage credentials for Ollama when set behind proxies, including the option to utilize prefix ID for proper distinction across multiple Ollama instances.
- **🔄 Connection Enable/Disable Toggle**: Easily enable or disable individual OpenAI and Ollama connections as needed.
- **🎨 Redesigned Model Workspace**: Freshly redesigned to improve usability for managing models across users and groups.
- **🎨 Redesigned Prompt Workspace**: A fresh UI to conveniently organize and manage prompts.
- **🧩 Sorted Functions Workspace**: Functions are now automatically categorized by type (Action, Filter, Pipe), streamlining management.
- **💻 Redesigned Collaborative Workspace**: Enhanced support for multiple users contributing to models, knowledge, prompts, or tools, improving collaboration.
- **🔧 Auto-Selected Tools in Model Editor**: Tools enabled through the model editor are now automatically selected, whereas previously it only gave users the option to enable the tool, reducing manual steps and enhancing efficiency.
- **🔔 Web Search & Tools Indicator**: A clear indication now shows when web search or tools are active, reducing confusion.
- **🔑 Toggle API Key Auth**: Tighten security by easily enabling or disabling API key authentication option for Open WebUI.
- **🗂️ Agentic Retrieval**: Improve RAG accuracy via smart pre-processing of chat history to determine the best queries before retrieval.
- **📁 Large Text as File Option**: Optionally convert large pasted text into a file upload, keeping the chat interface cleaner.
- **🗂️ Toggle Citations for Models**: Ability to disable citations has been introduced in the model editor.
- **🔍 User Settings Search**: Quickly search for settings fields, improving ease of use and navigation.
- **🗣️ Experimental SpeechT5 TTS**: Local SpeechT5 support added for improved text-to-speech capabilities.
- **🔄 Unified Reset for Models**: A one-click option has been introduced to reset and remove all models from the Admin Settings.
- **🛠️ Initial Setup Wizard**: The setup process now explicitly informs users that they are creating an admin account during the first-time setup, ensuring clarity. Previously, users encountered the login page right away without this distinction.
- **🌐 Enhanced Translations**: Several language translations, including Ukrainian, Norwegian, and Brazilian Portuguese, were refined for better localization.
### Fixed
- **🎥 YouTube Video Attachments**: Fixed issues preventing proper loading and attachment of YouTube videos as files.
- **🔄 Shared Chat Update**: Corrected issues where shared chats were not updating, improving collaboration consistency.
- **🔍 DuckDuckGo Rate Limit Fix**: Addressed issues with DuckDuckGo search integration, enhancing search stability and performance when operating within rate limits.
- **🧾 Citations Relevance Fix**: Adjusted the relevance percentage calculation for citations, so that Open WebUI properly reflect the accuracy of a retrieved document in RAG, ensuring users get clearer insights into sources.
- **🔑 Jina Search API Key Requirement**: Added the option to input an API key for Jina Search, ensuring smooth functionality as keys are now mandatory.
### Changed
- **🛠️ Functions Moved to Admin Panel**: As Functions operate as advanced plugins, they are now accessible from the Admin Panel instead of the workspace.
- **🛠️ Manage Ollama Connections**: The "Models" section in Admin Settings has been relocated to Admin Settings > "Connections" > Ollama Connections. You can now manage Ollama instances via a dedicated "Manage Ollama" modal from "Connections", streamlining the setup and configuration of Ollama models.
- **📊 Base Models in Admin Settings**: Admins can now find all base models, both connections or functions, in the "Models" Admin setting. Global model accessibility can be enabled or disabled here. Models are private by default, requiring explicit permission assignment for user access.
- **📌 Sticky Model Selection for New Chats**: The model chosen from a previous chat now persists when creating a new chat. If you click "New Chat" again from the new chat page, it will revert to your default model.
- **🎨 Design Refactoring**: Overall design refinements across the platform have been made, providing a more cohesive and polished user experience.
### Removed
- **📂 Model List Reordering**: Temporarily removed and will be reintroduced in upcoming user group settings improvements.
- **⚙️ Default Model Setting**: Removed the ability to set a default model for users, will be reintroduced with user group settings in the future.
## [0.3.35] - 2024-10-26
### Added
- **🌐 Translation Update**: Added translation labels in the SearchInput and CreateCollection components and updated Brazilian Portuguese translation (pt-BR)
- **📁 Robust File Handling**: Enhanced file input handling for chat. If the content extraction fails or is empty, users will now receive a clear warning, preventing silent failures and ensuring you always know what's happening with your uploads.
- **🌍 New Language Support**: Introduced Hungarian translations and updated French translations, expanding the platform's language accessibility for a more global user base.
### Fixed
- **📚 Knowledge Base Loading Issue**: Resolved a critical bug where the Knowledge Base was not loading, ensuring smooth access to your stored documents and improving information retrieval in RAG-enhanced workflows.
- **🛠️ Tool Parameters Issue**: Fixed an error where tools were not functioning correctly when required parameters were missing, ensuring reliable tool performance and more efficient task completions.
- **🔗 Merged Response Loss in Multi-Model Chats**: Addressed an issue where responses in multi-model chat workflows were being deleted after follow-up queries, improving consistency and ensuring smoother interactions across models.
## [0.3.34] - 2024-10-26
### Added
- **🔧 Feedback Export Enhancements**: Feedback history data can now be exported to JSON, allowing for seamless integration in RLHF processing and further analysis.
- **🗂️ Embedding Model Lazy Loading**: Search functionality for leaderboard reranking is now more efficient, as embedding models are lazy-loaded only when needed, optimizing performance.
- **🎨 Rich Text Input Toggle**: Users can now switch back to legacy textarea input for chat if they prefer simpler text input, though rich text is still the default until deprecation.
- **🛠️ Improved Tool Calling Mechanism**: Enhanced method for parsing and calling tools, improving the reliability and robustness of tool function calls.
- **🌐 Globalization Enhancements**: Updates to internationalization (i18n) support, further refining multi-language compatibility and accuracy.
### Fixed
- **🖥️ Folder Rename Fix for Firefox**: Addressed a persistent issue where users could not rename folders by pressing enter in Firefox, now ensuring seamless folder management across browsers.
- **🔠 Tiktoken Model Text Splitter Issue**: Resolved an issue where the tiktoken text splitter wasnt working in Docker installations, restoring full functionality for tokenized text editing.
- **💼 S3 File Upload Issue**: Fixed a problem affecting S3 file uploads, ensuring smooth operations for those who store files on cloud storage.
- **🔒 Strict-Transport-Security Crash**: Resolved a crash when setting the Strict-Transport-Security (HSTS) header, improving stability and security enhancements.
- **🚫 OIDC Boolean Access Fix**: Addressed an issue with boolean values not being accessed correctly during OIDC logins, ensuring login reliability.
- **⚙️ Rich Text Paste Behavior**: Refined paste behavior in rich text input to make it smoother and more intuitive when pasting various content types.
- **🔨 Model Exclusion for Arena Fix**: Corrected the filter function that was not properly excluding models from the arena, improving model management.
- **🏷️ "Tags Generation Prompt" Fix**: Addressed an issue preventing custom "tags generation prompts" from registering properly, ensuring custom prompt work seamlessly.
## [0.3.33] - 2024-10-24
### Added
- **🏆 Evaluation Leaderboard**: Easily track your performance through a new leaderboard system where your ratings contribute to a real-time ranking based on the Elo system. Sibling responses (regenerations, many model chats) are required for your ratings to count in the leaderboard. Additionally, you can opt-in to share your feedback history and be part of the community-wide leaderboard. Expect further improvements as we refine the algorithm—help us build the best community leaderboard!
- **⚔️ Arena Model Evaluation**: Enable blind A/B testing of models directly from Admin Settings > Evaluation for a true side-by-side comparison. Ideal for pinpointing the best model for your needs.
- **🎯 Topic-Based Leaderboard**: Discover more accurate rankings with experimental topic-based reranking, which adjusts leaderboard standings based on tag similarity in feedback. Get more relevant insights based on specific topics!
- **📁 Folders Support for Chats**: Organize your chats better by grouping them into folders. Drag and drop chats between folders and export them seamlessly for easy sharing or analysis.
- **📤 Easy Chat Import via Drag & Drop**: Save time by simply dragging and dropping chat exports (JSON) directly onto the sidebar to import them into your workspace—streamlined, efficient, and intuitive!
- **📚 Enhanced Knowledge Collection**: Now, you can reference individual files from a knowledge collection—ideal for more precise Retrieval-Augmented Generations (RAG) queries and document analysis.
- **🏷️ Enhanced Tagging System**: Tags now take up less space! Utilize the new 'tag:' query system to manage, search, and organize your conversations more effectively without cluttering the interface.
- **🧠 Auto-Tagging for Chats**: Your conversations are now automatically tagged for improved organization, mirroring the efficiency of auto-generated titles.
- **🔍 Backend Chat Query System**: Chat filtering has become more efficient, now handled through the backend\*\* instead of your browser, improving search performance and accuracy.
- **🎮 Revamped Playground**: Experience a refreshed and optimized Playground for smoother testing, tweaks, and experimentation of your models and tools.
- **🧩 Token-Based Text Splitter**: Introducing token-based text splitting (tiktoken), giving you more precise control over how text is processed. Previously, only character-based splitting was available.
- **🔢 Ollama Batch Embeddings**: Leverage new batch embedding support for improved efficiency and performance with Ollama embedding models.
- **🔍 Enhanced Add Text Content Modal**: Enjoy a cleaner, more intuitive workflow for adding and curating knowledge content with an upgraded input modal from our Knowledge workspace.
- **🖋️ Rich Text Input for Chats**: Make your chat inputs more dynamic with support for rich text formatting. Your conversations just got a lot more polished and professional.
- **⚡ Faster Whisper Model Configurability**: Customize your local faster whisper model directly from the WebUI.
- **☁️ Experimental S3 Support**: Enable stateless WebUI instances with S3 support, greatly enhancing scalability and balancing heavy workloads.
- **🔕 Disable Update Toast**: Now you can streamline your workspace even further—choose to disable update notifications for a more focused experience.
- **🌟 RAG Citation Relevance Percentage**: Easily assess citation accuracy with the addition of relevance percentages in RAG results.
- **⚙️ Mermaid Copy Button**: Mermaid diagrams now come with a handy copy button, simplifying the extraction and use of diagram contents directly in your workflow.
- **🎨 UI Redesign**: Major interface redesign that will make navigation smoother, keep your focus where it matters, and ensure a modern look.
### Fixed
- **🎙️ Voice Note Mic Stopping Issue**: Fixed the issue where the microphone stayed active after ending a voice note recording, ensuring your audio workflow runs smoothly.
### Removed
- **👋 Goodbye Sidebar Tags**: Sidebar tag clutter is gone. Weve shifted tag buttons to more effective query-based tag filtering for a sleeker, more agile interface.
## [0.3.32] - 2024-10-06
### Added
- **🔢 Workspace Enhancements**: Added a display count for models, prompts, tools, and functions in the workspace, providing a clear overview and easier management.
### Fixed
- **🖥️ Web and YouTube Attachment Fix**: Resolved an issue where attaching web links and YouTube videos was malfunctioning, ensuring seamless integration and display within chats.
- **📞 Call Mode Activation on Landing Page**: Fixed a bug where call mode was not operational from the landing page.
### Changed
- **🔄 URL Parameter Refinement**: Updated the 'tool_ids' URL parameter to 'tools' or 'tool-ids' for more intuitive and consistent user experience.
- **🎨 Floating Buttons Styling Update**: Refactored the styling of floating buttons to intelligently adjust to the left side when there isn't enough room on the right, improving interface usability and aesthetic.
- **🔧 Enhanced Accessibility for Floating Buttons**: Implemented the ability to close floating buttons with the 'Esc' key, making workflow smoother and more efficient for users navigating via keyboard.
- **🖇️ Updated Information URL**: Information URLs now direct users to a general release page rather than a version-specific URL, ensuring access to the latest and relevant details all in one place.
- **📦 Library Dependencies Update**: Upgraded dependencies to ensure compatibility and performance optimization for pip installs.
## [0.3.31] - 2024-10-06
### Added
- **📚 Knowledge Feature**: Reimagined documents feature, now more performant with a better UI for enhanced organization; includes streamlined API integration for Retrieval-Augmented Generation (RAG). Detailed documentation forthcoming: https://docs.openwebui.com/
- **🌐 New Landing Page**: Freshly designed landing page; toggle between the new UI and the classic chat UI from Settings > Interface for a personalized experience.
- **📁 Full Document Retrieval Mode**: Toggle between full document retrieval or traditional snippets by clicking on the file item. This mode enhances document capabilities and supports comprehensive tasks like summarization by utilizing the entire content instead of RAG.
- **📄 Extracted File Content Display**: View extracted content directly by clicking on the file item, simplifying file analysis.
- **🎨 Artifacts Feature**: Render web content and SVGs directly in the interface, supporting quick iterations and live changes.
- **🖊️ Editable Code Blocks**: Supercharged code blocks now allow live editing directly in the LLM response, with live reloads supported by artifacts.
- **🔧 Code Block Enhancements**: Introduced a floating copy button in code blocks to facilitate easier code copying without scrolling.
- **🔍 SVG Pan/Zoom**: Enhanced interaction with SVG images, including Mermaid diagrams, via new pan and zoom capabilities.
- **🔍 Text Select Quick Actions**: New floating buttons appear when text is highlighted in LLM responses, offering deeper interactions like "Ask a Question" or "Explain".
- **🗃️ Database Pool Configuration**: Enhanced database handling to support scalable user growth.
- **🔊 Experimental Audio Compression**: Compress audio files to navigate around the 25MB limit for OpenAI's speech-to-text processing.
- **🔍 Query Embedding**: Adjusted embedding behavior to enhance system performance by not repeating query embedding.
- **💾 Lazy Load Optimizations**: Implemented lazy loading of large dependencies to minimize initial memory usage, boosting performance.
- **🍏 Apple Touch Icon Support**: Optimizes the display of icons for web bookmarks on Apple mobile devices.
- **🔽 Expandable Content Markdown Support**: Introducing 'details', 'summary' tag support for creating expandable content sections in markdown, facilitating cleaner, organized documentation and interactive content display.
### Fixed
- **🔘 Action Button Issue**: Resolved a bug where action buttons were not functioning, enhancing UI reliability.
- **🔄 Multi-Model Chat Loop**: Fixed an infinite loop issue in multi-model chat environments, ensuring smoother chat operations.
- **📄 Chat PDF/TXT Export Issue**: Resolved problems with exporting chat logs to PDF and TXT formats.
- **🔊 Call to Text-to-Speech Issues**: Rectified problems with text-to-speech functions to improve audio interactions.
### Changed
- **⚙️ Endpoint Renaming**: Renamed 'rag' endpoints to 'retrieval' for clearer function description.
- **🎨 Styling and Interface Updates**: Multiple refinements across the platform to enhance visual appeal and user interaction.
### Removed
- **🗑️ Deprecated 'DOCS_DIR'**: Removed the outdated 'docs_dir' variable in favor of more direct file management solutions, with direct file directory syncing and API uploads for a more integrated experience.
## [0.3.30] - 2024-09-26
### Fixed
- **🍞 Update Available Toast Dismissal**: Enhanced user experience by ensuring that once the update available notification is dismissed, it won't reappear for 24 hours.
- **📋 Ollama /embed Form Data**: Adjusted the integration inaccuracies in the /embed form data to ensure it perfectly matches with Ollama's specifications.
- **🔧 O1 Max Completion Tokens Issue**: Resolved compatibility issues with OpenAI's o1 models max_completion_tokens param to ensure smooth operation.
- **🔄 Pip Install Database Issue**: Fixed a critical issue where database changes during pip installations were reverting and not saving chat logs, now ensuring data persistence and reliability in chat operations.
- **🏷️ Chat Rename Tab Update**: Fixed the functionality to change the web browser's tab title simultaneously when a chat is renamed, keeping tab titles consistent.
## [0.3.29] - 2023-09-25
### Fixed
- **🔧 KaTeX Rendering Improvement**: Resolved specific corner cases in KaTeX rendering to enhance the display of complex mathematical notation.
- **📞 'Call' URL Parameter Fix**: Corrected functionality for 'call' URL search parameter ensuring reliable activation of voice calls through URL triggers.
- **🔄 Configuration Reset Fix**: Fixed the RESET_CONFIG_ON_START to ensure settings revert to default correctly upon each startup, improving reliability in configuration management.
- **🌍 Filter Outlet Hook Fix**: Addressed issues in the filter outlet hook, ensuring all filter functions operate as intended.
## [0.3.28] - 2024-09-24
### Fixed
- **🔍 Web Search Functionality**: Corrected an issue where the web search option was not functioning properly.
## [0.3.27] - 2024-09-24
### Fixed
- **🔄 Periodic Cleanup Error Resolved**: Fixed a critical RuntimeError related to the 'periodic_usage_pool_cleanup' coroutine, ensuring smooth and efficient performance post-pip install, correcting a persisting issue from version 0.3.26.
- **📊 Enhanced LaTeX Rendering**: Improved rendering for LaTeX content, enhancing clarity and visual presentation in documents and mathematical models.
## [0.3.26] - 2024-09-24
### Fixed
- **🔄 Event Loop Error Resolution**: Addressed a critical error where a missing running event loop caused 'periodic_usage_pool_cleanup' to fail with pip installs. This fix ensures smoother and more reliable updates and installations, enhancing overall system stability.
## [0.3.25] - 2024-09-24
### Fixed
- **🖼️ Image Generation Functionality**: Resolved an issue where image generation was not functioning, restoring full capability for visual content creation.
- **⚖️ Rate Response Corrections**: Addressed a problem where rate responses were not working, ensuring reliable feedback mechanisms are operational.
## [0.3.24] - 2024-09-24
### Added
- **🚀 Rendering Optimization**: Significantly improved message rendering performance, enhancing user experience and webui responsiveness.
- **💖 Favorite Response Feature in Chat Overview**: Users can now mark responses as favorite directly from the chat overview, enhancing ease of retrieval and organization of preferred responses.
- **💬 Create Message Pairs with Shortcut**: Implemented creation of new message pairs using Cmd/Ctrl+Shift+Enter, making conversation editing faster and more intuitive.
- **🌍 Expanded User Prompt Variables**: Added weekday, timezone, and language information variables to user prompts to match system prompt variables.
- **🎵 Enhanced Audio Support**: Now includes support for 'audio/x-m4a' files, broadening compatibility with audio content within the platform.
- **🔏 Model URL Search Parameter**: Added an ability to select a model directly via URL parameters, streamlining navigation and model access.
- **📄 Enhanced PDF Citations**: PDF citations now open at the associated page, streamlining reference checks and document handling.
- **🔧Use of Redis in Sockets**: Enhanced socket implementation to fully support Redis, enabling effective stateless instances suitable for scalable load balancing.
- **🌍 Stream Individual Model Responses**: Allows specific models to have individualized streaming settings, enhancing performance and customization.
- **🕒 Display Model Hash and Last Modified Timestamp for Ollama Models**: Provides critical model details directly in the Models workspace for enhanced tracking.
- **❗ Update Info Notification for Admins**: Ensures administrators receive immediate updates upon login, keeping them informed of the latest changes and system statuses.
### Fixed
- **🗑️ Temporary File Handling On Windows**: Fixed an issue causing errors when accessing a temporary file being used by another process, Tools & Functions should now work as intended.
- **🔓 Authentication Toggle Issue**: Resolved the malfunction where setting 'WEBUI_AUTH=False' did not appropriately disable authentication, ensuring that user experience and system security settings function as configured.
- **🔧 Save As Copy Issue for Many Model Chats**: Resolved an error preventing users from save messages as copies in many model chats.
- **🔒 Sidebar Closure on Mobile**: Resolved an issue where the mobile sidebar remained open after menu engagement, improving user interface responsivity and comfort.
- **🛡️ Tooltip XSS Vulnerability**: Resolved a cross-site scripting (XSS) issue within tooltips, ensuring enhanced security and data integrity during user interactions.
### Changed
- **↩️ Deprecated Interface Stream Response Settings**: Moved to advanced parameters to streamline interface settings and enhance user clarity.
- **⚙️ Renamed 'speedRate' to 'playbackRate'**: Standardizes terminology, improving usability and understanding in media settings.
## [0.3.23] - 2024-09-21
### Added
- **🚀 WebSocket Redis Support**: Enhanced load balancing capabilities for multiple instance setups, promoting better performance and reliability in WebUI.
- **🔧 Adjustable Chat Controls**: Introduced width-adjustable chat controls, enabling a personalized and more comfortable user interface.
- **🌎 i18n Updates**: Improved and updated the Chinese translations.
### Fixed
- **🌐 Task Model Unloading Issue**: Modified task handling to use the Ollama /api/chat endpoint instead of OpenAI compatible endpoint, ensuring models stay loaded and ready with custom parameters, thus minimizing delays in task execution.
- **📝 Title Generation Fix for OpenAI Compatible APIs**: Resolved an issue preventing the generation of titles, enhancing consistency and reliability when using multiple API providers.
- **🗃️ RAG Duplicate Collection Issue**: Fixed a bug causing repeated processing of the same uploaded file. Now utilizes indexed files to prevent unnecessary duplications, optimizing resource usage.
- **🖼️ Image Generation Enhancement**: Refactored OpenAI image generation endpoint to be asynchronous, preventing the WebUI from becoming unresponsive during processing, thus enhancing user experience.
- **🔓 Downgrade Authlib**: Reverted Authlib to version 1.3.1 to address and resolve issues concerning OAuth functionality.
### Changed
- **🔍 Improved Message Interaction**: Enhanced the message node interface to allow for easier focus redirection with a simple click, streamlining user interaction.
- **✨ Styling Refactor**: Updated WebUI styling for a cleaner, more modern look, enhancing user experience across the platform.
## [0.3.22] - 2024-09-19
### Added
- **⭐ Chat Overview**: Introducing a node-based interactive messages diagram for improved visualization of conversation flows.
- **🔗 Multiple Vector DB Support**: Now supports multiple vector databases, including the newly added Milvus support. Community contributions for additional database support are highly encouraged!
- **📡 Experimental Non-Stream Chat Completion**: Experimental feature allowing the use of OpenAI o1 models, which do not support streaming, ensuring more versatile model deployment.
- **🔍 Experimental Colbert-AI Reranker Integration**: Added support for "jinaai/jina-colbert-v2" as a reranker, enhancing search relevance and accuracy. Note: it may not function at all on low-spec computers.
- **🕸️ ENABLE_WEBSOCKET_SUPPORT**: Added environment variable for instances to ignore websocket upgrades, stabilizing connections on platforms with websocket issues.
- **🔊 Azure Speech Service Integration**: Added support for Azure Speech services for Text-to-Speech (TTS).
- **🎚️ Customizable Playback Speed**: Playback speed control is now available in Call mode settings, allowing users to adjust audio playback speed to their preferences.
- **🧠 Enhanced Error Messaging**: System now displays helpful error messages directly to users during chat completion issues.
- **📂 Save Model as Transparent PNG**: Model profile images are now saved as PNGs, supporting transparency and improving visual integration.
- **📱 iPhone Compatibility Adjustments**: Added padding to accommodate the iPhone navigation bar, improving UI display on these devices.
- **🔗 Secure Response Headers**: Implemented security response headers, bolstering web application security.
- **🔧 Enhanced AUTOMATIC1111 Settings**: Users can now configure 'CFG Scale', 'Sampler', and 'Scheduler' parameters directly in the admin settings, enhancing workflow flexibility without source code modifications.
- **🌍 i18n Updates**: Enhanced translations for Chinese, Ukrainian, Russian, and French, fostering a better localized experience.
### Fixed
- **🛠️ Chat Message Deletion**: Resolved issues with chat message deletion, ensuring a smoother user interaction and system stability.
- **🔢 Ordered List Numbering**: Fixed the incorrect ordering in lists.
### Changed
- **🎨 Transparent Icon Handling**: Allowed model icons to be displayed on transparent backgrounds, improving UI aesthetics.
- **📝 Improved RAG Template**: Enhanced Retrieval-Augmented Generation template, optimizing context handling and error checking for more precise operation.
## [0.3.21] - 2024-09-08
### Added
- **📊 Document Count Display**: Now displays the total number of documents directly within the dashboard.
- **🚀 Ollama Embed API Endpoint**: Enabled /api/embed endpoint proxy support.
### Fixed
- **🐳 Docker Launch Issue**: Resolved the problem preventing Open-WebUI from launching correctly when using Docker.
### Changed
- **🔍 Enhanced Search Prompts**: Improved the search query generation prompts for better accuracy and user interaction, enhancing the overall search experience.
## [0.3.20] - 2024-09-07
### Added
- **🌐 Translation Update**: Updated Catalan translations to improve user experience for Catalan speakers.
### Fixed
- **📄 PDF Download**: Resolved a configuration issue with fonts directory, ensuring PDFs are now downloaded with the correct formatting.
- **🛠️ Installation of Tools & Functions Requirements**: Fixed a bug where necessary requirements for tools and functions were not properly installing.
- **🔗 Inline Image Link Rendering**: Enabled rendering of images directly from links in chat.
- **📞 Post-Call User Interface Cleanup**: Adjusted UI behavior to automatically close chat controls after a voice call ends, reducing screen clutter.
- **🎙️ Microphone Deactivation Post-Call**: Addressed an issue where the microphone remained active after calls.
- **✍️ Markdown Spacing Correction**: Corrected spacing in Markdown rendering, ensuring text appears neatly and as expected.
- **🔄 Message Re-rendering**: Fixed an issue causing all response messages to re-render with each new message, now improving chat performance.
### Changed
- **🌐 Refined Web Search Integration**: Deprecated the Search Query Generation Prompt threshold; introduced a toggle button for "Enable Web Search Query Generation" allowing users to opt-in to using web search more judiciously.
- **📝 Default Prompt Templates Update**: Emptied environment variable templates for search and title generation now default to the Open WebUI default prompt templates, simplifying configuration efforts.
## [0.3.19] - 2024-09-05
### Added
- **🌐 Translation Update**: Improved Chinese translations.
### Fixed
- **📂 DATA_DIR Overriding**: Fixed an issue to avoid overriding DATA_DIR, preventing errors when directories are set identically, ensuring smoother operation and data management.
- **🛠️ Frontmatter Extraction**: Fixed the extraction process for frontmatter in tools and functions.
### Changed
- **🎨 UI Styling**: Refined the user interface styling for enhanced visual coherence and user experience.
## [0.3.18] - 2024-09-04
### Added
- **🛠️ Direct Database Execution for Tools & Functions**: Enhanced the execution of Python files for tools and functions, now directly loading from the database for a more streamlined backend process.
### Fixed
- **🔄 Automatic Rewrite of Import Statements in Tools & Functions**: Tool and function scripts that import 'utils', 'apps', 'main', 'config' will now automatically rename these with 'open_webui.', ensuring compatibility and consistency across different modules.
- **🎨 Styling Adjustments**: Minor fixes in the visual styling to improve user experience and interface consistency.
## [0.3.17] - 2024-09-04
### Added
- **🔄 Import/Export Configuration**: Users can now import and export webui configurations from admin settings > Database, simplifying setup replication across systems.
- **🌍 Web Search via URL Parameter**: Added support for activating web search directly through URL by setting 'web-search=true'.
- **🌐 SearchApi Integration**: Added support for SearchApi as an alternative web search provider, enhancing search capabilities within the platform.
- **🔍 Literal Type Support in Tools**: Tools now support the Literal type.
- **🌍 Updated Translations**: Improved translations for Chinese, Ukrainian, and Catalan.
### Fixed
- **🔧 Pip Install Issue**: Resolved the issue where pip install failed due to missing 'alembic.ini', ensuring smoother installation processes.
- **🌃 Automatic Theme Update**: Fixed an issue where the color theme did not update dynamically with system changes.
- **🛠️ User Agent in ComfyUI**: Added default headers in ComfyUI to fix access issues, improving reliability in network communications.
- **🔄 Missing Chat Completion Response Headers**: Ensured proper return of proxied response headers during chat completion, improving API reliability.
- **🔗 Websocket Connection Prioritization**: Modified socket.io configuration to prefer websockets and more reliably fallback to polling, enhancing connection stability.
- **🎭 Accessibility Enhancements**: Added missing ARIA labels for buttons, improving accessibility for visually impaired users.
- **⚖️ Advanced Parameter**: Fixed an issue ensuring that advanced parameters are correctly applied in all scenarios, ensuring consistent behavior of user-defined settings.
### Changed
- **🔁 Namespace Reorganization**: Reorganized all Python files under the 'open_webui' namespace to streamline the project structure and improve maintainability. Tools and functions importing from 'utils' should now use 'open_webui.utils'.
- **🚧 Dependency Updates**: Updated several backend dependencies like 'aiohttp', 'authlib', 'duckduckgo-search', 'flask-cors', and 'langchain' to their latest versions, enhancing performance and security.
## [0.3.16] - 2024-08-27
### Added
- **🚀 Config DB Migration**: Migrated configuration handling from config.json to the database, enabling high-availability setups and load balancing across multiple Open WebUI instances.
- **🔗 Call Mode Activation via URL**: Added a 'call=true' URL search parameter enabling direct shortcuts to activate call mode, enhancing user interaction on mobile devices.
- **✨ TTS Content Control**: Added functionality to control how message content is segmented for Text-to-Speech (TTS) generation requests, allowing for more flexible speech output options.
- **😄 Show Knowledge Search Status**: Enhanced model usage transparency by displaying status when working with knowledge-augmented models, helping users understand the system's state during queries.
- **👆 Click-to-Copy for Codespan**: Enhanced interactive experience in the WebUI by allowing users to click to copy content from code spans directly.
- **🚫 API User Blocking via Model Filter**: Introduced the ability to block API users based on customized model filters, enhancing security and control over API access.
- **🎬 Call Overlay Styling**: Adjusted call overlay styling on large screens to not cover the entire interface, but only the chat control area, for a more unobtrusive interaction experience.
### Fixed
- **🔧 LaTeX Rendering Issue**: Addressed an issue that affected the correct rendering of LaTeX.
- **📁 File Leak Prevention**: Resolved the issue of uploaded files mistakenly being accessible across user chats.
- **🔧 Pipe Functions with '**files**' Param**: Fixed issues with '**files**' parameter not functioning correctly in pipe functions.
- **📝 Markdown Processing for RAG**: Fixed issues with processing Markdown in files.
- **🚫 Duplicate System Prompts**: Fixed bugs causing system prompts to duplicate.
### Changed
- **🔋 Wakelock Permission**: Optimized the activation of wakelock to only engage during call mode, conserving device resources and improving battery performance during idle periods.
- **🔍 Content-Type for Ollama Chats**: Added 'application/x-ndjson' content-type to '/api/chat' endpoint responses to match raw Ollama responses.
- **✋ Disable Signups Conditionally**: Implemented conditional logic to disable sign-ups when 'ENABLE_LOGIN_FORM' is set to false.
## [0.3.15] - 2024-08-21
### Added
- **🔗 Temporary Chat Activation**: Integrated a new URL parameter 'temporary-chat=true' to enable temporary chat sessions directly through the URL.
- **🌄 ComfyUI Seed Node Support**: Introduced seed node support in ComfyUI for image generation, allowing users to specify node IDs for randomized seed assignment.
### Fixed
- **🛠️ Tools and Functions**: Resolved a critical issue where Tools and Functions were not properly functioning, restoring full capability and reliability to these essential features.
- **🔘 Chat Action Button in Many Model Chat**: Fixed the malfunctioning of chat action buttons in many model chat environments, ensuring a smoother and more responsive user interaction.
- **⏪ Many Model Chat Compatibility**: Restored backward compatibility for many model chats.
## [0.3.14] - 2024-08-21
### Added
- **🛠️ Custom ComfyUI Workflow**: Deprecating several older environment variables, this enhancement introduces a new, customizable workflow for a more tailored user experience.
- **🔀 Merge Responses in Many Model Chat**: Enhances the dialogue by merging responses from multiple models into a single, coherent reply, improving the interaction quality in many model chats.
- **✅ Multiple Instances of Same Model in Chats**: Enhanced many model chat to support adding multiple instances of the same model.
- **🔧 Quick Actions in Model Workspace**: Enhanced Shift key quick actions for hiding/unhiding and deleting models, facilitating a smoother workflow.
- **🗨️ Markdown Rendering in User Messages**: User messages are now rendered in Markdown, enhancing readability and interaction.
- **💬 Temporary Chat Feature**: Introduced a temporary chat feature, deprecating the old chat history setting to enhance user interaction flexibility.
- **🖋️ User Message Editing**: Enhanced the user chat editing feature to allow saving changes without sending, providing more flexibility in message management.
- **🛡️ Security Enhancements**: Various security improvements implemented across the platform to ensure safer user experiences.
- **🌍 Updated Translations**: Enhanced translations for Chinese, Ukrainian, and Bahasa Malaysia, improving localization and user comprehension.
### Fixed
- **📑 Mermaid Rendering Issue**: Addressed issues with Mermaid chart rendering to ensure clean and clear visual data representation.
- **🎭 PWA Icon Maskability**: Fixed the Progressive Web App icon to be maskable, ensuring proper display on various device home screens.
- **🔀 Cloned Model Chat Freezing Issue**: Fixed a bug where cloning many model chats would cause freezing, enhancing stability and responsiveness.
- **🔍 Generic Error Handling and Refinements**: Various minor fixes and refinements to address previously untracked issues, ensuring smoother operations.
### Changed
- **🖼️ Image Generation Refactor**: Overhauled image generation processes for improved efficiency and quality.
- **🔨 Refactor Tool and Function Calling**: Refactored tool and function calling mechanisms for improved clarity and maintainability.
- **🌐 Backend Library Updates**: Updated critical backend libraries including SQLAlchemy, uvicorn[standard], faster-whisper, bcrypt, and boto3 for enhanced performance and security.
### Removed
- **🚫 Deprecated ComfyUI Environment Variables**: Removed several outdated environment variables related to ComfyUI settings, simplifying configuration management.
## [0.3.13] - 2024-08-14
### Added
- **🎨 Enhanced Markdown Rendering**: Significant improvements in rendering markdown, ensuring smooth and reliable display of LaTeX and Mermaid charts, enhancing user experience with more robust visual content.
- **🔄 Auto-Install Tools & Functions Python Dependencies**: For 'Tools' and 'Functions', Open WebUI now automatically install extra python requirements specified in the frontmatter, streamlining setup processes and customization.
- **🌀 OAuth Email Claim Customization**: Introduced an 'OAUTH_EMAIL_CLAIM' variable to allow customization of the default "email" claim within OAuth configurations, providing greater flexibility in authentication processes.
- **📶 Websocket Reconnection**: Enhanced reliability with the capability to automatically reconnect when a websocket is closed, ensuring consistent and stable communication.
- **🤳 Haptic Feedback on Support Devices**: Android devices now support haptic feedback for an immersive tactile experience during certain interactions.
### Fixed
- **🛠️ ComfyUI Performance Improvement**: Addressed an issue causing FastAPI to stall when ComfyUI image generation was active; now runs in a separate thread to prevent UI unresponsiveness.
- **🔀 Session Handling**: Fixed an issue mandating session_id on client-side to ensure smoother session management and transitions.
- **🖋️ Minor Bug Fixes and Format Corrections**: Various minor fixes including typo corrections, backend formatting improvements, and test amendments enhancing overall system stability and performance.
### Changed
- **🚀 Migration to SvelteKit 2**: Upgraded the underlying framework to SvelteKit version 2, offering enhanced speed, better code structure, and improved deployment capabilities.
- **🧹 General Cleanup and Refactoring**: Performed broad cleanup and refactoring across the platform, improving code efficiency and maintaining high standards of code health.
- **🚧 Integration Testing Improvements**: Modified how Cypress integration tests detect chat messages and updated sharing tests for better reliability and accuracy.
- **📁 Standardized '.safetensors' File Extension**: Renamed the '.sft' file extension to '.safetensors' for ComfyUI workflows, standardizing file formats across the platform.
### Removed
- **🗑️ Deprecated Frontend Functions**: Removed frontend functions that were migrated to backend to declutter the codebase and reduce redundancy.
## [0.3.12] - 2024-08-07
### Added

View File

@@ -2,76 +2,98 @@
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
As members, contributors, and leaders of this community, we pledge to make participation in our open-source project a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
We are committed to creating and maintaining an open, respectful, and professional environment where positive contributions and meaningful discussions can flourish. By participating in this project, you agree to uphold these values and align your behavior to the standards outlined in this Code of Conduct.
## Why These Standards Are Important
Open-source projects rely on a community of volunteers dedicating their time, expertise, and effort toward a shared goal. These projects are inherently collaborative but also fragile, as the success of the project depends on the goodwill, energy, and productivity of those involved.
Maintaining a positive and respectful environment is essential to safeguarding the integrity of this project and protecting contributors' efforts. Behavior that disrupts this atmosphere—whether through hostility, entitlement, or unprofessional conduct—can severely harm the morale and productivity of the community. **Strict enforcement of these standards ensures a safe and supportive space for meaningful collaboration.**
This is a community where **respect and professionalism are mandatory.** Violations of these standards will result in **zero tolerance** and immediate enforcement to prevent disruption and ensure the well-being of all participants.
## Our Standards
Examples of behavior that contribute to a positive environment for our community include:
Examples of behavior that contribute to a positive and professional community include:
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall community
- **Respecting others.** Be considerate, listen actively, and engage with empathy toward others' viewpoints and experiences.
- **Constructive feedback.** Provide actionable, thoughtful, and respectful feedback that helps improve the project and encourages collaboration. Avoid unproductive negativity or hypercriticism.
- **Recognizing volunteer contributions.** Appreciate that contributors dedicate their free time and resources selflessly. Approach them with gratitude and patience.
- **Focusing on shared goals.** Collaborate in ways that prioritize the health, success, and sustainability of the community over individual agendas.
Examples of unacceptable behavior include:
- The use of sexualized language or imagery, and sexual attention or advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address, without their explicit permission
- **Spamming of any kind**
- Aggressive sales tactics targeting our community members are strictly prohibited. You can mention your product if it's relevant to the discussion, but under no circumstances should you push it forcefully
- Other conduct which could reasonably be considered inappropriate in a professional setting
- The use of discriminatory, demeaning, or sexualized language or behavior.
- Personal attacks, derogatory comments, trolling, or inflammatory political or ideological arguments.
- Harassment, intimidation, or any behavior intended to create a hostile, uncomfortable, or unsafe environment.
- Publishing others' private information (e.g., physical or email addresses) without explicit permission.
- **Entitlement, demand, or aggression toward contributors.** Volunteers are under no obligation to provide immediate or personalized support. Rude or dismissive behavior will not be tolerated.
- **Unproductive or destructive behavior.** This includes venting frustration as hostility ("tantrums"), hypercriticism, attention-seeking negativity, or anything that distracts from the project's goals.
- **Spamming and promotional exploitation.** Sharing irrelevant product promotions or self-promotion in the community is not allowed unless it directly contributes value to the discussion.
### Feedback and Community Engagement
- **Constructive feedback is encouraged, but hostile or entitled behavior will result in immediate action.** If you disagree with elements of the project, we encourage you to offer meaningful improvements or fork the project if necessary. Healthy discussions and technical disagreements are welcome only when handled with professionalism.
- **Respect contributors' time and efforts.** No one is entitled to personalized or on-demand assistance. This is a community built on collaboration and shared effort; demanding or demeaning behavior undermines that trust and will not be allowed.
### Zero Tolerance: No Warnings, Immediate Action
This community operates under a **zero-tolerance policy.** Any behavior deemed unacceptable under this Code of Conduct will result in **immediate enforcement, without prior warning.**
We employ this approach to ensure that unproductive or disruptive behavior does not escalate further or cause unnecessary harm to other contributors. The standards are clear, and violations of any kind—whether mild or severe—will be addressed decisively to protect the community.
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
Community leaders are responsible for upholding and enforcing these standards. They are empowered to take **immediate and appropriate action** to address any behaviors they deem unacceptable under this Code of Conduct. These actions are taken with the goal of protecting the community and preserving its safe, positive, and productive environment.
## Scope
This Code of Conduct applies within all community spaces and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
This Code of Conduct applies to all community spaces, including forums, repositories, social media accounts, and in-person events. It also applies when an individual represents the community in public settings, such as conferences or official communications.
## Enforcement
Additionally, any behavior outside of these defined spaces that negatively impacts the community or its members may fall within the scope of this Code of Conduct.
Instances of abusive, harassing, spamming, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at hello@openwebui.com. All complaints will be reviewed and investigated promptly and fairly.
## Reporting Violations
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
Instances of unacceptable behavior can be reported to the leadership team at **hello@openwebui.com**. Reports will be handled promptly, confidentially, and with consideration for the safety and well-being of the reporter.
All community leaders are required to uphold confidentiality and impartiality when addressing reports of violations.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
### Ban
### 1. Temporary Ban
**Community Impact**: Community leaders will issue a ban to any participant whose behavior is deemed unacceptable according to this Code of Conduct. Bans are enforced immediately and without prior notice.
**Community Impact**: Any violation of community standards, including but not limited to inappropriate language, unprofessional behavior, harassment, or spamming.
A ban may be temporary or permanent, depending on the severity of the violation. This includes—but is not limited to—behavior such as:
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
- Harassment or abusive behavior toward contributors.
- Persistent negativity or hostility that disrupts the collaborative environment.
- Disrespectful, demanding, or aggressive interactions with others.
- Attempts to cause harm or sabotage the community.
### 2. Permanent Ban
**Consequence**: A banned individual is immediately removed from access to all community spaces, communication channels, and events. Community leaders reserve the right to enforce either a time-limited suspension or a permanent ban based on the specific circumstances of the violation.
**Community Impact**: Repeated or severe violations of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
This approach ensures that disruptive behaviors are addressed swiftly and decisively in order to maintain the integrity and productivity of the community.
**Consequence**: A permanent ban from any sort of public interaction within the community.
## Why Zero Tolerance Is Necessary
Open-source projects thrive on collaboration, goodwill, and mutual respect. Toxic behaviors—such as entitlement, hostility, or persistent negativity—threaten not just individual contributors but the health of the project as a whole. Allowing such behaviors to persist robs contributors of their time, energy, and enthusiasm for the work they do.
By enforcing a zero-tolerance policy, we ensure that the community remains a safe, welcoming space for all participants. These measures are not about harshness—they are about protecting contributors and fostering a productive environment where innovation can thrive.
Our expectations are clear, and our enforcement reflects our commitment to this project's long-term success.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.

View File

@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
# Initialize device type args
# use build args in the docker build commmand with --build-arg="BUILDARG=true"
# use build args in the docker build command with --build-arg="BUILDARG=true"
ARG USE_CUDA=false
ARG USE_OLLAMA=false
# Tested with cu117 for CUDA 11 and cu121 for CUDA 12 (default)
@@ -11,13 +11,17 @@ ARG USE_CUDA_VER=cu121
# IMPORTANT: If you change the embedding model (sentence-transformers/all-MiniLM-L6-v2) and vice versa, you aren't able to use RAG Chat with your previous documents loaded in the WebUI! You need to re-embed them.
ARG USE_EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
ARG USE_RERANKING_MODEL=""
# Tiktoken encoding name; models to use can be found at https://huggingface.co/models?library=tiktoken
ARG USE_TIKTOKEN_ENCODING_NAME="cl100k_base"
ARG BUILD_HASH=dev-build
# Override at your own risk - non-root configurations are untested
ARG UID=0
ARG GID=0
######## WebUI frontend ########
FROM --platform=$BUILDPLATFORM node:21-alpine3.19 as build
FROM --platform=$BUILDPLATFORM node:22-alpine3.20 AS build
ARG BUILD_HASH
WORKDIR /app
@@ -30,7 +34,7 @@ ENV APP_BUILD_HASH=${BUILD_HASH}
RUN npm run build
######## WebUI backend ########
FROM python:3.11-slim-bookworm as base
FROM python:3.11-slim-bookworm AS base
# Use args
ARG USE_CUDA
@@ -72,13 +76,21 @@ ENV RAG_EMBEDDING_MODEL="$USE_EMBEDDING_MODEL_DOCKER" \
RAG_RERANKING_MODEL="$USE_RERANKING_MODEL_DOCKER" \
SENTENCE_TRANSFORMERS_HOME="/app/backend/data/cache/embedding/models"
## Tiktoken model settings ##
ENV TIKTOKEN_ENCODING_NAME="cl100k_base" \
TIKTOKEN_CACHE_DIR="/app/backend/data/cache/tiktoken"
## Hugging Face download cache ##
ENV HF_HOME="/app/backend/data/cache/embedding/models"
## Torch Extensions ##
# ENV TORCH_EXTENSIONS_DIR="/.cache/torch_extensions"
#### Other models ##########################################################
WORKDIR /app/backend
ENV HOME /root
ENV HOME=/root
# Create user and group if not root
RUN if [ $UID -ne 0 ]; then \
if [ $GID -ne 0 ]; then \
@@ -96,7 +108,7 @@ RUN chown -R $UID:$GID /app $HOME
RUN if [ "$USE_OLLAMA" = "true" ]; then \
apt-get update && \
# Install pandoc and netcat
apt-get install -y --no-install-recommends pandoc netcat-openbsd curl && \
apt-get install -y --no-install-recommends git build-essential pandoc netcat-openbsd curl && \
apt-get install -y --no-install-recommends gcc python3-dev && \
# for RAG OCR
apt-get install -y --no-install-recommends ffmpeg libsm6 libxext6 && \
@@ -109,7 +121,7 @@ RUN if [ "$USE_OLLAMA" = "true" ]; then \
else \
apt-get update && \
# Install pandoc, netcat and gcc
apt-get install -y --no-install-recommends pandoc gcc netcat-openbsd curl jq && \
apt-get install -y --no-install-recommends git build-essential pandoc gcc netcat-openbsd curl jq && \
apt-get install -y --no-install-recommends gcc python3-dev && \
# for RAG OCR
apt-get install -y --no-install-recommends ffmpeg libsm6 libxext6 && \
@@ -127,11 +139,13 @@ RUN pip3 install uv && \
uv pip install --system -r requirements.txt --no-cache-dir && \
python -c "import os; from sentence_transformers import SentenceTransformer; SentenceTransformer(os.environ['RAG_EMBEDDING_MODEL'], device='cpu')" && \
python -c "import os; from faster_whisper import WhisperModel; WhisperModel(os.environ['WHISPER_MODEL'], device='cpu', compute_type='int8', download_root=os.environ['WHISPER_MODEL_DIR'])"; \
python -c "import os; import tiktoken; tiktoken.get_encoding(os.environ['TIKTOKEN_ENCODING_NAME'])"; \
else \
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu --no-cache-dir && \
uv pip install --system -r requirements.txt --no-cache-dir && \
python -c "import os; from sentence_transformers import SentenceTransformer; SentenceTransformer(os.environ['RAG_EMBEDDING_MODEL'], device='cpu')" && \
python -c "import os; from faster_whisper import WhisperModel; WhisperModel(os.environ['WHISPER_MODEL'], device='cpu', compute_type='int8', download_root=os.environ['WHISPER_MODEL_DIR'])"; \
python -c "import os; import tiktoken; tiktoken.get_encoding(os.environ['TIKTOKEN_ENCODING_NAME'])"; \
fi; \
chown -R $UID:$GID /app/backend/data/
@@ -157,5 +171,6 @@ USER $UID:$GID
ARG BUILD_HASH
ENV WEBUI_BUILD_VERSION=${BUILD_HASH}
ENV DOCKER=true
CMD [ "bash", "start.sh"]

View File

@@ -1,4 +1,4 @@
# Open WebUI (Formerly Ollama WebUI) 👋
# Open WebUI 👋
![GitHub stars](https://img.shields.io/github/stars/open-webui/open-webui?style=social)
![GitHub forks](https://img.shields.io/github/forks/open-webui/open-webui?style=social)
@@ -21,7 +21,7 @@ Open WebUI is an [extensible](https://github.com/open-webui/pipelines), feature-
- 🤝 **Ollama/OpenAI API Integration**: Effortlessly integrate OpenAI-compatible APIs for versatile conversations alongside Ollama models. Customize the OpenAI API URL to link with **LMStudio, GroqCloud, Mistral, OpenRouter, and more**.
- 🧩 **Pipelines, Open WebUI Plugin Support**: Seamlessly integrate custom logic and Python libraries into Open WebUI using [Pipelines Plugin Framework](https://github.com/open-webui/pipelines). Launch your Pipelines instance, set the OpenAI URL to the Pipelines URL, and explore endless possibilities. [Examples](https://github.com/open-webui/pipelines/tree/main/examples) include **Function Calling**, User **Rate Limiting** to control access, **Usage Monitoring** with tools like Langfuse, **Live Translation with LibreTranslate** for multilingual support, **Toxic Message Filtering** and much more.
- 🛡️ **Granular Permissions and User Groups**: By allowing administrators to create detailed user roles and permissions, we ensure a secure user environment. This granularity not only enhances security but also allows for customized user experiences, fostering a sense of ownership and responsibility amongst users.
- 📱 **Responsive Design**: Enjoy a seamless experience across Desktop PC, Laptop, and Mobile devices.
@@ -37,7 +37,7 @@ Open WebUI is an [extensible](https://github.com/open-webui/pipelines), feature-
- 📚 **Local RAG Integration**: Dive into the future of chat interactions with groundbreaking Retrieval Augmented Generation (RAG) support. This feature seamlessly integrates document interactions into your chat experience. You can load documents directly into the chat or add files to your document library, effortlessly accessing them using the `#` command before a query.
- 🔍 **Web Search for RAG**: Perform web searches using providers like `SearXNG`, `Google PSE`, `Brave Search`, `serpstack`, `serper`, `Serply`, `DuckDuckGo` and `TavilySearch` and inject the results directly into your chat experience.
- 🔍 **Web Search for RAG**: Perform web searches using providers like `SearXNG`, `Google PSE`, `Brave Search`, `serpstack`, `serper`, `Serply`, `DuckDuckGo`, `TavilySearch`, `SearchApi` and `Bing` and inject the results directly into your chat experience.
- 🌐 **Web Browsing Capability**: Seamlessly integrate websites into your chat experience using the `#` command followed by a URL. This feature allows you to incorporate web content directly into your conversations, enhancing the richness and depth of your interactions.
@@ -49,6 +49,8 @@ Open WebUI is an [extensible](https://github.com/open-webui/pipelines), feature-
- 🌐🌍 **Multilingual Support**: Experience Open WebUI in your preferred language with our internationalization (i18n) support. Join us in expanding our supported languages! We're actively seeking contributors!
- 🧩 **Pipelines, Open WebUI Plugin Support**: Seamlessly integrate custom logic and Python libraries into Open WebUI using [Pipelines Plugin Framework](https://github.com/open-webui/pipelines). Launch your Pipelines instance, set the OpenAI URL to the Pipelines URL, and explore endless possibilities. [Examples](https://github.com/open-webui/pipelines/tree/main/examples) include **Function Calling**, User **Rate Limiting** to control access, **Usage Monitoring** with tools like Langfuse, **Live Translation with LibreTranslate** for multilingual support, **Toxic Message Filtering** and much more.
- 🌟 **Continuous Updates**: We are committed to improving Open WebUI with regular updates, fixes, and new features.
Want to learn more about Open WebUI's features? Check out our [Open WebUI documentation](https://docs.openwebui.com/features) for a comprehensive overview!
@@ -59,11 +61,31 @@ Don't forget to explore our sibling project, [Open WebUI Community](https://open
## How to Install 🚀
> [!NOTE]
> Please note that for certain Docker environments, additional configurations might be needed. If you encounter any connection issues, our detailed guide on [Open WebUI Documentation](https://docs.openwebui.com/) is ready to assist you.
### Installation via Python pip 🐍
Open WebUI can be installed using pip, the Python package installer. Before proceeding, ensure you're using **Python 3.11** to avoid compatibility issues.
1. **Install Open WebUI**:
Open your terminal and run the following command to install Open WebUI:
```bash
pip install open-webui
```
2. **Running Open WebUI**:
After installation, you can start Open WebUI by executing:
```bash
open-webui serve
```
This will start the Open WebUI server, which you can access at [http://localhost:8080](http://localhost:8080)
### Quick Start with Docker 🐳
> [!NOTE]
> Please note that for certain Docker environments, additional configurations might be needed. If you encounter any connection issues, our detailed guide on [Open WebUI Documentation](https://docs.openwebui.com/) is ready to assist you.
> [!WARNING]
> When using Docker to install Open WebUI, make sure to include the `-v open-webui:/app/backend/data` in your Docker command. This step is crucial as it ensures your database is properly mounted and prevents any loss of data.
@@ -86,7 +108,7 @@ Don't forget to explore our sibling project, [Open WebUI Community](https://open
docker run -d -p 3000:8080 -e OLLAMA_BASE_URL=https://example.com -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main
```
- **To run Open WebUI with Nvidia GPU support**, use this command:
- **To run Open WebUI with Nvidia GPU support**, use this command:
```bash
docker run -d -p 3000:8080 --gpus all --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:cuda
@@ -150,7 +172,7 @@ docker run --rm --volume /var/run/docker.sock:/var/run/docker.sock containrrr/wa
In the last part of the command, replace `open-webui` with your container name if it is different.
Check our Migration Guide available in our [Open WebUI Documentation](https://docs.openwebui.com/migration/).
Check our Migration Guide available in our [Open WebUI Documentation](https://docs.openwebui.com/tutorials/migration/).
### Using the Dev Branch 🌙
@@ -167,18 +189,6 @@ docker run -d -p 3000:8080 -v open-webui:/app/backend/data --name open-webui --a
Discover upcoming features on our roadmap in the [Open WebUI Documentation](https://docs.openwebui.com/roadmap/).
## Supporters ✨
A big shoutout to our amazing supporters who's helping to make this project possible! 🙏
### Platinum Sponsors 🤍
- We're looking for Sponsors!
### Acknowledgments
Special thanks to [Prof. Lawrence Kim](https://www.lhkim.com/) and [Prof. Nick Vincent](https://www.nickmvincent.com/) for their invaluable support and guidance in shaping this project into a research endeavor. Grateful for your mentorship throughout the journey! 🙌
## License 📜
This project is licensed under the [MIT License](LICENSE) - see the [LICENSE](LICENSE) file for details. 📄
@@ -200,4 +210,4 @@ If you have any questions, suggestions, or need assistance, please open an issue
---
Created by [Timothy J. Baek](https://github.com/tjbck) - Let's make Open WebUI even more amazing together! 💪
Created by [Timothy Jaeryang Baek](https://github.com/tjbck) - Let's make Open WebUI even more amazing together! 💪

View File

@@ -18,7 +18,7 @@ If you're experiencing connection issues, its often due to the WebUI docker c
docker run -d --network=host -v open-webui:/app/backend/data -e OLLAMA_BASE_URL=http://127.0.0.1:11434 --name open-webui --restart always ghcr.io/open-webui/open-webui:main
```
### Error on Slow Reponses for Ollama
### Error on Slow Responses for Ollama
Open WebUI has a default timeout of 5 minutes for Ollama to finish generating the response. If needed, this can be adjusted via the environment variable AIOHTTP_CLIENT_TIMEOUT, which sets the timeout in seconds.

6
backend/.gitignore vendored
View File

@@ -8,9 +8,5 @@ _test
Pipfile
!/data
/data/*
!/data/litellm
/data/litellm/*
!data/litellm/config.yaml
!data/config.json
/open_webui/data/*
.webui_secret_key

View File

@@ -1,504 +0,0 @@
import os
import logging
from fastapi import (
FastAPI,
Request,
Depends,
HTTPException,
status,
UploadFile,
File,
Form,
)
from fastapi.responses import StreamingResponse, JSONResponse, FileResponse
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
from typing import List
import uuid
import requests
import hashlib
from pathlib import Path
import json
from constants import ERROR_MESSAGES
from utils.utils import (
decode_token,
get_current_user,
get_verified_user,
get_admin_user,
)
from utils.misc import calculate_sha256
from config import (
SRC_LOG_LEVELS,
CACHE_DIR,
UPLOAD_DIR,
WHISPER_MODEL,
WHISPER_MODEL_DIR,
WHISPER_MODEL_AUTO_UPDATE,
DEVICE_TYPE,
AUDIO_STT_OPENAI_API_BASE_URL,
AUDIO_STT_OPENAI_API_KEY,
AUDIO_TTS_OPENAI_API_BASE_URL,
AUDIO_TTS_OPENAI_API_KEY,
AUDIO_TTS_API_KEY,
AUDIO_STT_ENGINE,
AUDIO_STT_MODEL,
AUDIO_TTS_ENGINE,
AUDIO_TTS_MODEL,
AUDIO_TTS_VOICE,
AppConfig,
)
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["AUDIO"])
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.state.config = AppConfig()
app.state.config.STT_OPENAI_API_BASE_URL = AUDIO_STT_OPENAI_API_BASE_URL
app.state.config.STT_OPENAI_API_KEY = AUDIO_STT_OPENAI_API_KEY
app.state.config.STT_ENGINE = AUDIO_STT_ENGINE
app.state.config.STT_MODEL = AUDIO_STT_MODEL
app.state.config.TTS_OPENAI_API_BASE_URL = AUDIO_TTS_OPENAI_API_BASE_URL
app.state.config.TTS_OPENAI_API_KEY = AUDIO_TTS_OPENAI_API_KEY
app.state.config.TTS_ENGINE = AUDIO_TTS_ENGINE
app.state.config.TTS_MODEL = AUDIO_TTS_MODEL
app.state.config.TTS_VOICE = AUDIO_TTS_VOICE
app.state.config.TTS_API_KEY = AUDIO_TTS_API_KEY
# setting device type for whisper model
whisper_device_type = DEVICE_TYPE if DEVICE_TYPE and DEVICE_TYPE == "cuda" else "cpu"
log.info(f"whisper_device_type: {whisper_device_type}")
SPEECH_CACHE_DIR = Path(CACHE_DIR).joinpath("./audio/speech/")
SPEECH_CACHE_DIR.mkdir(parents=True, exist_ok=True)
class TTSConfigForm(BaseModel):
OPENAI_API_BASE_URL: str
OPENAI_API_KEY: str
API_KEY: str
ENGINE: str
MODEL: str
VOICE: str
class STTConfigForm(BaseModel):
OPENAI_API_BASE_URL: str
OPENAI_API_KEY: str
ENGINE: str
MODEL: str
class AudioConfigUpdateForm(BaseModel):
tts: TTSConfigForm
stt: STTConfigForm
from pydub import AudioSegment
from pydub.utils import mediainfo
def is_mp4_audio(file_path):
"""Check if the given file is an MP4 audio file."""
if not os.path.isfile(file_path):
print(f"File not found: {file_path}")
return False
info = mediainfo(file_path)
if (
info.get("codec_name") == "aac"
and info.get("codec_type") == "audio"
and info.get("codec_tag_string") == "mp4a"
):
return True
return False
def convert_mp4_to_wav(file_path, output_path):
"""Convert MP4 audio file to WAV format."""
audio = AudioSegment.from_file(file_path, format="mp4")
audio.export(output_path, format="wav")
print(f"Converted {file_path} to {output_path}")
@app.get("/config")
async def get_audio_config(user=Depends(get_admin_user)):
return {
"tts": {
"OPENAI_API_BASE_URL": app.state.config.TTS_OPENAI_API_BASE_URL,
"OPENAI_API_KEY": app.state.config.TTS_OPENAI_API_KEY,
"API_KEY": app.state.config.TTS_API_KEY,
"ENGINE": app.state.config.TTS_ENGINE,
"MODEL": app.state.config.TTS_MODEL,
"VOICE": app.state.config.TTS_VOICE,
},
"stt": {
"OPENAI_API_BASE_URL": app.state.config.STT_OPENAI_API_BASE_URL,
"OPENAI_API_KEY": app.state.config.STT_OPENAI_API_KEY,
"ENGINE": app.state.config.STT_ENGINE,
"MODEL": app.state.config.STT_MODEL,
},
}
@app.post("/config/update")
async def update_audio_config(
form_data: AudioConfigUpdateForm, user=Depends(get_admin_user)
):
app.state.config.TTS_OPENAI_API_BASE_URL = form_data.tts.OPENAI_API_BASE_URL
app.state.config.TTS_OPENAI_API_KEY = form_data.tts.OPENAI_API_KEY
app.state.config.TTS_API_KEY = form_data.tts.API_KEY
app.state.config.TTS_ENGINE = form_data.tts.ENGINE
app.state.config.TTS_MODEL = form_data.tts.MODEL
app.state.config.TTS_VOICE = form_data.tts.VOICE
app.state.config.STT_OPENAI_API_BASE_URL = form_data.stt.OPENAI_API_BASE_URL
app.state.config.STT_OPENAI_API_KEY = form_data.stt.OPENAI_API_KEY
app.state.config.STT_ENGINE = form_data.stt.ENGINE
app.state.config.STT_MODEL = form_data.stt.MODEL
return {
"tts": {
"OPENAI_API_BASE_URL": app.state.config.TTS_OPENAI_API_BASE_URL,
"OPENAI_API_KEY": app.state.config.TTS_OPENAI_API_KEY,
"API_KEY": app.state.config.TTS_API_KEY,
"ENGINE": app.state.config.TTS_ENGINE,
"MODEL": app.state.config.TTS_MODEL,
"VOICE": app.state.config.TTS_VOICE,
},
"stt": {
"OPENAI_API_BASE_URL": app.state.config.STT_OPENAI_API_BASE_URL,
"OPENAI_API_KEY": app.state.config.STT_OPENAI_API_KEY,
"ENGINE": app.state.config.STT_ENGINE,
"MODEL": app.state.config.STT_MODEL,
},
}
@app.post("/speech")
async def speech(request: Request, user=Depends(get_verified_user)):
body = await request.body()
name = hashlib.sha256(body).hexdigest()
file_path = SPEECH_CACHE_DIR.joinpath(f"{name}.mp3")
file_body_path = SPEECH_CACHE_DIR.joinpath(f"{name}.json")
# Check if the file already exists in the cache
if file_path.is_file():
return FileResponse(file_path)
if app.state.config.TTS_ENGINE == "openai":
headers = {}
headers["Authorization"] = f"Bearer {app.state.config.TTS_OPENAI_API_KEY}"
headers["Content-Type"] = "application/json"
try:
body = body.decode("utf-8")
body = json.loads(body)
body["model"] = app.state.config.TTS_MODEL
body = json.dumps(body).encode("utf-8")
except Exception as e:
pass
r = None
try:
r = requests.post(
url=f"{app.state.config.TTS_OPENAI_API_BASE_URL}/audio/speech",
data=body,
headers=headers,
stream=True,
)
r.raise_for_status()
# Save the streaming content to a file
with open(file_path, "wb") as f:
for chunk in r.iter_content(chunk_size=8192):
f.write(chunk)
with open(file_body_path, "w") as f:
json.dump(json.loads(body.decode("utf-8")), f)
# Return the saved file
return FileResponse(file_path)
except Exception as e:
log.exception(e)
error_detail = "Open WebUI: Server Connection Error"
if r is not None:
try:
res = r.json()
if "error" in res:
error_detail = f"External: {res['error']['message']}"
except:
error_detail = f"External: {e}"
raise HTTPException(
status_code=r.status_code if r != None else 500,
detail=error_detail,
)
elif app.state.config.TTS_ENGINE == "elevenlabs":
payload = None
try:
payload = json.loads(body.decode("utf-8"))
except Exception as e:
log.exception(e)
raise HTTPException(status_code=400, detail="Invalid JSON payload")
voice_id = payload.get("voice", "")
url = f"https://api.elevenlabs.io/v1/text-to-speech/{voice_id}"
headers = {
"Accept": "audio/mpeg",
"Content-Type": "application/json",
"xi-api-key": app.state.config.TTS_API_KEY,
}
data = {
"text": payload["input"],
"model_id": app.state.config.TTS_MODEL,
"voice_settings": {"stability": 0.5, "similarity_boost": 0.5},
}
try:
r = requests.post(url, json=data, headers=headers)
r.raise_for_status()
# Save the streaming content to a file
with open(file_path, "wb") as f:
for chunk in r.iter_content(chunk_size=8192):
f.write(chunk)
with open(file_body_path, "w") as f:
json.dump(json.loads(body.decode("utf-8")), f)
# Return the saved file
return FileResponse(file_path)
except Exception as e:
log.exception(e)
error_detail = "Open WebUI: Server Connection Error"
if r is not None:
try:
res = r.json()
if "error" in res:
error_detail = f"External: {res['error']['message']}"
except:
error_detail = f"External: {e}"
raise HTTPException(
status_code=r.status_code if r != None else 500,
detail=error_detail,
)
@app.post("/transcriptions")
def transcribe(
file: UploadFile = File(...),
user=Depends(get_current_user),
):
log.info(f"file.content_type: {file.content_type}")
if file.content_type not in ["audio/mpeg", "audio/wav"]:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=ERROR_MESSAGES.FILE_NOT_SUPPORTED,
)
try:
ext = file.filename.split(".")[-1]
id = uuid.uuid4()
filename = f"{id}.{ext}"
file_dir = f"{CACHE_DIR}/audio/transcriptions"
os.makedirs(file_dir, exist_ok=True)
file_path = f"{file_dir}/{filename}"
print(filename)
contents = file.file.read()
with open(file_path, "wb") as f:
f.write(contents)
f.close()
if app.state.config.STT_ENGINE == "":
from faster_whisper import WhisperModel
whisper_kwargs = {
"model_size_or_path": WHISPER_MODEL,
"device": whisper_device_type,
"compute_type": "int8",
"download_root": WHISPER_MODEL_DIR,
"local_files_only": not WHISPER_MODEL_AUTO_UPDATE,
}
log.debug(f"whisper_kwargs: {whisper_kwargs}")
try:
model = WhisperModel(**whisper_kwargs)
except:
log.warning(
"WhisperModel initialization failed, attempting download with local_files_only=False"
)
whisper_kwargs["local_files_only"] = False
model = WhisperModel(**whisper_kwargs)
segments, info = model.transcribe(file_path, beam_size=5)
log.info(
"Detected language '%s' with probability %f"
% (info.language, info.language_probability)
)
transcript = "".join([segment.text for segment in list(segments)])
data = {"text": transcript.strip()}
# save the transcript to a json file
transcript_file = f"{file_dir}/{id}.json"
with open(transcript_file, "w") as f:
json.dump(data, f)
print(data)
return data
elif app.state.config.STT_ENGINE == "openai":
if is_mp4_audio(file_path):
print("is_mp4_audio")
os.rename(file_path, file_path.replace(".wav", ".mp4"))
# Convert MP4 audio file to WAV format
convert_mp4_to_wav(file_path.replace(".wav", ".mp4"), file_path)
headers = {"Authorization": f"Bearer {app.state.config.STT_OPENAI_API_KEY}"}
files = {"file": (filename, open(file_path, "rb"))}
data = {"model": app.state.config.STT_MODEL}
print(files, data)
r = None
try:
r = requests.post(
url=f"{app.state.config.STT_OPENAI_API_BASE_URL}/audio/transcriptions",
headers=headers,
files=files,
data=data,
)
r.raise_for_status()
data = r.json()
# save the transcript to a json file
transcript_file = f"{file_dir}/{id}.json"
with open(transcript_file, "w") as f:
json.dump(data, f)
print(data)
return data
except Exception as e:
log.exception(e)
error_detail = "Open WebUI: Server Connection Error"
if r is not None:
try:
res = r.json()
if "error" in res:
error_detail = f"External: {res['error']['message']}"
except:
error_detail = f"External: {e}"
raise HTTPException(
status_code=r.status_code if r != None else 500,
detail=error_detail,
)
except Exception as e:
log.exception(e)
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=ERROR_MESSAGES.DEFAULT(e),
)
def get_available_models() -> List[dict]:
if app.state.config.TTS_ENGINE == "openai":
return [{"id": "tts-1"}, {"id": "tts-1-hd"}]
elif app.state.config.TTS_ENGINE == "elevenlabs":
headers = {
"xi-api-key": app.state.config.TTS_API_KEY,
"Content-Type": "application/json",
}
try:
response = requests.get(
"https://api.elevenlabs.io/v1/models", headers=headers
)
response.raise_for_status()
models = response.json()
return [
{"name": model["name"], "id": model["model_id"]} for model in models
]
except requests.RequestException as e:
log.error(f"Error fetching voices: {str(e)}")
return []
@app.get("/models")
async def get_models(user=Depends(get_verified_user)):
return {"models": get_available_models()}
def get_available_voices() -> List[dict]:
if app.state.config.TTS_ENGINE == "openai":
return [
{"name": "alloy", "id": "alloy"},
{"name": "echo", "id": "echo"},
{"name": "fable", "id": "fable"},
{"name": "onyx", "id": "onyx"},
{"name": "nova", "id": "nova"},
{"name": "shimmer", "id": "shimmer"},
]
elif app.state.config.TTS_ENGINE == "elevenlabs":
headers = {
"xi-api-key": app.state.config.TTS_API_KEY,
"Content-Type": "application/json",
}
try:
response = requests.get(
"https://api.elevenlabs.io/v1/voices", headers=headers
)
response.raise_for_status()
voices_data = response.json()
voices = []
for voice in voices_data.get("voices", []):
voices.append({"name": voice["name"], "id": voice["voice_id"]})
return voices
except requests.RequestException as e:
log.error(f"Error fetching voices: {str(e)}")
return []
@app.get("/voices")
async def get_voices(user=Depends(get_verified_user)):
return {"voices": get_available_voices()}

View File

@@ -1,407 +0,0 @@
import websocket # NOTE: websocket-client (https://github.com/websocket-client/websocket-client)
import uuid
import json
import urllib.request
import urllib.parse
import random
import logging
from config import SRC_LOG_LEVELS
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["COMFYUI"])
from pydantic import BaseModel
from typing import Optional
COMFYUI_DEFAULT_PROMPT = """
{
"3": {
"inputs": {
"seed": 0,
"steps": 20,
"cfg": 8,
"sampler_name": "euler",
"scheduler": "normal",
"denoise": 1,
"model": [
"4",
0
],
"positive": [
"6",
0
],
"negative": [
"7",
0
],
"latent_image": [
"5",
0
]
},
"class_type": "KSampler",
"_meta": {
"title": "KSampler"
}
},
"4": {
"inputs": {
"ckpt_name": "model.safetensors"
},
"class_type": "CheckpointLoaderSimple",
"_meta": {
"title": "Load Checkpoint"
}
},
"5": {
"inputs": {
"width": 512,
"height": 512,
"batch_size": 1
},
"class_type": "EmptyLatentImage",
"_meta": {
"title": "Empty Latent Image"
}
},
"6": {
"inputs": {
"text": "Prompt",
"clip": [
"4",
1
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"7": {
"inputs": {
"text": "Negative Prompt",
"clip": [
"4",
1
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"8": {
"inputs": {
"samples": [
"3",
0
],
"vae": [
"4",
2
]
},
"class_type": "VAEDecode",
"_meta": {
"title": "VAE Decode"
}
},
"9": {
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"8",
0
]
},
"class_type": "SaveImage",
"_meta": {
"title": "Save Image"
}
}
}
"""
FLUX_DEFAULT_PROMPT = """
{
"5": {
"inputs": {
"width": 1024,
"height": 1024,
"batch_size": 1
},
"class_type": "EmptyLatentImage"
},
"6": {
"inputs": {
"text": "Input Text Here",
"clip": [
"11",
0
]
},
"class_type": "CLIPTextEncode"
},
"8": {
"inputs": {
"samples": [
"13",
0
],
"vae": [
"10",
0
]
},
"class_type": "VAEDecode"
},
"9": {
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"8",
0
]
},
"class_type": "SaveImage"
},
"10": {
"inputs": {
"vae_name": "ae.sft"
},
"class_type": "VAELoader"
},
"11": {
"inputs": {
"clip_name1": "clip_l.safetensors",
"clip_name2": "t5xxl_fp16.safetensors",
"type": "flux"
},
"class_type": "DualCLIPLoader"
},
"12": {
"inputs": {
"unet_name": "flux1-dev.sft",
"weight_dtype": "default"
},
"class_type": "UNETLoader"
},
"13": {
"inputs": {
"noise": [
"25",
0
],
"guider": [
"22",
0
],
"sampler": [
"16",
0
],
"sigmas": [
"17",
0
],
"latent_image": [
"5",
0
]
},
"class_type": "SamplerCustomAdvanced"
},
"16": {
"inputs": {
"sampler_name": "euler"
},
"class_type": "KSamplerSelect"
},
"17": {
"inputs": {
"scheduler": "simple",
"steps": 20,
"denoise": 1,
"model": [
"12",
0
]
},
"class_type": "BasicScheduler"
},
"22": {
"inputs": {
"model": [
"12",
0
],
"conditioning": [
"6",
0
]
},
"class_type": "BasicGuider"
},
"25": {
"inputs": {
"noise_seed": 778937779713005
},
"class_type": "RandomNoise"
}
}
"""
def queue_prompt(prompt, client_id, base_url):
log.info("queue_prompt")
p = {"prompt": prompt, "client_id": client_id}
data = json.dumps(p).encode("utf-8")
req = urllib.request.Request(f"{base_url}/prompt", data=data)
return json.loads(urllib.request.urlopen(req).read())
def get_image(filename, subfolder, folder_type, base_url):
log.info("get_image")
data = {"filename": filename, "subfolder": subfolder, "type": folder_type}
url_values = urllib.parse.urlencode(data)
with urllib.request.urlopen(f"{base_url}/view?{url_values}") as response:
return response.read()
def get_image_url(filename, subfolder, folder_type, base_url):
log.info("get_image")
data = {"filename": filename, "subfolder": subfolder, "type": folder_type}
url_values = urllib.parse.urlencode(data)
return f"{base_url}/view?{url_values}"
def get_history(prompt_id, base_url):
log.info("get_history")
with urllib.request.urlopen(f"{base_url}/history/{prompt_id}") as response:
return json.loads(response.read())
def get_images(ws, prompt, client_id, base_url):
prompt_id = queue_prompt(prompt, client_id, base_url)["prompt_id"]
output_images = []
while True:
out = ws.recv()
if isinstance(out, str):
message = json.loads(out)
if message["type"] == "executing":
data = message["data"]
if data["node"] is None and data["prompt_id"] == prompt_id:
break # Execution is done
else:
continue # previews are binary data
history = get_history(prompt_id, base_url)[prompt_id]
for o in history["outputs"]:
for node_id in history["outputs"]:
node_output = history["outputs"][node_id]
if "images" in node_output:
for image in node_output["images"]:
url = get_image_url(
image["filename"], image["subfolder"], image["type"], base_url
)
output_images.append({"url": url})
return {"data": output_images}
class ImageGenerationPayload(BaseModel):
prompt: str
negative_prompt: Optional[str] = ""
steps: Optional[int] = None
seed: Optional[int] = None
width: int
height: int
n: int = 1
cfg_scale: Optional[float] = None
sampler: Optional[str] = None
scheduler: Optional[str] = None
sd3: Optional[bool] = None
flux: Optional[bool] = None
flux_weight_dtype: Optional[str] = None
flux_fp8_clip: Optional[bool] = None
def comfyui_generate_image(
model: str, payload: ImageGenerationPayload, client_id, base_url
):
ws_url = base_url.replace("http://", "ws://").replace("https://", "wss://")
comfyui_prompt = json.loads(COMFYUI_DEFAULT_PROMPT)
if payload.cfg_scale:
comfyui_prompt["3"]["inputs"]["cfg"] = payload.cfg_scale
if payload.sampler:
comfyui_prompt["3"]["inputs"]["sampler"] = payload.sampler
if payload.scheduler:
comfyui_prompt["3"]["inputs"]["scheduler"] = payload.scheduler
if payload.sd3:
comfyui_prompt["5"]["class_type"] = "EmptySD3LatentImage"
if payload.steps:
comfyui_prompt["3"]["inputs"]["steps"] = payload.steps
comfyui_prompt["4"]["inputs"]["ckpt_name"] = model
comfyui_prompt["7"]["inputs"]["text"] = payload.negative_prompt
comfyui_prompt["3"]["inputs"]["seed"] = (
payload.seed if payload.seed else random.randint(0, 18446744073709551614)
)
# as Flux uses a completely different workflow, we must treat it specially
if payload.flux:
comfyui_prompt = json.loads(FLUX_DEFAULT_PROMPT)
comfyui_prompt["12"]["inputs"]["unet_name"] = model
comfyui_prompt["25"]["inputs"]["noise_seed"] = (
payload.seed if payload.seed else random.randint(0, 18446744073709551614)
)
if payload.sampler:
comfyui_prompt["16"]["inputs"]["sampler_name"] = payload.sampler
if payload.steps:
comfyui_prompt["17"]["inputs"]["steps"] = payload.steps
if payload.scheduler:
comfyui_prompt["17"]["inputs"]["scheduler"] = payload.scheduler
if payload.flux_weight_dtype:
comfyui_prompt["12"]["inputs"]["weight_dtype"] = payload.flux_weight_dtype
if payload.flux_fp8_clip:
comfyui_prompt["11"]["inputs"][
"clip_name2"
] = "t5xxl_fp8_e4m3fn.safetensors"
comfyui_prompt["5"]["inputs"]["batch_size"] = payload.n
comfyui_prompt["5"]["inputs"]["width"] = payload.width
comfyui_prompt["5"]["inputs"]["height"] = payload.height
# set the text prompt for our positive CLIPTextEncode
comfyui_prompt["6"]["inputs"]["text"] = payload.prompt
try:
ws = websocket.WebSocket()
ws.connect(f"{ws_url}/ws?clientId={client_id}")
log.info("WebSocket connection established.")
except Exception as e:
log.exception(f"Failed to connect to WebSocket server: {e}")
return None
try:
images = get_images(ws, comfyui_prompt, client_id, base_url)
except Exception as e:
log.exception(f"Error while receiving images: {e}")
images = None
ws.close()
return images

View File

@@ -1,508 +0,0 @@
from fastapi import FastAPI, Request, HTTPException, Depends
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import StreamingResponse, FileResponse
import requests
import aiohttp
import asyncio
import json
import logging
from pydantic import BaseModel
from starlette.background import BackgroundTask
from apps.webui.models.models import Models
from constants import ERROR_MESSAGES
from utils.utils import (
get_verified_user,
get_admin_user,
)
from utils.misc import apply_model_params_to_body, apply_model_system_prompt_to_body
from config import (
SRC_LOG_LEVELS,
ENABLE_OPENAI_API,
AIOHTTP_CLIENT_TIMEOUT,
OPENAI_API_BASE_URLS,
OPENAI_API_KEYS,
CACHE_DIR,
ENABLE_MODEL_FILTER,
MODEL_FILTER_LIST,
AppConfig,
)
from typing import List, Optional, Literal, overload
import hashlib
from pathlib import Path
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["OPENAI"])
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.state.config = AppConfig()
app.state.config.ENABLE_MODEL_FILTER = ENABLE_MODEL_FILTER
app.state.config.MODEL_FILTER_LIST = MODEL_FILTER_LIST
app.state.config.ENABLE_OPENAI_API = ENABLE_OPENAI_API
app.state.config.OPENAI_API_BASE_URLS = OPENAI_API_BASE_URLS
app.state.config.OPENAI_API_KEYS = OPENAI_API_KEYS
app.state.MODELS = {}
@app.middleware("http")
async def check_url(request: Request, call_next):
if len(app.state.MODELS) == 0:
await get_all_models()
response = await call_next(request)
return response
@app.get("/config")
async def get_config(user=Depends(get_admin_user)):
return {"ENABLE_OPENAI_API": app.state.config.ENABLE_OPENAI_API}
class OpenAIConfigForm(BaseModel):
enable_openai_api: Optional[bool] = None
@app.post("/config/update")
async def update_config(form_data: OpenAIConfigForm, user=Depends(get_admin_user)):
app.state.config.ENABLE_OPENAI_API = form_data.enable_openai_api
return {"ENABLE_OPENAI_API": app.state.config.ENABLE_OPENAI_API}
class UrlsUpdateForm(BaseModel):
urls: List[str]
class KeysUpdateForm(BaseModel):
keys: List[str]
@app.get("/urls")
async def get_openai_urls(user=Depends(get_admin_user)):
return {"OPENAI_API_BASE_URLS": app.state.config.OPENAI_API_BASE_URLS}
@app.post("/urls/update")
async def update_openai_urls(form_data: UrlsUpdateForm, user=Depends(get_admin_user)):
await get_all_models()
app.state.config.OPENAI_API_BASE_URLS = form_data.urls
return {"OPENAI_API_BASE_URLS": app.state.config.OPENAI_API_BASE_URLS}
@app.get("/keys")
async def get_openai_keys(user=Depends(get_admin_user)):
return {"OPENAI_API_KEYS": app.state.config.OPENAI_API_KEYS}
@app.post("/keys/update")
async def update_openai_key(form_data: KeysUpdateForm, user=Depends(get_admin_user)):
app.state.config.OPENAI_API_KEYS = form_data.keys
return {"OPENAI_API_KEYS": app.state.config.OPENAI_API_KEYS}
@app.post("/audio/speech")
async def speech(request: Request, user=Depends(get_verified_user)):
idx = None
try:
idx = app.state.config.OPENAI_API_BASE_URLS.index("https://api.openai.com/v1")
body = await request.body()
name = hashlib.sha256(body).hexdigest()
SPEECH_CACHE_DIR = Path(CACHE_DIR).joinpath("./audio/speech/")
SPEECH_CACHE_DIR.mkdir(parents=True, exist_ok=True)
file_path = SPEECH_CACHE_DIR.joinpath(f"{name}.mp3")
file_body_path = SPEECH_CACHE_DIR.joinpath(f"{name}.json")
# Check if the file already exists in the cache
if file_path.is_file():
return FileResponse(file_path)
headers = {}
headers["Authorization"] = f"Bearer {app.state.config.OPENAI_API_KEYS[idx]}"
headers["Content-Type"] = "application/json"
if "openrouter.ai" in app.state.config.OPENAI_API_BASE_URLS[idx]:
headers["HTTP-Referer"] = "https://openwebui.com/"
headers["X-Title"] = "Open WebUI"
r = None
try:
r = requests.post(
url=f"{app.state.config.OPENAI_API_BASE_URLS[idx]}/audio/speech",
data=body,
headers=headers,
stream=True,
)
r.raise_for_status()
# Save the streaming content to a file
with open(file_path, "wb") as f:
for chunk in r.iter_content(chunk_size=8192):
f.write(chunk)
with open(file_body_path, "w") as f:
json.dump(json.loads(body.decode("utf-8")), f)
# Return the saved file
return FileResponse(file_path)
except Exception as e:
log.exception(e)
error_detail = "Open WebUI: Server Connection Error"
if r is not None:
try:
res = r.json()
if "error" in res:
error_detail = f"External: {res['error']}"
except Exception:
error_detail = f"External: {e}"
raise HTTPException(
status_code=r.status_code if r else 500, detail=error_detail
)
except ValueError:
raise HTTPException(status_code=401, detail=ERROR_MESSAGES.OPENAI_NOT_FOUND)
async def fetch_url(url, key):
timeout = aiohttp.ClientTimeout(total=5)
try:
headers = {"Authorization": f"Bearer {key}"}
async with aiohttp.ClientSession(timeout=timeout, trust_env=True) as session:
async with session.get(url, headers=headers) as response:
return await response.json()
except Exception as e:
# Handle connection error here
log.error(f"Connection error: {e}")
return None
async def cleanup_response(
response: Optional[aiohttp.ClientResponse],
session: Optional[aiohttp.ClientSession],
):
if response:
response.close()
if session:
await session.close()
def merge_models_lists(model_lists):
log.debug(f"merge_models_lists {model_lists}")
merged_list = []
for idx, models in enumerate(model_lists):
if models is not None and "error" not in models:
merged_list.extend(
[
{
**model,
"name": model.get("name", model["id"]),
"owned_by": "openai",
"openai": model,
"urlIdx": idx,
}
for model in models
if "api.openai.com"
not in app.state.config.OPENAI_API_BASE_URLS[idx]
or "gpt" in model["id"]
]
)
return merged_list
def is_openai_api_disabled():
api_keys = app.state.config.OPENAI_API_KEYS
no_keys = len(api_keys) == 1 and api_keys[0] == ""
return no_keys or not app.state.config.ENABLE_OPENAI_API
async def get_all_models_raw() -> list:
if is_openai_api_disabled():
return []
# Check if API KEYS length is same than API URLS length
num_urls = len(app.state.config.OPENAI_API_BASE_URLS)
num_keys = len(app.state.config.OPENAI_API_KEYS)
if num_keys != num_urls:
# if there are more keys than urls, remove the extra keys
if num_keys > num_urls:
new_keys = app.state.config.OPENAI_API_KEYS[:num_urls]
app.state.config.OPENAI_API_KEYS = new_keys
# if there are more urls than keys, add empty keys
else:
app.state.config.OPENAI_API_KEYS += [""] * (num_urls - num_keys)
tasks = [
fetch_url(f"{url}/models", app.state.config.OPENAI_API_KEYS[idx])
for idx, url in enumerate(app.state.config.OPENAI_API_BASE_URLS)
]
responses = await asyncio.gather(*tasks)
log.debug(f"get_all_models:responses() {responses}")
return responses
@overload
async def get_all_models(raw: Literal[True]) -> list: ...
@overload
async def get_all_models(raw: Literal[False] = False) -> dict[str, list]: ...
async def get_all_models(raw=False) -> dict[str, list] | list:
log.info("get_all_models()")
if is_openai_api_disabled():
return [] if raw else {"data": []}
responses = await get_all_models_raw()
if raw:
return responses
def extract_data(response):
if response and "data" in response:
return response["data"]
if isinstance(response, list):
return response
return None
models = {"data": merge_models_lists(map(extract_data, responses))}
log.debug(f"models: {models}")
app.state.MODELS = {model["id"]: model for model in models["data"]}
return models
@app.get("/models")
@app.get("/models/{url_idx}")
async def get_models(url_idx: Optional[int] = None, user=Depends(get_verified_user)):
if url_idx is None:
models = await get_all_models()
if app.state.config.ENABLE_MODEL_FILTER:
if user.role == "user":
models["data"] = list(
filter(
lambda model: model["id"] in app.state.config.MODEL_FILTER_LIST,
models["data"],
)
)
return models
return models
else:
url = app.state.config.OPENAI_API_BASE_URLS[url_idx]
key = app.state.config.OPENAI_API_KEYS[url_idx]
headers = {}
headers["Authorization"] = f"Bearer {key}"
headers["Content-Type"] = "application/json"
r = None
try:
r = requests.request(method="GET", url=f"{url}/models", headers=headers)
r.raise_for_status()
response_data = r.json()
if "api.openai.com" in url:
response_data["data"] = list(
filter(lambda model: "gpt" in model["id"], response_data["data"])
)
return response_data
except Exception as e:
log.exception(e)
error_detail = "Open WebUI: Server Connection Error"
if r is not None:
try:
res = r.json()
if "error" in res:
error_detail = f"External: {res['error']}"
except Exception:
error_detail = f"External: {e}"
raise HTTPException(
status_code=r.status_code if r else 500,
detail=error_detail,
)
@app.post("/chat/completions")
@app.post("/chat/completions/{url_idx}")
async def generate_chat_completion(
form_data: dict,
url_idx: Optional[int] = None,
user=Depends(get_verified_user),
):
idx = 0
payload = {**form_data}
payload.pop("metadata")
model_id = form_data.get("model")
model_info = Models.get_model_by_id(model_id)
if model_info:
if model_info.base_model_id:
payload["model"] = model_info.base_model_id
params = model_info.params.model_dump()
payload = apply_model_params_to_body(params, payload)
payload = apply_model_system_prompt_to_body(params, payload, user)
model = app.state.MODELS[payload.get("model")]
idx = model["urlIdx"]
if "pipeline" in model and model.get("pipeline"):
payload["user"] = {
"name": user.name,
"id": user.id,
"email": user.email,
"role": user.role,
}
# Convert the modified body back to JSON
payload = json.dumps(payload)
log.debug(payload)
url = app.state.config.OPENAI_API_BASE_URLS[idx]
key = app.state.config.OPENAI_API_KEYS[idx]
headers = {}
headers["Authorization"] = f"Bearer {key}"
headers["Content-Type"] = "application/json"
if "openrouter.ai" in app.state.config.OPENAI_API_BASE_URLS[idx]:
headers["HTTP-Referer"] = "https://openwebui.com/"
headers["X-Title"] = "Open WebUI"
r = None
session = None
streaming = False
try:
session = aiohttp.ClientSession(
trust_env=True, timeout=aiohttp.ClientTimeout(total=AIOHTTP_CLIENT_TIMEOUT)
)
r = await session.request(
method="POST",
url=f"{url}/chat/completions",
data=payload,
headers=headers,
)
r.raise_for_status()
# Check if response is SSE
if "text/event-stream" in r.headers.get("Content-Type", ""):
streaming = True
return StreamingResponse(
r.content,
status_code=r.status,
headers=dict(r.headers),
background=BackgroundTask(
cleanup_response, response=r, session=session
),
)
else:
response_data = await r.json()
return response_data
except Exception as e:
log.exception(e)
error_detail = "Open WebUI: Server Connection Error"
if r is not None:
try:
res = await r.json()
print(res)
if "error" in res:
error_detail = f"External: {res['error']['message'] if 'message' in res['error'] else res['error']}"
except Exception:
error_detail = f"External: {e}"
raise HTTPException(status_code=r.status if r else 500, detail=error_detail)
finally:
if not streaming and session:
if r:
r.close()
await session.close()
@app.api_route("/{path:path}", methods=["GET", "POST", "PUT", "DELETE"])
async def proxy(path: str, request: Request, user=Depends(get_verified_user)):
idx = 0
body = await request.body()
url = app.state.config.OPENAI_API_BASE_URLS[idx]
key = app.state.config.OPENAI_API_KEYS[idx]
target_url = f"{url}/{path}"
headers = {}
headers["Authorization"] = f"Bearer {key}"
headers["Content-Type"] = "application/json"
r = None
session = None
streaming = False
try:
session = aiohttp.ClientSession(trust_env=True)
r = await session.request(
method=request.method,
url=target_url,
data=body,
headers=headers,
)
r.raise_for_status()
# Check if response is SSE
if "text/event-stream" in r.headers.get("Content-Type", ""):
streaming = True
return StreamingResponse(
r.content,
status_code=r.status,
headers=dict(r.headers),
background=BackgroundTask(
cleanup_response, response=r, session=session
),
)
else:
response_data = await r.json()
return response_data
except Exception as e:
log.exception(e)
error_detail = "Open WebUI: Server Connection Error"
if r is not None:
try:
res = await r.json()
print(res)
if "error" in res:
error_detail = f"External: {res['error']['message'] if 'message' in res['error'] else res['error']}"
except Exception:
error_detail = f"External: {e}"
raise HTTPException(status_code=r.status if r else 500, detail=error_detail)
finally:
if not streaming and session:
if r:
r.close()
await session.close()

View File

@@ -1,171 +0,0 @@
import socketio
import asyncio
from apps.webui.models.users import Users
from utils.utils import decode_token
sio = socketio.AsyncServer(cors_allowed_origins=[], async_mode="asgi")
app = socketio.ASGIApp(sio, socketio_path="/ws/socket.io")
# Dictionary to maintain the user pool
SESSION_POOL = {}
USER_POOL = {}
USAGE_POOL = {}
# Timeout duration in seconds
TIMEOUT_DURATION = 3
@sio.event
async def connect(sid, environ, auth):
user = None
if auth and "token" in auth:
data = decode_token(auth["token"])
if data is not None and "id" in data:
user = Users.get_user_by_id(data["id"])
if user:
SESSION_POOL[sid] = user.id
if user.id in USER_POOL:
USER_POOL[user.id].append(sid)
else:
USER_POOL[user.id] = [sid]
print(f"user {user.name}({user.id}) connected with session ID {sid}")
await sio.emit("user-count", {"count": len(set(USER_POOL))})
await sio.emit("usage", {"models": get_models_in_use()})
@sio.on("user-join")
async def user_join(sid, data):
print("user-join", sid, data)
auth = data["auth"] if "auth" in data else None
if not auth or "token" not in auth:
return
data = decode_token(auth["token"])
if data is None or "id" not in data:
return
user = Users.get_user_by_id(data["id"])
if not user:
return
SESSION_POOL[sid] = user.id
if user.id in USER_POOL:
USER_POOL[user.id].append(sid)
else:
USER_POOL[user.id] = [sid]
print(f"user {user.name}({user.id}) connected with session ID {sid}")
await sio.emit("user-count", {"count": len(set(USER_POOL))})
@sio.on("user-count")
async def user_count(sid):
await sio.emit("user-count", {"count": len(set(USER_POOL))})
def get_models_in_use():
# Aggregate all models in use
models_in_use = []
for model_id, data in USAGE_POOL.items():
models_in_use.append(model_id)
return models_in_use
@sio.on("usage")
async def usage(sid, data):
model_id = data["model"]
# Cancel previous callback if there is one
if model_id in USAGE_POOL:
USAGE_POOL[model_id]["callback"].cancel()
# Store the new usage data and task
if model_id in USAGE_POOL:
USAGE_POOL[model_id]["sids"].append(sid)
USAGE_POOL[model_id]["sids"] = list(set(USAGE_POOL[model_id]["sids"]))
else:
USAGE_POOL[model_id] = {"sids": [sid]}
# Schedule a task to remove the usage data after TIMEOUT_DURATION
USAGE_POOL[model_id]["callback"] = asyncio.create_task(
remove_after_timeout(sid, model_id)
)
# Broadcast the usage data to all clients
await sio.emit("usage", {"models": get_models_in_use()})
async def remove_after_timeout(sid, model_id):
try:
await asyncio.sleep(TIMEOUT_DURATION)
if model_id in USAGE_POOL:
print(USAGE_POOL[model_id]["sids"])
USAGE_POOL[model_id]["sids"].remove(sid)
USAGE_POOL[model_id]["sids"] = list(set(USAGE_POOL[model_id]["sids"]))
if len(USAGE_POOL[model_id]["sids"]) == 0:
del USAGE_POOL[model_id]
# Broadcast the usage data to all clients
await sio.emit("usage", {"models": get_models_in_use()})
except asyncio.CancelledError:
# Task was cancelled due to new 'usage' event
pass
@sio.event
async def disconnect(sid):
if sid in SESSION_POOL:
user_id = SESSION_POOL[sid]
del SESSION_POOL[sid]
USER_POOL[user_id].remove(sid)
if len(USER_POOL[user_id]) == 0:
del USER_POOL[user_id]
await sio.emit("user-count", {"count": len(USER_POOL)})
else:
print(f"Unknown session ID {sid} disconnected")
def get_event_emitter(request_info):
async def __event_emitter__(event_data):
await sio.emit(
"chat-events",
{
"chat_id": request_info["chat_id"],
"message_id": request_info["message_id"],
"data": event_data,
},
to=request_info["session_id"],
)
return __event_emitter__
def get_event_call(request_info):
async def __event_call__(event_data):
response = await sio.call(
"chat-events",
{
"chat_id": request_info["chat_id"],
"message_id": request_info["message_id"],
"data": event_data,
},
to=request_info["session_id"],
)
return response
return __event_call__

View File

@@ -1,407 +0,0 @@
from pydantic import BaseModel, ConfigDict
from typing import List, Union, Optional
import json
import uuid
import time
from sqlalchemy import Column, String, BigInteger, Boolean, Text
from apps.webui.internal.db import Base, get_db
####################
# Chat DB Schema
####################
class Chat(Base):
__tablename__ = "chat"
id = Column(String, primary_key=True)
user_id = Column(String)
title = Column(Text)
chat = Column(Text) # Save Chat JSON as Text
created_at = Column(BigInteger)
updated_at = Column(BigInteger)
share_id = Column(Text, unique=True, nullable=True)
archived = Column(Boolean, default=False)
class ChatModel(BaseModel):
model_config = ConfigDict(from_attributes=True)
id: str
user_id: str
title: str
chat: str
created_at: int # timestamp in epoch
updated_at: int # timestamp in epoch
share_id: Optional[str] = None
archived: bool = False
####################
# Forms
####################
class ChatForm(BaseModel):
chat: dict
class ChatTitleForm(BaseModel):
title: str
class ChatResponse(BaseModel):
id: str
user_id: str
title: str
chat: dict
updated_at: int # timestamp in epoch
created_at: int # timestamp in epoch
share_id: Optional[str] = None # id of the chat to be shared
archived: bool
class ChatTitleIdResponse(BaseModel):
id: str
title: str
updated_at: int
created_at: int
class ChatTable:
def insert_new_chat(self, user_id: str, form_data: ChatForm) -> Optional[ChatModel]:
with get_db() as db:
id = str(uuid.uuid4())
chat = ChatModel(
**{
"id": id,
"user_id": user_id,
"title": (
form_data.chat["title"]
if "title" in form_data.chat
else "New Chat"
),
"chat": json.dumps(form_data.chat),
"created_at": int(time.time()),
"updated_at": int(time.time()),
}
)
result = Chat(**chat.model_dump())
db.add(result)
db.commit()
db.refresh(result)
return ChatModel.model_validate(result) if result else None
def update_chat_by_id(self, id: str, chat: dict) -> Optional[ChatModel]:
try:
with get_db() as db:
chat_obj = db.get(Chat, id)
chat_obj.chat = json.dumps(chat)
chat_obj.title = chat["title"] if "title" in chat else "New Chat"
chat_obj.updated_at = int(time.time())
db.commit()
db.refresh(chat_obj)
return ChatModel.model_validate(chat_obj)
except Exception as e:
return None
def insert_shared_chat_by_chat_id(self, chat_id: str) -> Optional[ChatModel]:
with get_db() as db:
# Get the existing chat to share
chat = db.get(Chat, chat_id)
# Check if the chat is already shared
if chat.share_id:
return self.get_chat_by_id_and_user_id(chat.share_id, "shared")
# Create a new chat with the same data, but with a new ID
shared_chat = ChatModel(
**{
"id": str(uuid.uuid4()),
"user_id": f"shared-{chat_id}",
"title": chat.title,
"chat": chat.chat,
"created_at": chat.created_at,
"updated_at": int(time.time()),
}
)
shared_result = Chat(**shared_chat.model_dump())
db.add(shared_result)
db.commit()
db.refresh(shared_result)
# Update the original chat with the share_id
result = (
db.query(Chat)
.filter_by(id=chat_id)
.update({"share_id": shared_chat.id})
)
db.commit()
return shared_chat if (shared_result and result) else None
def update_shared_chat_by_chat_id(self, chat_id: str) -> Optional[ChatModel]:
try:
with get_db() as db:
print("update_shared_chat_by_id")
chat = db.get(Chat, chat_id)
print(chat)
chat.title = chat.title
chat.chat = chat.chat
db.commit()
db.refresh(chat)
return self.get_chat_by_id(chat.share_id)
except:
return None
def delete_shared_chat_by_chat_id(self, chat_id: str) -> bool:
try:
with get_db() as db:
db.query(Chat).filter_by(user_id=f"shared-{chat_id}").delete()
db.commit()
return True
except:
return False
def update_chat_share_id_by_id(
self, id: str, share_id: Optional[str]
) -> Optional[ChatModel]:
try:
with get_db() as db:
chat = db.get(Chat, id)
chat.share_id = share_id
db.commit()
db.refresh(chat)
return ChatModel.model_validate(chat)
except:
return None
def toggle_chat_archive_by_id(self, id: str) -> Optional[ChatModel]:
try:
with get_db() as db:
chat = db.get(Chat, id)
chat.archived = not chat.archived
db.commit()
db.refresh(chat)
return ChatModel.model_validate(chat)
except:
return None
def archive_all_chats_by_user_id(self, user_id: str) -> bool:
try:
with get_db() as db:
db.query(Chat).filter_by(user_id=user_id).update({"archived": True})
db.commit()
return True
except:
return False
def get_archived_chat_list_by_user_id(
self, user_id: str, skip: int = 0, limit: int = 50
) -> List[ChatModel]:
with get_db() as db:
all_chats = (
db.query(Chat)
.filter_by(user_id=user_id, archived=True)
.order_by(Chat.updated_at.desc())
# .limit(limit).offset(skip)
.all()
)
return [ChatModel.model_validate(chat) for chat in all_chats]
def get_chat_list_by_user_id(
self,
user_id: str,
include_archived: bool = False,
skip: int = 0,
limit: int = 50,
) -> List[ChatModel]:
with get_db() as db:
query = db.query(Chat).filter_by(user_id=user_id)
if not include_archived:
query = query.filter_by(archived=False)
all_chats = (
query.order_by(Chat.updated_at.desc())
# .limit(limit).offset(skip)
.all()
)
return [ChatModel.model_validate(chat) for chat in all_chats]
def get_chat_title_id_list_by_user_id(
self,
user_id: str,
include_archived: bool = False,
skip: int = 0,
limit: int = -1,
) -> List[ChatTitleIdResponse]:
with get_db() as db:
query = db.query(Chat).filter_by(user_id=user_id)
if not include_archived:
query = query.filter_by(archived=False)
all_chats = (
query.order_by(Chat.updated_at.desc())
# limit cols
.with_entities(Chat.id, Chat.title, Chat.updated_at, Chat.created_at)
.limit(limit)
.offset(skip)
.all()
)
# result has to be destrctured from sqlalchemy `row` and mapped to a dict since the `ChatModel`is not the returned dataclass.
return [
ChatTitleIdResponse.model_validate(
{
"id": chat[0],
"title": chat[1],
"updated_at": chat[2],
"created_at": chat[3],
}
)
for chat in all_chats
]
def get_chat_list_by_chat_ids(
self, chat_ids: List[str], skip: int = 0, limit: int = 50
) -> List[ChatModel]:
with get_db() as db:
all_chats = (
db.query(Chat)
.filter(Chat.id.in_(chat_ids))
.filter_by(archived=False)
.order_by(Chat.updated_at.desc())
.all()
)
return [ChatModel.model_validate(chat) for chat in all_chats]
def get_chat_by_id(self, id: str) -> Optional[ChatModel]:
try:
with get_db() as db:
chat = db.get(Chat, id)
return ChatModel.model_validate(chat)
except:
return None
def get_chat_by_share_id(self, id: str) -> Optional[ChatModel]:
try:
with get_db() as db:
chat = db.query(Chat).filter_by(share_id=id).first()
if chat:
return self.get_chat_by_id(id)
else:
return None
except Exception as e:
return None
def get_chat_by_id_and_user_id(self, id: str, user_id: str) -> Optional[ChatModel]:
try:
with get_db() as db:
chat = db.query(Chat).filter_by(id=id, user_id=user_id).first()
return ChatModel.model_validate(chat)
except:
return None
def get_chats(self, skip: int = 0, limit: int = 50) -> List[ChatModel]:
with get_db() as db:
all_chats = (
db.query(Chat)
# .limit(limit).offset(skip)
.order_by(Chat.updated_at.desc())
)
return [ChatModel.model_validate(chat) for chat in all_chats]
def get_chats_by_user_id(self, user_id: str) -> List[ChatModel]:
with get_db() as db:
all_chats = (
db.query(Chat)
.filter_by(user_id=user_id)
.order_by(Chat.updated_at.desc())
)
return [ChatModel.model_validate(chat) for chat in all_chats]
def get_archived_chats_by_user_id(self, user_id: str) -> List[ChatModel]:
with get_db() as db:
all_chats = (
db.query(Chat)
.filter_by(user_id=user_id, archived=True)
.order_by(Chat.updated_at.desc())
)
return [ChatModel.model_validate(chat) for chat in all_chats]
def delete_chat_by_id(self, id: str) -> bool:
try:
with get_db() as db:
db.query(Chat).filter_by(id=id).delete()
db.commit()
return True and self.delete_shared_chat_by_chat_id(id)
except:
return False
def delete_chat_by_id_and_user_id(self, id: str, user_id: str) -> bool:
try:
with get_db() as db:
db.query(Chat).filter_by(id=id, user_id=user_id).delete()
db.commit()
return True and self.delete_shared_chat_by_chat_id(id)
except:
return False
def delete_chats_by_user_id(self, user_id: str) -> bool:
try:
with get_db() as db:
self.delete_shared_chats_by_user_id(user_id)
db.query(Chat).filter_by(user_id=user_id).delete()
db.commit()
return True
except:
return False
def delete_shared_chats_by_user_id(self, user_id: str) -> bool:
try:
with get_db() as db:
chats_by_user = db.query(Chat).filter_by(user_id=user_id).all()
shared_chat_ids = [f"shared-{chat.id}" for chat in chats_by_user]
db.query(Chat).filter(Chat.user_id.in_(shared_chat_ids)).delete()
db.commit()
return True
except:
return False
Chats = ChatTable()

View File

@@ -1,167 +0,0 @@
from pydantic import BaseModel, ConfigDict
from typing import List, Optional
import time
import logging
from sqlalchemy import String, Column, BigInteger, Text
from apps.webui.internal.db import Base, get_db
import json
from config import SRC_LOG_LEVELS
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["MODELS"])
####################
# Documents DB Schema
####################
class Document(Base):
__tablename__ = "document"
collection_name = Column(String, primary_key=True)
name = Column(String, unique=True)
title = Column(Text)
filename = Column(Text)
content = Column(Text, nullable=True)
user_id = Column(String)
timestamp = Column(BigInteger)
class DocumentModel(BaseModel):
model_config = ConfigDict(from_attributes=True)
collection_name: str
name: str
title: str
filename: str
content: Optional[str] = None
user_id: str
timestamp: int # timestamp in epoch
####################
# Forms
####################
class DocumentResponse(BaseModel):
collection_name: str
name: str
title: str
filename: str
content: Optional[dict] = None
user_id: str
timestamp: int # timestamp in epoch
class DocumentUpdateForm(BaseModel):
name: str
title: str
class DocumentForm(DocumentUpdateForm):
collection_name: str
filename: str
content: Optional[str] = None
class DocumentsTable:
def insert_new_doc(
self, user_id: str, form_data: DocumentForm
) -> Optional[DocumentModel]:
with get_db() as db:
document = DocumentModel(
**{
**form_data.model_dump(),
"user_id": user_id,
"timestamp": int(time.time()),
}
)
try:
result = Document(**document.model_dump())
db.add(result)
db.commit()
db.refresh(result)
if result:
return DocumentModel.model_validate(result)
else:
return None
except:
return None
def get_doc_by_name(self, name: str) -> Optional[DocumentModel]:
try:
with get_db() as db:
document = db.query(Document).filter_by(name=name).first()
return DocumentModel.model_validate(document) if document else None
except:
return None
def get_docs(self) -> List[DocumentModel]:
with get_db() as db:
return [
DocumentModel.model_validate(doc) for doc in db.query(Document).all()
]
def update_doc_by_name(
self, name: str, form_data: DocumentUpdateForm
) -> Optional[DocumentModel]:
try:
with get_db() as db:
db.query(Document).filter_by(name=name).update(
{
"title": form_data.title,
"name": form_data.name,
"timestamp": int(time.time()),
}
)
db.commit()
return self.get_doc_by_name(form_data.name)
except Exception as e:
log.exception(e)
return None
def update_doc_content_by_name(
self, name: str, updated: dict
) -> Optional[DocumentModel]:
try:
doc = self.get_doc_by_name(name)
doc_content = json.loads(doc.content if doc.content else "{}")
doc_content = {**doc_content, **updated}
with get_db() as db:
db.query(Document).filter_by(name=name).update(
{
"content": json.dumps(doc_content),
"timestamp": int(time.time()),
}
)
db.commit()
return self.get_doc_by_name(name)
except Exception as e:
log.exception(e)
return None
def delete_doc_by_name(self, name: str) -> bool:
try:
with get_db() as db:
db.query(Document).filter_by(name=name).delete()
db.commit()
return True
except:
return False
Documents = DocumentsTable()

View File

@@ -1,126 +0,0 @@
from pydantic import BaseModel, ConfigDict
from typing import List, Union, Optional
import time
import logging
from sqlalchemy import Column, String, BigInteger, Text
from apps.webui.internal.db import JSONField, Base, get_db
import json
from config import SRC_LOG_LEVELS
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["MODELS"])
####################
# Files DB Schema
####################
class File(Base):
__tablename__ = "file"
id = Column(String, primary_key=True)
user_id = Column(String)
filename = Column(Text)
meta = Column(JSONField)
created_at = Column(BigInteger)
class FileModel(BaseModel):
id: str
user_id: str
filename: str
meta: dict
created_at: int # timestamp in epoch
model_config = ConfigDict(from_attributes=True)
####################
# Forms
####################
class FileModelResponse(BaseModel):
id: str
user_id: str
filename: str
meta: dict
created_at: int # timestamp in epoch
class FileForm(BaseModel):
id: str
filename: str
meta: dict = {}
class FilesTable:
def insert_new_file(self, user_id: str, form_data: FileForm) -> Optional[FileModel]:
with get_db() as db:
file = FileModel(
**{
**form_data.model_dump(),
"user_id": user_id,
"created_at": int(time.time()),
}
)
try:
result = File(**file.model_dump())
db.add(result)
db.commit()
db.refresh(result)
if result:
return FileModel.model_validate(result)
else:
return None
except Exception as e:
print(f"Error creating tool: {e}")
return None
def get_file_by_id(self, id: str) -> Optional[FileModel]:
with get_db() as db:
try:
file = db.get(File, id)
return FileModel.model_validate(file)
except:
return None
def get_files(self) -> List[FileModel]:
with get_db() as db:
return [FileModel.model_validate(file) for file in db.query(File).all()]
def delete_file_by_id(self, id: str) -> bool:
with get_db() as db:
try:
db.query(File).filter_by(id=id).delete()
db.commit()
return True
except:
return False
def delete_all_files(self) -> bool:
with get_db() as db:
try:
db.query(File).delete()
db.commit()
return True
except:
return False
Files = FilesTable()

View File

@@ -1,272 +0,0 @@
from pydantic import BaseModel, ConfigDict
from typing import List, Optional
import json
import uuid
import time
import logging
from sqlalchemy import String, Column, BigInteger, Text
from apps.webui.internal.db import Base, get_db
from config import SRC_LOG_LEVELS
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["MODELS"])
####################
# Tag DB Schema
####################
class Tag(Base):
__tablename__ = "tag"
id = Column(String, primary_key=True)
name = Column(String)
user_id = Column(String)
data = Column(Text, nullable=True)
class ChatIdTag(Base):
__tablename__ = "chatidtag"
id = Column(String, primary_key=True)
tag_name = Column(String)
chat_id = Column(String)
user_id = Column(String)
timestamp = Column(BigInteger)
class TagModel(BaseModel):
id: str
name: str
user_id: str
data: Optional[str] = None
model_config = ConfigDict(from_attributes=True)
class ChatIdTagModel(BaseModel):
id: str
tag_name: str
chat_id: str
user_id: str
timestamp: int
model_config = ConfigDict(from_attributes=True)
####################
# Forms
####################
class ChatIdTagForm(BaseModel):
tag_name: str
chat_id: str
class TagChatIdsResponse(BaseModel):
chat_ids: List[str]
class ChatTagsResponse(BaseModel):
tags: List[str]
class TagTable:
def insert_new_tag(self, name: str, user_id: str) -> Optional[TagModel]:
with get_db() as db:
id = str(uuid.uuid4())
tag = TagModel(**{"id": id, "user_id": user_id, "name": name})
try:
result = Tag(**tag.model_dump())
db.add(result)
db.commit()
db.refresh(result)
if result:
return TagModel.model_validate(result)
else:
return None
except Exception as e:
return None
def get_tag_by_name_and_user_id(
self, name: str, user_id: str
) -> Optional[TagModel]:
try:
with get_db() as db:
tag = db.query(Tag).filter_by(name=name, user_id=user_id).first()
return TagModel.model_validate(tag)
except Exception as e:
return None
def add_tag_to_chat(
self, user_id: str, form_data: ChatIdTagForm
) -> Optional[ChatIdTagModel]:
tag = self.get_tag_by_name_and_user_id(form_data.tag_name, user_id)
if tag == None:
tag = self.insert_new_tag(form_data.tag_name, user_id)
id = str(uuid.uuid4())
chatIdTag = ChatIdTagModel(
**{
"id": id,
"user_id": user_id,
"chat_id": form_data.chat_id,
"tag_name": tag.name,
"timestamp": int(time.time()),
}
)
try:
with get_db() as db:
result = ChatIdTag(**chatIdTag.model_dump())
db.add(result)
db.commit()
db.refresh(result)
if result:
return ChatIdTagModel.model_validate(result)
else:
return None
except:
return None
def get_tags_by_user_id(self, user_id: str) -> List[TagModel]:
with get_db() as db:
tag_names = [
chat_id_tag.tag_name
for chat_id_tag in (
db.query(ChatIdTag)
.filter_by(user_id=user_id)
.order_by(ChatIdTag.timestamp.desc())
.all()
)
]
return [
TagModel.model_validate(tag)
for tag in (
db.query(Tag)
.filter_by(user_id=user_id)
.filter(Tag.name.in_(tag_names))
.all()
)
]
def get_tags_by_chat_id_and_user_id(
self, chat_id: str, user_id: str
) -> List[TagModel]:
with get_db() as db:
tag_names = [
chat_id_tag.tag_name
for chat_id_tag in (
db.query(ChatIdTag)
.filter_by(user_id=user_id, chat_id=chat_id)
.order_by(ChatIdTag.timestamp.desc())
.all()
)
]
return [
TagModel.model_validate(tag)
for tag in (
db.query(Tag)
.filter_by(user_id=user_id)
.filter(Tag.name.in_(tag_names))
.all()
)
]
def get_chat_ids_by_tag_name_and_user_id(
self, tag_name: str, user_id: str
) -> List[ChatIdTagModel]:
with get_db() as db:
return [
ChatIdTagModel.model_validate(chat_id_tag)
for chat_id_tag in (
db.query(ChatIdTag)
.filter_by(user_id=user_id, tag_name=tag_name)
.order_by(ChatIdTag.timestamp.desc())
.all()
)
]
def count_chat_ids_by_tag_name_and_user_id(
self, tag_name: str, user_id: str
) -> int:
with get_db() as db:
return (
db.query(ChatIdTag)
.filter_by(tag_name=tag_name, user_id=user_id)
.count()
)
def delete_tag_by_tag_name_and_user_id(self, tag_name: str, user_id: str) -> bool:
try:
with get_db() as db:
res = (
db.query(ChatIdTag)
.filter_by(tag_name=tag_name, user_id=user_id)
.delete()
)
log.debug(f"res: {res}")
db.commit()
tag_count = self.count_chat_ids_by_tag_name_and_user_id(
tag_name, user_id
)
if tag_count == 0:
# Remove tag item from Tag col as well
db.query(Tag).filter_by(name=tag_name, user_id=user_id).delete()
db.commit()
return True
except Exception as e:
log.error(f"delete_tag: {e}")
return False
def delete_tag_by_tag_name_and_chat_id_and_user_id(
self, tag_name: str, chat_id: str, user_id: str
) -> bool:
try:
with get_db() as db:
res = (
db.query(ChatIdTag)
.filter_by(tag_name=tag_name, chat_id=chat_id, user_id=user_id)
.delete()
)
log.debug(f"res: {res}")
db.commit()
tag_count = self.count_chat_ids_by_tag_name_and_user_id(
tag_name, user_id
)
if tag_count == 0:
# Remove tag item from Tag col as well
db.query(Tag).filter_by(name=tag_name, user_id=user_id).delete()
db.commit()
return True
except Exception as e:
log.error(f"delete_tag: {e}")
return False
def delete_tags_by_chat_id_and_user_id(self, chat_id: str, user_id: str) -> bool:
tags = self.get_tags_by_chat_id_and_user_id(chat_id, user_id)
for tag in tags:
self.delete_tag_by_tag_name_and_chat_id_and_user_id(
tag.tag_name, chat_id, user_id
)
return True
Tags = TagTable()

View File

@@ -1,429 +0,0 @@
import logging
from fastapi import Request, UploadFile, File
from fastapi import Depends, HTTPException, status
from fastapi.responses import Response
from fastapi import APIRouter
from pydantic import BaseModel
import re
import uuid
import csv
from apps.webui.models.auths import (
SigninForm,
SignupForm,
AddUserForm,
UpdateProfileForm,
UpdatePasswordForm,
UserResponse,
SigninResponse,
Auths,
ApiKey,
)
from apps.webui.models.users import Users
from utils.utils import (
get_password_hash,
get_current_user,
get_admin_user,
create_token,
create_api_key,
)
from utils.misc import parse_duration, validate_email_format
from utils.webhook import post_webhook
from constants import ERROR_MESSAGES, WEBHOOK_MESSAGES
from config import (
WEBUI_AUTH,
WEBUI_AUTH_TRUSTED_EMAIL_HEADER,
WEBUI_AUTH_TRUSTED_NAME_HEADER,
)
router = APIRouter()
############################
# GetSessionUser
############################
@router.get("/", response_model=UserResponse)
async def get_session_user(
request: Request, response: Response, user=Depends(get_current_user)
):
token = create_token(
data={"id": user.id},
expires_delta=parse_duration(request.app.state.config.JWT_EXPIRES_IN),
)
# Set the cookie token
response.set_cookie(
key="token",
value=token,
httponly=True, # Ensures the cookie is not accessible via JavaScript
)
return {
"id": user.id,
"email": user.email,
"name": user.name,
"role": user.role,
"profile_image_url": user.profile_image_url,
}
############################
# Update Profile
############################
@router.post("/update/profile", response_model=UserResponse)
async def update_profile(
form_data: UpdateProfileForm, session_user=Depends(get_current_user)
):
if session_user:
user = Users.update_user_by_id(
session_user.id,
{"profile_image_url": form_data.profile_image_url, "name": form_data.name},
)
if user:
return user
else:
raise HTTPException(400, detail=ERROR_MESSAGES.DEFAULT())
else:
raise HTTPException(400, detail=ERROR_MESSAGES.INVALID_CRED)
############################
# Update Password
############################
@router.post("/update/password", response_model=bool)
async def update_password(
form_data: UpdatePasswordForm, session_user=Depends(get_current_user)
):
if WEBUI_AUTH_TRUSTED_EMAIL_HEADER:
raise HTTPException(400, detail=ERROR_MESSAGES.ACTION_PROHIBITED)
if session_user:
user = Auths.authenticate_user(session_user.email, form_data.password)
if user:
hashed = get_password_hash(form_data.new_password)
return Auths.update_user_password_by_id(user.id, hashed)
else:
raise HTTPException(400, detail=ERROR_MESSAGES.INVALID_PASSWORD)
else:
raise HTTPException(400, detail=ERROR_MESSAGES.INVALID_CRED)
############################
# SignIn
############################
@router.post("/signin", response_model=SigninResponse)
async def signin(request: Request, response: Response, form_data: SigninForm):
if WEBUI_AUTH_TRUSTED_EMAIL_HEADER:
if WEBUI_AUTH_TRUSTED_EMAIL_HEADER not in request.headers:
raise HTTPException(400, detail=ERROR_MESSAGES.INVALID_TRUSTED_HEADER)
trusted_email = request.headers[WEBUI_AUTH_TRUSTED_EMAIL_HEADER].lower()
trusted_name = trusted_email
if WEBUI_AUTH_TRUSTED_NAME_HEADER:
trusted_name = request.headers.get(
WEBUI_AUTH_TRUSTED_NAME_HEADER, trusted_email
)
if not Users.get_user_by_email(trusted_email.lower()):
await signup(
request,
response,
SignupForm(
email=trusted_email, password=str(uuid.uuid4()), name=trusted_name
),
)
user = Auths.authenticate_user_by_trusted_header(trusted_email)
elif WEBUI_AUTH == False:
admin_email = "admin@localhost"
admin_password = "admin"
if Users.get_user_by_email(admin_email.lower()):
user = Auths.authenticate_user(admin_email.lower(), admin_password)
else:
if Users.get_num_users() != 0:
raise HTTPException(400, detail=ERROR_MESSAGES.EXISTING_USERS)
await signup(
request,
response,
SignupForm(email=admin_email, password=admin_password, name="User"),
)
user = Auths.authenticate_user(admin_email.lower(), admin_password)
else:
user = Auths.authenticate_user(form_data.email.lower(), form_data.password)
if user:
token = create_token(
data={"id": user.id},
expires_delta=parse_duration(request.app.state.config.JWT_EXPIRES_IN),
)
# Set the cookie token
response.set_cookie(
key="token",
value=token,
httponly=True, # Ensures the cookie is not accessible via JavaScript
)
return {
"token": token,
"token_type": "Bearer",
"id": user.id,
"email": user.email,
"name": user.name,
"role": user.role,
"profile_image_url": user.profile_image_url,
}
else:
raise HTTPException(400, detail=ERROR_MESSAGES.INVALID_CRED)
############################
# SignUp
############################
@router.post("/signup", response_model=SigninResponse)
async def signup(request: Request, response: Response, form_data: SignupForm):
if not request.app.state.config.ENABLE_SIGNUP and WEBUI_AUTH:
raise HTTPException(
status.HTTP_403_FORBIDDEN, detail=ERROR_MESSAGES.ACCESS_PROHIBITED
)
if not validate_email_format(form_data.email.lower()):
raise HTTPException(
status.HTTP_400_BAD_REQUEST, detail=ERROR_MESSAGES.INVALID_EMAIL_FORMAT
)
if Users.get_user_by_email(form_data.email.lower()):
raise HTTPException(400, detail=ERROR_MESSAGES.EMAIL_TAKEN)
try:
role = (
"admin"
if Users.get_num_users() == 0
else request.app.state.config.DEFAULT_USER_ROLE
)
hashed = get_password_hash(form_data.password)
user = Auths.insert_new_auth(
form_data.email.lower(),
hashed,
form_data.name,
form_data.profile_image_url,
role,
)
if user:
token = create_token(
data={"id": user.id},
expires_delta=parse_duration(request.app.state.config.JWT_EXPIRES_IN),
)
# response.set_cookie(key='token', value=token, httponly=True)
# Set the cookie token
response.set_cookie(
key="token",
value=token,
httponly=True, # Ensures the cookie is not accessible via JavaScript
)
if request.app.state.config.WEBHOOK_URL:
post_webhook(
request.app.state.config.WEBHOOK_URL,
WEBHOOK_MESSAGES.USER_SIGNUP(user.name),
{
"action": "signup",
"message": WEBHOOK_MESSAGES.USER_SIGNUP(user.name),
"user": user.model_dump_json(exclude_none=True),
},
)
return {
"token": token,
"token_type": "Bearer",
"id": user.id,
"email": user.email,
"name": user.name,
"role": user.role,
"profile_image_url": user.profile_image_url,
}
else:
raise HTTPException(500, detail=ERROR_MESSAGES.CREATE_USER_ERROR)
except Exception as err:
raise HTTPException(500, detail=ERROR_MESSAGES.DEFAULT(err))
############################
# AddUser
############################
@router.post("/add", response_model=SigninResponse)
async def add_user(form_data: AddUserForm, user=Depends(get_admin_user)):
if not validate_email_format(form_data.email.lower()):
raise HTTPException(
status.HTTP_400_BAD_REQUEST, detail=ERROR_MESSAGES.INVALID_EMAIL_FORMAT
)
if Users.get_user_by_email(form_data.email.lower()):
raise HTTPException(400, detail=ERROR_MESSAGES.EMAIL_TAKEN)
try:
print(form_data)
hashed = get_password_hash(form_data.password)
user = Auths.insert_new_auth(
form_data.email.lower(),
hashed,
form_data.name,
form_data.profile_image_url,
form_data.role,
)
if user:
token = create_token(data={"id": user.id})
return {
"token": token,
"token_type": "Bearer",
"id": user.id,
"email": user.email,
"name": user.name,
"role": user.role,
"profile_image_url": user.profile_image_url,
}
else:
raise HTTPException(500, detail=ERROR_MESSAGES.CREATE_USER_ERROR)
except Exception as err:
raise HTTPException(500, detail=ERROR_MESSAGES.DEFAULT(err))
############################
# GetAdminDetails
############################
@router.get("/admin/details")
async def get_admin_details(request: Request, user=Depends(get_current_user)):
if request.app.state.config.SHOW_ADMIN_DETAILS:
admin_email = request.app.state.config.ADMIN_EMAIL
admin_name = None
print(admin_email, admin_name)
if admin_email:
admin = Users.get_user_by_email(admin_email)
if admin:
admin_name = admin.name
else:
admin = Users.get_first_user()
if admin:
admin_email = admin.email
admin_name = admin.name
return {
"name": admin_name,
"email": admin_email,
}
else:
raise HTTPException(400, detail=ERROR_MESSAGES.ACTION_PROHIBITED)
############################
# ToggleSignUp
############################
@router.get("/admin/config")
async def get_admin_config(request: Request, user=Depends(get_admin_user)):
return {
"SHOW_ADMIN_DETAILS": request.app.state.config.SHOW_ADMIN_DETAILS,
"ENABLE_SIGNUP": request.app.state.config.ENABLE_SIGNUP,
"DEFAULT_USER_ROLE": request.app.state.config.DEFAULT_USER_ROLE,
"JWT_EXPIRES_IN": request.app.state.config.JWT_EXPIRES_IN,
"ENABLE_COMMUNITY_SHARING": request.app.state.config.ENABLE_COMMUNITY_SHARING,
}
class AdminConfig(BaseModel):
SHOW_ADMIN_DETAILS: bool
ENABLE_SIGNUP: bool
DEFAULT_USER_ROLE: str
JWT_EXPIRES_IN: str
ENABLE_COMMUNITY_SHARING: bool
@router.post("/admin/config")
async def update_admin_config(
request: Request, form_data: AdminConfig, user=Depends(get_admin_user)
):
request.app.state.config.SHOW_ADMIN_DETAILS = form_data.SHOW_ADMIN_DETAILS
request.app.state.config.ENABLE_SIGNUP = form_data.ENABLE_SIGNUP
if form_data.DEFAULT_USER_ROLE in ["pending", "user", "admin"]:
request.app.state.config.DEFAULT_USER_ROLE = form_data.DEFAULT_USER_ROLE
pattern = r"^(-1|0|(-?\d+(\.\d+)?)(ms|s|m|h|d|w))$"
# Check if the input string matches the pattern
if re.match(pattern, form_data.JWT_EXPIRES_IN):
request.app.state.config.JWT_EXPIRES_IN = form_data.JWT_EXPIRES_IN
request.app.state.config.ENABLE_COMMUNITY_SHARING = (
form_data.ENABLE_COMMUNITY_SHARING
)
return {
"SHOW_ADMIN_DETAILS": request.app.state.config.SHOW_ADMIN_DETAILS,
"ENABLE_SIGNUP": request.app.state.config.ENABLE_SIGNUP,
"DEFAULT_USER_ROLE": request.app.state.config.DEFAULT_USER_ROLE,
"JWT_EXPIRES_IN": request.app.state.config.JWT_EXPIRES_IN,
"ENABLE_COMMUNITY_SHARING": request.app.state.config.ENABLE_COMMUNITY_SHARING,
}
############################
# API Key
############################
# create api key
@router.post("/api_key", response_model=ApiKey)
async def create_api_key_(user=Depends(get_current_user)):
api_key = create_api_key()
success = Users.update_user_api_key_by_id(user.id, api_key)
if success:
return {
"api_key": api_key,
}
else:
raise HTTPException(500, detail=ERROR_MESSAGES.CREATE_API_KEY_ERROR)
# delete api key
@router.delete("/api_key", response_model=bool)
async def delete_api_key(user=Depends(get_current_user)):
success = Users.update_user_api_key_by_id(user.id, None)
return success
# get api key
@router.get("/api_key", response_model=ApiKey)
async def get_api_key(user=Depends(get_current_user)):
api_key = Users.get_user_api_key_by_id(user.id)
if api_key:
return {
"api_key": api_key,
}
else:
raise HTTPException(404, detail=ERROR_MESSAGES.API_KEY_NOT_FOUND)

View File

@@ -1,494 +0,0 @@
from fastapi import Depends, Request, HTTPException, status
from datetime import datetime, timedelta
from typing import List, Union, Optional
from utils.utils import get_verified_user, get_admin_user
from fastapi import APIRouter
from pydantic import BaseModel
import json
import logging
from apps.webui.models.users import Users
from apps.webui.models.chats import (
ChatModel,
ChatResponse,
ChatTitleForm,
ChatForm,
ChatTitleIdResponse,
Chats,
)
from apps.webui.models.tags import (
TagModel,
ChatIdTagModel,
ChatIdTagForm,
ChatTagsResponse,
Tags,
)
from constants import ERROR_MESSAGES
from config import SRC_LOG_LEVELS, ENABLE_ADMIN_EXPORT, ENABLE_ADMIN_CHAT_ACCESS
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["MODELS"])
router = APIRouter()
############################
# GetChatList
############################
@router.get("/", response_model=List[ChatTitleIdResponse])
@router.get("/list", response_model=List[ChatTitleIdResponse])
async def get_session_user_chat_list(
user=Depends(get_verified_user), page: Optional[int] = None
):
if page is not None:
limit = 60
skip = (page - 1) * limit
return Chats.get_chat_title_id_list_by_user_id(user.id, skip=skip, limit=limit)
else:
return Chats.get_chat_title_id_list_by_user_id(user.id)
############################
# DeleteAllChats
############################
@router.delete("/", response_model=bool)
async def delete_all_user_chats(request: Request, user=Depends(get_verified_user)):
if (
user.role == "user"
and not request.app.state.config.USER_PERMISSIONS["chat"]["deletion"]
):
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.ACCESS_PROHIBITED,
)
result = Chats.delete_chats_by_user_id(user.id)
return result
############################
# GetUserChatList
############################
@router.get("/list/user/{user_id}", response_model=List[ChatTitleIdResponse])
async def get_user_chat_list_by_user_id(
user_id: str,
user=Depends(get_admin_user),
skip: int = 0,
limit: int = 50,
):
if not ENABLE_ADMIN_CHAT_ACCESS:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.ACCESS_PROHIBITED,
)
return Chats.get_chat_list_by_user_id(
user_id, include_archived=True, skip=skip, limit=limit
)
############################
# CreateNewChat
############################
@router.post("/new", response_model=Optional[ChatResponse])
async def create_new_chat(form_data: ChatForm, user=Depends(get_verified_user)):
try:
chat = Chats.insert_new_chat(user.id, form_data)
return ChatResponse(**{**chat.model_dump(), "chat": json.loads(chat.chat)})
except Exception as e:
log.exception(e)
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST, detail=ERROR_MESSAGES.DEFAULT()
)
############################
# GetChats
############################
@router.get("/all", response_model=List[ChatResponse])
async def get_user_chats(user=Depends(get_verified_user)):
return [
ChatResponse(**{**chat.model_dump(), "chat": json.loads(chat.chat)})
for chat in Chats.get_chats_by_user_id(user.id)
]
############################
# GetArchivedChats
############################
@router.get("/all/archived", response_model=List[ChatResponse])
async def get_user_archived_chats(user=Depends(get_verified_user)):
return [
ChatResponse(**{**chat.model_dump(), "chat": json.loads(chat.chat)})
for chat in Chats.get_archived_chats_by_user_id(user.id)
]
############################
# GetAllChatsInDB
############################
@router.get("/all/db", response_model=List[ChatResponse])
async def get_all_user_chats_in_db(user=Depends(get_admin_user)):
if not ENABLE_ADMIN_EXPORT:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.ACCESS_PROHIBITED,
)
return [
ChatResponse(**{**chat.model_dump(), "chat": json.loads(chat.chat)})
for chat in Chats.get_chats()
]
############################
# GetArchivedChats
############################
@router.get("/archived", response_model=List[ChatTitleIdResponse])
async def get_archived_session_user_chat_list(
user=Depends(get_verified_user), skip: int = 0, limit: int = 50
):
return Chats.get_archived_chat_list_by_user_id(user.id, skip, limit)
############################
# ArchiveAllChats
############################
@router.post("/archive/all", response_model=bool)
async def archive_all_chats(user=Depends(get_verified_user)):
return Chats.archive_all_chats_by_user_id(user.id)
############################
# GetSharedChatById
############################
@router.get("/share/{share_id}", response_model=Optional[ChatResponse])
async def get_shared_chat_by_id(share_id: str, user=Depends(get_verified_user)):
if user.role == "pending":
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED, detail=ERROR_MESSAGES.NOT_FOUND
)
if user.role == "user" or (user.role == "admin" and not ENABLE_ADMIN_CHAT_ACCESS):
chat = Chats.get_chat_by_share_id(share_id)
elif user.role == "admin" and ENABLE_ADMIN_CHAT_ACCESS:
chat = Chats.get_chat_by_id(share_id)
if chat:
return ChatResponse(**{**chat.model_dump(), "chat": json.loads(chat.chat)})
else:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED, detail=ERROR_MESSAGES.NOT_FOUND
)
############################
# GetChatsByTags
############################
class TagNameForm(BaseModel):
name: str
skip: Optional[int] = 0
limit: Optional[int] = 50
@router.post("/tags", response_model=List[ChatTitleIdResponse])
async def get_user_chat_list_by_tag_name(
form_data: TagNameForm, user=Depends(get_verified_user)
):
chat_ids = [
chat_id_tag.chat_id
for chat_id_tag in Tags.get_chat_ids_by_tag_name_and_user_id(
form_data.name, user.id
)
]
chats = Chats.get_chat_list_by_chat_ids(chat_ids, form_data.skip, form_data.limit)
if len(chats) == 0:
Tags.delete_tag_by_tag_name_and_user_id(form_data.name, user.id)
return chats
############################
# GetAllTags
############################
@router.get("/tags/all", response_model=List[TagModel])
async def get_all_tags(user=Depends(get_verified_user)):
try:
tags = Tags.get_tags_by_user_id(user.id)
return tags
except Exception as e:
log.exception(e)
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST, detail=ERROR_MESSAGES.DEFAULT()
)
############################
# GetChatById
############################
@router.get("/{id}", response_model=Optional[ChatResponse])
async def get_chat_by_id(id: str, user=Depends(get_verified_user)):
chat = Chats.get_chat_by_id_and_user_id(id, user.id)
if chat:
return ChatResponse(**{**chat.model_dump(), "chat": json.loads(chat.chat)})
else:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED, detail=ERROR_MESSAGES.NOT_FOUND
)
############################
# UpdateChatById
############################
@router.post("/{id}", response_model=Optional[ChatResponse])
async def update_chat_by_id(
id: str, form_data: ChatForm, user=Depends(get_verified_user)
):
chat = Chats.get_chat_by_id_and_user_id(id, user.id)
if chat:
updated_chat = {**json.loads(chat.chat), **form_data.chat}
chat = Chats.update_chat_by_id(id, updated_chat)
return ChatResponse(**{**chat.model_dump(), "chat": json.loads(chat.chat)})
else:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.ACCESS_PROHIBITED,
)
############################
# DeleteChatById
############################
@router.delete("/{id}", response_model=bool)
async def delete_chat_by_id(request: Request, id: str, user=Depends(get_verified_user)):
if user.role == "admin":
result = Chats.delete_chat_by_id(id)
return result
else:
if not request.app.state.config.USER_PERMISSIONS["chat"]["deletion"]:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.ACCESS_PROHIBITED,
)
result = Chats.delete_chat_by_id_and_user_id(id, user.id)
return result
############################
# CloneChat
############################
@router.get("/{id}/clone", response_model=Optional[ChatResponse])
async def clone_chat_by_id(id: str, user=Depends(get_verified_user)):
chat = Chats.get_chat_by_id_and_user_id(id, user.id)
if chat:
chat_body = json.loads(chat.chat)
updated_chat = {
**chat_body,
"originalChatId": chat.id,
"branchPointMessageId": chat_body["history"]["currentId"],
"title": f"Clone of {chat.title}",
}
chat = Chats.insert_new_chat(user.id, ChatForm(**{"chat": updated_chat}))
return ChatResponse(**{**chat.model_dump(), "chat": json.loads(chat.chat)})
else:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED, detail=ERROR_MESSAGES.DEFAULT()
)
############################
# ArchiveChat
############################
@router.get("/{id}/archive", response_model=Optional[ChatResponse])
async def archive_chat_by_id(id: str, user=Depends(get_verified_user)):
chat = Chats.get_chat_by_id_and_user_id(id, user.id)
if chat:
chat = Chats.toggle_chat_archive_by_id(id)
return ChatResponse(**{**chat.model_dump(), "chat": json.loads(chat.chat)})
else:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED, detail=ERROR_MESSAGES.DEFAULT()
)
############################
# ShareChatById
############################
@router.post("/{id}/share", response_model=Optional[ChatResponse])
async def share_chat_by_id(id: str, user=Depends(get_verified_user)):
chat = Chats.get_chat_by_id_and_user_id(id, user.id)
if chat:
if chat.share_id:
shared_chat = Chats.update_shared_chat_by_chat_id(chat.id)
return ChatResponse(
**{**shared_chat.model_dump(), "chat": json.loads(shared_chat.chat)}
)
shared_chat = Chats.insert_shared_chat_by_chat_id(chat.id)
if not shared_chat:
raise HTTPException(
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
detail=ERROR_MESSAGES.DEFAULT(),
)
return ChatResponse(
**{**shared_chat.model_dump(), "chat": json.loads(shared_chat.chat)}
)
else:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.ACCESS_PROHIBITED,
)
############################
# DeletedSharedChatById
############################
@router.delete("/{id}/share", response_model=Optional[bool])
async def delete_shared_chat_by_id(id: str, user=Depends(get_verified_user)):
chat = Chats.get_chat_by_id_and_user_id(id, user.id)
if chat:
if not chat.share_id:
return False
result = Chats.delete_shared_chat_by_chat_id(id)
update_result = Chats.update_chat_share_id_by_id(id, None)
return result and update_result != None
else:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.ACCESS_PROHIBITED,
)
############################
# GetChatTagsById
############################
@router.get("/{id}/tags", response_model=List[TagModel])
async def get_chat_tags_by_id(id: str, user=Depends(get_verified_user)):
tags = Tags.get_tags_by_chat_id_and_user_id(id, user.id)
if tags != None:
return tags
else:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED, detail=ERROR_MESSAGES.NOT_FOUND
)
############################
# AddChatTagById
############################
@router.post("/{id}/tags", response_model=Optional[ChatIdTagModel])
async def add_chat_tag_by_id(
id: str, form_data: ChatIdTagForm, user=Depends(get_verified_user)
):
tags = Tags.get_tags_by_chat_id_and_user_id(id, user.id)
if form_data.tag_name not in tags:
tag = Tags.add_tag_to_chat(user.id, form_data)
if tag:
return tag
else:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.NOT_FOUND,
)
else:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED, detail=ERROR_MESSAGES.DEFAULT()
)
############################
# DeleteChatTagById
############################
@router.delete("/{id}/tags", response_model=Optional[bool])
async def delete_chat_tag_by_id(
id: str, form_data: ChatIdTagForm, user=Depends(get_verified_user)
):
result = Tags.delete_tag_by_tag_name_and_chat_id_and_user_id(
form_data.tag_name, id, user.id
)
if result:
return result
else:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED, detail=ERROR_MESSAGES.NOT_FOUND
)
############################
# DeleteAllChatTagsById
############################
@router.delete("/{id}/tags/all", response_model=Optional[bool])
async def delete_all_chat_tags_by_id(id: str, user=Depends(get_verified_user)):
result = Tags.delete_tags_by_chat_id_and_user_id(id, user.id)
if result:
return result
else:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED, detail=ERROR_MESSAGES.NOT_FOUND
)

View File

@@ -1,89 +0,0 @@
from fastapi import Response, Request
from fastapi import Depends, FastAPI, HTTPException, status
from datetime import datetime, timedelta
from typing import List, Union
from fastapi import APIRouter
from pydantic import BaseModel
import time
import uuid
from config import BannerModel
from apps.webui.models.users import Users
from utils.utils import (
get_password_hash,
get_verified_user,
get_admin_user,
create_token,
)
from utils.misc import get_gravatar_url, validate_email_format
from constants import ERROR_MESSAGES
router = APIRouter()
class SetDefaultModelsForm(BaseModel):
models: str
class PromptSuggestion(BaseModel):
title: List[str]
content: str
class SetDefaultSuggestionsForm(BaseModel):
suggestions: List[PromptSuggestion]
############################
# SetDefaultModels
############################
@router.post("/default/models", response_model=str)
async def set_global_default_models(
request: Request, form_data: SetDefaultModelsForm, user=Depends(get_admin_user)
):
request.app.state.config.DEFAULT_MODELS = form_data.models
return request.app.state.config.DEFAULT_MODELS
@router.post("/default/suggestions", response_model=List[PromptSuggestion])
async def set_global_default_suggestions(
request: Request,
form_data: SetDefaultSuggestionsForm,
user=Depends(get_admin_user),
):
data = form_data.model_dump()
request.app.state.config.DEFAULT_PROMPT_SUGGESTIONS = data["suggestions"]
return request.app.state.config.DEFAULT_PROMPT_SUGGESTIONS
############################
# SetBanners
############################
class SetBannersForm(BaseModel):
banners: List[BannerModel]
@router.post("/banners", response_model=List[BannerModel])
async def set_banners(
request: Request,
form_data: SetBannersForm,
user=Depends(get_admin_user),
):
data = form_data.model_dump()
request.app.state.config.BANNERS = data["banners"]
return request.app.state.config.BANNERS
@router.get("/banners", response_model=List[BannerModel])
async def get_banners(
request: Request,
user=Depends(get_verified_user),
):
return request.app.state.config.BANNERS

View File

@@ -1,160 +0,0 @@
from fastapi import Depends, FastAPI, HTTPException, status
from datetime import datetime, timedelta
from typing import List, Union, Optional
from fastapi import APIRouter
from pydantic import BaseModel
import json
from apps.webui.models.documents import (
Documents,
DocumentForm,
DocumentUpdateForm,
DocumentModel,
DocumentResponse,
)
from utils.utils import get_verified_user, get_admin_user
from constants import ERROR_MESSAGES
router = APIRouter()
############################
# GetDocuments
############################
@router.get("/", response_model=List[DocumentResponse])
async def get_documents(user=Depends(get_verified_user)):
docs = [
DocumentResponse(
**{
**doc.model_dump(),
"content": json.loads(doc.content if doc.content else "{}"),
}
)
for doc in Documents.get_docs()
]
return docs
############################
# CreateNewDoc
############################
@router.post("/create", response_model=Optional[DocumentResponse])
async def create_new_doc(form_data: DocumentForm, user=Depends(get_admin_user)):
doc = Documents.get_doc_by_name(form_data.name)
if doc == None:
doc = Documents.insert_new_doc(user.id, form_data)
if doc:
return DocumentResponse(
**{
**doc.model_dump(),
"content": json.loads(doc.content if doc.content else "{}"),
}
)
else:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=ERROR_MESSAGES.FILE_EXISTS,
)
else:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=ERROR_MESSAGES.NAME_TAG_TAKEN,
)
############################
# GetDocByName
############################
@router.get("/doc", response_model=Optional[DocumentResponse])
async def get_doc_by_name(name: str, user=Depends(get_verified_user)):
doc = Documents.get_doc_by_name(name)
if doc:
return DocumentResponse(
**{
**doc.model_dump(),
"content": json.loads(doc.content if doc.content else "{}"),
}
)
else:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.NOT_FOUND,
)
############################
# TagDocByName
############################
class TagItem(BaseModel):
name: str
class TagDocumentForm(BaseModel):
name: str
tags: List[dict]
@router.post("/doc/tags", response_model=Optional[DocumentResponse])
async def tag_doc_by_name(form_data: TagDocumentForm, user=Depends(get_verified_user)):
doc = Documents.update_doc_content_by_name(form_data.name, {"tags": form_data.tags})
if doc:
return DocumentResponse(
**{
**doc.model_dump(),
"content": json.loads(doc.content if doc.content else "{}"),
}
)
else:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.NOT_FOUND,
)
############################
# UpdateDocByName
############################
@router.post("/doc/update", response_model=Optional[DocumentResponse])
async def update_doc_by_name(
name: str,
form_data: DocumentUpdateForm,
user=Depends(get_admin_user),
):
doc = Documents.update_doc_by_name(name, form_data)
if doc:
return DocumentResponse(
**{
**doc.model_dump(),
"content": json.loads(doc.content if doc.content else "{}"),
}
)
else:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=ERROR_MESSAGES.NAME_TAG_TAKEN,
)
############################
# DeleteDocByName
############################
@router.delete("/doc/delete", response_model=bool)
async def delete_doc_by_name(name: str, user=Depends(get_admin_user)):
result = Documents.delete_doc_by_name(name)
return result

View File

@@ -1,241 +0,0 @@
from fastapi import (
Depends,
FastAPI,
HTTPException,
status,
Request,
UploadFile,
File,
Form,
)
from datetime import datetime, timedelta
from typing import List, Union, Optional
from pathlib import Path
from fastapi import APIRouter
from fastapi.responses import StreamingResponse, JSONResponse, FileResponse
from pydantic import BaseModel
import json
from apps.webui.models.files import (
Files,
FileForm,
FileModel,
FileModelResponse,
)
from utils.utils import get_verified_user, get_admin_user
from constants import ERROR_MESSAGES
from importlib import util
import os
import uuid
import os, shutil, logging, re
from config import SRC_LOG_LEVELS, UPLOAD_DIR
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["MODELS"])
router = APIRouter()
############################
# Upload File
############################
@router.post("/")
def upload_file(file: UploadFile = File(...), user=Depends(get_verified_user)):
log.info(f"file.content_type: {file.content_type}")
try:
unsanitized_filename = file.filename
filename = os.path.basename(unsanitized_filename)
# replace filename with uuid
id = str(uuid.uuid4())
name = filename
filename = f"{id}_{filename}"
file_path = f"{UPLOAD_DIR}/{filename}"
contents = file.file.read()
with open(file_path, "wb") as f:
f.write(contents)
f.close()
file = Files.insert_new_file(
user.id,
FileForm(
**{
"id": id,
"filename": filename,
"meta": {
"name": name,
"content_type": file.content_type,
"size": len(contents),
"path": file_path,
},
}
),
)
if file:
return file
else:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=ERROR_MESSAGES.DEFAULT("Error uploading file"),
)
except Exception as e:
log.exception(e)
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=ERROR_MESSAGES.DEFAULT(e),
)
############################
# List Files
############################
@router.get("/", response_model=List[FileModel])
async def list_files(user=Depends(get_verified_user)):
files = Files.get_files()
return files
############################
# Delete All Files
############################
@router.delete("/all")
async def delete_all_files(user=Depends(get_admin_user)):
result = Files.delete_all_files()
if result:
folder = f"{UPLOAD_DIR}"
try:
# Check if the directory exists
if os.path.exists(folder):
# Iterate over all the files and directories in the specified directory
for filename in os.listdir(folder):
file_path = os.path.join(folder, filename)
try:
if os.path.isfile(file_path) or os.path.islink(file_path):
os.unlink(file_path) # Remove the file or link
elif os.path.isdir(file_path):
shutil.rmtree(file_path) # Remove the directory
except Exception as e:
print(f"Failed to delete {file_path}. Reason: {e}")
else:
print(f"The directory {folder} does not exist")
except Exception as e:
print(f"Failed to process the directory {folder}. Reason: {e}")
return {"message": "All files deleted successfully"}
else:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=ERROR_MESSAGES.DEFAULT("Error deleting files"),
)
############################
# Get File By Id
############################
@router.get("/{id}", response_model=Optional[FileModel])
async def get_file_by_id(id: str, user=Depends(get_verified_user)):
file = Files.get_file_by_id(id)
if file:
return file
else:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail=ERROR_MESSAGES.NOT_FOUND,
)
############################
# Get File Content By Id
############################
@router.get("/{id}/content", response_model=Optional[FileModel])
async def get_file_content_by_id(id: str, user=Depends(get_verified_user)):
file = Files.get_file_by_id(id)
if file:
file_path = Path(file.meta["path"])
# Check if the file already exists in the cache
if file_path.is_file():
print(f"file_path: {file_path}")
return FileResponse(file_path)
else:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail=ERROR_MESSAGES.NOT_FOUND,
)
else:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail=ERROR_MESSAGES.NOT_FOUND,
)
@router.get("/{id}/content/{file_name}", response_model=Optional[FileModel])
async def get_file_content_by_id(id: str, user=Depends(get_verified_user)):
file = Files.get_file_by_id(id)
if file:
file_path = Path(file.meta["path"])
# Check if the file already exists in the cache
if file_path.is_file():
print(f"file_path: {file_path}")
return FileResponse(file_path)
else:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail=ERROR_MESSAGES.NOT_FOUND,
)
else:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail=ERROR_MESSAGES.NOT_FOUND,
)
############################
# Delete File By Id
############################
@router.delete("/{id}")
async def delete_file_by_id(id: str, user=Depends(get_verified_user)):
file = Files.get_file_by_id(id)
if file:
result = Files.delete_file_by_id(id)
if result:
return {"message": "File deleted successfully"}
else:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=ERROR_MESSAGES.DEFAULT("Error deleting file"),
)
else:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail=ERROR_MESSAGES.NOT_FOUND,
)

View File

@@ -1,113 +0,0 @@
from fastapi import Depends, FastAPI, HTTPException, status, Request
from datetime import datetime, timedelta
from typing import List, Union, Optional
from fastapi import APIRouter
from pydantic import BaseModel
import json
from apps.webui.models.models import Models, ModelModel, ModelForm, ModelResponse
from utils.utils import get_verified_user, get_admin_user
from constants import ERROR_MESSAGES
router = APIRouter()
###########################
# getModels
###########################
@router.get("/", response_model=List[ModelResponse])
async def get_models(user=Depends(get_verified_user)):
return Models.get_all_models()
############################
# AddNewModel
############################
@router.post("/add", response_model=Optional[ModelModel])
async def add_new_model(
request: Request,
form_data: ModelForm,
user=Depends(get_admin_user),
):
if form_data.id in request.app.state.MODELS:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.MODEL_ID_TAKEN,
)
else:
model = Models.insert_new_model(form_data, user.id)
if model:
return model
else:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.DEFAULT(),
)
############################
# GetModelById
############################
@router.get("/", response_model=Optional[ModelModel])
async def get_model_by_id(id: str, user=Depends(get_verified_user)):
model = Models.get_model_by_id(id)
if model:
return model
else:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.NOT_FOUND,
)
############################
# UpdateModelById
############################
@router.post("/update", response_model=Optional[ModelModel])
async def update_model_by_id(
request: Request,
id: str,
form_data: ModelForm,
user=Depends(get_admin_user),
):
model = Models.get_model_by_id(id)
if model:
model = Models.update_model_by_id(id, form_data)
return model
else:
if form_data.id in request.app.state.MODELS:
model = Models.insert_new_model(form_data, user.id)
if model:
return model
else:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.DEFAULT(),
)
else:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.DEFAULT(),
)
############################
# DeleteModelById
############################
@router.delete("/delete", response_model=bool)
async def delete_model_by_id(id: str, user=Depends(get_admin_user)):
result = Models.delete_model_by_id(id)
return result

View File

@@ -1,96 +0,0 @@
from fastapi import Depends, FastAPI, HTTPException, status
from datetime import datetime, timedelta
from typing import List, Union, Optional
from fastapi import APIRouter
from pydantic import BaseModel
import json
from apps.webui.models.prompts import Prompts, PromptForm, PromptModel
from utils.utils import get_verified_user, get_admin_user
from constants import ERROR_MESSAGES
router = APIRouter()
############################
# GetPrompts
############################
@router.get("/", response_model=List[PromptModel])
async def get_prompts(user=Depends(get_verified_user)):
return Prompts.get_prompts()
############################
# CreateNewPrompt
############################
@router.post("/create", response_model=Optional[PromptModel])
async def create_new_prompt(form_data: PromptForm, user=Depends(get_admin_user)):
prompt = Prompts.get_prompt_by_command(form_data.command)
if prompt == None:
prompt = Prompts.insert_new_prompt(user.id, form_data)
if prompt:
return prompt
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=ERROR_MESSAGES.DEFAULT(),
)
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=ERROR_MESSAGES.COMMAND_TAKEN,
)
############################
# GetPromptByCommand
############################
@router.get("/command/{command}", response_model=Optional[PromptModel])
async def get_prompt_by_command(command: str, user=Depends(get_verified_user)):
prompt = Prompts.get_prompt_by_command(f"/{command}")
if prompt:
return prompt
else:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.NOT_FOUND,
)
############################
# UpdatePromptByCommand
############################
@router.post("/command/{command}/update", response_model=Optional[PromptModel])
async def update_prompt_by_command(
command: str,
form_data: PromptForm,
user=Depends(get_admin_user),
):
prompt = Prompts.update_prompt_by_command(f"/{command}", form_data)
if prompt:
return prompt
else:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.ACCESS_PROHIBITED,
)
############################
# DeletePromptByCommand
############################
@router.delete("/command/{command}/delete", response_model=bool)
async def delete_prompt_by_command(command: str, user=Depends(get_admin_user)):
result = Prompts.delete_prompt_by_command(f"/{command}")
return result

View File

@@ -1,148 +0,0 @@
from pathlib import Path
import site
from fastapi import APIRouter, UploadFile, File, Response
from fastapi import Depends, HTTPException, status
from starlette.responses import StreamingResponse, FileResponse
from pydantic import BaseModel
from fpdf import FPDF
import markdown
import black
from utils.utils import get_admin_user
from utils.misc import calculate_sha256, get_gravatar_url
from config import OLLAMA_BASE_URLS, DATA_DIR, UPLOAD_DIR, ENABLE_ADMIN_EXPORT
from constants import ERROR_MESSAGES
from typing import List
router = APIRouter()
@router.get("/gravatar")
async def get_gravatar(
email: str,
):
return get_gravatar_url(email)
class CodeFormatRequest(BaseModel):
code: str
@router.post("/code/format")
async def format_code(request: CodeFormatRequest):
try:
formatted_code = black.format_str(request.code, mode=black.Mode())
return {"code": formatted_code}
except black.NothingChanged:
return {"code": request.code}
except Exception as e:
raise HTTPException(status_code=400, detail=str(e))
class MarkdownForm(BaseModel):
md: str
@router.post("/markdown")
async def get_html_from_markdown(
form_data: MarkdownForm,
):
return {"html": markdown.markdown(form_data.md)}
class ChatForm(BaseModel):
title: str
messages: List[dict]
@router.post("/pdf")
async def download_chat_as_pdf(
form_data: ChatForm,
):
pdf = FPDF()
pdf.add_page()
# When running in docker, workdir is /app/backend, so fonts is in /app/backend/static/fonts
FONTS_DIR = Path("./static/fonts")
# Non Docker Installation
# When running using `pip install` the static directory is in the site packages.
if not FONTS_DIR.exists():
FONTS_DIR = Path(site.getsitepackages()[0]) / "static/fonts"
# When running using `pip install -e .` the static directory is in the site packages.
# This path only works if `open-webui serve` is run from the root of this project.
if not FONTS_DIR.exists():
FONTS_DIR = Path("./backend/static/fonts")
pdf.add_font("NotoSans", "", f"{FONTS_DIR}/NotoSans-Regular.ttf")
pdf.add_font("NotoSans", "b", f"{FONTS_DIR}/NotoSans-Bold.ttf")
pdf.add_font("NotoSans", "i", f"{FONTS_DIR}/NotoSans-Italic.ttf")
pdf.add_font("NotoSansKR", "", f"{FONTS_DIR}/NotoSansKR-Regular.ttf")
pdf.add_font("NotoSansJP", "", f"{FONTS_DIR}/NotoSansJP-Regular.ttf")
pdf.set_font("NotoSans", size=12)
pdf.set_fallback_fonts(["NotoSansKR", "NotoSansJP"])
pdf.set_auto_page_break(auto=True, margin=15)
# Adjust the effective page width for multi_cell
effective_page_width = (
pdf.w - 2 * pdf.l_margin - 10
) # Subtracted an additional 10 for extra padding
# Add chat messages
for message in form_data.messages:
role = message["role"]
content = message["content"]
pdf.set_font("NotoSans", "B", size=14) # Bold for the role
pdf.multi_cell(effective_page_width, 10, f"{role.upper()}", 0, "L")
pdf.ln(1) # Extra space between messages
pdf.set_font("NotoSans", size=10) # Regular for content
pdf.multi_cell(effective_page_width, 6, content, 0, "L")
pdf.ln(1.5) # Extra space between messages
# Save the pdf with name .pdf
pdf_bytes = pdf.output()
return Response(
content=bytes(pdf_bytes),
media_type="application/pdf",
headers={"Content-Disposition": f"attachment;filename=chat.pdf"},
)
@router.get("/db/download")
async def download_db(user=Depends(get_admin_user)):
if not ENABLE_ADMIN_EXPORT:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.ACCESS_PROHIBITED,
)
from apps.webui.internal.db import engine
if engine.name != "sqlite":
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=ERROR_MESSAGES.DB_NOT_SQLITE,
)
return FileResponse(
engine.url.database,
media_type="application/octet-stream",
filename="webui.db",
)
@router.get("/litellm/config")
async def download_litellm_config_yaml(user=Depends(get_admin_user)):
return FileResponse(
f"{DATA_DIR}/litellm/config.yaml",
media_type="application/octet-stream",
filename="config.yaml",
)

View File

@@ -1,90 +0,0 @@
from importlib import util
import os
import re
from config import TOOLS_DIR, FUNCTIONS_DIR
def extract_frontmatter(file_path):
"""
Extract frontmatter as a dictionary from the specified file path.
"""
frontmatter = {}
frontmatter_started = False
frontmatter_ended = False
frontmatter_pattern = re.compile(r"^\s*([a-z_]+):\s*(.*)\s*$", re.IGNORECASE)
try:
with open(file_path, "r", encoding="utf-8") as file:
first_line = file.readline()
if first_line.strip() != '"""':
# The file doesn't start with triple quotes
return {}
frontmatter_started = True
for line in file:
if '"""' in line:
if frontmatter_started:
frontmatter_ended = True
break
if frontmatter_started and not frontmatter_ended:
match = frontmatter_pattern.match(line)
if match:
key, value = match.groups()
frontmatter[key.strip()] = value.strip()
except FileNotFoundError:
print(f"Error: The file {file_path} does not exist.")
return {}
except Exception as e:
print(f"An error occurred: {e}")
return {}
return frontmatter
def load_toolkit_module_by_id(toolkit_id):
toolkit_path = os.path.join(TOOLS_DIR, f"{toolkit_id}.py")
spec = util.spec_from_file_location(toolkit_id, toolkit_path)
module = util.module_from_spec(spec)
frontmatter = extract_frontmatter(toolkit_path)
try:
spec.loader.exec_module(module)
print(f"Loaded module: {module.__name__}")
if hasattr(module, "Tools"):
return module.Tools(), frontmatter
else:
raise Exception("No Tools class found")
except Exception as e:
print(f"Error loading module: {toolkit_id}")
# Move the file to the error folder
os.rename(toolkit_path, f"{toolkit_path}.error")
raise e
def load_function_module_by_id(function_id):
function_path = os.path.join(FUNCTIONS_DIR, f"{function_id}.py")
spec = util.spec_from_file_location(function_id, function_path)
module = util.module_from_spec(spec)
frontmatter = extract_frontmatter(function_path)
try:
spec.loader.exec_module(module)
print(f"Loaded module: {module.__name__}")
if hasattr(module, "Pipe"):
return module.Pipe(), "pipe", frontmatter
elif hasattr(module, "Filter"):
return module.Filter(), "filter", frontmatter
elif hasattr(module, "Action"):
return module.Action(), "action", frontmatter
else:
raise Exception("No Function class found")
except Exception as e:
print(f"Error loading module: {function_id}")
# Move the file to the error folder
os.rename(function_path, f"{function_path}.error")
raise e

View File

@@ -1,36 +0,0 @@
{
"version": 0,
"ui": {
"default_locale": "",
"prompt_suggestions": [
{
"title": ["Help me study", "vocabulary for a college entrance exam"],
"content": "Help me study vocabulary: write a sentence for me to fill in the blank, and I'll try to pick the correct option."
},
{
"title": ["Give me ideas", "for what to do with my kids' art"],
"content": "What are 5 creative things I could do with my kids' art? I don't want to throw them away, but it's also so much clutter."
},
{
"title": ["Tell me a fun fact", "about the Roman Empire"],
"content": "Tell me a random fun fact about the Roman Empire"
},
{
"title": ["Show me a code snippet", "of a website's sticky header"],
"content": "Show me a code snippet of a website's sticky header in CSS and JavaScript."
},
{
"title": ["Explain options trading", "if I'm familiar with buying and selling stocks"],
"content": "Explain options trading in simple terms if I'm familiar with buying and selling stocks."
},
{
"title": ["Overcome procrastination", "give me tips"],
"content": "Could you start by asking me about instances when I procrastinate the most and then give me some suggestions to overcome it?"
},
{
"title": ["Grammar check", "rewrite it for better readability "],
"content": "Check the following sentence for grammar and clarity: \"[sentence]\". Rewrite it for better readability while maintaining its original meaning."
}
]
}
}

View File

@@ -1,4 +0,0 @@
general_settings: {}
litellm_settings: {}
model_list: []
router_settings: {}

View File

@@ -1 +1 @@
dir for backend files (db, documents, etc.)
docker dir for backend files (db, documents, etc.)

View File

@@ -1,2 +1,2 @@
PORT="${PORT:-8080}"
uvicorn main:app --port $PORT --host 0.0.0.0 --forwarded-allow-ips '*' --reload
uvicorn open_webui.main:app --port $PORT --host 0.0.0.0 --forwarded-allow-ips '*' --reload

File diff suppressed because it is too large Load Diff

View File

@@ -9,8 +9,6 @@ import uvicorn
app = typer.Typer()
KEY_FILE = Path.cwd() / ".webui_secret_key"
if (frontend_build_dir := Path(__file__).parent / "frontend").exists():
os.environ["FRONTEND_BUILD_DIR"] = str(frontend_build_dir)
@app.command()
@@ -18,6 +16,7 @@ def serve(
host: str = "0.0.0.0",
port: int = 8080,
):
os.environ["FROM_INIT_PY"] = "true"
if os.getenv("WEBUI_SECRET_KEY") is None:
typer.echo(
"Loading WEBUI_SECRET_KEY from file, not provided as an environment variable."
@@ -40,9 +39,23 @@ def serve(
"/usr/local/lib/python3.11/site-packages/nvidia/cudnn/lib",
]
)
import main # we need set environment variables before importing main
try:
import torch
uvicorn.run(main.app, host=host, port=port, forwarded_allow_ips="*")
assert torch.cuda.is_available(), "CUDA not available"
typer.echo("CUDA seems to be working")
except Exception as e:
typer.echo(
"Error when testing CUDA but USE_CUDA_DOCKER is true. "
"Resetting USE_CUDA_DOCKER to false and removing "
f"LD_LIBRARY_PATH modifications: {e}"
)
os.environ["USE_CUDA_DOCKER"] = "false"
os.environ["LD_LIBRARY_PATH"] = ":".join(LD_LIBRARY_PATH)
import open_webui.main # we need set environment variables before importing main
uvicorn.run(open_webui.main.app, host=host, port=port, forwarded_allow_ips="*")
@app.command()
@@ -52,7 +65,11 @@ def dev(
reload: bool = True,
):
uvicorn.run(
"main:app", host=host, port=port, reload=reload, forwarded_allow_ips="*"
"open_webui.main:app",
host=host,
port=port,
reload=reload,
forwarded_allow_ips="*",
)

View File

@@ -0,0 +1,703 @@
import hashlib
import json
import logging
import os
import uuid
from functools import lru_cache
from pathlib import Path
from pydub import AudioSegment
from pydub.silence import split_on_silence
import aiohttp
import aiofiles
import requests
from open_webui.config import (
AUDIO_STT_ENGINE,
AUDIO_STT_MODEL,
AUDIO_STT_OPENAI_API_BASE_URL,
AUDIO_STT_OPENAI_API_KEY,
AUDIO_TTS_API_KEY,
AUDIO_TTS_ENGINE,
AUDIO_TTS_MODEL,
AUDIO_TTS_OPENAI_API_BASE_URL,
AUDIO_TTS_OPENAI_API_KEY,
AUDIO_TTS_SPLIT_ON,
AUDIO_TTS_VOICE,
AUDIO_TTS_AZURE_SPEECH_REGION,
AUDIO_TTS_AZURE_SPEECH_OUTPUT_FORMAT,
CACHE_DIR,
CORS_ALLOW_ORIGIN,
WHISPER_MODEL,
WHISPER_MODEL_AUTO_UPDATE,
WHISPER_MODEL_DIR,
AppConfig,
)
from open_webui.constants import ERROR_MESSAGES
from open_webui.env import (
ENV,
SRC_LOG_LEVELS,
DEVICE_TYPE,
ENABLE_FORWARD_USER_INFO_HEADERS,
)
from fastapi import Depends, FastAPI, File, HTTPException, Request, UploadFile, status
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import FileResponse
from pydantic import BaseModel
from open_webui.utils.utils import get_admin_user, get_verified_user
# Constants
MAX_FILE_SIZE_MB = 25
MAX_FILE_SIZE = MAX_FILE_SIZE_MB * 1024 * 1024 # Convert MB to bytes
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["AUDIO"])
app = FastAPI(
docs_url="/docs" if ENV == "dev" else None,
openapi_url="/openapi.json" if ENV == "dev" else None,
redoc_url=None,
)
app.add_middleware(
CORSMiddleware,
allow_origins=CORS_ALLOW_ORIGIN,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.state.config = AppConfig()
app.state.config.STT_OPENAI_API_BASE_URL = AUDIO_STT_OPENAI_API_BASE_URL
app.state.config.STT_OPENAI_API_KEY = AUDIO_STT_OPENAI_API_KEY
app.state.config.STT_ENGINE = AUDIO_STT_ENGINE
app.state.config.STT_MODEL = AUDIO_STT_MODEL
app.state.config.WHISPER_MODEL = WHISPER_MODEL
app.state.faster_whisper_model = None
app.state.config.TTS_OPENAI_API_BASE_URL = AUDIO_TTS_OPENAI_API_BASE_URL
app.state.config.TTS_OPENAI_API_KEY = AUDIO_TTS_OPENAI_API_KEY
app.state.config.TTS_ENGINE = AUDIO_TTS_ENGINE
app.state.config.TTS_MODEL = AUDIO_TTS_MODEL
app.state.config.TTS_VOICE = AUDIO_TTS_VOICE
app.state.config.TTS_API_KEY = AUDIO_TTS_API_KEY
app.state.config.TTS_SPLIT_ON = AUDIO_TTS_SPLIT_ON
app.state.speech_synthesiser = None
app.state.speech_speaker_embeddings_dataset = None
app.state.config.TTS_AZURE_SPEECH_REGION = AUDIO_TTS_AZURE_SPEECH_REGION
app.state.config.TTS_AZURE_SPEECH_OUTPUT_FORMAT = AUDIO_TTS_AZURE_SPEECH_OUTPUT_FORMAT
# setting device type for whisper model
whisper_device_type = DEVICE_TYPE if DEVICE_TYPE and DEVICE_TYPE == "cuda" else "cpu"
log.info(f"whisper_device_type: {whisper_device_type}")
SPEECH_CACHE_DIR = Path(CACHE_DIR).joinpath("./audio/speech/")
SPEECH_CACHE_DIR.mkdir(parents=True, exist_ok=True)
def set_faster_whisper_model(model: str, auto_update: bool = False):
if model and app.state.config.STT_ENGINE == "":
from faster_whisper import WhisperModel
faster_whisper_kwargs = {
"model_size_or_path": model,
"device": whisper_device_type,
"compute_type": "int8",
"download_root": WHISPER_MODEL_DIR,
"local_files_only": not auto_update,
}
try:
app.state.faster_whisper_model = WhisperModel(**faster_whisper_kwargs)
except Exception:
log.warning(
"WhisperModel initialization failed, attempting download with local_files_only=False"
)
faster_whisper_kwargs["local_files_only"] = False
app.state.faster_whisper_model = WhisperModel(**faster_whisper_kwargs)
else:
app.state.faster_whisper_model = None
class TTSConfigForm(BaseModel):
OPENAI_API_BASE_URL: str
OPENAI_API_KEY: str
API_KEY: str
ENGINE: str
MODEL: str
VOICE: str
SPLIT_ON: str
AZURE_SPEECH_REGION: str
AZURE_SPEECH_OUTPUT_FORMAT: str
class STTConfigForm(BaseModel):
OPENAI_API_BASE_URL: str
OPENAI_API_KEY: str
ENGINE: str
MODEL: str
WHISPER_MODEL: str
class AudioConfigUpdateForm(BaseModel):
tts: TTSConfigForm
stt: STTConfigForm
from pydub import AudioSegment
from pydub.utils import mediainfo
def is_mp4_audio(file_path):
"""Check if the given file is an MP4 audio file."""
if not os.path.isfile(file_path):
print(f"File not found: {file_path}")
return False
info = mediainfo(file_path)
if (
info.get("codec_name") == "aac"
and info.get("codec_type") == "audio"
and info.get("codec_tag_string") == "mp4a"
):
return True
return False
def convert_mp4_to_wav(file_path, output_path):
"""Convert MP4 audio file to WAV format."""
audio = AudioSegment.from_file(file_path, format="mp4")
audio.export(output_path, format="wav")
print(f"Converted {file_path} to {output_path}")
@app.get("/config")
async def get_audio_config(user=Depends(get_admin_user)):
return {
"tts": {
"OPENAI_API_BASE_URL": app.state.config.TTS_OPENAI_API_BASE_URL,
"OPENAI_API_KEY": app.state.config.TTS_OPENAI_API_KEY,
"API_KEY": app.state.config.TTS_API_KEY,
"ENGINE": app.state.config.TTS_ENGINE,
"MODEL": app.state.config.TTS_MODEL,
"VOICE": app.state.config.TTS_VOICE,
"SPLIT_ON": app.state.config.TTS_SPLIT_ON,
"AZURE_SPEECH_REGION": app.state.config.TTS_AZURE_SPEECH_REGION,
"AZURE_SPEECH_OUTPUT_FORMAT": app.state.config.TTS_AZURE_SPEECH_OUTPUT_FORMAT,
},
"stt": {
"OPENAI_API_BASE_URL": app.state.config.STT_OPENAI_API_BASE_URL,
"OPENAI_API_KEY": app.state.config.STT_OPENAI_API_KEY,
"ENGINE": app.state.config.STT_ENGINE,
"MODEL": app.state.config.STT_MODEL,
"WHISPER_MODEL": app.state.config.WHISPER_MODEL,
},
}
@app.post("/config/update")
async def update_audio_config(
form_data: AudioConfigUpdateForm, user=Depends(get_admin_user)
):
app.state.config.TTS_OPENAI_API_BASE_URL = form_data.tts.OPENAI_API_BASE_URL
app.state.config.TTS_OPENAI_API_KEY = form_data.tts.OPENAI_API_KEY
app.state.config.TTS_API_KEY = form_data.tts.API_KEY
app.state.config.TTS_ENGINE = form_data.tts.ENGINE
app.state.config.TTS_MODEL = form_data.tts.MODEL
app.state.config.TTS_VOICE = form_data.tts.VOICE
app.state.config.TTS_SPLIT_ON = form_data.tts.SPLIT_ON
app.state.config.TTS_AZURE_SPEECH_REGION = form_data.tts.AZURE_SPEECH_REGION
app.state.config.TTS_AZURE_SPEECH_OUTPUT_FORMAT = (
form_data.tts.AZURE_SPEECH_OUTPUT_FORMAT
)
app.state.config.STT_OPENAI_API_BASE_URL = form_data.stt.OPENAI_API_BASE_URL
app.state.config.STT_OPENAI_API_KEY = form_data.stt.OPENAI_API_KEY
app.state.config.STT_ENGINE = form_data.stt.ENGINE
app.state.config.STT_MODEL = form_data.stt.MODEL
app.state.config.WHISPER_MODEL = form_data.stt.WHISPER_MODEL
set_faster_whisper_model(form_data.stt.WHISPER_MODEL, WHISPER_MODEL_AUTO_UPDATE)
return {
"tts": {
"OPENAI_API_BASE_URL": app.state.config.TTS_OPENAI_API_BASE_URL,
"OPENAI_API_KEY": app.state.config.TTS_OPENAI_API_KEY,
"API_KEY": app.state.config.TTS_API_KEY,
"ENGINE": app.state.config.TTS_ENGINE,
"MODEL": app.state.config.TTS_MODEL,
"VOICE": app.state.config.TTS_VOICE,
"SPLIT_ON": app.state.config.TTS_SPLIT_ON,
"AZURE_SPEECH_REGION": app.state.config.TTS_AZURE_SPEECH_REGION,
"AZURE_SPEECH_OUTPUT_FORMAT": app.state.config.TTS_AZURE_SPEECH_OUTPUT_FORMAT,
},
"stt": {
"OPENAI_API_BASE_URL": app.state.config.STT_OPENAI_API_BASE_URL,
"OPENAI_API_KEY": app.state.config.STT_OPENAI_API_KEY,
"ENGINE": app.state.config.STT_ENGINE,
"MODEL": app.state.config.STT_MODEL,
"WHISPER_MODEL": app.state.config.WHISPER_MODEL,
},
}
def load_speech_pipeline():
from transformers import pipeline
from datasets import load_dataset
if app.state.speech_synthesiser is None:
app.state.speech_synthesiser = pipeline(
"text-to-speech", "microsoft/speecht5_tts"
)
if app.state.speech_speaker_embeddings_dataset is None:
app.state.speech_speaker_embeddings_dataset = load_dataset(
"Matthijs/cmu-arctic-xvectors", split="validation"
)
@app.post("/speech")
async def speech(request: Request, user=Depends(get_verified_user)):
body = await request.body()
name = hashlib.sha256(body).hexdigest()
file_path = SPEECH_CACHE_DIR.joinpath(f"{name}.mp3")
file_body_path = SPEECH_CACHE_DIR.joinpath(f"{name}.json")
# Check if the file already exists in the cache
if file_path.is_file():
return FileResponse(file_path)
if app.state.config.TTS_ENGINE == "openai":
headers = {}
headers["Authorization"] = f"Bearer {app.state.config.TTS_OPENAI_API_KEY}"
headers["Content-Type"] = "application/json"
if ENABLE_FORWARD_USER_INFO_HEADERS:
headers["X-OpenWebUI-User-Name"] = user.name
headers["X-OpenWebUI-User-Id"] = user.id
headers["X-OpenWebUI-User-Email"] = user.email
headers["X-OpenWebUI-User-Role"] = user.role
try:
body = body.decode("utf-8")
body = json.loads(body)
body["model"] = app.state.config.TTS_MODEL
body = json.dumps(body).encode("utf-8")
except Exception:
pass
try:
async with aiohttp.ClientSession() as session:
async with session.post(
url=f"{app.state.config.TTS_OPENAI_API_BASE_URL}/audio/speech",
data=body,
headers=headers,
) as r:
r.raise_for_status()
async with aiofiles.open(file_path, "wb") as f:
await f.write(await r.read())
async with aiofiles.open(file_body_path, "w") as f:
await f.write(json.dumps(json.loads(body.decode("utf-8"))))
return FileResponse(file_path)
except Exception as e:
log.exception(e)
error_detail = "Open WebUI: Server Connection Error"
try:
if r.status != 200:
res = await r.json()
if "error" in res:
error_detail = f"External: {res['error']['message']}"
except Exception:
error_detail = f"External: {e}"
raise HTTPException(
status_code=getattr(r, "status", 500),
detail=error_detail,
)
elif app.state.config.TTS_ENGINE == "elevenlabs":
try:
payload = json.loads(body.decode("utf-8"))
except Exception as e:
log.exception(e)
raise HTTPException(status_code=400, detail="Invalid JSON payload")
voice_id = payload.get("voice", "")
if voice_id not in get_available_voices():
raise HTTPException(
status_code=400,
detail="Invalid voice id",
)
url = f"https://api.elevenlabs.io/v1/text-to-speech/{voice_id}"
headers = {
"Accept": "audio/mpeg",
"Content-Type": "application/json",
"xi-api-key": app.state.config.TTS_API_KEY,
}
data = {
"text": payload["input"],
"model_id": app.state.config.TTS_MODEL,
"voice_settings": {"stability": 0.5, "similarity_boost": 0.5},
}
try:
async with aiohttp.ClientSession() as session:
async with session.post(url, json=data, headers=headers) as r:
r.raise_for_status()
async with aiofiles.open(file_path, "wb") as f:
await f.write(await r.read())
async with aiofiles.open(file_body_path, "w") as f:
await f.write(json.dumps(json.loads(body.decode("utf-8"))))
return FileResponse(file_path)
except Exception as e:
log.exception(e)
error_detail = "Open WebUI: Server Connection Error"
try:
if r.status != 200:
res = await r.json()
if "error" in res:
error_detail = f"External: {res['error']['message']}"
except Exception:
error_detail = f"External: {e}"
raise HTTPException(
status_code=getattr(r, "status", 500),
detail=error_detail,
)
elif app.state.config.TTS_ENGINE == "azure":
try:
payload = json.loads(body.decode("utf-8"))
except Exception as e:
log.exception(e)
raise HTTPException(status_code=400, detail="Invalid JSON payload")
region = app.state.config.TTS_AZURE_SPEECH_REGION
language = app.state.config.TTS_VOICE
locale = "-".join(app.state.config.TTS_VOICE.split("-")[:1])
output_format = app.state.config.TTS_AZURE_SPEECH_OUTPUT_FORMAT
url = f"https://{region}.tts.speech.microsoft.com/cognitiveservices/v1"
headers = {
"Ocp-Apim-Subscription-Key": app.state.config.TTS_API_KEY,
"Content-Type": "application/ssml+xml",
"X-Microsoft-OutputFormat": output_format,
}
data = f"""<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="{locale}">
<voice name="{language}">{payload["input"]}</voice>
</speak>"""
try:
async with aiohttp.ClientSession() as session:
async with session.post(url, headers=headers, data=data) as response:
if response.status == 200:
async with aiofiles.open(file_path, "wb") as f:
await f.write(await response.read())
return FileResponse(file_path)
else:
error_msg = f"Error synthesizing speech - {response.reason}"
log.error(error_msg)
raise HTTPException(status_code=500, detail=error_msg)
except Exception as e:
log.exception(e)
raise HTTPException(status_code=500, detail=str(e))
elif app.state.config.TTS_ENGINE == "transformers":
payload = None
try:
payload = json.loads(body.decode("utf-8"))
except Exception as e:
log.exception(e)
raise HTTPException(status_code=400, detail="Invalid JSON payload")
import torch
import soundfile as sf
load_speech_pipeline()
embeddings_dataset = app.state.speech_speaker_embeddings_dataset
speaker_index = 6799
try:
speaker_index = embeddings_dataset["filename"].index(
app.state.config.TTS_MODEL
)
except Exception:
pass
speaker_embedding = torch.tensor(
embeddings_dataset[speaker_index]["xvector"]
).unsqueeze(0)
speech = app.state.speech_synthesiser(
payload["input"],
forward_params={"speaker_embeddings": speaker_embedding},
)
sf.write(file_path, speech["audio"], samplerate=speech["sampling_rate"])
with open(file_body_path, "w") as f:
json.dump(json.loads(body.decode("utf-8")), f)
return FileResponse(file_path)
def transcribe(file_path):
print("transcribe", file_path)
filename = os.path.basename(file_path)
file_dir = os.path.dirname(file_path)
id = filename.split(".")[0]
if app.state.config.STT_ENGINE == "":
if app.state.faster_whisper_model is None:
set_faster_whisper_model(app.state.config.WHISPER_MODEL)
model = app.state.faster_whisper_model
segments, info = model.transcribe(file_path, beam_size=5)
log.info(
"Detected language '%s' with probability %f"
% (info.language, info.language_probability)
)
transcript = "".join([segment.text for segment in list(segments)])
data = {"text": transcript.strip()}
# save the transcript to a json file
transcript_file = f"{file_dir}/{id}.json"
with open(transcript_file, "w") as f:
json.dump(data, f)
log.debug(data)
return data
elif app.state.config.STT_ENGINE == "openai":
if is_mp4_audio(file_path):
print("is_mp4_audio")
os.rename(file_path, file_path.replace(".wav", ".mp4"))
# Convert MP4 audio file to WAV format
convert_mp4_to_wav(file_path.replace(".wav", ".mp4"), file_path)
headers = {"Authorization": f"Bearer {app.state.config.STT_OPENAI_API_KEY}"}
files = {"file": (filename, open(file_path, "rb"))}
data = {"model": app.state.config.STT_MODEL}
log.debug(files, data)
r = None
try:
r = requests.post(
url=f"{app.state.config.STT_OPENAI_API_BASE_URL}/audio/transcriptions",
headers=headers,
files=files,
data=data,
)
r.raise_for_status()
data = r.json()
# save the transcript to a json file
transcript_file = f"{file_dir}/{id}.json"
with open(transcript_file, "w") as f:
json.dump(data, f)
print(data)
return data
except Exception as e:
log.exception(e)
error_detail = "Open WebUI: Server Connection Error"
if r is not None:
try:
res = r.json()
if "error" in res:
error_detail = f"External: {res['error']['message']}"
except Exception:
error_detail = f"External: {e}"
raise Exception(error_detail)
@app.post("/transcriptions")
def transcription(
file: UploadFile = File(...),
user=Depends(get_verified_user),
):
log.info(f"file.content_type: {file.content_type}")
if file.content_type not in ["audio/mpeg", "audio/wav", "audio/ogg", "audio/x-m4a"]:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=ERROR_MESSAGES.FILE_NOT_SUPPORTED,
)
try:
ext = file.filename.split(".")[-1]
id = uuid.uuid4()
filename = f"{id}.{ext}"
contents = file.file.read()
file_dir = f"{CACHE_DIR}/audio/transcriptions"
os.makedirs(file_dir, exist_ok=True)
file_path = f"{file_dir}/{filename}"
with open(file_path, "wb") as f:
f.write(contents)
try:
if os.path.getsize(file_path) > MAX_FILE_SIZE: # file is bigger than 25MB
log.debug(f"File size is larger than {MAX_FILE_SIZE_MB}MB")
audio = AudioSegment.from_file(file_path)
audio = audio.set_frame_rate(16000).set_channels(1) # Compress audio
compressed_path = f"{file_dir}/{id}_compressed.opus"
audio.export(compressed_path, format="opus", bitrate="32k")
log.debug(f"Compressed audio to {compressed_path}")
file_path = compressed_path
if (
os.path.getsize(file_path) > MAX_FILE_SIZE
): # Still larger than 25MB after compression
log.debug(
f"Compressed file size is still larger than {MAX_FILE_SIZE_MB}MB: {os.path.getsize(file_path)}"
)
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=ERROR_MESSAGES.FILE_TOO_LARGE(
size=f"{MAX_FILE_SIZE_MB}MB"
),
)
data = transcribe(file_path)
else:
data = transcribe(file_path)
file_path = file_path.split("/")[-1]
return {**data, "filename": file_path}
except Exception as e:
log.exception(e)
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=ERROR_MESSAGES.DEFAULT(e),
)
except Exception as e:
log.exception(e)
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=ERROR_MESSAGES.DEFAULT(e),
)
def get_available_models() -> list[dict]:
if app.state.config.TTS_ENGINE == "openai":
return [{"id": "tts-1"}, {"id": "tts-1-hd"}]
elif app.state.config.TTS_ENGINE == "elevenlabs":
headers = {
"xi-api-key": app.state.config.TTS_API_KEY,
"Content-Type": "application/json",
}
try:
response = requests.get(
"https://api.elevenlabs.io/v1/models", headers=headers, timeout=5
)
response.raise_for_status()
models = response.json()
return [
{"name": model["name"], "id": model["model_id"]} for model in models
]
except requests.RequestException as e:
log.error(f"Error fetching voices: {str(e)}")
return []
@app.get("/models")
async def get_models(user=Depends(get_verified_user)):
return {"models": get_available_models()}
def get_available_voices() -> dict:
"""Returns {voice_id: voice_name} dict"""
ret = {}
if app.state.config.TTS_ENGINE == "openai":
ret = {
"alloy": "alloy",
"echo": "echo",
"fable": "fable",
"onyx": "onyx",
"nova": "nova",
"shimmer": "shimmer",
}
elif app.state.config.TTS_ENGINE == "elevenlabs":
try:
ret = get_elevenlabs_voices()
except Exception:
# Avoided @lru_cache with exception
pass
elif app.state.config.TTS_ENGINE == "azure":
try:
region = app.state.config.TTS_AZURE_SPEECH_REGION
url = f"https://{region}.tts.speech.microsoft.com/cognitiveservices/voices/list"
headers = {"Ocp-Apim-Subscription-Key": app.state.config.TTS_API_KEY}
response = requests.get(url, headers=headers)
response.raise_for_status()
voices = response.json()
for voice in voices:
ret[voice["ShortName"]] = (
f"{voice['DisplayName']} ({voice['ShortName']})"
)
except requests.RequestException as e:
log.error(f"Error fetching voices: {str(e)}")
return ret
@lru_cache
def get_elevenlabs_voices() -> dict:
"""
Note, set the following in your .env file to use Elevenlabs:
AUDIO_TTS_ENGINE=elevenlabs
AUDIO_TTS_API_KEY=sk_... # Your Elevenlabs API key
AUDIO_TTS_VOICE=EXAVITQu4vr4xnSDxMaL # From https://api.elevenlabs.io/v1/voices
AUDIO_TTS_MODEL=eleven_multilingual_v2
"""
headers = {
"xi-api-key": app.state.config.TTS_API_KEY,
"Content-Type": "application/json",
}
try:
# TODO: Add retries
response = requests.get("https://api.elevenlabs.io/v1/voices", headers=headers)
response.raise_for_status()
voices_data = response.json()
voices = {}
for voice in voices_data.get("voices", []):
voices[voice["voice_id"]] = voice["name"]
except requests.RequestException as e:
# Avoid @lru_cache with exception
log.error(f"Error fetching voices: {str(e)}")
raise RuntimeError(f"Error fetching voices: {str(e)}")
return voices
@app.get("/voices")
async def get_voices(user=Depends(get_verified_user)):
return {"voices": [{"id": k, "name": v} for k, v in get_available_voices().items()]}

View File

@@ -1,57 +1,46 @@
import re
import requests
import base64
from fastapi import (
FastAPI,
Request,
Depends,
HTTPException,
status,
UploadFile,
File,
Form,
)
from fastapi.middleware.cors import CORSMiddleware
from constants import ERROR_MESSAGES
from utils.utils import (
get_verified_user,
get_admin_user,
)
from apps.images.utils.comfyui import ImageGenerationPayload, comfyui_generate_image
from utils.misc import calculate_sha256
from typing import Optional
from pydantic import BaseModel
from pathlib import Path
import mimetypes
import uuid
import asyncio
import base64
import json
import logging
import mimetypes
import re
import uuid
from pathlib import Path
from typing import Optional
from config import (
SRC_LOG_LEVELS,
CACHE_DIR,
IMAGE_GENERATION_ENGINE,
ENABLE_IMAGE_GENERATION,
AUTOMATIC1111_BASE_URL,
import requests
from open_webui.apps.images.utils.comfyui import (
ComfyUIGenerateImageForm,
ComfyUIWorkflow,
comfyui_generate_image,
)
from open_webui.config import (
AUTOMATIC1111_API_AUTH,
AUTOMATIC1111_BASE_URL,
AUTOMATIC1111_CFG_SCALE,
AUTOMATIC1111_SAMPLER,
AUTOMATIC1111_SCHEDULER,
CACHE_DIR,
COMFYUI_BASE_URL,
COMFYUI_CFG_SCALE,
COMFYUI_SAMPLER,
COMFYUI_SCHEDULER,
COMFYUI_SD3,
COMFYUI_FLUX,
COMFYUI_FLUX_WEIGHT_DTYPE,
COMFYUI_FLUX_FP8_CLIP,
IMAGES_OPENAI_API_BASE_URL,
IMAGES_OPENAI_API_KEY,
COMFYUI_WORKFLOW,
COMFYUI_WORKFLOW_NODES,
CORS_ALLOW_ORIGIN,
ENABLE_IMAGE_GENERATION,
IMAGE_GENERATION_ENGINE,
IMAGE_GENERATION_MODEL,
IMAGE_SIZE,
IMAGE_STEPS,
IMAGES_OPENAI_API_BASE_URL,
IMAGES_OPENAI_API_KEY,
AppConfig,
)
from open_webui.constants import ERROR_MESSAGES
from open_webui.env import ENV, SRC_LOG_LEVELS, ENABLE_FORWARD_USER_INFO_HEADERS
from fastapi import Depends, FastAPI, HTTPException, Request
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
from open_webui.utils.utils import get_admin_user, get_verified_user
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["IMAGES"])
@@ -59,10 +48,15 @@ log.setLevel(SRC_LOG_LEVELS["IMAGES"])
IMAGE_CACHE_DIR = Path(CACHE_DIR).joinpath("./image/generations/")
IMAGE_CACHE_DIR.mkdir(parents=True, exist_ok=True)
app = FastAPI()
app = FastAPI(
docs_url="/docs" if ENV == "dev" else None,
openapi_url="/openapi.json" if ENV == "dev" else None,
redoc_url=None,
)
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_origins=CORS_ALLOW_ORIGIN,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
@@ -80,21 +74,127 @@ app.state.config.MODEL = IMAGE_GENERATION_MODEL
app.state.config.AUTOMATIC1111_BASE_URL = AUTOMATIC1111_BASE_URL
app.state.config.AUTOMATIC1111_API_AUTH = AUTOMATIC1111_API_AUTH
app.state.config.AUTOMATIC1111_CFG_SCALE = AUTOMATIC1111_CFG_SCALE
app.state.config.AUTOMATIC1111_SAMPLER = AUTOMATIC1111_SAMPLER
app.state.config.AUTOMATIC1111_SCHEDULER = AUTOMATIC1111_SCHEDULER
app.state.config.COMFYUI_BASE_URL = COMFYUI_BASE_URL
app.state.config.COMFYUI_WORKFLOW = COMFYUI_WORKFLOW
app.state.config.COMFYUI_WORKFLOW_NODES = COMFYUI_WORKFLOW_NODES
app.state.config.IMAGE_SIZE = IMAGE_SIZE
app.state.config.IMAGE_STEPS = IMAGE_STEPS
app.state.config.COMFYUI_CFG_SCALE = COMFYUI_CFG_SCALE
app.state.config.COMFYUI_SAMPLER = COMFYUI_SAMPLER
app.state.config.COMFYUI_SCHEDULER = COMFYUI_SCHEDULER
app.state.config.COMFYUI_SD3 = COMFYUI_SD3
app.state.config.COMFYUI_FLUX = COMFYUI_FLUX
app.state.config.COMFYUI_FLUX_WEIGHT_DTYPE = COMFYUI_FLUX_WEIGHT_DTYPE
app.state.config.COMFYUI_FLUX_FP8_CLIP = COMFYUI_FLUX_FP8_CLIP
@app.get("/config")
async def get_config(request: Request, user=Depends(get_admin_user)):
return {
"enabled": app.state.config.ENABLED,
"engine": app.state.config.ENGINE,
"openai": {
"OPENAI_API_BASE_URL": app.state.config.OPENAI_API_BASE_URL,
"OPENAI_API_KEY": app.state.config.OPENAI_API_KEY,
},
"automatic1111": {
"AUTOMATIC1111_BASE_URL": app.state.config.AUTOMATIC1111_BASE_URL,
"AUTOMATIC1111_API_AUTH": app.state.config.AUTOMATIC1111_API_AUTH,
"AUTOMATIC1111_CFG_SCALE": app.state.config.AUTOMATIC1111_CFG_SCALE,
"AUTOMATIC1111_SAMPLER": app.state.config.AUTOMATIC1111_SAMPLER,
"AUTOMATIC1111_SCHEDULER": app.state.config.AUTOMATIC1111_SCHEDULER,
},
"comfyui": {
"COMFYUI_BASE_URL": app.state.config.COMFYUI_BASE_URL,
"COMFYUI_WORKFLOW": app.state.config.COMFYUI_WORKFLOW,
"COMFYUI_WORKFLOW_NODES": app.state.config.COMFYUI_WORKFLOW_NODES,
},
}
class OpenAIConfigForm(BaseModel):
OPENAI_API_BASE_URL: str
OPENAI_API_KEY: str
class Automatic1111ConfigForm(BaseModel):
AUTOMATIC1111_BASE_URL: str
AUTOMATIC1111_API_AUTH: str
AUTOMATIC1111_CFG_SCALE: Optional[str]
AUTOMATIC1111_SAMPLER: Optional[str]
AUTOMATIC1111_SCHEDULER: Optional[str]
class ComfyUIConfigForm(BaseModel):
COMFYUI_BASE_URL: str
COMFYUI_WORKFLOW: str
COMFYUI_WORKFLOW_NODES: list[dict]
class ConfigForm(BaseModel):
enabled: bool
engine: str
openai: OpenAIConfigForm
automatic1111: Automatic1111ConfigForm
comfyui: ComfyUIConfigForm
@app.post("/config/update")
async def update_config(form_data: ConfigForm, user=Depends(get_admin_user)):
app.state.config.ENGINE = form_data.engine
app.state.config.ENABLED = form_data.enabled
app.state.config.OPENAI_API_BASE_URL = form_data.openai.OPENAI_API_BASE_URL
app.state.config.OPENAI_API_KEY = form_data.openai.OPENAI_API_KEY
app.state.config.AUTOMATIC1111_BASE_URL = (
form_data.automatic1111.AUTOMATIC1111_BASE_URL
)
app.state.config.AUTOMATIC1111_API_AUTH = (
form_data.automatic1111.AUTOMATIC1111_API_AUTH
)
app.state.config.AUTOMATIC1111_CFG_SCALE = (
float(form_data.automatic1111.AUTOMATIC1111_CFG_SCALE)
if form_data.automatic1111.AUTOMATIC1111_CFG_SCALE
else None
)
app.state.config.AUTOMATIC1111_SAMPLER = (
form_data.automatic1111.AUTOMATIC1111_SAMPLER
if form_data.automatic1111.AUTOMATIC1111_SAMPLER
else None
)
app.state.config.AUTOMATIC1111_SCHEDULER = (
form_data.automatic1111.AUTOMATIC1111_SCHEDULER
if form_data.automatic1111.AUTOMATIC1111_SCHEDULER
else None
)
app.state.config.COMFYUI_BASE_URL = form_data.comfyui.COMFYUI_BASE_URL.strip("/")
app.state.config.COMFYUI_WORKFLOW = form_data.comfyui.COMFYUI_WORKFLOW
app.state.config.COMFYUI_WORKFLOW_NODES = form_data.comfyui.COMFYUI_WORKFLOW_NODES
return {
"enabled": app.state.config.ENABLED,
"engine": app.state.config.ENGINE,
"openai": {
"OPENAI_API_BASE_URL": app.state.config.OPENAI_API_BASE_URL,
"OPENAI_API_KEY": app.state.config.OPENAI_API_KEY,
},
"automatic1111": {
"AUTOMATIC1111_BASE_URL": app.state.config.AUTOMATIC1111_BASE_URL,
"AUTOMATIC1111_API_AUTH": app.state.config.AUTOMATIC1111_API_AUTH,
"AUTOMATIC1111_CFG_SCALE": app.state.config.AUTOMATIC1111_CFG_SCALE,
"AUTOMATIC1111_SAMPLER": app.state.config.AUTOMATIC1111_SAMPLER,
"AUTOMATIC1111_SCHEDULER": app.state.config.AUTOMATIC1111_SCHEDULER,
},
"comfyui": {
"COMFYUI_BASE_URL": app.state.config.COMFYUI_BASE_URL,
"COMFYUI_WORKFLOW": app.state.config.COMFYUI_WORKFLOW,
"COMFYUI_WORKFLOW_NODES": app.state.config.COMFYUI_WORKFLOW_NODES,
},
}
def get_automatic1111_api_auth():
if app.state.config.AUTOMATIC1111_API_AUTH == None:
if app.state.config.AUTOMATIC1111_API_AUTH is None:
return ""
else:
auth1111_byte_string = app.state.config.AUTOMATIC1111_API_AUTH.encode("utf-8")
@@ -103,164 +203,112 @@ def get_automatic1111_api_auth():
return f"Basic {auth1111_base64_encoded_string}"
@app.get("/config")
async def get_config(request: Request, user=Depends(get_admin_user)):
return {
"engine": app.state.config.ENGINE,
"enabled": app.state.config.ENABLED,
}
class ConfigUpdateForm(BaseModel):
engine: str
enabled: bool
@app.post("/config/update")
async def update_config(form_data: ConfigUpdateForm, user=Depends(get_admin_user)):
app.state.config.ENGINE = form_data.engine
app.state.config.ENABLED = form_data.enabled
return {
"engine": app.state.config.ENGINE,
"enabled": app.state.config.ENABLED,
}
class EngineUrlUpdateForm(BaseModel):
AUTOMATIC1111_BASE_URL: Optional[str] = None
AUTOMATIC1111_API_AUTH: Optional[str] = None
COMFYUI_BASE_URL: Optional[str] = None
@app.get("/url")
async def get_engine_url(user=Depends(get_admin_user)):
return {
"AUTOMATIC1111_BASE_URL": app.state.config.AUTOMATIC1111_BASE_URL,
"AUTOMATIC1111_API_AUTH": app.state.config.AUTOMATIC1111_API_AUTH,
"COMFYUI_BASE_URL": app.state.config.COMFYUI_BASE_URL,
}
@app.post("/url/update")
async def update_engine_url(
form_data: EngineUrlUpdateForm, user=Depends(get_admin_user)
):
if form_data.AUTOMATIC1111_BASE_URL == None:
app.state.config.AUTOMATIC1111_BASE_URL = AUTOMATIC1111_BASE_URL
else:
url = form_data.AUTOMATIC1111_BASE_URL.strip("/")
@app.get("/config/url/verify")
async def verify_url(user=Depends(get_admin_user)):
if app.state.config.ENGINE == "automatic1111":
try:
r = requests.head(url)
app.state.config.AUTOMATIC1111_BASE_URL = url
r = requests.get(
url=f"{app.state.config.AUTOMATIC1111_BASE_URL}/sdapi/v1/options",
headers={"authorization": get_automatic1111_api_auth()},
)
r.raise_for_status()
return True
except Exception:
app.state.config.ENABLED = False
raise HTTPException(status_code=400, detail=ERROR_MESSAGES.INVALID_URL)
elif app.state.config.ENGINE == "comfyui":
try:
r = requests.get(url=f"{app.state.config.COMFYUI_BASE_URL}/object_info")
r.raise_for_status()
return True
except Exception:
app.state.config.ENABLED = False
raise HTTPException(status_code=400, detail=ERROR_MESSAGES.INVALID_URL)
else:
return True
def set_image_model(model: str):
log.info(f"Setting image model to {model}")
app.state.config.MODEL = model
if app.state.config.ENGINE in ["", "automatic1111"]:
api_auth = get_automatic1111_api_auth()
r = requests.get(
url=f"{app.state.config.AUTOMATIC1111_BASE_URL}/sdapi/v1/options",
headers={"authorization": api_auth},
)
options = r.json()
if model != options["sd_model_checkpoint"]:
options["sd_model_checkpoint"] = model
r = requests.post(
url=f"{app.state.config.AUTOMATIC1111_BASE_URL}/sdapi/v1/options",
json=options,
headers={"authorization": api_auth},
)
return app.state.config.MODEL
def get_image_model():
if app.state.config.ENGINE == "openai":
return app.state.config.MODEL if app.state.config.MODEL else "dall-e-2"
elif app.state.config.ENGINE == "comfyui":
return app.state.config.MODEL if app.state.config.MODEL else ""
elif app.state.config.ENGINE == "automatic1111" or app.state.config.ENGINE == "":
try:
r = requests.get(
url=f"{app.state.config.AUTOMATIC1111_BASE_URL}/sdapi/v1/options",
headers={"authorization": get_automatic1111_api_auth()},
)
options = r.json()
return options["sd_model_checkpoint"]
except Exception as e:
app.state.config.ENABLED = False
raise HTTPException(status_code=400, detail=ERROR_MESSAGES.DEFAULT(e))
if form_data.COMFYUI_BASE_URL == None:
app.state.config.COMFYUI_BASE_URL = COMFYUI_BASE_URL
else:
url = form_data.COMFYUI_BASE_URL.strip("/")
try:
r = requests.head(url)
app.state.config.COMFYUI_BASE_URL = url
except Exception as e:
raise HTTPException(status_code=400, detail=ERROR_MESSAGES.DEFAULT(e))
class ImageConfigForm(BaseModel):
MODEL: str
IMAGE_SIZE: str
IMAGE_STEPS: int
if form_data.AUTOMATIC1111_API_AUTH == None:
app.state.config.AUTOMATIC1111_API_AUTH = AUTOMATIC1111_API_AUTH
else:
app.state.config.AUTOMATIC1111_API_AUTH = form_data.AUTOMATIC1111_API_AUTH
@app.get("/image/config")
async def get_image_config(user=Depends(get_admin_user)):
return {
"AUTOMATIC1111_BASE_URL": app.state.config.AUTOMATIC1111_BASE_URL,
"AUTOMATIC1111_API_AUTH": app.state.config.AUTOMATIC1111_API_AUTH,
"COMFYUI_BASE_URL": app.state.config.COMFYUI_BASE_URL,
"status": True,
"MODEL": app.state.config.MODEL,
"IMAGE_SIZE": app.state.config.IMAGE_SIZE,
"IMAGE_STEPS": app.state.config.IMAGE_STEPS,
}
class OpenAIConfigUpdateForm(BaseModel):
url: str
key: str
@app.post("/image/config/update")
async def update_image_config(form_data: ImageConfigForm, user=Depends(get_admin_user)):
set_image_model(form_data.MODEL)
@app.get("/openai/config")
async def get_openai_config(user=Depends(get_admin_user)):
return {
"OPENAI_API_BASE_URL": app.state.config.OPENAI_API_BASE_URL,
"OPENAI_API_KEY": app.state.config.OPENAI_API_KEY,
}
@app.post("/openai/config/update")
async def update_openai_config(
form_data: OpenAIConfigUpdateForm, user=Depends(get_admin_user)
):
if form_data.key == "":
raise HTTPException(status_code=400, detail=ERROR_MESSAGES.API_KEY_NOT_FOUND)
app.state.config.OPENAI_API_BASE_URL = form_data.url
app.state.config.OPENAI_API_KEY = form_data.key
return {
"status": True,
"OPENAI_API_BASE_URL": app.state.config.OPENAI_API_BASE_URL,
"OPENAI_API_KEY": app.state.config.OPENAI_API_KEY,
}
class ImageSizeUpdateForm(BaseModel):
size: str
@app.get("/size")
async def get_image_size(user=Depends(get_admin_user)):
return {"IMAGE_SIZE": app.state.config.IMAGE_SIZE}
@app.post("/size/update")
async def update_image_size(
form_data: ImageSizeUpdateForm, user=Depends(get_admin_user)
):
pattern = r"^\d+x\d+$" # Regular expression pattern
if re.match(pattern, form_data.size):
app.state.config.IMAGE_SIZE = form_data.size
return {
"IMAGE_SIZE": app.state.config.IMAGE_SIZE,
"status": True,
}
pattern = r"^\d+x\d+$"
if re.match(pattern, form_data.IMAGE_SIZE):
app.state.config.IMAGE_SIZE = form_data.IMAGE_SIZE
else:
raise HTTPException(
status_code=400,
detail=ERROR_MESSAGES.INCORRECT_FORMAT(" (e.g., 512x512)."),
)
class ImageStepsUpdateForm(BaseModel):
steps: int
@app.get("/steps")
async def get_image_size(user=Depends(get_admin_user)):
return {"IMAGE_STEPS": app.state.config.IMAGE_STEPS}
@app.post("/steps/update")
async def update_image_size(
form_data: ImageStepsUpdateForm, user=Depends(get_admin_user)
):
if form_data.steps >= 0:
app.state.config.IMAGE_STEPS = form_data.steps
return {
"IMAGE_STEPS": app.state.config.IMAGE_STEPS,
"status": True,
}
if form_data.IMAGE_STEPS >= 0:
app.state.config.IMAGE_STEPS = form_data.IMAGE_STEPS
else:
raise HTTPException(
status_code=400,
detail=ERROR_MESSAGES.INCORRECT_FORMAT(" (e.g., 50)."),
)
return {
"MODEL": app.state.config.MODEL,
"IMAGE_SIZE": app.state.config.IMAGE_SIZE,
"IMAGE_STEPS": app.state.config.IMAGE_STEPS,
}
@app.get("/models")
def get_models(user=Depends(get_verified_user)):
@@ -271,18 +319,51 @@ def get_models(user=Depends(get_verified_user)):
{"id": "dall-e-3", "name": "DALL·E 3"},
]
elif app.state.config.ENGINE == "comfyui":
# TODO - get models from comfyui
r = requests.get(url=f"{app.state.config.COMFYUI_BASE_URL}/object_info")
info = r.json()
return list(
map(
lambda model: {"id": model, "name": model},
info["CheckpointLoaderSimple"]["input"]["required"]["ckpt_name"][0],
)
)
workflow = json.loads(app.state.config.COMFYUI_WORKFLOW)
model_node_id = None
else:
for node in app.state.config.COMFYUI_WORKFLOW_NODES:
if node["type"] == "model":
if node["node_ids"]:
model_node_id = node["node_ids"][0]
break
if model_node_id:
model_list_key = None
print(workflow[model_node_id]["class_type"])
for key in info[workflow[model_node_id]["class_type"]]["input"][
"required"
]:
if "_name" in key:
model_list_key = key
break
if model_list_key:
return list(
map(
lambda model: {"id": model, "name": model},
info[workflow[model_node_id]["class_type"]]["input"][
"required"
][model_list_key][0],
)
)
else:
return list(
map(
lambda model: {"id": model, "name": model},
info["CheckpointLoaderSimple"]["input"]["required"][
"ckpt_name"
][0],
)
)
elif (
app.state.config.ENGINE == "automatic1111" or app.state.config.ENGINE == ""
):
r = requests.get(
url=f"{app.state.config.AUTOMATIC1111_BASE_URL}/sdapi/v1/sd-models",
headers={"authorization": get_automatic1111_api_auth()},
@@ -299,69 +380,11 @@ def get_models(user=Depends(get_verified_user)):
raise HTTPException(status_code=400, detail=ERROR_MESSAGES.DEFAULT(e))
@app.get("/models/default")
async def get_default_model(user=Depends(get_admin_user)):
try:
if app.state.config.ENGINE == "openai":
return {
"model": (
app.state.config.MODEL if app.state.config.MODEL else "dall-e-2"
)
}
elif app.state.config.ENGINE == "comfyui":
return {"model": (app.state.config.MODEL if app.state.config.MODEL else "")}
else:
r = requests.get(
url=f"{app.state.config.AUTOMATIC1111_BASE_URL}/sdapi/v1/options",
headers={"authorization": get_automatic1111_api_auth()},
)
options = r.json()
return {"model": options["sd_model_checkpoint"]}
except Exception as e:
app.state.config.ENABLED = False
raise HTTPException(status_code=400, detail=ERROR_MESSAGES.DEFAULT(e))
class UpdateModelForm(BaseModel):
model: str
def set_model_handler(model: str):
if app.state.config.ENGINE in ["openai", "comfyui"]:
app.state.config.MODEL = model
return app.state.config.MODEL
else:
api_auth = get_automatic1111_api_auth()
r = requests.get(
url=f"{app.state.config.AUTOMATIC1111_BASE_URL}/sdapi/v1/options",
headers={"authorization": api_auth},
)
options = r.json()
if model != options["sd_model_checkpoint"]:
options["sd_model_checkpoint"] = model
r = requests.post(
url=f"{app.state.config.AUTOMATIC1111_BASE_URL}/sdapi/v1/options",
json=options,
headers={"authorization": api_auth},
)
return options
@app.post("/models/default/update")
def update_default_model(
form_data: UpdateModelForm,
user=Depends(get_verified_user),
):
return set_model_handler(form_data.model)
class GenerateImageForm(BaseModel):
model: Optional[str] = None
prompt: str
n: int = 1
size: Optional[str] = None
n: int = 1
negative_prompt: Optional[str] = None
@@ -403,7 +426,6 @@ def save_url_image(url):
r = requests.get(url)
r.raise_for_status()
if r.headers["content-type"].split("/")[0] == "image":
mime_type = r.headers["content-type"]
image_format = mimetypes.guess_extension(mime_type)
@@ -418,7 +440,7 @@ def save_url_image(url):
image_file.write(chunk)
return image_filename
else:
log.error(f"Url does not point to an image.")
log.error("Url does not point to an image.")
return None
except Exception as e:
@@ -436,11 +458,16 @@ async def image_generations(
r = None
try:
if app.state.config.ENGINE == "openai":
headers = {}
headers["Authorization"] = f"Bearer {app.state.config.OPENAI_API_KEY}"
headers["Content-Type"] = "application/json"
if ENABLE_FORWARD_USER_INFO_HEADERS:
headers["X-OpenWebUI-User-Name"] = user.name
headers["X-OpenWebUI-User-Id"] = user.id
headers["X-OpenWebUI-User-Email"] = user.email
headers["X-OpenWebUI-User-Role"] = user.role
data = {
"model": (
app.state.config.MODEL
@@ -455,7 +482,9 @@ async def image_generations(
"response_format": "b64_json",
}
r = requests.post(
# Use asyncio.to_thread for the requests.post call
r = await asyncio.to_thread(
requests.post,
url=f"{app.state.config.OPENAI_API_BASE_URL}/images/generations",
json=data,
headers=headers,
@@ -477,7 +506,6 @@ async def image_generations(
return images
elif app.state.config.ENGINE == "comfyui":
data = {
"prompt": form_data.prompt,
"width": width,
@@ -491,32 +519,20 @@ async def image_generations(
if form_data.negative_prompt is not None:
data["negative_prompt"] = form_data.negative_prompt
if app.state.config.COMFYUI_CFG_SCALE:
data["cfg_scale"] = app.state.config.COMFYUI_CFG_SCALE
if app.state.config.COMFYUI_SAMPLER is not None:
data["sampler"] = app.state.config.COMFYUI_SAMPLER
if app.state.config.COMFYUI_SCHEDULER is not None:
data["scheduler"] = app.state.config.COMFYUI_SCHEDULER
if app.state.config.COMFYUI_SD3 is not None:
data["sd3"] = app.state.config.COMFYUI_SD3
if app.state.config.COMFYUI_FLUX is not None:
data["flux"] = app.state.config.COMFYUI_FLUX
if app.state.config.COMFYUI_FLUX_WEIGHT_DTYPE is not None:
data["flux_weight_dtype"] = app.state.config.COMFYUI_FLUX_WEIGHT_DTYPE
if app.state.config.COMFYUI_FLUX_FP8_CLIP is not None:
data["flux_fp8_clip"] = app.state.config.COMFYUI_FLUX_FP8_CLIP
data = ImageGenerationPayload(**data)
res = comfyui_generate_image(
form_data = ComfyUIGenerateImageForm(
**{
"workflow": ComfyUIWorkflow(
**{
"workflow": app.state.config.COMFYUI_WORKFLOW,
"nodes": app.state.config.COMFYUI_WORKFLOW_NODES,
}
),
**data,
}
)
res = await comfyui_generate_image(
app.state.config.MODEL,
data,
form_data,
user.id,
app.state.config.COMFYUI_BASE_URL,
)
@@ -530,13 +546,15 @@ async def image_generations(
file_body_path = IMAGE_CACHE_DIR.joinpath(f"{image_filename}.json")
with open(file_body_path, "w") as f:
json.dump(data.model_dump(exclude_none=True), f)
json.dump(form_data.model_dump(exclude_none=True), f)
log.debug(f"images: {images}")
return images
else:
elif (
app.state.config.ENGINE == "automatic1111" or app.state.config.ENGINE == ""
):
if form_data.model:
set_model_handler(form_data.model)
set_image_model(form_data.model)
data = {
"prompt": form_data.prompt,
@@ -551,14 +569,24 @@ async def image_generations(
if form_data.negative_prompt is not None:
data["negative_prompt"] = form_data.negative_prompt
r = requests.post(
if app.state.config.AUTOMATIC1111_CFG_SCALE:
data["cfg_scale"] = app.state.config.AUTOMATIC1111_CFG_SCALE
if app.state.config.AUTOMATIC1111_SAMPLER:
data["sampler_name"] = app.state.config.AUTOMATIC1111_SAMPLER
if app.state.config.AUTOMATIC1111_SCHEDULER:
data["scheduler"] = app.state.config.AUTOMATIC1111_SCHEDULER
# Use asyncio.to_thread for the requests.post call
r = await asyncio.to_thread(
requests.post,
url=f"{app.state.config.AUTOMATIC1111_BASE_URL}/sdapi/v1/txt2img",
json=data,
headers={"authorization": get_automatic1111_api_auth()},
)
res = r.json()
log.debug(f"res: {res}")
images = []
@@ -572,10 +600,8 @@ async def image_generations(
json.dump({**data, "info": res["info"]}, f)
return images
except Exception as e:
error = e
if r != None:
data = r.json()
if "error" in data:

View File

@@ -0,0 +1,186 @@
import asyncio
import json
import logging
import random
import urllib.parse
import urllib.request
from typing import Optional
import websocket # NOTE: websocket-client (https://github.com/websocket-client/websocket-client)
from open_webui.env import SRC_LOG_LEVELS
from pydantic import BaseModel
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["COMFYUI"])
default_headers = {"User-Agent": "Mozilla/5.0"}
def queue_prompt(prompt, client_id, base_url):
log.info("queue_prompt")
p = {"prompt": prompt, "client_id": client_id}
data = json.dumps(p).encode("utf-8")
log.debug(f"queue_prompt data: {data}")
try:
req = urllib.request.Request(
f"{base_url}/prompt", data=data, headers=default_headers
)
response = urllib.request.urlopen(req).read()
return json.loads(response)
except Exception as e:
log.exception(f"Error while queuing prompt: {e}")
raise e
def get_image(filename, subfolder, folder_type, base_url):
log.info("get_image")
data = {"filename": filename, "subfolder": subfolder, "type": folder_type}
url_values = urllib.parse.urlencode(data)
req = urllib.request.Request(
f"{base_url}/view?{url_values}", headers=default_headers
)
with urllib.request.urlopen(req) as response:
return response.read()
def get_image_url(filename, subfolder, folder_type, base_url):
log.info("get_image")
data = {"filename": filename, "subfolder": subfolder, "type": folder_type}
url_values = urllib.parse.urlencode(data)
return f"{base_url}/view?{url_values}"
def get_history(prompt_id, base_url):
log.info("get_history")
req = urllib.request.Request(
f"{base_url}/history/{prompt_id}", headers=default_headers
)
with urllib.request.urlopen(req) as response:
return json.loads(response.read())
def get_images(ws, prompt, client_id, base_url):
prompt_id = queue_prompt(prompt, client_id, base_url)["prompt_id"]
output_images = []
while True:
out = ws.recv()
if isinstance(out, str):
message = json.loads(out)
if message["type"] == "executing":
data = message["data"]
if data["node"] is None and data["prompt_id"] == prompt_id:
break # Execution is done
else:
continue # previews are binary data
history = get_history(prompt_id, base_url)[prompt_id]
for o in history["outputs"]:
for node_id in history["outputs"]:
node_output = history["outputs"][node_id]
if "images" in node_output:
for image in node_output["images"]:
url = get_image_url(
image["filename"], image["subfolder"], image["type"], base_url
)
output_images.append({"url": url})
return {"data": output_images}
class ComfyUINodeInput(BaseModel):
type: Optional[str] = None
node_ids: list[str] = []
key: Optional[str] = "text"
value: Optional[str] = None
class ComfyUIWorkflow(BaseModel):
workflow: str
nodes: list[ComfyUINodeInput]
class ComfyUIGenerateImageForm(BaseModel):
workflow: ComfyUIWorkflow
prompt: str
negative_prompt: Optional[str] = None
width: int
height: int
n: int = 1
steps: Optional[int] = None
seed: Optional[int] = None
async def comfyui_generate_image(
model: str, payload: ComfyUIGenerateImageForm, client_id, base_url
):
ws_url = base_url.replace("http://", "ws://").replace("https://", "wss://")
workflow = json.loads(payload.workflow.workflow)
for node in payload.workflow.nodes:
if node.type:
if node.type == "model":
for node_id in node.node_ids:
workflow[node_id]["inputs"][node.key] = model
elif node.type == "prompt":
for node_id in node.node_ids:
workflow[node_id]["inputs"][
node.key if node.key else "text"
] = payload.prompt
elif node.type == "negative_prompt":
for node_id in node.node_ids:
workflow[node_id]["inputs"][
node.key if node.key else "text"
] = payload.negative_prompt
elif node.type == "width":
for node_id in node.node_ids:
workflow[node_id]["inputs"][
node.key if node.key else "width"
] = payload.width
elif node.type == "height":
for node_id in node.node_ids:
workflow[node_id]["inputs"][
node.key if node.key else "height"
] = payload.height
elif node.type == "n":
for node_id in node.node_ids:
workflow[node_id]["inputs"][
node.key if node.key else "batch_size"
] = payload.n
elif node.type == "steps":
for node_id in node.node_ids:
workflow[node_id]["inputs"][
node.key if node.key else "steps"
] = payload.steps
elif node.type == "seed":
seed = (
payload.seed
if payload.seed
else random.randint(0, 18446744073709551614)
)
for node_id in node.node_ids:
workflow[node_id]["inputs"][node.key] = seed
else:
for node_id in node.node_ids:
workflow[node_id]["inputs"][node.key] = node.value
try:
ws = websocket.WebSocket()
ws.connect(f"{ws_url}/ws?clientId={client_id}")
log.info("WebSocket connection established.")
except Exception as e:
log.exception(f"Failed to connect to WebSocket server: {e}")
return None
try:
log.info("Sending workflow to WebSocket server.")
log.info(f"Workflow: {workflow}")
images = await asyncio.to_thread(get_images, ws, workflow, client_id, base_url)
except Exception as e:
log.exception(f"Error while receiving images: {e}")
images = None
ws.close()
return images

View File

@@ -0,0 +1,718 @@
import asyncio
import hashlib
import json
import logging
from pathlib import Path
from typing import Literal, Optional, overload
import aiohttp
from aiocache import cached
import requests
from open_webui.apps.webui.models.models import Models
from open_webui.config import (
CACHE_DIR,
CORS_ALLOW_ORIGIN,
ENABLE_OPENAI_API,
OPENAI_API_BASE_URLS,
OPENAI_API_KEYS,
OPENAI_API_CONFIGS,
AppConfig,
)
from open_webui.env import (
AIOHTTP_CLIENT_TIMEOUT,
AIOHTTP_CLIENT_TIMEOUT_OPENAI_MODEL_LIST,
ENABLE_FORWARD_USER_INFO_HEADERS,
)
from open_webui.constants import ERROR_MESSAGES
from open_webui.env import ENV, SRC_LOG_LEVELS
from fastapi import Depends, FastAPI, HTTPException, Request
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import FileResponse, StreamingResponse
from pydantic import BaseModel
from starlette.background import BackgroundTask
from open_webui.utils.payload import (
apply_model_params_to_body_openai,
apply_model_system_prompt_to_body,
)
from open_webui.utils.utils import get_admin_user, get_verified_user
from open_webui.utils.access_control import has_access
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["OPENAI"])
app = FastAPI(
docs_url="/docs" if ENV == "dev" else None,
openapi_url="/openapi.json" if ENV == "dev" else None,
redoc_url=None,
)
app.add_middleware(
CORSMiddleware,
allow_origins=CORS_ALLOW_ORIGIN,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.state.config = AppConfig()
app.state.config.ENABLE_OPENAI_API = ENABLE_OPENAI_API
app.state.config.OPENAI_API_BASE_URLS = OPENAI_API_BASE_URLS
app.state.config.OPENAI_API_KEYS = OPENAI_API_KEYS
app.state.config.OPENAI_API_CONFIGS = OPENAI_API_CONFIGS
@app.get("/config")
async def get_config(user=Depends(get_admin_user)):
return {
"ENABLE_OPENAI_API": app.state.config.ENABLE_OPENAI_API,
"OPENAI_API_BASE_URLS": app.state.config.OPENAI_API_BASE_URLS,
"OPENAI_API_KEYS": app.state.config.OPENAI_API_KEYS,
"OPENAI_API_CONFIGS": app.state.config.OPENAI_API_CONFIGS,
}
class OpenAIConfigForm(BaseModel):
ENABLE_OPENAI_API: Optional[bool] = None
OPENAI_API_BASE_URLS: list[str]
OPENAI_API_KEYS: list[str]
OPENAI_API_CONFIGS: dict
@app.post("/config/update")
async def update_config(form_data: OpenAIConfigForm, user=Depends(get_admin_user)):
app.state.config.ENABLE_OPENAI_API = form_data.ENABLE_OPENAI_API
app.state.config.OPENAI_API_BASE_URLS = form_data.OPENAI_API_BASE_URLS
app.state.config.OPENAI_API_KEYS = form_data.OPENAI_API_KEYS
# Check if API KEYS length is same than API URLS length
if len(app.state.config.OPENAI_API_KEYS) != len(
app.state.config.OPENAI_API_BASE_URLS
):
if len(app.state.config.OPENAI_API_KEYS) > len(
app.state.config.OPENAI_API_BASE_URLS
):
app.state.config.OPENAI_API_KEYS = app.state.config.OPENAI_API_KEYS[
: len(app.state.config.OPENAI_API_BASE_URLS)
]
else:
app.state.config.OPENAI_API_KEYS += [""] * (
len(app.state.config.OPENAI_API_BASE_URLS)
- len(app.state.config.OPENAI_API_KEYS)
)
app.state.config.OPENAI_API_CONFIGS = form_data.OPENAI_API_CONFIGS
# Remove any extra configs
config_urls = app.state.config.OPENAI_API_CONFIGS.keys()
for idx, url in enumerate(app.state.config.OPENAI_API_BASE_URLS):
if url not in config_urls:
app.state.config.OPENAI_API_CONFIGS.pop(url, None)
return {
"ENABLE_OPENAI_API": app.state.config.ENABLE_OPENAI_API,
"OPENAI_API_BASE_URLS": app.state.config.OPENAI_API_BASE_URLS,
"OPENAI_API_KEYS": app.state.config.OPENAI_API_KEYS,
"OPENAI_API_CONFIGS": app.state.config.OPENAI_API_CONFIGS,
}
@app.post("/audio/speech")
async def speech(request: Request, user=Depends(get_verified_user)):
idx = None
try:
idx = app.state.config.OPENAI_API_BASE_URLS.index("https://api.openai.com/v1")
body = await request.body()
name = hashlib.sha256(body).hexdigest()
SPEECH_CACHE_DIR = Path(CACHE_DIR).joinpath("./audio/speech/")
SPEECH_CACHE_DIR.mkdir(parents=True, exist_ok=True)
file_path = SPEECH_CACHE_DIR.joinpath(f"{name}.mp3")
file_body_path = SPEECH_CACHE_DIR.joinpath(f"{name}.json")
# Check if the file already exists in the cache
if file_path.is_file():
return FileResponse(file_path)
headers = {}
headers["Authorization"] = f"Bearer {app.state.config.OPENAI_API_KEYS[idx]}"
headers["Content-Type"] = "application/json"
if "openrouter.ai" in app.state.config.OPENAI_API_BASE_URLS[idx]:
headers["HTTP-Referer"] = "https://openwebui.com/"
headers["X-Title"] = "Open WebUI"
if ENABLE_FORWARD_USER_INFO_HEADERS:
headers["X-OpenWebUI-User-Name"] = user.name
headers["X-OpenWebUI-User-Id"] = user.id
headers["X-OpenWebUI-User-Email"] = user.email
headers["X-OpenWebUI-User-Role"] = user.role
r = None
try:
r = requests.post(
url=f"{app.state.config.OPENAI_API_BASE_URLS[idx]}/audio/speech",
data=body,
headers=headers,
stream=True,
)
r.raise_for_status()
# Save the streaming content to a file
with open(file_path, "wb") as f:
for chunk in r.iter_content(chunk_size=8192):
f.write(chunk)
with open(file_body_path, "w") as f:
json.dump(json.loads(body.decode("utf-8")), f)
# Return the saved file
return FileResponse(file_path)
except Exception as e:
log.exception(e)
error_detail = "Open WebUI: Server Connection Error"
if r is not None:
try:
res = r.json()
if "error" in res:
error_detail = f"External: {res['error']}"
except Exception:
error_detail = f"External: {e}"
raise HTTPException(
status_code=r.status_code if r else 500, detail=error_detail
)
except ValueError:
raise HTTPException(status_code=401, detail=ERROR_MESSAGES.OPENAI_NOT_FOUND)
async def aiohttp_get(url, key=None):
timeout = aiohttp.ClientTimeout(total=AIOHTTP_CLIENT_TIMEOUT_OPENAI_MODEL_LIST)
try:
headers = {"Authorization": f"Bearer {key}"} if key else {}
async with aiohttp.ClientSession(timeout=timeout, trust_env=True) as session:
async with session.get(url, headers=headers) as response:
return await response.json()
except Exception as e:
# Handle connection error here
log.error(f"Connection error: {e}")
return None
async def cleanup_response(
response: Optional[aiohttp.ClientResponse],
session: Optional[aiohttp.ClientSession],
):
if response:
response.close()
if session:
await session.close()
def merge_models_lists(model_lists):
log.debug(f"merge_models_lists {model_lists}")
merged_list = []
for idx, models in enumerate(model_lists):
if models is not None and "error" not in models:
merged_list.extend(
[
{
**model,
"name": model.get("name", model["id"]),
"owned_by": "openai",
"openai": model,
"urlIdx": idx,
}
for model in models
if "api.openai.com"
not in app.state.config.OPENAI_API_BASE_URLS[idx]
or not any(
name in model["id"]
for name in [
"babbage",
"dall-e",
"davinci",
"embedding",
"tts",
"whisper",
]
)
]
)
return merged_list
async def get_all_models_responses() -> list:
if not app.state.config.ENABLE_OPENAI_API:
return []
# Check if API KEYS length is same than API URLS length
num_urls = len(app.state.config.OPENAI_API_BASE_URLS)
num_keys = len(app.state.config.OPENAI_API_KEYS)
if num_keys != num_urls:
# if there are more keys than urls, remove the extra keys
if num_keys > num_urls:
new_keys = app.state.config.OPENAI_API_KEYS[:num_urls]
app.state.config.OPENAI_API_KEYS = new_keys
# if there are more urls than keys, add empty keys
else:
app.state.config.OPENAI_API_KEYS += [""] * (num_urls - num_keys)
tasks = []
for idx, url in enumerate(app.state.config.OPENAI_API_BASE_URLS):
if url not in app.state.config.OPENAI_API_CONFIGS:
tasks.append(
aiohttp_get(f"{url}/models", app.state.config.OPENAI_API_KEYS[idx])
)
else:
api_config = app.state.config.OPENAI_API_CONFIGS.get(url, {})
enable = api_config.get("enable", True)
model_ids = api_config.get("model_ids", [])
if enable:
if len(model_ids) == 0:
tasks.append(
aiohttp_get(
f"{url}/models", app.state.config.OPENAI_API_KEYS[idx]
)
)
else:
model_list = {
"object": "list",
"data": [
{
"id": model_id,
"name": model_id,
"owned_by": "openai",
"openai": {"id": model_id},
"urlIdx": idx,
}
for model_id in model_ids
],
}
tasks.append(asyncio.ensure_future(asyncio.sleep(0, model_list)))
else:
tasks.append(asyncio.ensure_future(asyncio.sleep(0, None)))
responses = await asyncio.gather(*tasks)
for idx, response in enumerate(responses):
if response:
url = app.state.config.OPENAI_API_BASE_URLS[idx]
api_config = app.state.config.OPENAI_API_CONFIGS.get(url, {})
prefix_id = api_config.get("prefix_id", None)
if prefix_id:
for model in (
response if isinstance(response, list) else response.get("data", [])
):
model["id"] = f"{prefix_id}.{model['id']}"
log.debug(f"get_all_models:responses() {responses}")
return responses
@cached(ttl=3)
async def get_all_models() -> dict[str, list]:
log.info("get_all_models()")
if not app.state.config.ENABLE_OPENAI_API:
return {"data": []}
responses = await get_all_models_responses()
def extract_data(response):
if response and "data" in response:
return response["data"]
if isinstance(response, list):
return response
return None
models = {"data": merge_models_lists(map(extract_data, responses))}
log.debug(f"models: {models}")
return models
@app.get("/models")
@app.get("/models/{url_idx}")
async def get_models(url_idx: Optional[int] = None, user=Depends(get_verified_user)):
models = {
"data": [],
}
if url_idx is None:
models = await get_all_models()
else:
url = app.state.config.OPENAI_API_BASE_URLS[url_idx]
key = app.state.config.OPENAI_API_KEYS[url_idx]
headers = {}
headers["Authorization"] = f"Bearer {key}"
headers["Content-Type"] = "application/json"
if ENABLE_FORWARD_USER_INFO_HEADERS:
headers["X-OpenWebUI-User-Name"] = user.name
headers["X-OpenWebUI-User-Id"] = user.id
headers["X-OpenWebUI-User-Email"] = user.email
headers["X-OpenWebUI-User-Role"] = user.role
r = None
timeout = aiohttp.ClientTimeout(total=AIOHTTP_CLIENT_TIMEOUT_OPENAI_MODEL_LIST)
async with aiohttp.ClientSession(timeout=timeout) as session:
try:
async with session.get(f"{url}/models", headers=headers) as r:
if r.status != 200:
# Extract response error details if available
error_detail = f"HTTP Error: {r.status}"
res = await r.json()
if "error" in res:
error_detail = f"External Error: {res['error']}"
raise Exception(error_detail)
response_data = await r.json()
# Check if we're calling OpenAI API based on the URL
if "api.openai.com" in url:
# Filter models according to the specified conditions
response_data["data"] = [
model
for model in response_data.get("data", [])
if not any(
name in model["id"]
for name in [
"babbage",
"dall-e",
"davinci",
"embedding",
"tts",
"whisper",
]
)
]
models = response_data
except aiohttp.ClientError as e:
# ClientError covers all aiohttp requests issues
log.exception(f"Client error: {str(e)}")
# Handle aiohttp-specific connection issues, timeout etc.
raise HTTPException(
status_code=500, detail="Open WebUI: Server Connection Error"
)
except Exception as e:
log.exception(f"Unexpected error: {e}")
# Generic error handler in case parsing JSON or other steps fail
error_detail = f"Unexpected error: {str(e)}"
raise HTTPException(status_code=500, detail=error_detail)
if user.role == "user":
# Filter models based on user access control
filtered_models = []
for model in models.get("data", []):
model_info = Models.get_model_by_id(model["id"])
if model_info:
if user.id == model_info.user_id or has_access(
user.id, type="read", access_control=model_info.access_control
):
filtered_models.append(model)
models["data"] = filtered_models
return models
class ConnectionVerificationForm(BaseModel):
url: str
key: str
@app.post("/verify")
async def verify_connection(
form_data: ConnectionVerificationForm, user=Depends(get_admin_user)
):
url = form_data.url
key = form_data.key
headers = {}
headers["Authorization"] = f"Bearer {key}"
headers["Content-Type"] = "application/json"
timeout = aiohttp.ClientTimeout(total=AIOHTTP_CLIENT_TIMEOUT_OPENAI_MODEL_LIST)
async with aiohttp.ClientSession(timeout=timeout) as session:
try:
async with session.get(f"{url}/models", headers=headers) as r:
if r.status != 200:
# Extract response error details if available
error_detail = f"HTTP Error: {r.status}"
res = await r.json()
if "error" in res:
error_detail = f"External Error: {res['error']}"
raise Exception(error_detail)
response_data = await r.json()
return response_data
except aiohttp.ClientError as e:
# ClientError covers all aiohttp requests issues
log.exception(f"Client error: {str(e)}")
# Handle aiohttp-specific connection issues, timeout etc.
raise HTTPException(
status_code=500, detail="Open WebUI: Server Connection Error"
)
except Exception as e:
log.exception(f"Unexpected error: {e}")
# Generic error handler in case parsing JSON or other steps fail
error_detail = f"Unexpected error: {str(e)}"
raise HTTPException(status_code=500, detail=error_detail)
@app.post("/chat/completions")
async def generate_chat_completion(
form_data: dict,
user=Depends(get_verified_user),
bypass_filter: Optional[bool] = False,
):
idx = 0
payload = {**form_data}
if "metadata" in payload:
del payload["metadata"]
model_id = form_data.get("model")
model_info = Models.get_model_by_id(model_id)
# Check model info and override the payload
if model_info:
if model_info.base_model_id:
payload["model"] = model_info.base_model_id
params = model_info.params.model_dump()
payload = apply_model_params_to_body_openai(params, payload)
payload = apply_model_system_prompt_to_body(params, payload, user)
# Check if user has access to the model
if not bypass_filter and user.role == "user":
if not (
user.id == model_info.user_id
or has_access(
user.id, type="read", access_control=model_info.access_control
)
):
raise HTTPException(
status_code=403,
detail="Model not found",
)
elif not bypass_filter:
if user.role != "admin":
raise HTTPException(
status_code=403,
detail="Model not found",
)
# Attemp to get urlIdx from the model
models = await get_all_models()
# Find the model from the list
model = next(
(model for model in models["data"] if model["id"] == payload.get("model")),
None,
)
if model:
idx = model["urlIdx"]
else:
raise HTTPException(
status_code=404,
detail="Model not found",
)
# Get the API config for the model
api_config = app.state.config.OPENAI_API_CONFIGS.get(
app.state.config.OPENAI_API_BASE_URLS[idx], {}
)
prefix_id = api_config.get("prefix_id", None)
if prefix_id:
payload["model"] = payload["model"].replace(f"{prefix_id}.", "")
# Add user info to the payload if the model is a pipeline
if "pipeline" in model and model.get("pipeline"):
payload["user"] = {
"name": user.name,
"id": user.id,
"email": user.email,
"role": user.role,
}
url = app.state.config.OPENAI_API_BASE_URLS[idx]
key = app.state.config.OPENAI_API_KEYS[idx]
# Fix: O1 does not support the "max_tokens" parameter, Modify "max_tokens" to "max_completion_tokens"
is_o1 = payload["model"].lower().startswith("o1-")
# Change max_completion_tokens to max_tokens (Backward compatible)
if "api.openai.com" not in url and not is_o1:
if "max_completion_tokens" in payload:
# Remove "max_completion_tokens" from the payload
payload["max_tokens"] = payload["max_completion_tokens"]
del payload["max_completion_tokens"]
else:
if is_o1 and "max_tokens" in payload:
payload["max_completion_tokens"] = payload["max_tokens"]
del payload["max_tokens"]
if "max_tokens" in payload and "max_completion_tokens" in payload:
del payload["max_tokens"]
# Fix: O1 does not support the "system" parameter, Modify "system" to "user"
if is_o1 and payload["messages"][0]["role"] == "system":
payload["messages"][0]["role"] = "user"
# Convert the modified body back to JSON
payload = json.dumps(payload)
headers = {}
headers["Authorization"] = f"Bearer {key}"
headers["Content-Type"] = "application/json"
if "openrouter.ai" in app.state.config.OPENAI_API_BASE_URLS[idx]:
headers["HTTP-Referer"] = "https://openwebui.com/"
headers["X-Title"] = "Open WebUI"
if ENABLE_FORWARD_USER_INFO_HEADERS:
headers["X-OpenWebUI-User-Name"] = user.name
headers["X-OpenWebUI-User-Id"] = user.id
headers["X-OpenWebUI-User-Email"] = user.email
headers["X-OpenWebUI-User-Role"] = user.role
r = None
session = None
streaming = False
response = None
try:
session = aiohttp.ClientSession(
trust_env=True, timeout=aiohttp.ClientTimeout(total=AIOHTTP_CLIENT_TIMEOUT)
)
r = await session.request(
method="POST",
url=f"{url}/chat/completions",
data=payload,
headers=headers,
)
# Check if response is SSE
if "text/event-stream" in r.headers.get("Content-Type", ""):
streaming = True
return StreamingResponse(
r.content,
status_code=r.status,
headers=dict(r.headers),
background=BackgroundTask(
cleanup_response, response=r, session=session
),
)
else:
try:
response = await r.json()
except Exception as e:
log.error(e)
response = await r.text()
r.raise_for_status()
return response
except Exception as e:
log.exception(e)
error_detail = "Open WebUI: Server Connection Error"
if isinstance(response, dict):
if "error" in response:
error_detail = f"{response['error']['message'] if 'message' in response['error'] else response['error']}"
elif isinstance(response, str):
error_detail = response
raise HTTPException(status_code=r.status if r else 500, detail=error_detail)
finally:
if not streaming and session:
if r:
r.close()
await session.close()
@app.api_route("/{path:path}", methods=["GET", "POST", "PUT", "DELETE"])
async def proxy(path: str, request: Request, user=Depends(get_verified_user)):
idx = 0
body = await request.body()
url = app.state.config.OPENAI_API_BASE_URLS[idx]
key = app.state.config.OPENAI_API_KEYS[idx]
target_url = f"{url}/{path}"
headers = {}
headers["Authorization"] = f"Bearer {key}"
headers["Content-Type"] = "application/json"
if ENABLE_FORWARD_USER_INFO_HEADERS:
headers["X-OpenWebUI-User-Name"] = user.name
headers["X-OpenWebUI-User-Id"] = user.id
headers["X-OpenWebUI-User-Email"] = user.email
headers["X-OpenWebUI-User-Role"] = user.role
r = None
session = None
streaming = False
try:
session = aiohttp.ClientSession(trust_env=True)
r = await session.request(
method=request.method,
url=target_url,
data=body,
headers=headers,
)
r.raise_for_status()
# Check if response is SSE
if "text/event-stream" in r.headers.get("Content-Type", ""):
streaming = True
return StreamingResponse(
r.content,
status_code=r.status,
headers=dict(r.headers),
background=BackgroundTask(
cleanup_response, response=r, session=session
),
)
else:
response_data = await r.json()
return response_data
except Exception as e:
log.exception(e)
error_detail = "Open WebUI: Server Connection Error"
if r is not None:
try:
res = await r.json()
print(res)
if "error" in res:
error_detail = f"External: {res['error']['message'] if 'message' in res['error'] else res['error']}"
except Exception:
error_detail = f"External: {e}"
raise HTTPException(status_code=r.status if r else 500, detail=error_detail)
finally:
if not streaming and session:
if r:
r.close()
await session.close()

View File

@@ -0,0 +1,190 @@
import requests
import logging
import ftfy
from langchain_community.document_loaders import (
BSHTMLLoader,
CSVLoader,
Docx2txtLoader,
OutlookMessageLoader,
PyPDFLoader,
TextLoader,
UnstructuredEPubLoader,
UnstructuredExcelLoader,
UnstructuredMarkdownLoader,
UnstructuredPowerPointLoader,
UnstructuredRSTLoader,
UnstructuredXMLLoader,
YoutubeLoader,
)
from langchain_core.documents import Document
from open_webui.env import SRC_LOG_LEVELS
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["RAG"])
known_source_ext = [
"go",
"py",
"java",
"sh",
"bat",
"ps1",
"cmd",
"js",
"ts",
"css",
"cpp",
"hpp",
"h",
"c",
"cs",
"sql",
"log",
"ini",
"pl",
"pm",
"r",
"dart",
"dockerfile",
"env",
"php",
"hs",
"hsc",
"lua",
"nginxconf",
"conf",
"m",
"mm",
"plsql",
"perl",
"rb",
"rs",
"db2",
"scala",
"bash",
"swift",
"vue",
"svelte",
"msg",
"ex",
"exs",
"erl",
"tsx",
"jsx",
"hs",
"lhs",
]
class TikaLoader:
def __init__(self, url, file_path, mime_type=None):
self.url = url
self.file_path = file_path
self.mime_type = mime_type
def load(self) -> list[Document]:
with open(self.file_path, "rb") as f:
data = f.read()
if self.mime_type is not None:
headers = {"Content-Type": self.mime_type}
else:
headers = {}
endpoint = self.url
if not endpoint.endswith("/"):
endpoint += "/"
endpoint += "tika/text"
r = requests.put(endpoint, data=data, headers=headers)
if r.ok:
raw_metadata = r.json()
text = raw_metadata.get("X-TIKA:content", "<No text content found>")
if "Content-Type" in raw_metadata:
headers["Content-Type"] = raw_metadata["Content-Type"]
log.info("Tika extracted text: %s", text)
return [Document(page_content=text, metadata=headers)]
else:
raise Exception(f"Error calling Tika: {r.reason}")
class Loader:
def __init__(self, engine: str = "", **kwargs):
self.engine = engine
self.kwargs = kwargs
def load(
self, filename: str, file_content_type: str, file_path: str
) -> list[Document]:
loader = self._get_loader(filename, file_content_type, file_path)
docs = loader.load()
return [
Document(
page_content=ftfy.fix_text(doc.page_content), metadata=doc.metadata
)
for doc in docs
]
def _get_loader(self, filename: str, file_content_type: str, file_path: str):
file_ext = filename.split(".")[-1].lower()
if self.engine == "tika" and self.kwargs.get("TIKA_SERVER_URL"):
if file_ext in known_source_ext or (
file_content_type and file_content_type.find("text/") >= 0
):
loader = TextLoader(file_path, autodetect_encoding=True)
else:
loader = TikaLoader(
url=self.kwargs.get("TIKA_SERVER_URL"),
file_path=file_path,
mime_type=file_content_type,
)
else:
if file_ext == "pdf":
loader = PyPDFLoader(
file_path, extract_images=self.kwargs.get("PDF_EXTRACT_IMAGES")
)
elif file_ext == "csv":
loader = CSVLoader(file_path)
elif file_ext == "rst":
loader = UnstructuredRSTLoader(file_path, mode="elements")
elif file_ext == "xml":
loader = UnstructuredXMLLoader(file_path)
elif file_ext in ["htm", "html"]:
loader = BSHTMLLoader(file_path, open_encoding="unicode_escape")
elif file_ext == "md":
loader = TextLoader(file_path, autodetect_encoding=True)
elif file_content_type == "application/epub+zip":
loader = UnstructuredEPubLoader(file_path)
elif (
file_content_type
== "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
or file_ext == "docx"
):
loader = Docx2txtLoader(file_path)
elif file_content_type in [
"application/vnd.ms-excel",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
] or file_ext in ["xls", "xlsx"]:
loader = UnstructuredExcelLoader(file_path)
elif file_content_type in [
"application/vnd.ms-powerpoint",
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
] or file_ext in ["ppt", "pptx"]:
loader = UnstructuredPowerPointLoader(file_path)
elif file_ext == "msg":
loader = OutlookMessageLoader(file_path)
elif file_ext in known_source_ext or (
file_content_type and file_content_type.find("text/") >= 0
):
loader = TextLoader(file_path, autodetect_encoding=True)
else:
loader = TextLoader(file_path, autodetect_encoding=True)
return loader

View File

@@ -0,0 +1,117 @@
import logging
from typing import Any, Dict, Generator, List, Optional, Sequence, Union
from urllib.parse import parse_qs, urlparse
from langchain_core.documents import Document
from open_webui.env import SRC_LOG_LEVELS
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["RAG"])
ALLOWED_SCHEMES = {"http", "https"}
ALLOWED_NETLOCS = {
"youtu.be",
"m.youtube.com",
"youtube.com",
"www.youtube.com",
"www.youtube-nocookie.com",
"vid.plus",
}
def _parse_video_id(url: str) -> Optional[str]:
"""Parse a YouTube URL and return the video ID if valid, otherwise None."""
parsed_url = urlparse(url)
if parsed_url.scheme not in ALLOWED_SCHEMES:
return None
if parsed_url.netloc not in ALLOWED_NETLOCS:
return None
path = parsed_url.path
if path.endswith("/watch"):
query = parsed_url.query
parsed_query = parse_qs(query)
if "v" in parsed_query:
ids = parsed_query["v"]
video_id = ids if isinstance(ids, str) else ids[0]
else:
return None
else:
path = parsed_url.path.lstrip("/")
video_id = path.split("/")[-1]
if len(video_id) != 11: # Video IDs are 11 characters long
return None
return video_id
class YoutubeLoader:
"""Load `YouTube` video transcripts."""
def __init__(
self,
video_id: str,
language: Union[str, Sequence[str]] = "en",
proxy_url: Optional[str] = None,
):
"""Initialize with YouTube video ID."""
_video_id = _parse_video_id(video_id)
self.video_id = _video_id if _video_id is not None else video_id
self._metadata = {"source": video_id}
self.language = language
self.proxy_url = proxy_url
if isinstance(language, str):
self.language = [language]
else:
self.language = language
def load(self) -> List[Document]:
"""Load YouTube transcripts into `Document` objects."""
try:
from youtube_transcript_api import (
NoTranscriptFound,
TranscriptsDisabled,
YouTubeTranscriptApi,
)
except ImportError:
raise ImportError(
'Could not import "youtube_transcript_api" Python package. '
"Please install it with `pip install youtube-transcript-api`."
)
if self.proxy_url:
youtube_proxies = {
"http": self.proxy_url,
"https": self.proxy_url,
}
# Don't log complete URL because it might contain secrets
log.debug(f"Using proxy URL: {self.proxy_url[:14]}...")
else:
youtube_proxies = None
try:
transcript_list = YouTubeTranscriptApi.list_transcripts(
self.video_id, proxies=youtube_proxies
)
except Exception as e:
log.exception("Loading YouTube transcript failed")
return []
try:
transcript = transcript_list.find_transcript(self.language)
except NoTranscriptFound:
transcript = transcript_list.find_transcript(["en"])
transcript_pieces: List[Dict[str, Any]] = transcript.fetch()
transcript = " ".join(
map(
lambda transcript_piece: transcript_piece["text"].strip(" "),
transcript_pieces,
)
)
return [Document(page_content=transcript, metadata=self._metadata)]

View File

@@ -0,0 +1,81 @@
import os
import torch
import numpy as np
from colbert.infra import ColBERTConfig
from colbert.modeling.checkpoint import Checkpoint
class ColBERT:
def __init__(self, name, **kwargs) -> None:
print("ColBERT: Loading model", name)
self.device = "cuda" if torch.cuda.is_available() else "cpu"
DOCKER = kwargs.get("env") == "docker"
if DOCKER:
# This is a workaround for the issue with the docker container
# where the torch extension is not loaded properly
# and the following error is thrown:
# /root/.cache/torch_extensions/py311_cpu/segmented_maxsim_cpp/segmented_maxsim_cpp.so: cannot open shared object file: No such file or directory
lock_file = (
"/root/.cache/torch_extensions/py311_cpu/segmented_maxsim_cpp/lock"
)
if os.path.exists(lock_file):
os.remove(lock_file)
self.ckpt = Checkpoint(
name,
colbert_config=ColBERTConfig(model_name=name),
).to(self.device)
pass
def calculate_similarity_scores(self, query_embeddings, document_embeddings):
query_embeddings = query_embeddings.to(self.device)
document_embeddings = document_embeddings.to(self.device)
# Validate dimensions to ensure compatibility
if query_embeddings.dim() != 3:
raise ValueError(
f"Expected query embeddings to have 3 dimensions, but got {query_embeddings.dim()}."
)
if document_embeddings.dim() != 3:
raise ValueError(
f"Expected document embeddings to have 3 dimensions, but got {document_embeddings.dim()}."
)
if query_embeddings.size(0) not in [1, document_embeddings.size(0)]:
raise ValueError(
"There should be either one query or queries equal to the number of documents."
)
# Transpose the query embeddings to align for matrix multiplication
transposed_query_embeddings = query_embeddings.permute(0, 2, 1)
# Compute similarity scores using batch matrix multiplication
computed_scores = torch.matmul(document_embeddings, transposed_query_embeddings)
# Apply max pooling to extract the highest semantic similarity across each document's sequence
maximum_scores = torch.max(computed_scores, dim=1).values
# Sum up the maximum scores across features to get the overall document relevance scores
final_scores = maximum_scores.sum(dim=1)
normalized_scores = torch.softmax(final_scores, dim=0)
return normalized_scores.detach().cpu().numpy().astype(np.float32)
def predict(self, sentences):
query = sentences[0][0]
docs = [i[1] for i in sentences]
# Embedding the documents
embedded_docs = self.ckpt.docFromText(docs, bsize=32)[0]
# Embedding the queries
embedded_queries = self.ckpt.queryFromText([query], bsize=32)
embedded_query = embedded_queries[0]
# Calculate retrieval scores for the query against all documents
scores = self.calculate_similarity_scores(
embedded_query.unsqueeze(0), embedded_docs
)
return scores

View File

@@ -1,50 +1,79 @@
import os
import logging
import os
import uuid
from typing import Optional, Union
import asyncio
import requests
from typing import List, Union
from apps.ollama.main import (
generate_ollama_embeddings,
GenerateEmbeddingsForm,
)
from huggingface_hub import snapshot_download
from langchain_core.documents import Document
from langchain.retrievers import ContextualCompressionRetriever, EnsembleRetriever
from langchain_community.retrievers import BM25Retriever
from langchain.retrievers import (
ContextualCompressionRetriever,
EnsembleRetriever,
)
from langchain_core.documents import Document
from typing import Optional
from open_webui.apps.retrieval.vector.connector import VECTOR_DB_CLIENT
from open_webui.utils.misc import get_last_user_message
from utils.misc import get_last_user_message, add_or_update_system_message
from config import SRC_LOG_LEVELS, CHROMA_CLIENT
from open_webui.env import SRC_LOG_LEVELS
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["RAG"])
from typing import Any
from langchain_core.callbacks import CallbackManagerForRetrieverRun
from langchain_core.retrievers import BaseRetriever
class VectorSearchRetriever(BaseRetriever):
collection_name: Any
embedding_function: Any
top_k: int
def _get_relevant_documents(
self,
query: str,
*,
run_manager: CallbackManagerForRetrieverRun,
) -> list[Document]:
result = VECTOR_DB_CLIENT.search(
collection_name=self.collection_name,
vectors=[self.embedding_function(query)],
limit=self.top_k,
)
ids = result.ids[0]
metadatas = result.metadatas[0]
documents = result.documents[0]
results = []
for idx in range(len(ids)):
results.append(
Document(
metadata=metadatas[idx],
page_content=documents[idx],
)
)
return results
def query_doc(
collection_name: str,
query: str,
embedding_function,
query_embedding: list[float],
k: int,
):
try:
collection = CHROMA_CLIENT.get_collection(name=collection_name)
query_embeddings = embedding_function(query)
result = collection.query(
query_embeddings=[query_embeddings],
n_results=k,
result = VECTOR_DB_CLIENT.search(
collection_name=collection_name,
vectors=[query_embedding],
limit=k,
)
log.info(f"query_doc:result {result}")
log.info(f"query_doc:result {result.ids} {result.metadatas}")
return result
except Exception as e:
print(e)
raise e
@@ -55,27 +84,25 @@ def query_doc_with_hybrid_search(
k: int,
reranking_function,
r: float,
):
) -> dict:
try:
collection = CHROMA_CLIENT.get_collection(name=collection_name)
documents = collection.get() # get all documents
result = VECTOR_DB_CLIENT.get(collection_name=collection_name)
bm25_retriever = BM25Retriever.from_texts(
texts=documents.get("documents"),
metadatas=documents.get("metadatas"),
texts=result.documents[0],
metadatas=result.metadatas[0],
)
bm25_retriever.k = k
chroma_retriever = ChromaRetriever(
collection=collection,
vector_search_retriever = VectorSearchRetriever(
collection_name=collection_name,
embedding_function=embedding_function,
top_n=k,
top_k=k,
)
ensemble_retriever = EnsembleRetriever(
retrievers=[bm25_retriever, chroma_retriever], weights=[0.5, 0.5]
retrievers=[bm25_retriever, vector_search_retriever], weights=[0.5, 0.5]
)
compressor = RerankCompressor(
embedding_function=embedding_function,
top_n=k,
@@ -94,13 +121,18 @@ def query_doc_with_hybrid_search(
"metadatas": [[d.metadata for d in result]],
}
log.info(f"query_doc_with_hybrid_search:result {result}")
log.info(
"query_doc_with_hybrid_search:result "
+ f'{result["metadatas"]} {result["distances"]}'
)
return result
except Exception as e:
raise e
def merge_and_sort_query_results(query_results, k, reverse=False):
def merge_and_sort_query_results(
query_results: list[dict], k: int, reverse: bool = False
) -> list[dict]:
# Initialize lists to store combined data
combined_distances = []
combined_documents = []
@@ -142,182 +174,197 @@ def merge_and_sort_query_results(query_results, k, reverse=False):
def query_collection(
collection_names: List[str],
query: str,
collection_names: list[str],
queries: list[str],
embedding_function,
k: int,
):
) -> dict:
results = []
for collection_name in collection_names:
try:
result = query_doc(
collection_name=collection_name,
query=query,
k=k,
embedding_function=embedding_function,
)
results.append(result)
except:
pass
for query in queries:
query_embedding = embedding_function(query)
for collection_name in collection_names:
if collection_name:
try:
result = query_doc(
collection_name=collection_name,
k=k,
query_embedding=query_embedding,
)
if result is not None:
results.append(result.model_dump())
except Exception as e:
log.exception(f"Error when querying the collection: {e}")
else:
pass
return merge_and_sort_query_results(results, k=k)
def query_collection_with_hybrid_search(
collection_names: List[str],
query: str,
collection_names: list[str],
queries: list[str],
embedding_function,
k: int,
reranking_function,
r: float,
):
) -> dict:
results = []
error = False
for collection_name in collection_names:
try:
result = query_doc_with_hybrid_search(
collection_name=collection_name,
query=query,
embedding_function=embedding_function,
k=k,
reranking_function=reranking_function,
r=r,
for query in queries:
result = query_doc_with_hybrid_search(
collection_name=collection_name,
query=query,
embedding_function=embedding_function,
k=k,
reranking_function=reranking_function,
r=r,
)
results.append(result)
except Exception as e:
log.exception(
"Error when querying the collection with " f"hybrid_search: {e}"
)
results.append(result)
except:
pass
error = True
if error:
raise Exception(
"Hybrid search failed for all collections. Using Non hybrid search as fallback."
)
return merge_and_sort_query_results(results, k=k, reverse=True)
def rag_template(template: str, context: str, query: str):
template = template.replace("[context]", context)
template = template.replace("[query]", query)
return template
def get_embedding_function(
embedding_engine,
embedding_model,
embedding_function,
openai_key,
openai_url,
batch_size,
url,
key,
embedding_batch_size,
):
if embedding_engine == "":
return lambda query: embedding_function.encode(query).tolist()
elif embedding_engine in ["ollama", "openai"]:
if embedding_engine == "ollama":
func = lambda query: generate_ollama_embeddings(
GenerateEmbeddingsForm(
**{
"model": embedding_model,
"prompt": query,
}
)
)
elif embedding_engine == "openai":
func = lambda query: generate_openai_embeddings(
model=embedding_model,
text=query,
key=openai_key,
url=openai_url,
)
func = lambda query: generate_embeddings(
engine=embedding_engine,
model=embedding_model,
text=query,
url=url,
key=key,
)
def generate_multiple(query, f):
def generate_multiple(query, func):
if isinstance(query, list):
if embedding_engine == "openai":
embeddings = []
for i in range(0, len(query), batch_size):
embeddings.extend(f(query[i : i + batch_size]))
return embeddings
else:
return [f(q) for q in query]
embeddings = []
for i in range(0, len(query), embedding_batch_size):
embeddings.extend(func(query[i : i + embedding_batch_size]))
return embeddings
else:
return f(query)
return func(query)
return lambda query: generate_multiple(query, func)
def get_rag_context(
def get_sources_from_files(
files,
messages,
queries,
embedding_function,
k,
reranking_function,
r,
hybrid_search,
):
log.debug(f"files: {files} {messages} {embedding_function} {reranking_function}")
query = get_last_user_message(messages)
log.debug(f"files: {files} {queries} {embedding_function} {reranking_function}")
extracted_collections = []
relevant_contexts = []
for file in files:
context = None
collection_names = (
file["collection_names"]
if file["type"] == "collection"
else [file["collection_name"]]
)
collection_names = set(collection_names).difference(extracted_collections)
if not collection_names:
log.debug(f"skipping {file} as it has already been extracted")
continue
try:
if file["type"] == "text":
context = file["content"]
else:
if hybrid_search:
context = query_collection_with_hybrid_search(
collection_names=collection_names,
query=query,
embedding_function=embedding_function,
k=k,
reranking_function=reranking_function,
r=r,
)
else:
context = query_collection(
collection_names=collection_names,
query=query,
embedding_function=embedding_function,
k=k,
)
except Exception as e:
log.exception(e)
if file.get("context") == "full":
context = {
"documents": [[file.get("file").get("data", {}).get("content")]],
"metadatas": [[{"file_id": file.get("id"), "name": file.get("name")}]],
}
else:
context = None
collection_names = []
if file.get("type") == "collection":
if file.get("legacy"):
collection_names = file.get("collection_names", [])
else:
collection_names.append(file["id"])
elif file.get("collection_name"):
collection_names.append(file["collection_name"])
elif file.get("id"):
if file.get("legacy"):
collection_names.append(f"{file['id']}")
else:
collection_names.append(f"file-{file['id']}")
collection_names = set(collection_names).difference(extracted_collections)
if not collection_names:
log.debug(f"skipping {file} as it has already been extracted")
continue
try:
context = None
if file.get("type") == "text":
context = file["content"]
else:
if hybrid_search:
try:
context = query_collection_with_hybrid_search(
collection_names=collection_names,
queries=queries,
embedding_function=embedding_function,
k=k,
reranking_function=reranking_function,
r=r,
)
except Exception as e:
log.debug(
"Error when using hybrid search, using"
" non hybrid search as fallback."
)
if (not hybrid_search) or (context is None):
context = query_collection(
collection_names=collection_names,
queries=queries,
embedding_function=embedding_function,
k=k,
)
except Exception as e:
log.exception(e)
extracted_collections.extend(collection_names)
if context:
relevant_contexts.append({**context, "source": file})
extracted_collections.extend(collection_names)
contexts = []
citations = []
if "data" in file:
del file["data"]
relevant_contexts.append({**context, "file": file})
sources = []
for context in relevant_contexts:
try:
if "documents" in context:
contexts.append(
"\n\n".join(
[text for text in context["documents"][0] if text is not None]
)
)
if "metadatas" in context:
citations.append(
{
"source": context["source"],
"document": context["documents"][0],
"metadata": context["metadatas"][0],
}
)
source = {
"source": context["file"],
"document": context["documents"][0],
"metadata": context["metadatas"][0],
}
if "distances" in context and context["distances"]:
source["distances"] = context["distances"][0]
sources.append(source)
except Exception as e:
log.exception(e)
return contexts, citations
return sources
def get_model_path(model: str, update_model: bool = False):
@@ -358,22 +405,8 @@ def get_model_path(model: str, update_model: bool = False):
return model
def generate_openai_embeddings(
model: str,
text: Union[str, list[str]],
key: str,
url: str = "https://api.openai.com/v1",
):
if isinstance(text, list):
embeddings = generate_openai_batch_embeddings(model, text, key, url)
else:
embeddings = generate_openai_batch_embeddings(model, [text], key, url)
return embeddings[0] if isinstance(text, str) else embeddings
def generate_openai_batch_embeddings(
model: str, texts: list[str], key: str, url: str = "https://api.openai.com/v1"
model: str, texts: list[str], url: str = "https://api.openai.com/v1", key: str = ""
) -> Optional[list[list[float]]]:
try:
r = requests.post(
@@ -395,52 +428,58 @@ def generate_openai_batch_embeddings(
return None
from typing import Any
from langchain_core.retrievers import BaseRetriever
from langchain_core.callbacks import CallbackManagerForRetrieverRun
class ChromaRetriever(BaseRetriever):
collection: Any
embedding_function: Any
top_n: int
def _get_relevant_documents(
self,
query: str,
*,
run_manager: CallbackManagerForRetrieverRun,
) -> List[Document]:
query_embeddings = self.embedding_function(query)
results = self.collection.query(
query_embeddings=[query_embeddings],
n_results=self.top_n,
def generate_ollama_batch_embeddings(
model: str, texts: list[str], url: str, key: str = ""
) -> Optional[list[list[float]]]:
try:
r = requests.post(
f"{url}/api/embed",
headers={
"Content-Type": "application/json",
"Authorization": f"Bearer {key}",
},
json={"input": texts, "model": model},
)
r.raise_for_status()
data = r.json()
ids = results["ids"][0]
metadatas = results["metadatas"][0]
documents = results["documents"][0]
if "embeddings" in data:
return data["embeddings"]
else:
raise "Something went wrong :/"
except Exception as e:
print(e)
return None
results = []
for idx in range(len(ids)):
results.append(
Document(
metadata=metadatas[idx],
page_content=documents[idx],
)
def generate_embeddings(engine: str, model: str, text: Union[str, list[str]], **kwargs):
url = kwargs.get("url", "")
key = kwargs.get("key", "")
if engine == "ollama":
if isinstance(text, list):
embeddings = generate_ollama_batch_embeddings(
**{"model": model, "texts": text, "url": url, "key": key}
)
return results
else:
embeddings = generate_ollama_batch_embeddings(
**{"model": model, "texts": [text], "url": url, "key": key}
)
return embeddings[0] if isinstance(text, str) else embeddings
elif engine == "openai":
if isinstance(text, list):
embeddings = generate_openai_batch_embeddings(model, text, url, key)
else:
embeddings = generate_openai_batch_embeddings(model, [text], url, key)
return embeddings[0] if isinstance(text, str) else embeddings
import operator
from typing import Optional, Sequence
from langchain_core.documents import BaseDocumentCompressor, Document
from langchain_core.callbacks import Callbacks
from langchain_core.pydantic_v1 import Extra
from langchain_core.documents import BaseDocumentCompressor, Document
class RerankCompressor(BaseDocumentCompressor):
@@ -450,7 +489,7 @@ class RerankCompressor(BaseDocumentCompressor):
r_score: float
class Config:
extra = Extra.forbid
extra = "forbid"
arbitrary_types_allowed = True
def compress_documents(

View File

@@ -0,0 +1,22 @@
from open_webui.config import VECTOR_DB
if VECTOR_DB == "milvus":
from open_webui.apps.retrieval.vector.dbs.milvus import MilvusClient
VECTOR_DB_CLIENT = MilvusClient()
elif VECTOR_DB == "qdrant":
from open_webui.apps.retrieval.vector.dbs.qdrant import QdrantClient
VECTOR_DB_CLIENT = QdrantClient()
elif VECTOR_DB == "opensearch":
from open_webui.apps.retrieval.vector.dbs.opensearch import OpenSearchClient
VECTOR_DB_CLIENT = OpenSearchClient()
elif VECTOR_DB == "pgvector":
from open_webui.apps.retrieval.vector.dbs.pgvector import PgvectorClient
VECTOR_DB_CLIENT = PgvectorClient()
else:
from open_webui.apps.retrieval.vector.dbs.chroma import ChromaClient
VECTOR_DB_CLIENT = ChromaClient()

View File

@@ -0,0 +1,174 @@
import chromadb
from chromadb import Settings
from chromadb.utils.batch_utils import create_batches
from typing import Optional
from open_webui.apps.retrieval.vector.main import VectorItem, SearchResult, GetResult
from open_webui.config import (
CHROMA_DATA_PATH,
CHROMA_HTTP_HOST,
CHROMA_HTTP_PORT,
CHROMA_HTTP_HEADERS,
CHROMA_HTTP_SSL,
CHROMA_TENANT,
CHROMA_DATABASE,
CHROMA_CLIENT_AUTH_PROVIDER,
CHROMA_CLIENT_AUTH_CREDENTIALS,
)
class ChromaClient:
def __init__(self):
settings_dict = {
"allow_reset": True,
"anonymized_telemetry": False,
}
if CHROMA_CLIENT_AUTH_PROVIDER is not None:
settings_dict["chroma_client_auth_provider"] = CHROMA_CLIENT_AUTH_PROVIDER
if CHROMA_CLIENT_AUTH_CREDENTIALS is not None:
settings_dict["chroma_client_auth_credentials"] = (
CHROMA_CLIENT_AUTH_CREDENTIALS
)
if CHROMA_HTTP_HOST != "":
self.client = chromadb.HttpClient(
host=CHROMA_HTTP_HOST,
port=CHROMA_HTTP_PORT,
headers=CHROMA_HTTP_HEADERS,
ssl=CHROMA_HTTP_SSL,
tenant=CHROMA_TENANT,
database=CHROMA_DATABASE,
settings=Settings(**settings_dict),
)
else:
self.client = chromadb.PersistentClient(
path=CHROMA_DATA_PATH,
settings=Settings(**settings_dict),
tenant=CHROMA_TENANT,
database=CHROMA_DATABASE,
)
def has_collection(self, collection_name: str) -> bool:
# Check if the collection exists based on the collection name.
collections = self.client.list_collections()
return collection_name in [collection.name for collection in collections]
def delete_collection(self, collection_name: str):
# Delete the collection based on the collection name.
return self.client.delete_collection(name=collection_name)
def search(
self, collection_name: str, vectors: list[list[float | int]], limit: int
) -> Optional[SearchResult]:
# Search for the nearest neighbor items based on the vectors and return 'limit' number of results.
try:
collection = self.client.get_collection(name=collection_name)
if collection:
result = collection.query(
query_embeddings=vectors,
n_results=limit,
)
return SearchResult(
**{
"ids": result["ids"],
"distances": result["distances"],
"documents": result["documents"],
"metadatas": result["metadatas"],
}
)
return None
except Exception as e:
return None
def query(
self, collection_name: str, filter: dict, limit: Optional[int] = None
) -> Optional[GetResult]:
# Query the items from the collection based on the filter.
try:
collection = self.client.get_collection(name=collection_name)
if collection:
result = collection.get(
where=filter,
limit=limit,
)
return GetResult(
**{
"ids": [result["ids"]],
"documents": [result["documents"]],
"metadatas": [result["metadatas"]],
}
)
return None
except Exception as e:
print(e)
return None
def get(self, collection_name: str) -> Optional[GetResult]:
# Get all the items in the collection.
collection = self.client.get_collection(name=collection_name)
if collection:
result = collection.get()
return GetResult(
**{
"ids": [result["ids"]],
"documents": [result["documents"]],
"metadatas": [result["metadatas"]],
}
)
return None
def insert(self, collection_name: str, items: list[VectorItem]):
# Insert the items into the collection, if the collection does not exist, it will be created.
collection = self.client.get_or_create_collection(
name=collection_name, metadata={"hnsw:space": "cosine"}
)
ids = [item["id"] for item in items]
documents = [item["text"] for item in items]
embeddings = [item["vector"] for item in items]
metadatas = [item["metadata"] for item in items]
for batch in create_batches(
api=self.client,
documents=documents,
embeddings=embeddings,
ids=ids,
metadatas=metadatas,
):
collection.add(*batch)
def upsert(self, collection_name: str, items: list[VectorItem]):
# Update the items in the collection, if the items are not present, insert them. If the collection does not exist, it will be created.
collection = self.client.get_or_create_collection(
name=collection_name, metadata={"hnsw:space": "cosine"}
)
ids = [item["id"] for item in items]
documents = [item["text"] for item in items]
embeddings = [item["vector"] for item in items]
metadatas = [item["metadata"] for item in items]
collection.upsert(
ids=ids, documents=documents, embeddings=embeddings, metadatas=metadatas
)
def delete(
self,
collection_name: str,
ids: Optional[list[str]] = None,
filter: Optional[dict] = None,
):
# Delete the items from the collection based on the ids.
collection = self.client.get_collection(name=collection_name)
if collection:
if ids:
collection.delete(ids=ids)
elif filter:
collection.delete(where=filter)
def reset(self):
# Resets the database. This will delete all collections and item entries.
return self.client.reset()

View File

@@ -0,0 +1,286 @@
from pymilvus import MilvusClient as Client
from pymilvus import FieldSchema, DataType
import json
from typing import Optional
from open_webui.apps.retrieval.vector.main import VectorItem, SearchResult, GetResult
from open_webui.config import (
MILVUS_URI,
)
class MilvusClient:
def __init__(self):
self.collection_prefix = "open_webui"
self.client = Client(uri=MILVUS_URI)
def _result_to_get_result(self, result) -> GetResult:
ids = []
documents = []
metadatas = []
for match in result:
_ids = []
_documents = []
_metadatas = []
for item in match:
_ids.append(item.get("id"))
_documents.append(item.get("data", {}).get("text"))
_metadatas.append(item.get("metadata"))
ids.append(_ids)
documents.append(_documents)
metadatas.append(_metadatas)
return GetResult(
**{
"ids": ids,
"documents": documents,
"metadatas": metadatas,
}
)
def _result_to_search_result(self, result) -> SearchResult:
ids = []
distances = []
documents = []
metadatas = []
for match in result:
_ids = []
_distances = []
_documents = []
_metadatas = []
for item in match:
_ids.append(item.get("id"))
_distances.append(item.get("distance"))
_documents.append(item.get("entity", {}).get("data", {}).get("text"))
_metadatas.append(item.get("entity", {}).get("metadata"))
ids.append(_ids)
distances.append(_distances)
documents.append(_documents)
metadatas.append(_metadatas)
return SearchResult(
**{
"ids": ids,
"distances": distances,
"documents": documents,
"metadatas": metadatas,
}
)
def _create_collection(self, collection_name: str, dimension: int):
schema = self.client.create_schema(
auto_id=False,
enable_dynamic_field=True,
)
schema.add_field(
field_name="id",
datatype=DataType.VARCHAR,
is_primary=True,
max_length=65535,
)
schema.add_field(
field_name="vector",
datatype=DataType.FLOAT_VECTOR,
dim=dimension,
description="vector",
)
schema.add_field(field_name="data", datatype=DataType.JSON, description="data")
schema.add_field(
field_name="metadata", datatype=DataType.JSON, description="metadata"
)
index_params = self.client.prepare_index_params()
index_params.add_index(
field_name="vector",
index_type="HNSW",
metric_type="COSINE",
params={"M": 16, "efConstruction": 100},
)
self.client.create_collection(
collection_name=f"{self.collection_prefix}_{collection_name}",
schema=schema,
index_params=index_params,
)
def has_collection(self, collection_name: str) -> bool:
# Check if the collection exists based on the collection name.
collection_name = collection_name.replace("-", "_")
return self.client.has_collection(
collection_name=f"{self.collection_prefix}_{collection_name}"
)
def delete_collection(self, collection_name: str):
# Delete the collection based on the collection name.
collection_name = collection_name.replace("-", "_")
return self.client.drop_collection(
collection_name=f"{self.collection_prefix}_{collection_name}"
)
def search(
self, collection_name: str, vectors: list[list[float | int]], limit: int
) -> Optional[SearchResult]:
# Search for the nearest neighbor items based on the vectors and return 'limit' number of results.
collection_name = collection_name.replace("-", "_")
result = self.client.search(
collection_name=f"{self.collection_prefix}_{collection_name}",
data=vectors,
limit=limit,
output_fields=["data", "metadata"],
)
return self._result_to_search_result(result)
def query(self, collection_name: str, filter: dict, limit: Optional[int] = None):
# Construct the filter string for querying
collection_name = collection_name.replace("-", "_")
if not self.has_collection(collection_name):
return None
filter_string = " && ".join(
[
f'metadata["{key}"] == {json.dumps(value)}'
for key, value in filter.items()
]
)
max_limit = 16383 # The maximum number of records per request
all_results = []
if limit is None:
limit = float("inf") # Use infinity as a placeholder for no limit
# Initialize offset and remaining to handle pagination
offset = 0
remaining = limit
try:
# Loop until there are no more items to fetch or the desired limit is reached
while remaining > 0:
print("remaining", remaining)
current_fetch = min(
max_limit, remaining
) # Determine how many items to fetch in this iteration
results = self.client.query(
collection_name=f"{self.collection_prefix}_{collection_name}",
filter=filter_string,
output_fields=["*"],
limit=current_fetch,
offset=offset,
)
if not results:
break
all_results.extend(results)
results_count = len(results)
remaining -= (
results_count # Decrease remaining by the number of items fetched
)
offset += results_count
# Break the loop if the results returned are less than the requested fetch count
if results_count < current_fetch:
break
print(all_results)
return self._result_to_get_result([all_results])
except Exception as e:
print(e)
return None
def get(self, collection_name: str) -> Optional[GetResult]:
# Get all the items in the collection.
collection_name = collection_name.replace("-", "_")
result = self.client.query(
collection_name=f"{self.collection_prefix}_{collection_name}",
filter='id != ""',
)
return self._result_to_get_result([result])
def insert(self, collection_name: str, items: list[VectorItem]):
# Insert the items into the collection, if the collection does not exist, it will be created.
collection_name = collection_name.replace("-", "_")
if not self.client.has_collection(
collection_name=f"{self.collection_prefix}_{collection_name}"
):
self._create_collection(
collection_name=collection_name, dimension=len(items[0]["vector"])
)
return self.client.insert(
collection_name=f"{self.collection_prefix}_{collection_name}",
data=[
{
"id": item["id"],
"vector": item["vector"],
"data": {"text": item["text"]},
"metadata": item["metadata"],
}
for item in items
],
)
def upsert(self, collection_name: str, items: list[VectorItem]):
# Update the items in the collection, if the items are not present, insert them. If the collection does not exist, it will be created.
collection_name = collection_name.replace("-", "_")
if not self.client.has_collection(
collection_name=f"{self.collection_prefix}_{collection_name}"
):
self._create_collection(
collection_name=collection_name, dimension=len(items[0]["vector"])
)
return self.client.upsert(
collection_name=f"{self.collection_prefix}_{collection_name}",
data=[
{
"id": item["id"],
"vector": item["vector"],
"data": {"text": item["text"]},
"metadata": item["metadata"],
}
for item in items
],
)
def delete(
self,
collection_name: str,
ids: Optional[list[str]] = None,
filter: Optional[dict] = None,
):
# Delete the items from the collection based on the ids.
collection_name = collection_name.replace("-", "_")
if ids:
return self.client.delete(
collection_name=f"{self.collection_prefix}_{collection_name}",
ids=ids,
)
elif filter:
# Convert the filter dictionary to a string using JSON_CONTAINS.
filter_string = " && ".join(
[
f'metadata["{key}"] == {json.dumps(value)}'
for key, value in filter.items()
]
)
return self.client.delete(
collection_name=f"{self.collection_prefix}_{collection_name}",
filter=filter_string,
)
def reset(self):
# Resets the database. This will delete all collections and item entries.
collection_names = self.client.list_collections()
for collection_name in collection_names:
if collection_name.startswith(self.collection_prefix):
self.client.drop_collection(collection_name=collection_name)

View File

@@ -0,0 +1,178 @@
from opensearchpy import OpenSearch
from typing import Optional
from open_webui.apps.retrieval.vector.main import VectorItem, SearchResult, GetResult
from open_webui.config import (
OPENSEARCH_URI,
OPENSEARCH_SSL,
OPENSEARCH_CERT_VERIFY,
OPENSEARCH_USERNAME,
OPENSEARCH_PASSWORD,
)
class OpenSearchClient:
def __init__(self):
self.index_prefix = "open_webui"
self.client = OpenSearch(
hosts=[OPENSEARCH_URI],
use_ssl=OPENSEARCH_SSL,
verify_certs=OPENSEARCH_CERT_VERIFY,
http_auth=(OPENSEARCH_USERNAME, OPENSEARCH_PASSWORD),
)
def _result_to_get_result(self, result) -> GetResult:
ids = []
documents = []
metadatas = []
for hit in result["hits"]["hits"]:
ids.append(hit["_id"])
documents.append(hit["_source"].get("text"))
metadatas.append(hit["_source"].get("metadata"))
return GetResult(ids=ids, documents=documents, metadatas=metadatas)
def _result_to_search_result(self, result) -> SearchResult:
ids = []
distances = []
documents = []
metadatas = []
for hit in result["hits"]["hits"]:
ids.append(hit["_id"])
distances.append(hit["_score"])
documents.append(hit["_source"].get("text"))
metadatas.append(hit["_source"].get("metadata"))
return SearchResult(
ids=ids, distances=distances, documents=documents, metadatas=metadatas
)
def _create_index(self, index_name: str, dimension: int):
body = {
"mappings": {
"properties": {
"id": {"type": "keyword"},
"vector": {
"type": "dense_vector",
"dims": dimension, # Adjust based on your vector dimensions
"index": true,
"similarity": "faiss",
"method": {
"name": "hnsw",
"space_type": "ip", # Use inner product to approximate cosine similarity
"engine": "faiss",
"ef_construction": 128,
"m": 16,
},
},
"text": {"type": "text"},
"metadata": {"type": "object"},
}
}
}
self.client.indices.create(index=f"{self.index_prefix}_{index_name}", body=body)
def _create_batches(self, items: list[VectorItem], batch_size=100):
for i in range(0, len(items), batch_size):
yield items[i : i + batch_size]
def has_collection(self, index_name: str) -> bool:
# has_collection here means has index.
# We are simply adapting to the norms of the other DBs.
return self.client.indices.exists(index=f"{self.index_prefix}_{index_name}")
def delete_colleciton(self, index_name: str):
# delete_collection here means delete index.
# We are simply adapting to the norms of the other DBs.
self.client.indices.delete(index=f"{self.index_prefix}_{index_name}")
def search(
self, index_name: str, vectors: list[list[float]], limit: int
) -> Optional[SearchResult]:
query = {
"size": limit,
"_source": ["text", "metadata"],
"query": {
"script_score": {
"query": {"match_all": {}},
"script": {
"source": "cosineSimilarity(params.vector, 'vector') + 1.0",
"params": {
"vector": vectors[0]
}, # Assuming single query vector
},
}
},
}
result = self.client.search(
index=f"{self.index_prefix}_{index_name}", body=query
)
return self._result_to_search_result(result)
def get_or_create_index(self, index_name: str, dimension: int):
if not self.has_index(index_name):
self._create_index(index_name, dimension)
def get(self, index_name: str) -> Optional[GetResult]:
query = {"query": {"match_all": {}}, "_source": ["text", "metadata"]}
result = self.client.search(
index=f"{self.index_prefix}_{index_name}", body=query
)
return self._result_to_get_result(result)
def insert(self, index_name: str, items: list[VectorItem]):
if not self.has_index(index_name):
self._create_index(index_name, dimension=len(items[0]["vector"]))
for batch in self._create_batches(items):
actions = [
{
"index": {
"_id": item["id"],
"_source": {
"vector": item["vector"],
"text": item["text"],
"metadata": item["metadata"],
},
}
}
for item in batch
]
self.client.bulk(actions)
def upsert(self, index_name: str, items: list[VectorItem]):
if not self.has_index(index_name):
self._create_index(index_name, dimension=len(items[0]["vector"]))
for batch in self._create_batches(items):
actions = [
{
"index": {
"_id": item["id"],
"_source": {
"vector": item["vector"],
"text": item["text"],
"metadata": item["metadata"],
},
}
}
for item in batch
]
self.client.bulk(actions)
def delete(self, index_name: str, ids: list[str]):
actions = [
{"delete": {"_index": f"{self.index_prefix}_{index_name}", "_id": id}}
for id in ids
]
self.client.bulk(body=actions)
def reset(self):
indices = self.client.indices.get(index=f"{self.index_prefix}_*")
for index in indices:
self.client.indices.delete(index=index)

View File

@@ -0,0 +1,354 @@
from typing import Optional, List, Dict, Any
from sqlalchemy import (
cast,
column,
create_engine,
Column,
Integer,
select,
text,
Text,
values,
)
from sqlalchemy.sql import true
from sqlalchemy.pool import NullPool
from sqlalchemy.orm import declarative_base, scoped_session, sessionmaker
from sqlalchemy.dialects.postgresql import JSONB, array
from pgvector.sqlalchemy import Vector
from sqlalchemy.ext.mutable import MutableDict
from open_webui.apps.retrieval.vector.main import VectorItem, SearchResult, GetResult
from open_webui.config import PGVECTOR_DB_URL
VECTOR_LENGTH = 1536
Base = declarative_base()
class DocumentChunk(Base):
__tablename__ = "document_chunk"
id = Column(Text, primary_key=True)
vector = Column(Vector(dim=VECTOR_LENGTH), nullable=True)
collection_name = Column(Text, nullable=False)
text = Column(Text, nullable=True)
vmetadata = Column(MutableDict.as_mutable(JSONB), nullable=True)
class PgvectorClient:
def __init__(self) -> None:
# if no pgvector uri, use the existing database connection
if not PGVECTOR_DB_URL:
from open_webui.apps.webui.internal.db import Session
self.session = Session
else:
engine = create_engine(
PGVECTOR_DB_URL, pool_pre_ping=True, poolclass=NullPool
)
SessionLocal = sessionmaker(
autocommit=False, autoflush=False, bind=engine, expire_on_commit=False
)
self.session = scoped_session(SessionLocal)
try:
# Ensure the pgvector extension is available
self.session.execute(text("CREATE EXTENSION IF NOT EXISTS vector;"))
# Create the tables if they do not exist
# Base.metadata.create_all requires a bind (engine or connection)
# Get the connection from the session
connection = self.session.connection()
Base.metadata.create_all(bind=connection)
# Create an index on the vector column if it doesn't exist
self.session.execute(
text(
"CREATE INDEX IF NOT EXISTS idx_document_chunk_vector "
"ON document_chunk USING ivfflat (vector vector_cosine_ops) WITH (lists = 100);"
)
)
self.session.execute(
text(
"CREATE INDEX IF NOT EXISTS idx_document_chunk_collection_name "
"ON document_chunk (collection_name);"
)
)
self.session.commit()
print("Initialization complete.")
except Exception as e:
self.session.rollback()
print(f"Error during initialization: {e}")
raise
def adjust_vector_length(self, vector: List[float]) -> List[float]:
# Adjust vector to have length VECTOR_LENGTH
current_length = len(vector)
if current_length < VECTOR_LENGTH:
# Pad the vector with zeros
vector += [0.0] * (VECTOR_LENGTH - current_length)
elif current_length > VECTOR_LENGTH:
raise Exception(
f"Vector length {current_length} not supported. Max length must be <= {VECTOR_LENGTH}"
)
return vector
def insert(self, collection_name: str, items: List[VectorItem]) -> None:
try:
new_items = []
for item in items:
vector = self.adjust_vector_length(item["vector"])
new_chunk = DocumentChunk(
id=item["id"],
vector=vector,
collection_name=collection_name,
text=item["text"],
vmetadata=item["metadata"],
)
new_items.append(new_chunk)
self.session.bulk_save_objects(new_items)
self.session.commit()
print(
f"Inserted {len(new_items)} items into collection '{collection_name}'."
)
except Exception as e:
self.session.rollback()
print(f"Error during insert: {e}")
raise
def upsert(self, collection_name: str, items: List[VectorItem]) -> None:
try:
for item in items:
vector = self.adjust_vector_length(item["vector"])
existing = (
self.session.query(DocumentChunk)
.filter(DocumentChunk.id == item["id"])
.first()
)
if existing:
existing.vector = vector
existing.text = item["text"]
existing.vmetadata = item["metadata"]
existing.collection_name = (
collection_name # Update collection_name if necessary
)
else:
new_chunk = DocumentChunk(
id=item["id"],
vector=vector,
collection_name=collection_name,
text=item["text"],
vmetadata=item["metadata"],
)
self.session.add(new_chunk)
self.session.commit()
print(f"Upserted {len(items)} items into collection '{collection_name}'.")
except Exception as e:
self.session.rollback()
print(f"Error during upsert: {e}")
raise
def search(
self,
collection_name: str,
vectors: List[List[float]],
limit: Optional[int] = None,
) -> Optional[SearchResult]:
try:
if not vectors:
return None
# Adjust query vectors to VECTOR_LENGTH
vectors = [self.adjust_vector_length(vector) for vector in vectors]
num_queries = len(vectors)
def vector_expr(vector):
return cast(array(vector), Vector(VECTOR_LENGTH))
# Create the values for query vectors
qid_col = column("qid", Integer)
q_vector_col = column("q_vector", Vector(VECTOR_LENGTH))
query_vectors = (
values(qid_col, q_vector_col)
.data(
[(idx, vector_expr(vector)) for idx, vector in enumerate(vectors)]
)
.alias("query_vectors")
)
# Build the lateral subquery for each query vector
subq = (
select(
DocumentChunk.id,
DocumentChunk.text,
DocumentChunk.vmetadata,
(
DocumentChunk.vector.cosine_distance(query_vectors.c.q_vector)
).label("distance"),
)
.where(DocumentChunk.collection_name == collection_name)
.order_by(
(DocumentChunk.vector.cosine_distance(query_vectors.c.q_vector))
)
)
if limit is not None:
subq = subq.limit(limit)
subq = subq.lateral("result")
# Build the main query by joining query_vectors and the lateral subquery
stmt = (
select(
query_vectors.c.qid,
subq.c.id,
subq.c.text,
subq.c.vmetadata,
subq.c.distance,
)
.select_from(query_vectors)
.join(subq, true())
.order_by(query_vectors.c.qid, subq.c.distance)
)
result_proxy = self.session.execute(stmt)
results = result_proxy.all()
ids = [[] for _ in range(num_queries)]
distances = [[] for _ in range(num_queries)]
documents = [[] for _ in range(num_queries)]
metadatas = [[] for _ in range(num_queries)]
if not results:
return SearchResult(
ids=ids,
distances=distances,
documents=documents,
metadatas=metadatas,
)
for row in results:
qid = int(row.qid)
ids[qid].append(row.id)
distances[qid].append(row.distance)
documents[qid].append(row.text)
metadatas[qid].append(row.vmetadata)
return SearchResult(
ids=ids, distances=distances, documents=documents, metadatas=metadatas
)
except Exception as e:
print(f"Error during search: {e}")
return None
def query(
self, collection_name: str, filter: Dict[str, Any], limit: Optional[int] = None
) -> Optional[GetResult]:
try:
query = self.session.query(DocumentChunk).filter(
DocumentChunk.collection_name == collection_name
)
for key, value in filter.items():
query = query.filter(DocumentChunk.vmetadata[key].astext == str(value))
if limit is not None:
query = query.limit(limit)
results = query.all()
if not results:
return None
ids = [[result.id for result in results]]
documents = [[result.text for result in results]]
metadatas = [[result.vmetadata for result in results]]
return GetResult(
ids=ids,
documents=documents,
metadatas=metadatas,
)
except Exception as e:
print(f"Error during query: {e}")
return None
def get(
self, collection_name: str, limit: Optional[int] = None
) -> Optional[GetResult]:
try:
query = self.session.query(DocumentChunk).filter(
DocumentChunk.collection_name == collection_name
)
if limit is not None:
query = query.limit(limit)
results = query.all()
if not results:
return None
ids = [[result.id for result in results]]
documents = [[result.text for result in results]]
metadatas = [[result.vmetadata for result in results]]
return GetResult(ids=ids, documents=documents, metadatas=metadatas)
except Exception as e:
print(f"Error during get: {e}")
return None
def delete(
self,
collection_name: str,
ids: Optional[List[str]] = None,
filter: Optional[Dict[str, Any]] = None,
) -> None:
try:
query = self.session.query(DocumentChunk).filter(
DocumentChunk.collection_name == collection_name
)
if ids:
query = query.filter(DocumentChunk.id.in_(ids))
if filter:
for key, value in filter.items():
query = query.filter(
DocumentChunk.vmetadata[key].astext == str(value)
)
deleted = query.delete(synchronize_session=False)
self.session.commit()
print(f"Deleted {deleted} items from collection '{collection_name}'.")
except Exception as e:
self.session.rollback()
print(f"Error during delete: {e}")
raise
def reset(self) -> None:
try:
deleted = self.session.query(DocumentChunk).delete()
self.session.commit()
print(
f"Reset complete. Deleted {deleted} items from 'document_chunk' table."
)
except Exception as e:
self.session.rollback()
print(f"Error during reset: {e}")
raise
def close(self) -> None:
pass
def has_collection(self, collection_name: str) -> bool:
try:
exists = (
self.session.query(DocumentChunk)
.filter(DocumentChunk.collection_name == collection_name)
.first()
is not None
)
return exists
except Exception as e:
print(f"Error checking collection existence: {e}")
return False
def delete_collection(self, collection_name: str) -> None:
self.delete(collection_name)
print(f"Collection '{collection_name}' deleted.")

View File

@@ -0,0 +1,184 @@
from typing import Optional
from qdrant_client import QdrantClient as Qclient
from qdrant_client.http.models import PointStruct
from qdrant_client.models import models
from open_webui.apps.retrieval.vector.main import VectorItem, SearchResult, GetResult
from open_webui.config import QDRANT_URI, QDRANT_API_KEY
NO_LIMIT = 999999999
class QdrantClient:
def __init__(self):
self.collection_prefix = "open-webui"
self.QDRANT_URI = QDRANT_URI
self.QDRANT_API_KEY = QDRANT_API_KEY
self.client = (
Qclient(url=self.QDRANT_URI, api_key=self.QDRANT_API_KEY)
if self.QDRANT_URI
else None
)
def _result_to_get_result(self, points) -> GetResult:
ids = []
documents = []
metadatas = []
for point in points:
payload = point.payload
ids.append(point.id)
documents.append(payload["text"])
metadatas.append(payload["metadata"])
return GetResult(
**{
"ids": [ids],
"documents": [documents],
"metadatas": [metadatas],
}
)
def _create_collection(self, collection_name: str, dimension: int):
collection_name_with_prefix = f"{self.collection_prefix}_{collection_name}"
self.client.create_collection(
collection_name=collection_name_with_prefix,
vectors_config=models.VectorParams(
size=dimension, distance=models.Distance.COSINE
),
)
print(f"collection {collection_name_with_prefix} successfully created!")
def _create_collection_if_not_exists(self, collection_name, dimension):
if not self.has_collection(collection_name=collection_name):
self._create_collection(
collection_name=collection_name, dimension=dimension
)
def _create_points(self, items: list[VectorItem]):
return [
PointStruct(
id=item["id"],
vector=item["vector"],
payload={"text": item["text"], "metadata": item["metadata"]},
)
for item in items
]
def has_collection(self, collection_name: str) -> bool:
return self.client.collection_exists(
f"{self.collection_prefix}_{collection_name}"
)
def delete_collection(self, collection_name: str):
return self.client.delete_collection(
collection_name=f"{self.collection_prefix}_{collection_name}"
)
def search(
self, collection_name: str, vectors: list[list[float | int]], limit: int
) -> Optional[SearchResult]:
# Search for the nearest neighbor items based on the vectors and return 'limit' number of results.
if limit is None:
limit = NO_LIMIT # otherwise qdrant would set limit to 10!
query_response = self.client.query_points(
collection_name=f"{self.collection_prefix}_{collection_name}",
query=vectors[0],
limit=limit,
)
get_result = self._result_to_get_result(query_response.points)
return SearchResult(
ids=get_result.ids,
documents=get_result.documents,
metadatas=get_result.metadatas,
distances=[[point.score for point in query_response.points]],
)
def query(self, collection_name: str, filter: dict, limit: Optional[int] = None):
# Construct the filter string for querying
if not self.has_collection(collection_name):
return None
try:
if limit is None:
limit = NO_LIMIT # otherwise qdrant would set limit to 10!
field_conditions = []
for key, value in filter.items():
field_conditions.append(
models.FieldCondition(
key=f"metadata.{key}", match=models.MatchValue(value=value)
)
)
points = self.client.query_points(
collection_name=f"{self.collection_prefix}_{collection_name}",
query_filter=models.Filter(should=field_conditions),
limit=limit,
)
return self._result_to_get_result(points.points)
except Exception as e:
print(e)
return None
def get(self, collection_name: str) -> Optional[GetResult]:
# Get all the items in the collection.
points = self.client.query_points(
collection_name=f"{self.collection_prefix}_{collection_name}",
limit=NO_LIMIT, # otherwise qdrant would set limit to 10!
)
return self._result_to_get_result(points.points)
def insert(self, collection_name: str, items: list[VectorItem]):
# Insert the items into the collection, if the collection does not exist, it will be created.
self._create_collection_if_not_exists(collection_name, len(items[0]["vector"]))
points = self._create_points(items)
self.client.upload_points(f"{self.collection_prefix}_{collection_name}", points)
def upsert(self, collection_name: str, items: list[VectorItem]):
# Update the items in the collection, if the items are not present, insert them. If the collection does not exist, it will be created.
self._create_collection_if_not_exists(collection_name, len(items[0]["vector"]))
points = self._create_points(items)
return self.client.upsert(f"{self.collection_prefix}_{collection_name}", points)
def delete(
self,
collection_name: str,
ids: Optional[list[str]] = None,
filter: Optional[dict] = None,
):
# Delete the items from the collection based on the ids.
field_conditions = []
if ids:
for id_value in ids:
field_conditions.append(
models.FieldCondition(
key="metadata.id",
match=models.MatchValue(value=id_value),
),
),
elif filter:
for key, value in filter.items():
field_conditions.append(
models.FieldCondition(
key=f"metadata.{key}",
match=models.MatchValue(value=value),
),
),
return self.client.delete(
collection_name=f"{self.collection_prefix}_{collection_name}",
points_selector=models.FilterSelector(
filter=models.Filter(must=field_conditions)
),
)
def reset(self):
# Resets the database. This will delete all collections and item entries.
collection_names = self.client.get_collections().collections
for collection_name in collection_names:
if collection_name.name.startswith(self.collection_prefix):
self.client.delete_collection(collection_name=collection_name.name)

View File

@@ -0,0 +1,19 @@
from pydantic import BaseModel
from typing import Optional, List, Any
class VectorItem(BaseModel):
id: str
text: str
vector: List[float | int]
metadata: Any
class GetResult(BaseModel):
ids: Optional[List[List[str]]]
documents: Optional[List[List[str]]]
metadatas: Optional[List[List[Any]]]
class SearchResult(GetResult):
distances: Optional[List[List[float | int]]]

View File

@@ -0,0 +1,73 @@
import logging
import os
from pprint import pprint
from typing import Optional
import requests
from open_webui.apps.retrieval.web.main import SearchResult, get_filtered_results
from open_webui.env import SRC_LOG_LEVELS
import argparse
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["RAG"])
"""
Documentation: https://docs.microsoft.com/en-us/bing/search-apis/bing-web-search/overview
"""
def search_bing(
subscription_key: str,
endpoint: str,
locale: str,
query: str,
count: int,
filter_list: Optional[list[str]] = None,
) -> list[SearchResult]:
mkt = locale
params = {"q": query, "mkt": mkt, "answerCount": count}
headers = {"Ocp-Apim-Subscription-Key": subscription_key}
try:
response = requests.get(endpoint, headers=headers, params=params)
response.raise_for_status()
json_response = response.json()
results = json_response.get("webPages", {}).get("value", [])
if filter_list:
results = get_filtered_results(results, filter_list)
return [
SearchResult(
link=result["url"],
title=result.get("name"),
snippet=result.get("snippet"),
)
for result in results
]
except Exception as ex:
log.error(f"Error: {ex}")
raise ex
def main():
parser = argparse.ArgumentParser(description="Search Bing from the command line.")
parser.add_argument(
"query",
type=str,
default="Top 10 international news today",
help="The search query.",
)
parser.add_argument(
"--count", type=int, default=10, help="Number of search results to return."
)
parser.add_argument(
"--filter", nargs="*", help="List of filters to apply to the search results."
)
parser.add_argument(
"--locale",
type=str,
default="en-US",
help="The locale to use for the search, maps to market in api",
)
args = parser.parse_args()
results = search_bing(args.locale, args.query, args.count, args.filter)
pprint(results)

View File

@@ -1,16 +1,16 @@
import logging
from typing import List, Optional
import requests
from typing import Optional
from apps.rag.search.main import SearchResult, get_filtered_results
from config import SRC_LOG_LEVELS
import requests
from open_webui.apps.retrieval.web.main import SearchResult, get_filtered_results
from open_webui.env import SRC_LOG_LEVELS
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["RAG"])
def search_brave(
api_key: str, query: str, count: int, filter_list: Optional[List[str]] = None
api_key: str, query: str, count: int, filter_list: Optional[list[str]] = None
) -> list[SearchResult]:
"""Search using Brave's Search API and return the results as a list of SearchResult objects.

View File

@@ -1,15 +1,16 @@
import logging
from typing import List, Optional
from apps.rag.search.main import SearchResult, get_filtered_results
from typing import Optional
from open_webui.apps.retrieval.web.main import SearchResult, get_filtered_results
from duckduckgo_search import DDGS
from config import SRC_LOG_LEVELS
from open_webui.env import SRC_LOG_LEVELS
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["RAG"])
def search_duckduckgo(
query: str, count: int, filter_list: Optional[List[str]] = None
query: str, count: int, filter_list: Optional[list[str]] = None
) -> list[SearchResult]:
"""
Search using DuckDuckGo's Search API and return the results as a list of SearchResult objects.
@@ -18,7 +19,7 @@ def search_duckduckgo(
count (int): The number of results to return
Returns:
List[SearchResult]: A list of search results
list[SearchResult]: A list of search results
"""
# Use the DDGS context manager to create a DDGS object
with DDGS() as ddgs:

View File

@@ -1,10 +1,9 @@
import json
import logging
from typing import List, Optional
import requests
from typing import Optional
from apps.rag.search.main import SearchResult, get_filtered_results
from config import SRC_LOG_LEVELS
import requests
from open_webui.apps.retrieval.web.main import SearchResult, get_filtered_results
from open_webui.env import SRC_LOG_LEVELS
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["RAG"])
@@ -15,7 +14,7 @@ def search_google_pse(
search_engine_id: str,
query: str,
count: int,
filter_list: Optional[List[str]] = None,
filter_list: Optional[list[str]] = None,
) -> list[SearchResult]:
"""Search using Google's Programmable Search Engine API and return the results as a list of SearchResult objects.

View File

@@ -1,15 +1,15 @@
import logging
import requests
from yarl import URL
from apps.rag.search.main import SearchResult
from config import SRC_LOG_LEVELS
import requests
from open_webui.apps.retrieval.web.main import SearchResult
from open_webui.env import SRC_LOG_LEVELS
from yarl import URL
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["RAG"])
def search_jina(query: str, count: int) -> list[SearchResult]:
def search_jina(api_key: str, query: str, count: int) -> list[SearchResult]:
"""
Search using Jina's Search API and return the results as a list of SearchResult objects.
Args:
@@ -17,12 +17,10 @@ def search_jina(query: str, count: int) -> list[SearchResult]:
count (int): The number of results to return
Returns:
List[SearchResult]: A list of search results
list[SearchResult]: A list of search results
"""
jina_search_endpoint = "https://s.jina.ai/"
headers = {
"Accept": "application/json",
}
headers = {"Accept": "application/json", "Authorization": f"Bearer {api_key}"}
url = str(URL(jina_search_endpoint + query))
response = requests.get(url, headers=headers)
response.raise_for_status()

View File

@@ -1,5 +1,6 @@
from typing import Optional
from urllib.parse import urlparse
from pydantic import BaseModel
@@ -8,7 +9,8 @@ def get_filtered_results(results, filter_list):
return results
filtered_results = []
for result in results:
domain = urlparse(result["url"]).netloc
url = result.get("url") or result.get("link", "")
domain = urlparse(url).netloc
if any(domain.endswith(filtered_domain) for filtered_domain in filter_list):
filtered_results.append(result)
return filtered_results

View File

@@ -0,0 +1,40 @@
import logging
from typing import Optional
import requests
from open_webui.apps.retrieval.web.main import SearchResult, get_filtered_results
from open_webui.env import SRC_LOG_LEVELS
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["RAG"])
def search_mojeek(
api_key: str, query: str, count: int, filter_list: Optional[list[str]] = None
) -> list[SearchResult]:
"""Search using Mojeek's Search API and return the results as a list of SearchResult objects.
Args:
api_key (str): A Mojeek Search API key
query (str): The query to search for
"""
url = "https://api.mojeek.com/search"
headers = {
"Accept": "application/json",
}
params = {"q": query, "api_key": api_key, "fmt": "json", "t": count}
response = requests.get(url, headers=headers, params=params)
response.raise_for_status()
json_response = response.json()
results = json_response.get("response", {}).get("results", [])
print(results)
if filter_list:
results = get_filtered_results(results, filter_list)
return [
SearchResult(
link=result["url"], title=result.get("title"), snippet=result.get("desc")
)
for result in results
]

View File

@@ -0,0 +1,48 @@
import logging
from typing import Optional
from urllib.parse import urlencode
import requests
from open_webui.apps.retrieval.web.main import SearchResult, get_filtered_results
from open_webui.env import SRC_LOG_LEVELS
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["RAG"])
def search_searchapi(
api_key: str,
engine: str,
query: str,
count: int,
filter_list: Optional[list[str]] = None,
) -> list[SearchResult]:
"""Search using searchapi.io's API and return the results as a list of SearchResult objects.
Args:
api_key (str): A searchapi.io API key
query (str): The query to search for
"""
url = "https://www.searchapi.io/api/v1/search"
engine = engine or "google"
payload = {"engine": engine, "q": query, "api_key": api_key}
url = f"{url}?{urlencode(payload)}"
response = requests.request("GET", url)
json_response = response.json()
log.info(f"results from searchapi search: {json_response}")
results = sorted(
json_response.get("organic_results", []), key=lambda x: x.get("position", 0)
)
if filter_list:
results = get_filtered_results(results, filter_list)
return [
SearchResult(
link=result["link"], title=result["title"], snippet=result["snippet"]
)
for result in results[:count]
]

View File

@@ -1,10 +1,9 @@
import logging
from typing import Optional
import requests
from typing import List, Optional
from apps.rag.search.main import SearchResult, get_filtered_results
from config import SRC_LOG_LEVELS
from open_webui.apps.retrieval.web.main import SearchResult, get_filtered_results
from open_webui.env import SRC_LOG_LEVELS
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["RAG"])
@@ -14,9 +13,9 @@ def search_searxng(
query_url: str,
query: str,
count: int,
filter_list: Optional[List[str]] = None,
filter_list: Optional[list[str]] = None,
**kwargs,
) -> List[SearchResult]:
) -> list[SearchResult]:
"""
Search a SearXNG instance for a given query and return the results as a list of SearchResult objects.
@@ -31,10 +30,10 @@ def search_searxng(
language (str): Language filter for the search results; e.g., "en-US". Defaults to an empty string.
safesearch (int): Safe search filter for safer web results; 0 = off, 1 = moderate, 2 = strict. Defaults to 1 (moderate).
time_range (str): Time range for filtering results by date; e.g., "2023-04-05..today" or "all-time". Defaults to ''.
categories: (Optional[List[str]]): Specific categories within which the search should be performed, defaulting to an empty string if not provided.
categories: (Optional[list[str]]): Specific categories within which the search should be performed, defaulting to an empty string if not provided.
Returns:
List[SearchResult]: A list of SearchResults sorted by relevance score in descending order.
list[SearchResult]: A list of SearchResults sorted by relevance score in descending order.
Raise:
requests.exceptions.RequestException: If a request error occurs during the search process.

View File

@@ -1,17 +1,17 @@
import json
import logging
from typing import List, Optional
import requests
from typing import Optional
from apps.rag.search.main import SearchResult, get_filtered_results
from config import SRC_LOG_LEVELS
import requests
from open_webui.apps.retrieval.web.main import SearchResult, get_filtered_results
from open_webui.env import SRC_LOG_LEVELS
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["RAG"])
def search_serper(
api_key: str, query: str, count: int, filter_list: Optional[List[str]] = None
api_key: str, query: str, count: int, filter_list: Optional[list[str]] = None
) -> list[SearchResult]:
"""Search using serper.dev's API and return the results as a list of SearchResult objects.

View File

@@ -1,11 +1,10 @@
import json
import logging
from typing import List, Optional
import requests
from typing import Optional
from urllib.parse import urlencode
from apps.rag.search.main import SearchResult, get_filtered_results
from config import SRC_LOG_LEVELS
import requests
from open_webui.apps.retrieval.web.main import SearchResult, get_filtered_results
from open_webui.env import SRC_LOG_LEVELS
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["RAG"])
@@ -19,7 +18,7 @@ def search_serply(
limit: int = 10,
device_type: str = "desktop",
proxy_location: str = "US",
filter_list: Optional[List[str]] = None,
filter_list: Optional[list[str]] = None,
) -> list[SearchResult]:
"""Search using serper.dev's API and return the results as a list of SearchResult objects.

View File

@@ -1,10 +1,9 @@
import json
import logging
from typing import List, Optional
import requests
from typing import Optional
from apps.rag.search.main import SearchResult, get_filtered_results
from config import SRC_LOG_LEVELS
import requests
from open_webui.apps.retrieval.web.main import SearchResult, get_filtered_results
from open_webui.env import SRC_LOG_LEVELS
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["RAG"])
@@ -14,7 +13,7 @@ def search_serpstack(
api_key: str,
query: str,
count: int,
filter_list: Optional[List[str]] = None,
filter_list: Optional[list[str]] = None,
https_enabled: bool = True,
) -> list[SearchResult]:
"""Search using serpstack.com's and return the results as a list of SearchResult objects.

View File

@@ -1,9 +1,8 @@
import logging
import requests
from apps.rag.search.main import SearchResult
from config import SRC_LOG_LEVELS
from open_webui.apps.retrieval.web.main import SearchResult
from open_webui.env import SRC_LOG_LEVELS
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["RAG"])
@@ -17,7 +16,7 @@ def search_tavily(api_key: str, query: str, count: int) -> list[SearchResult]:
query (str): The query to search for
Returns:
List[SearchResult]: A list of search results
list[SearchResult]: A list of search results
"""
url = "https://api.tavily.com/search"
data = {"query": query, "api_key": api_key}

View File

@@ -0,0 +1,58 @@
{
"_type": "SearchResponse",
"queryContext": {
"originalQuery": "Top 10 international results"
},
"webPages": {
"webSearchUrl": "https://www.bing.com/search?q=Top+10+international+results",
"totalEstimatedMatches": 687,
"value": [
{
"id": "https://api.bing.microsoft.com/api/v7/#WebPages.0",
"name": "2024 Mexican Grand Prix - F1 results and latest standings ... - PlanetF1",
"url": "https://www.planetf1.com/news/f1-results-2024-mexican-grand-prix-race-standings",
"datePublished": "2024-10-27T00:00:00.0000000",
"datePublishedFreshnessText": "1 day ago",
"isFamilyFriendly": true,
"displayUrl": "https://www.planetf1.com/news/f1-results-2024-mexican-grand-prix-race-standings",
"snippet": "Nico Hulkenberg and Pierre Gasly completed the top 10. A full report of the Mexican Grand Prix is available at the bottom of this article. F1 results 2024 Mexican Grand Prix",
"dateLastCrawled": "2024-10-28T07:15:00.0000000Z",
"cachedPageUrl": "https://cc.bingj.com/cache.aspx?q=Top+10+international+results&d=916492551782&mkt=en-US&setlang=en-US&w=zBsfaAPyF2tUrHFHr_vFFdUm8sng4g34",
"language": "en",
"isNavigational": false,
"noCache": false
},
{
"id": "https://api.bing.microsoft.com/api/v7/#WebPages.1",
"name": "F1 Results Today: HUGE Verstappen penalties cause major title change",
"url": "https://www.gpfans.com/en/f1-news/1033512/f1-results-today-mexican-grand-prix-huge-max-verstappen-penalties-cause-major-title-change/",
"datePublished": "2024-10-27T00:00:00.0000000",
"datePublishedFreshnessText": "1 day ago",
"isFamilyFriendly": true,
"displayUrl": "https://www.gpfans.com/en/f1-news/1033512/f1-results-today-mexican-grand-prix-huge-max...",
"snippet": "Elsewhere, Mercedes duo Lewis Hamilton and George Russell came home in P4 and P5 respectively. Meanwhile, the surprise package of the day were Haas, with both Kevin Magnussen and Nico Hulkenberg finishing inside the points.. READ MORE: RB star issues apology after red flag CRASH at Mexican GP Mexican Grand Prix 2024 results. 1. Carlos Sainz [Ferrari] 2. Lando Norris [McLaren] - +4.705",
"dateLastCrawled": "2024-10-28T06:06:00.0000000Z",
"cachedPageUrl": "https://cc.bingj.com/cache.aspx?q=Top+10+international+results&d=2840656522642&mkt=en-US&setlang=en-US&w=-Tbkwxnq52jZCvG7l3CtgcwT1vwAjIUD",
"language": "en",
"isNavigational": false,
"noCache": false
},
{
"id": "https://api.bing.microsoft.com/api/v7/#WebPages.2",
"name": "International Power Rankings: England flying, Kangaroos cruising, Fiji rise",
"url": "https://www.loverugbyleague.com/post/international-power-rankings-england-flying-kangaroos-cruising-fiji-rise",
"datePublished": "2024-10-28T00:00:00.0000000",
"datePublishedFreshnessText": "7 hours ago",
"isFamilyFriendly": true,
"displayUrl": "https://www.loverugbyleague.com/post/international-power-rankings-england-flying...",
"snippet": "LRL RECOMMENDS: England player ratings from first Test against Samoa as omnificent George Williams scores perfect 10. 2. Australia (Men) SAME. The Kangaroos remain 2nd in our Power Rankings after their 22-10 win against New Zealand in Christchurch on Sunday. As was the case in their win against Tonga last week, Mal Meningas side weren ...",
"dateLastCrawled": "2024-10-28T07:09:00.0000000Z",
"cachedPageUrl": "https://cc.bingj.com/cache.aspx?q=Top+10+international+results&d=1535008462672&mkt=en-US&setlang=en-US&w=82ujhH4Kp0iuhCS7wh1xLUFYUeetaVVm",
"language": "en",
"isNavigational": false,
"noCache": false
}
],
"someResultsRemoved": true
}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,97 @@
import socket
import urllib.parse
import validators
from typing import Union, Sequence, Iterator
from langchain_community.document_loaders import (
WebBaseLoader,
)
from langchain_core.documents import Document
from open_webui.constants import ERROR_MESSAGES
from open_webui.config import ENABLE_RAG_LOCAL_WEB_FETCH
from open_webui.env import SRC_LOG_LEVELS
import logging
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["RAG"])
def validate_url(url: Union[str, Sequence[str]]):
if isinstance(url, str):
if isinstance(validators.url(url), validators.ValidationError):
raise ValueError(ERROR_MESSAGES.INVALID_URL)
if not ENABLE_RAG_LOCAL_WEB_FETCH:
# Local web fetch is disabled, filter out any URLs that resolve to private IP addresses
parsed_url = urllib.parse.urlparse(url)
# Get IPv4 and IPv6 addresses
ipv4_addresses, ipv6_addresses = resolve_hostname(parsed_url.hostname)
# Check if any of the resolved addresses are private
# This is technically still vulnerable to DNS rebinding attacks, as we don't control WebBaseLoader
for ip in ipv4_addresses:
if validators.ipv4(ip, private=True):
raise ValueError(ERROR_MESSAGES.INVALID_URL)
for ip in ipv6_addresses:
if validators.ipv6(ip, private=True):
raise ValueError(ERROR_MESSAGES.INVALID_URL)
return True
elif isinstance(url, Sequence):
return all(validate_url(u) for u in url)
else:
return False
def resolve_hostname(hostname):
# Get address information
addr_info = socket.getaddrinfo(hostname, None)
# Extract IP addresses from address information
ipv4_addresses = [info[4][0] for info in addr_info if info[0] == socket.AF_INET]
ipv6_addresses = [info[4][0] for info in addr_info if info[0] == socket.AF_INET6]
return ipv4_addresses, ipv6_addresses
class SafeWebBaseLoader(WebBaseLoader):
"""WebBaseLoader with enhanced error handling for URLs."""
def lazy_load(self) -> Iterator[Document]:
"""Lazy load text from the url(s) in web_path with error handling."""
for path in self.web_paths:
try:
soup = self._scrape(path, bs_kwargs=self.bs_kwargs)
text = soup.get_text(**self.bs_get_text_kwargs)
# Build metadata
metadata = {"source": path}
if title := soup.find("title"):
metadata["title"] = title.get_text()
if description := soup.find("meta", attrs={"name": "description"}):
metadata["description"] = description.get(
"content", "No description found."
)
if html := soup.find("html"):
metadata["language"] = html.get("lang", "No language found.")
yield Document(page_content=text, metadata=metadata)
except Exception as e:
# Log the error and continue with the next URL
log.error(f"Error loading {path}: {e}")
def get_web_loader(
url: Union[str, Sequence[str]],
verify_ssl: bool = True,
requests_per_second: int = 2,
):
# Check if the URL is valid
if not validate_url(url):
raise ValueError(ERROR_MESSAGES.INVALID_URL)
return SafeWebBaseLoader(
url,
verify_ssl=verify_ssl,
requests_per_second=requests_per_second,
continue_on_failure=True,
)

View File

@@ -0,0 +1,221 @@
# TODO: move socket to webui app
import asyncio
import socketio
import logging
import sys
import time
from open_webui.apps.webui.models.users import Users
from open_webui.env import (
ENABLE_WEBSOCKET_SUPPORT,
WEBSOCKET_MANAGER,
WEBSOCKET_REDIS_URL,
)
from open_webui.utils.utils import decode_token
from open_webui.apps.socket.utils import RedisDict
from open_webui.env import (
GLOBAL_LOG_LEVEL,
SRC_LOG_LEVELS,
)
logging.basicConfig(stream=sys.stdout, level=GLOBAL_LOG_LEVEL)
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["SOCKET"])
if WEBSOCKET_MANAGER == "redis":
mgr = socketio.AsyncRedisManager(WEBSOCKET_REDIS_URL)
sio = socketio.AsyncServer(
cors_allowed_origins=[],
async_mode="asgi",
transports=(
["polling", "websocket"] if ENABLE_WEBSOCKET_SUPPORT else ["polling"]
),
allow_upgrades=ENABLE_WEBSOCKET_SUPPORT,
always_connect=True,
client_manager=mgr,
)
else:
sio = socketio.AsyncServer(
cors_allowed_origins=[],
async_mode="asgi",
transports=(
["polling", "websocket"] if ENABLE_WEBSOCKET_SUPPORT else ["polling"]
),
allow_upgrades=ENABLE_WEBSOCKET_SUPPORT,
always_connect=True,
)
# Dictionary to maintain the user pool
if WEBSOCKET_MANAGER == "redis":
SESSION_POOL = RedisDict("open-webui:session_pool", redis_url=WEBSOCKET_REDIS_URL)
USER_POOL = RedisDict("open-webui:user_pool", redis_url=WEBSOCKET_REDIS_URL)
USAGE_POOL = RedisDict("open-webui:usage_pool", redis_url=WEBSOCKET_REDIS_URL)
else:
SESSION_POOL = {}
USER_POOL = {}
USAGE_POOL = {}
# Timeout duration in seconds
TIMEOUT_DURATION = 3
async def periodic_usage_pool_cleanup():
while True:
now = int(time.time())
for model_id, connections in list(USAGE_POOL.items()):
# Creating a list of sids to remove if they have timed out
expired_sids = [
sid
for sid, details in connections.items()
if now - details["updated_at"] > TIMEOUT_DURATION
]
for sid in expired_sids:
del connections[sid]
if not connections:
log.debug(f"Cleaning up model {model_id} from usage pool")
del USAGE_POOL[model_id]
else:
USAGE_POOL[model_id] = connections
# Emit updated usage information after cleaning
await sio.emit("usage", {"models": get_models_in_use()})
await asyncio.sleep(TIMEOUT_DURATION)
app = socketio.ASGIApp(
sio,
socketio_path="/ws/socket.io",
)
def get_models_in_use():
# List models that are currently in use
models_in_use = list(USAGE_POOL.keys())
return models_in_use
@sio.on("usage")
async def usage(sid, data):
model_id = data["model"]
# Record the timestamp for the last update
current_time = int(time.time())
# Store the new usage data and task
USAGE_POOL[model_id] = {
**(USAGE_POOL[model_id] if model_id in USAGE_POOL else {}),
sid: {"updated_at": current_time},
}
# Broadcast the usage data to all clients
await sio.emit("usage", {"models": get_models_in_use()})
@sio.event
async def connect(sid, environ, auth):
user = None
if auth and "token" in auth:
data = decode_token(auth["token"])
if data is not None and "id" in data:
user = Users.get_user_by_id(data["id"])
if user:
SESSION_POOL[sid] = user.id
if user.id in USER_POOL:
USER_POOL[user.id].append(sid)
else:
USER_POOL[user.id] = [sid]
# print(f"user {user.name}({user.id}) connected with session ID {sid}")
await sio.emit("user-count", {"count": len(USER_POOL.items())})
await sio.emit("usage", {"models": get_models_in_use()})
@sio.on("user-join")
async def user_join(sid, data):
# print("user-join", sid, data)
auth = data["auth"] if "auth" in data else None
if not auth or "token" not in auth:
return
data = decode_token(auth["token"])
if data is None or "id" not in data:
return
user = Users.get_user_by_id(data["id"])
if not user:
return
SESSION_POOL[sid] = user.id
if user.id in USER_POOL:
USER_POOL[user.id].append(sid)
else:
USER_POOL[user.id] = [sid]
# print(f"user {user.name}({user.id}) connected with session ID {sid}")
await sio.emit("user-count", {"count": len(USER_POOL.items())})
@sio.on("user-count")
async def user_count(sid):
await sio.emit("user-count", {"count": len(USER_POOL.items())})
@sio.event
async def disconnect(sid):
if sid in SESSION_POOL:
user_id = SESSION_POOL[sid]
del SESSION_POOL[sid]
USER_POOL[user_id] = [_sid for _sid in USER_POOL[user_id] if _sid != sid]
if len(USER_POOL[user_id]) == 0:
del USER_POOL[user_id]
await sio.emit("user-count", {"count": len(USER_POOL)})
else:
pass
# print(f"Unknown session ID {sid} disconnected")
def get_event_emitter(request_info):
async def __event_emitter__(event_data):
await sio.emit(
"chat-events",
{
"chat_id": request_info["chat_id"],
"message_id": request_info["message_id"],
"data": event_data,
},
to=request_info["session_id"],
)
return __event_emitter__
def get_event_call(request_info):
async def __event_call__(event_data):
response = await sio.call(
"chat-events",
{
"chat_id": request_info["chat_id"],
"message_id": request_info["message_id"],
"data": event_data,
},
to=request_info["session_id"],
)
return response
return __event_call__

View File

@@ -0,0 +1,59 @@
import json
import redis
class RedisDict:
def __init__(self, name, redis_url):
self.name = name
self.redis = redis.Redis.from_url(redis_url, decode_responses=True)
def __setitem__(self, key, value):
serialized_value = json.dumps(value)
self.redis.hset(self.name, key, serialized_value)
def __getitem__(self, key):
value = self.redis.hget(self.name, key)
if value is None:
raise KeyError(key)
return json.loads(value)
def __delitem__(self, key):
result = self.redis.hdel(self.name, key)
if result == 0:
raise KeyError(key)
def __contains__(self, key):
return self.redis.hexists(self.name, key)
def __len__(self):
return self.redis.hlen(self.name)
def keys(self):
return self.redis.hkeys(self.name)
def values(self):
return [json.loads(v) for v in self.redis.hvals(self.name)]
def items(self):
return [(k, json.loads(v)) for k, v in self.redis.hgetall(self.name).items()]
def get(self, key, default=None):
try:
return self[key]
except KeyError:
return default
def clear(self):
self.redis.delete(self.name)
def update(self, other=None, **kwargs):
if other is not None:
for k, v in other.items() if hasattr(other, "items") else other:
self[k] = v
for k, v in kwargs.items():
self[k] = v
def setdefault(self, key, default=None):
if key not in self:
self[key] = default
return self[key]

View File

@@ -1,20 +1,25 @@
import os
import logging
import json
import logging
from contextlib import contextmanager
from typing import Any, Optional
from open_webui.apps.webui.internal.wrappers import register_connection
from open_webui.env import (
OPEN_WEBUI_DIR,
DATABASE_URL,
SRC_LOG_LEVELS,
DATABASE_POOL_MAX_OVERFLOW,
DATABASE_POOL_RECYCLE,
DATABASE_POOL_SIZE,
DATABASE_POOL_TIMEOUT,
)
from peewee_migrate import Router
from apps.webui.internal.wrappers import register_connection
from typing import Optional, Any
from typing_extensions import Self
from sqlalchemy import create_engine, types, Dialect
from sqlalchemy import Dialect, create_engine, types
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.pool import QueuePool, NullPool
from sqlalchemy.sql.type_api import _T
from config import SRC_LOG_LEVELS, DATA_DIR, DATABASE_URL, BACKEND_DIR
from typing_extensions import Self
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["DB"])
@@ -42,34 +47,21 @@ class JSONField(types.TypeDecorator):
return json.loads(value)
# Check if the file exists
if os.path.exists(f"{DATA_DIR}/ollama.db"):
# Rename the file
os.rename(f"{DATA_DIR}/ollama.db", f"{DATA_DIR}/webui.db")
log.info("Database migrated from Ollama-WebUI successfully.")
else:
pass
# Workaround to handle the peewee migration
# This is required to ensure the peewee migration is handled before the alembic migration
def handle_peewee_migration(DATABASE_URL):
# db = None
try:
# Replace the postgresql:// with postgres:// and %40 with @ in the DATABASE_URL
db = register_connection(
DATABASE_URL.replace("postgresql://", "postgres://").replace("%40", "@")
)
migrate_dir = BACKEND_DIR / "apps" / "webui" / "internal" / "migrations"
# Replace the postgresql:// with postgres:// to handle the peewee migration
db = register_connection(DATABASE_URL.replace("postgresql://", "postgres://"))
migrate_dir = OPEN_WEBUI_DIR / "apps" / "webui" / "internal" / "migrations"
router = Router(db, logger=log, migrate_dir=migrate_dir)
router.run()
db.close()
# check if db connection has been closed
except Exception as e:
log.error(f"Failed to initialize the database connection: {e}")
raise
finally:
# Properly closing the database connection
if db and not db.is_closed():
@@ -88,7 +80,20 @@ if "sqlite" in SQLALCHEMY_DATABASE_URL:
SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}
)
else:
engine = create_engine(SQLALCHEMY_DATABASE_URL, pool_pre_ping=True)
if DATABASE_POOL_SIZE > 0:
engine = create_engine(
SQLALCHEMY_DATABASE_URL,
pool_size=DATABASE_POOL_SIZE,
max_overflow=DATABASE_POOL_MAX_OVERFLOW,
pool_timeout=DATABASE_POOL_TIMEOUT,
pool_recycle=DATABASE_POOL_RECYCLE,
pool_pre_ping=True,
poolclass=QueuePool,
)
else:
engine = create_engine(
SQLALCHEMY_DATABASE_URL, pool_pre_ping=True, poolclass=NullPool
)
SessionLocal = sessionmaker(
@@ -98,7 +103,6 @@ Base = declarative_base()
Session = scoped_session(SessionLocal)
# Dependency
def get_session():
db = SessionLocal()
try:

View File

@@ -30,7 +30,7 @@ import peewee as pw
from peewee_migrate import Migrator
import json
from utils.misc import parse_ollama_modelfile
from open_webui.utils.misc import parse_ollama_modelfile
with suppress(ImportError):
import playhouse.postgres_ext as pw_pext

Some files were not shown because too many files have changed in this diff Show More