Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert page column #8217

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/core/rag/datasource/vdb/vector_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def gen_index_struct_dict(vector_type: VectorType, collection_name: str) -> dict
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,6 @@ def _fetch_dataset_retriever(self, node_data: KnowledgeRetrievalNodeData, query:
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(
Expand Down Expand Up @@ -200,7 +197,6 @@ def _fetch_dataset_retriever(self, node_data: KnowledgeRetrievalNodeData, query:
"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),
Expand Down
1 change: 0 additions & 1 deletion api/core/workflow/nodes/llm/llm_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,6 @@ def _convert_to_original_retriever_resource(self, context_dict: dict) -> Optiona
"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
Expand Down