Skip to content

Commit 63533c9

Browse files
authored
Merge pull request open-webui#12524 from open-webui/dev
0.6.2
2 parents 41aca84 + 8e8bc31 commit 63533c9

File tree

79 files changed

+1046
-767
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1046
-767
lines changed

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
11
version: 2
22
updates:
3+
- package-ecosystem: uv
4+
directory: '/'
5+
schedule:
6+
interval: monthly
7+
target-branch: 'dev'
8+
39
- package-ecosystem: pip
410
directory: '/backend'
511
schedule:
612
interval: monthly
713
target-branch: 'dev'
14+
15+
- package-ecosystem: npm
16+
directory: '/'
17+
schedule:
18+
interval: monthly
19+
target-branch: 'dev'
20+
821
- package-ecosystem: 'github-actions'
922
directory: '/'
1023
schedule:
1124
# Check for updates to GitHub Actions every week
1225
interval: monthly
26+
target-branch: 'dev'

.github/workflows/format-backend.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,18 @@ on:
55
branches:
66
- main
77
- dev
8+
paths:
9+
- 'backend/**'
10+
- 'pyproject.toml'
11+
- 'uv.lock'
812
pull_request:
913
branches:
1014
- main
1115
- dev
16+
paths:
17+
- 'backend/**'
18+
- 'pyproject.toml'
19+
- 'uv.lock'
1220

1321
jobs:
1422
build:
@@ -17,15 +25,17 @@ jobs:
1725

1826
strategy:
1927
matrix:
20-
python-version: [3.11]
28+
python-version:
29+
- 3.11.x
30+
- 3.12.x
2131

2232
steps:
2333
- uses: actions/checkout@v4
2434

2535
- name: Set up Python
2636
uses: actions/setup-python@v5
2737
with:
28-
python-version: ${{ matrix.python-version }}
38+
python-version: '${{ matrix.python-version }}'
2939

3040
- name: Install dependencies
3141
run: |

.github/workflows/format-build-frontend.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,18 @@ on:
55
branches:
66
- main
77
- dev
8+
paths-ignore:
9+
- 'backend/**'
10+
- 'pyproject.toml'
11+
- 'uv.lock'
812
pull_request:
913
branches:
1014
- main
1115
- dev
16+
paths-ignore:
17+
- 'backend/**'
18+
- 'pyproject.toml'
19+
- 'uv.lock'
1220

1321
jobs:
1422
build:
@@ -21,7 +29,7 @@ jobs:
2129
- name: Setup Node.js
2230
uses: actions/setup-node@v4
2331
with:
24-
node-version: '22' # Or specify any other version you want to use
32+
node-version: '22'
2533

2634
- name: Install Dependencies
2735
run: npm install

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.6.2] - 2025-04-06
9+
10+
### Added
11+
12+
- 🌍 **Improved Global Language Support**: Expanded and refined translations across multiple languages to enhance clarity and consistency for international users.
13+
14+
### Fixed
15+
16+
- 🛠️ **Accurate Tool Descriptions from OpenAPI Servers**: External tools now use full endpoint descriptions instead of summaries when generating tool specifications—helping AI models understand tool purpose more precisely and choose the right tool more accurately in tool workflows.
17+
- 🔧 **Precise Web Results Source Attribution**: Fixed a key issue where all web search results showed the same source ID—now each result gets its correct and distinct source, ensuring accurate citations and traceability.
18+
- 🔍 **Clean Web Search Retrieval**: Web search now retains only results from URLs where real content was successfully fetched—improving accuracy and removing empty or broken links from citations.
19+
- 🎵 **Audio File Upload Response Restored**: Resolved an issue where uploading audio files did not return valid responses, restoring smooth file handling for transcription and audio-based workflows.
20+
21+
### Changed
22+
23+
- 🧰 **General Backend Refactoring**: Multiple behind-the-scenes improvements streamline backend performance, reduce complexity, and ensure a more stable, maintainable system overall—making everything smoother without changing your workflow.
24+
825
## [0.6.1] - 2025-04-05
926

1027
### Added

