瀏覽代碼

revert page column (#8217)

tags/0.8.0
Jyong 1 年之前
父節點
當前提交
bb3002b173
No account linked to committer's email address

+ 1
- 1
api/core/rag/datasource/vdb/vector_factory.py 查看文件

@@ -27,7 +27,7 @@ class AbstractVectorFactory(ABC):
class Vector:
def __init__(self, dataset: Dataset, attributes: list = None):
if attributes is None:
attributes = ["doc_id", "dataset_id", "document_id", "doc_hash", "page"]
attributes = ["doc_id", "dataset_id", "document_id", "doc_hash"]
self._dataset = dataset
self._embeddings = self._get_embeddings()
self._attributes = attributes

+ 0
- 4
api/core/workflow/nodes/knowledge_retrieval/knowledge_retrieval_node.py 查看文件

@@ -163,9 +163,6 @@ class KnowledgeRetrievalNode(BaseNode):
for item in all_documents:
if item.metadata.get("score"):
document_score_list[item.metadata["doc_id"]] = item.metadata["score"]
# both 'page' and 'score' are metadata fields
if item.metadata.get("page"):
page_number_list[item.metadata["doc_id"]] = item.metadata["page"]

index_node_ids = [document.metadata["doc_id"] for document in all_documents]
segments = DocumentSegment.query.filter(
@@ -200,7 +197,6 @@ class KnowledgeRetrievalNode(BaseNode):
"document_id": document.id,
"document_name": document.name,
"document_data_source_type": document.data_source_type,
"page": page_number_list.get(segment.index_node_id, None),
"segment_id": segment.id,
"retriever_from": "workflow",
"score": document_score_list.get(segment.index_node_id, None),

+ 0
- 1
api/core/workflow/nodes/llm/llm_node.py 查看文件

@@ -451,7 +451,6 @@ class LLMNode(BaseNode):
"segment_position": metadata.get("segment_position"),
"index_node_hash": metadata.get("segment_index_node_hash"),
"content": context_dict.get("content"),
"page": metadata.get("page"),
}

return source

Loading…
取消
儲存