mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 03:32:23 +08:00
revert page column (#8217)
This commit is contained in:
parent
d4dc54447a
commit
bb3002b173
|
@ -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
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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…
Reference in New Issue
Block a user