From 3ea85a6d59dc5bb594ea3421f172bc67b1cd3f3d Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Fri, 3 Nov 2023 17:50:01 +0800
Subject: [PATCH] feat:web add reference
---
pilot/scene/chat_knowledge/v1/chat.py | 12 +++++++-----
pilot/server/static/404.html | 2 +-
pilot/server/static/404/index.html | 2 +-
.../_buildManifest.js | 2 +-
.../_ssgManifest.js | 0
...4.f9e3c1ab25dda485.js => 304.406e3b6b89d8e49a.js} | 2 +-
.../_next/static/chunks/604.0b6534ada5e802bc.js | 1 -
.../_next/static/chunks/604.3bbbeaa2c767e7dc.js | 1 +
...-7394a5c2fd417054.js => _app-41ccdddf1de778e7.js} | 2 +-
.../static/chunks/pages/database-2066e1a37e227df6.js | 1 +
.../static/chunks/pages/database-ed7e37a49de751e1.js | 1 -
.../chunks/pages/knowledge-40fc3593b22ec10a.js | 1 +
.../chunks/pages/knowledge-c73b240310994685.js | 1 -
...cb320c82fd7041.js => webpack-77553ab117b6c794.js} | 2 +-
.../static/_next/static/css/6e82c5f591153e56.css | 3 ---
.../static/_next/static/css/d07b94ffd4f33c05.css | 3 +++
pilot/server/static/agent/index.html | 2 +-
pilot/server/static/chat/[scene]/[id]/index.html | 2 +-
pilot/server/static/chat/index.html | 2 +-
pilot/server/static/database/index.html | 2 +-
pilot/server/static/index.html | 2 +-
pilot/server/static/knowledge/chunk/index.html | 2 +-
pilot/server/static/knowledge/index.html | 2 +-
pilot/server/static/models/index.html | 2 +-
pilot/server/static/prompt/index.html | 2 +-
25 files changed, 28 insertions(+), 26 deletions(-)
rename pilot/server/static/_next/static/{2DHoqE6YLNDUgtBJJVe8p => Kx09a-jiuL7Kdi7fpiNnT}/_buildManifest.js (81%)
rename pilot/server/static/_next/static/{2DHoqE6YLNDUgtBJJVe8p => Kx09a-jiuL7Kdi7fpiNnT}/_ssgManifest.js (100%)
rename pilot/server/static/_next/static/chunks/{304.f9e3c1ab25dda485.js => 304.406e3b6b89d8e49a.js} (74%)
delete mode 100644 pilot/server/static/_next/static/chunks/604.0b6534ada5e802bc.js
create mode 100644 pilot/server/static/_next/static/chunks/604.3bbbeaa2c767e7dc.js
rename pilot/server/static/_next/static/chunks/pages/{_app-7394a5c2fd417054.js => _app-41ccdddf1de778e7.js} (92%)
create mode 100644 pilot/server/static/_next/static/chunks/pages/database-2066e1a37e227df6.js
delete mode 100644 pilot/server/static/_next/static/chunks/pages/database-ed7e37a49de751e1.js
create mode 100644 pilot/server/static/_next/static/chunks/pages/knowledge-40fc3593b22ec10a.js
delete mode 100644 pilot/server/static/_next/static/chunks/pages/knowledge-c73b240310994685.js
rename pilot/server/static/_next/static/chunks/{webpack-fbcb320c82fd7041.js => webpack-77553ab117b6c794.js} (60%)
delete mode 100644 pilot/server/static/_next/static/css/6e82c5f591153e56.css
create mode 100644 pilot/server/static/_next/static/css/d07b94ffd4f33c05.css
diff --git a/pilot/scene/chat_knowledge/v1/chat.py b/pilot/scene/chat_knowledge/v1/chat.py
index 4f3646718..d57b32b25 100644
--- a/pilot/scene/chat_knowledge/v1/chat.py
+++ b/pilot/scene/chat_knowledge/v1/chat.py
@@ -130,19 +130,21 @@ def parse_source_view(self, sources: List):
build knowledge reference view message to web
{
"title":"References",
- "reference":{
+ "references":[{
"name":"aa.pdf",
"pages":["1","2","3"]
- },
+ }]
}
"""
- references = {"title": "References", "reference": {}}
+ references = {"title": "References", "references": []}
for item in sources:
+ reference = {}
source = item["source"] if "source" in item else ""
- references["reference"]["name"] = source
+ reference["name"] = source
pages = item["pages"] if "pages" in item else []
if len(pages) > 0:
- references["reference"]["pages"] = pages
+ reference["pages"] = pages
+ references["references"].append(reference)
html = (
f"""
No data |
No data |