mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 05:45:19 +00:00
修复时间类型bugmodified: backend/open_webui/utils/middleware.py
This commit is contained in:
parent
34ea5f5426
commit
f591a2788b
2 changed files with 4 additions and 2 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1,3 +1,4 @@
|
||||||
|
./unitest/
|
||||||
x.py
|
x.py
|
||||||
yarn.lock
|
yarn.lock
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
@ -7,7 +8,7 @@ node_modules
|
||||||
/package
|
/package
|
||||||
.env
|
.env
|
||||||
.env.*
|
.env.*
|
||||||
!.env.example
|
!.env.exampley
|
||||||
vite.config.js.timestamp-*
|
vite.config.js.timestamp-*
|
||||||
vite.config.ts.timestamp-*
|
vite.config.ts.timestamp-*
|
||||||
# Byte-compiled / optimized / DLL files
|
# Byte-compiled / optimized / DLL files
|
||||||
|
|
|
||||||
|
|
@ -562,7 +562,8 @@ async def chat_memory_handler(
|
||||||
'''
|
'''
|
||||||
for item in mem0_results:
|
for item in mem0_results:
|
||||||
memory_content = item["memory"] if isinstance(item, dict) else item
|
memory_content = item["memory"] if isinstance(item, dict) else item
|
||||||
created_at_date = time.strftime("%Y-%m-%d", time.localtime(item.get("created_at", 0))) if isinstance(item, dict) else "Unknown Date"
|
created_at_date = item["created_at"] if isinstance(item, dict) else "unknown date"
|
||||||
|
|
||||||
categories = item.get("categories", []) if isinstance(item, dict) else []
|
categories = item.get("categories", []) if isinstance(item, dict) else []
|
||||||
if categories:
|
if categories:
|
||||||
entries.append(f"[{created_at_date}] {memory_content} (Categories: {', '.join(categories)})")
|
entries.append(f"[{created_at_date}] {memory_content} (Categories: {', '.join(categories)})")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue