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

fix: missed ref_doc_id in retrieval #1025

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def payload_to_semantic_attributes(
attributes[RETRIEVAL_DOCUMENTS] = [
{
DOCUMENT_ID: node_with_score.node.node_id,
DOCUMENT_REF_DOC_ID: node_with_score.node.ref_doc_id,
DOCUMENT_SCORE: node_with_score.score,
DOCUMENT_CONTENT: node_with_score.node.text,
**(
Expand Down Expand Up @@ -704,6 +705,7 @@ def _flatten(mapping: Mapping[str, Any]) -> Iterator[Tuple[str, AttributeValue]]

DOCUMENT_CONTENT = DocumentAttributes.DOCUMENT_CONTENT
DOCUMENT_ID = DocumentAttributes.DOCUMENT_ID
DOCUMENT_REF_DOC_ID = DocumentAttributes.DOCUMENT_REF_DOC_ID
DOCUMENT_METADATA = DocumentAttributes.DOCUMENT_METADATA
DOCUMENT_SCORE = DocumentAttributes.DOCUMENT_SCORE
EMBEDDING_EMBEDDINGS = SpanAttributes.EMBEDDING_EMBEDDINGS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ class DocumentAttributes:
"""
The id of the document.
"""
DOCUMENT_REF_DOC_ID = "document.ref_doc_id"
"""
The ref id of the document.
"""
DOCUMENT_SCORE = "document.score"
"""
The score of the document
Expand Down
Loading