From cf6c92d3e382e806a084cf3ede4a1e6a7bcb3c46 Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Wed, 22 Nov 2023 11:15:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- document_ai/server.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 2586aa0..e6ffd1d 100644 --- a/.gitignore +++ b/.gitignore @@ -158,5 +158,5 @@ cython_debug/ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire `idea` folder. -#.idea/ +.idea/ diff --git a/document_ai/server.py b/document_ai/server.py index b8b306e..a4980ca 100644 --- a/document_ai/server.py +++ b/document_ai/server.py @@ -64,7 +64,7 @@ class AIServer(proto.document_query_pb2_grpc.DocumentQuery): id=_chunk_id )) - print(_chunk_content.document) + # print(_chunk_content) # _doc_content_full = _chunk_content.content document_text += "\n" + _chunk_content.content + "\n" @@ -72,7 +72,8 @@ class AIServer(proto.document_query_pb2_grpc.DocumentQuery): # append sources.append({ "text": _chunk_content.content, - "document_id": _chunk_content.document.id + "document_id": _chunk_content.document.id, + "title": _chunk_content.document.title }) # doc_obj = Document(page_content=_doc_content_full, metadata={"source": "chunked content"}) @@ -86,6 +87,7 @@ class AIServer(proto.document_query_pb2_grpc.DocumentQuery): output = search(document_text, question) + print(sources) print("完成。") return proto.document_query_pb2.QueryResponse( text=output,