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,