Skip to content

Commit 6fedd72

Browse files
authored
Merge pull request open-webui#10459 from open-webui/dev
0.5.16
2 parents cf4bbcd + 472a291 commit 6fedd72

File tree

6 files changed

+36
-43
lines changed

6 files changed

+36
-43
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ 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.5.16] - 2025-02-20
9+
10+
### Fixed
11+
12+
- **🔍 Web Search Retrieval Restored**: Resolved a critical issue that broke web search retrieval by reverting deduplication changes, ensuring complete and accurate search results once again.
13+
814
## [0.5.15] - 2025-02-20
915

1016
### Added

backend/open_webui/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,7 +1714,7 @@ class BannerModel(BaseModel):
17141714
- Respond in the same language as the user's query.
17151715
- If the context is unreadable or of poor quality, inform the user and provide the best possible answer.
17161716
- If the answer isn't present in the context but you possess the knowledge, explain this to the user and provide the answer using your own understanding.
1717-
- **Only include inline citations using [source_id] when a <source_id> tag is explicitly provided in the context.**
1717+
- **Only include inline citations using [source_id] (e.g., [1], [2]) when a `<source_id>` tag is explicitly provided in the context.**
17181718
- Do not cite if the <source_id> tag is not provided in the context.
17191719
- Do not use XML tags in your response.
17201720
- Ensure citations are concise and directly related to the information provided.
@@ -1957,7 +1957,7 @@ class BannerModel(BaseModel):
19571957
RAG_WEB_SEARCH_TRUST_ENV = PersistentConfig(
19581958
"RAG_WEB_SEARCH_TRUST_ENV",
19591959
"rag.web.search.trust_env",
1960-
os.getenv("RAG_WEB_SEARCH_TRUST_ENV", False),
1960+
os.getenv("RAG_WEB_SEARCH_TRUST_ENV", "False").lower() == "true",
19611961
)
19621962