backend/open_webui/retrieval/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ def get_embedding_function(
357357
):
358358
if embedding_engine == "":
359359
return lambda query, prefix=None, user=None: embedding_function.encode(
360-
query, prompt=prefix if prefix else None
360+
query, **({"prompt": prefix} if prefix else {})
361361
).tolist()
362362
elif embedding_engine in ["ollama", "openai"]:
363363
func = lambda query, prefix=None, user=None: generate_embeddings(

backend/open_webui/routers/files.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,16 @@ def upload_file(
122122
]:
123123
file_path = Storage.get_file(file_path)
124124
result = transcribe(request, file_path)
125+
125126
process_file(
126127
request,
127128
ProcessFileForm(file_id=id, content=result.get("text", "")),
128129
user=user,
129130
)
130131
elif file.content_type not in ["image/png", "image/jpeg", "image/gif"]:
131132
process_file(request, ProcessFileForm(file_id=id), user=user)
132-
file_item = Files.get_file_by_id(id=id)
133+
134+
file_item = Files.get_file_by_id(id=id)
133135
except Exception as e:
134136
log.exception(e)
135137
log.error(f"Error processing file: {file_item.id}")
@@ -162,11 +164,16 @@ def upload_file(
162164

163165

164166
@router.get("/", response_model=list[FileModelResponse])
165-
async def list_files(user=Depends(get_verified_user)):
167+
async def list_files(user=Depends(get_verified_user), content: bool = Query(True)):
166168
if user.role == "admin":
167169
files = Files.get_files()
168170
else:
169171
files = Files.get_files_by_user_id(user.id)
172+
173+
if not content:
174+
for file in files:
175+
del file.data["content"]
176+
170177
return files
171178

172179

backend/open_webui/routers/retrieval.py

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ def get_rf(
150150
device=DEVICE_TYPE,
151151
trust_remote_code=RAG_RERANKING_MODEL_TRUST_REMOTE_CODE,
152152
)
153-
except:
154-
log.error("CrossEncoder error")
153+
except Exception as e:
154+
log.error(f"CrossEncoder: {e}")
155155
raise Exception(ERROR_MESSAGES.DEFAULT("CrossEncoder error"))
156156
return rf
157157

@@ -174,7 +174,7 @@ class ProcessUrlForm(CollectionNameForm):
174174
url: str
175175

176176

177-
class SearchForm(CollectionNameForm):
177+
class SearchForm(BaseModel):
178178
query: str
179179

180180

@@ -958,7 +958,7 @@ def process_file(
958958

959959
if form_data.content:
960960
# Update the content in the file
961-
# Usage: /files/{file_id}/data/content/update
961+
# Usage: /files/{file_id}/data/content/update, /files/ (audio file upload pipeline)
962962

963963
try:
964964
# /files/{file_id}/data/content/update
@@ -1464,12 +1464,6 @@ async def process_web_search(
14641464
log.debug(f"web_results: {web_results}")
14651465

14661466
try:
1467-
collection_name = form_data.collection_name
1468-
if collection_name == "" or collection_name is None:
1469-
collection_name = f"web-search-{calculate_sha256_string(form_data.query)}"[
1470-
:63
1471-
]
1472-
14731467
urls = [result.link for result in web_results]
14741468
loader = get_web_loader(
14751469
urls,
@@ -1478,6 +1472,9 @@ async def process_web_search(
14781472
trust_env=request.app.state.config.RAG_WEB_SEARCH_TRUST_ENV,
14791473
)
14801474
docs = await loader.aload()
1475+
urls = [
1476+
doc.metadata["source"] for doc in docs
1477+
] # only keep URLs which could be retrieved
14811478

14821479
if request.app.state.config.BYPASS_WEB_SEARCH_EMBEDDING_AND_RETRIEVAL:
14831480
return {
@@ -1494,18 +1491,26 @@ async def process_web_search(
14941491
"loaded_count": len(docs),
14951492
}
14961493
else:
1497-
await run_in_threadpool(
1498-
save_docs_to_vector_db,
1499-
request,
1500-
docs,
1501-
collection_name,
1502-
overwrite=True,
1503-
user=user,
1504-
)
1494+
collection_names = []
1495+
for doc_idx, doc in enumerate(docs):
1496+
collection_name = f"web-search-{calculate_sha256_string(form_data.query + '-' + urls[doc_idx])}"[
1497+
:63
1498+
]
1499+
1500+
collection_names.append(collection_name)
1501+
1502+
await run_in_threadpool(
1503+
save_docs_to_vector_db,
1504+
request,
1505+
[doc],
1506+
collection_name,
1507+
overwrite=True,
1508+
user=user,
1509+
)
15051510

15061511
return {
15071512
"status": True,
1508-
"collection_name": collection_name,
1513+
"collection_names": collection_names,
15091514
"filenames": urls,
15101515
"loaded_count": len(docs),
15111516
}

backend/open_webui/utils/middleware.py

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -399,24 +399,44 @@ async def chat_web_search_handler(
399399
all_results.append(results)
400400
files = form_data.get("files", [])
401401

402-
if results.get("collection_name"):
403-
files.append(
404-
{
405-
"collection_name": results["collection_name"],
406-
"name": searchQuery,
407-
"type": "web_search",
408-
"urls": results["filenames"],
409-
}
410-
)
402+
if results.get("collection_names"):
403+
for col_idx, collection_name in enumerate(
404+
results.get("collection_names")
405+
):
406+
files.append(
407+
{
408+
"collection_name": collection_name,
409+
"name": searchQuery,
410+
"type": "web_search",
411+
"urls": [results["filenames"][col_idx]],
412+
}
413+
)
411414
elif results.get("docs"):
412-
files.append(
413-
{
414-
"docs": results.get("docs", []),
415-
"name": searchQuery,
416-
"type": "web_search",
417-
"urls": results["filenames"],
418-
}
419-
)
415+
# Invoked when bypass embedding and retrieval is set to True
416+
docs = results["docs"]
417+
418+
if len(docs) == len(results["filenames"]):
419+
# the number of docs and filenames (urls) should be the same
420+
for doc_idx, doc in enumerate(docs):
421+
files.append(
422+
{
423+
"docs": [doc],
424+
"name": searchQuery,
425+
"type": "web_search",
426+
"urls": [results["filenames"][doc_idx]],
427+
}
428+
)
429+
else:
430+
# edge case when the number of docs and filenames (urls) are not the same
431+
# this should not happen, but if it does, we will just append the docs
432+
files.append(
433+
{
434+
"docs": results.get("docs", []),
435+
"name": searchQuery,
436+
"type": "web_search",
437+
"urls": results["filenames"],
438+
}
439+
)
420440

421441
form_data["files"] = files
422442
except Exception as e:

backend/open_webui/utils/tools.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,9 @@ def convert_openapi_to_tool_payload(openapi_spec):
337337
tool = {
338338
"type": "function",
339339
"name": operation.get("operationId"),
340-
"description": operation.get("summary", "No description available."),
340+
"description": operation.get(
341+
"description", operation.get("summary", "No description available.")
342+
),
341343
"parameters": {"type": "object", "properties": {}, "required": []},
342344
}
343345

backend/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ elasticsearch==8.17.1
5454

5555
transformers
5656
sentence-transformers==3.3.1
57+
accelerate
5758
colbert-ai==0.2.21
5859
einops==0.8.1
5960

0 commit comments

Comments
 (0)