19631963
PLAYWRIGHT_WS_URI = PersistentConfig(

backend/open_webui/retrieval/utils.py

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414

1515
from open_webui.config import VECTOR_DB
1616
from open_webui.retrieval.vector.connector import VECTOR_DB_CLIENT
17-
from open_webui.utils.misc import get_last_user_message
17+
from open_webui.utils.misc import get_last_user_message, calculate_sha256_string
18+
1819
from open_webui.models.users import UserModel
1920

2021
from open_webui.env import (
@@ -178,45 +179,31 @@ def merge_and_sort_query_results(
178179
combined_distances = []
179180
combined_documents = []
180181
combined_metadatas = []
181-
combined_ids = []
182182

183183
for data in query_results:
184184
combined_distances.extend(data["distances"][0])
185185
combined_documents.extend(data["documents"][0])
186186
combined_metadatas.extend(data["metadatas"][0])
187-
# DISTINCT(chunk_id,file_id) - in case if id (chunk_ids) become ordinals
188-
combined_ids.extend(
189-
[
190-
f"{id}-{meta['file_id']}"
191-
for id, meta in zip(data["ids"][0], data["metadatas"][0])
192-
]
193-
)
194187

195-
# Create a list of tuples (distance, document, metadata, ids)
196-
combined = list(
197-
zip(combined_distances, combined_documents, combined_metadatas, combined_ids)
198-
)
188+
# Create a list of tuples (distance, document, metadata)
189+
combined = list(zip(combined_distances, combined_documents, combined_metadatas))
199190

200191
# Sort the list based on distances
201192
combined.sort(key=lambda x: x[0], reverse=reverse)
202193

203-
sorted_distances = []
204-
sorted_documents = []
205-
sorted_metadatas = []
206-
# Otherwise we don't have anything :-(
207-
if combined:
194+
# We don't have anything :-(
195+
if not combined:
196+
sorted_distances = []
197+
sorted_documents = []
198+
sorted_metadatas = []
199+
else:
208200
# Unzip the sorted list
209-
all_distances, all_documents, all_metadatas, all_ids = zip(*combined)
210-
seen_ids = set()
201+
sorted_distances, sorted_documents, sorted_metadatas = zip(*combined)
202+
211203
# Slicing the lists to include only k elements
212-
for index, id in enumerate(all_ids):
213-
if id not in seen_ids:
214-
sorted_distances.append(all_distances[index])
215-
sorted_documents.append(all_documents[index])
216-
sorted_metadatas.append(all_metadatas[index])
217-
seen_ids.add(id)
218-
if len(sorted_distances) >= k:
219-
break
204+
sorted_distances = list(sorted_distances)[:k]
205+
sorted_documents = list(sorted_documents)[:k]
206+
sorted_metadatas = list(sorted_metadatas)[:k]
220207

221208
# Create the output dictionary
222209
result = {

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "open-webui",
3-
"version": "0.5.15",
3+
"version": "0.5.16",
44
"private": true,
55
"scripts": {
66
"dev": "npm run pyodide:fetch && vite dev --host",

src/lib/i18n/locales/zh-CN/translation.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
"Code execution": "代码执行",
183183
"Code Execution": "代码执行",
184184
"Code Execution Engine": "代码执行引擎",
185-
"Code Execution Timeout": "",
185+
"Code Execution Timeout": "代码执行超时时间",
186186
"Code formatted successfully": "代码格式化成功",
187187
"Code Interpreter": "代码解释器",
188188
"Code Interpreter Engine": "代码解释引擎",
@@ -205,7 +205,7 @@
205205
"Confirm your new password": "确认新密码",
206206
"Connect to your own OpenAI compatible API endpoints.": "连接到你自己的与 OpenAI 兼容的 API 接口端点。",
207207
"Connections": "外部连接",
208-
"Constrains effort on reasoning for reasoning models. Only applicable to reasoning models from specific providers that support reasoning effort. (Default: medium)": "限制推理模型的推理努力。仅适用于支持推理努力的特定提供商的推理模型。(默认值:中等)",
208+
"Constrains effort on reasoning for reasoning models. Only applicable to reasoning models from specific providers that support reasoning effort. (Default: medium)": "限制模型的努力。仅适用于支持努力的特定提供商的模型。(默认值:中等)",
209209
"Contact Admin for WebUI Access": "请联系管理员以获取访问权限",
210210
"Content": "内容",
211211
"Content Extraction": "内容提取",
@@ -322,7 +322,7 @@
322322
"Draw": "平局",
323323
"Drop any files here to add to the conversation": "拖动文件到此处以添加到对话中",
324324
"e.g. '30s','10m'. Valid time units are 's', 'm', 'h'.": "例如 '30s','10m'。有效的时间单位是秒:'s',分:'m',时:'h'。",
325-
"e.g. 60": "",
325+
"e.g. 60": "例如 '60'",
326326
"e.g. A filter to remove profanity from text": "例如:一个用于过滤文本中不当内容的过滤器",
327327
"e.g. My Filter": "例如:我的过滤器",
328328
"e.g. My Tools": "例如:我的工具",
@@ -410,7 +410,7 @@
410410
"Enter Tavily API Key": "输入 Tavily API 密钥",
411411
"Enter the public URL of your WebUI. This URL will be used to generate links in the notifications.": "输入 WebUI 的公共 URL。此 URL 将用于在通知中生成链接。",
412412
"Enter Tika Server URL": "输入 Tika 服务器地址",
413-
"Enter timeout in seconds": "",
413+
"Enter timeout in seconds": "输入以秒为单位的超时时间",
414414
"Enter Top K": "输入 Top K",
415415
"Enter URL (e.g. http://127.0.0.1:7860/)": "输入地址 (例如:http://127.0.0.1:7860/)",
416416
"Enter URL (e.g. http://localhost:11434)": "输入地址 (例如:http://localhost:11434)",
@@ -503,9 +503,9 @@
503503
"Functions allow arbitrary code execution": "注意:函数有权执行任意代码",
504504
"Functions allow arbitrary code execution.": "注意:函数有权执行任意代码。",
505505
"Functions imported successfully": "函数导入成功",
506-
"Gemini": "",
507-
"Gemini API Config": "",
508-
"Gemini API Key is required.": "",
506+
"Gemini": "Gemini",
507+
"Gemini API Config": "Gemini API 配置",
508+
"Gemini API Key is required.": "需要 Gemini API 密钥。",
509509
"General": "通用",
510510
"General Settings": "通用设置",
511511
"Generate an image": "生成图像",
@@ -981,7 +981,7 @@
981981
"The score should be a value between 0.0 (0%) and 1.0 (100%).": "分值应介于 0.0(0%)和 1.0(100%)之间。",
982982
"The temperature of the model. Increasing the temperature will make the model answer more creatively. (Default: 0.8)": "模型的温度。提高温度将使模型更具创造性地回答。(默认值:0.8)",
983983
"Theme": "主题",
984-
"Thinking...": "正在深度思考...",
984+
"Thinking...": "正在思考...",
985985
"This action cannot be undone. Do you wish to continue?": "此操作无法撤销。是否确认继续?",
986986
"This ensures that your valuable conversations are securely saved to your backend database. Thank you!": "这将确保您的宝贵对话被安全地保存到后台数据库中。感谢!",
987987
"This is an experimental feature, it may not function as expected and is subject to change at any time.": "这是一个实验功能,可能不会如预期那样工作,而且可能随时发生变化。",
@@ -995,8 +995,8 @@
995995
"This will delete all models including custom models and cannot be undone.": "这将删除所有模型,包括自定义模型,且无法撤销。",
996996
"This will reset the knowledge base and sync all files. Do you wish to continue?": "这将重置知识库并替换所有文件为目录下文件。确认继续?",
997997
"Thorough explanation": "解释较为详细",
998-
"Thought for {{DURATION}}": "已深度思考 用时 {{DURATION}}",
999-
"Thought for {{DURATION}} seconds": "已深度思考 用时 {{DURATION}} 秒",
998+
"Thought for {{DURATION}}": "已推理 持续 {{DURATION}}",
999+
"Thought for {{DURATION}} seconds": "已推理 持续 {{DURATION}} 秒",
10001000
"Tika": "Tika",
10011001
"Tika Server URL required.": "请输入 Tika 服务器地址。",
10021002
"Tiktoken": "Tiktoken",

0 commit comments

Comments
 (0)