Skip to content

Commit

Permalink
refactor: streamline segment casting and enhance output validation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
charli117 committed Feb 11, 2025
1 parent 87b2614 commit 127aa4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/core/rag/datasource/retrieval_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,10 @@ def format_retrieval_documents(cls, documents: list[Document]) -> list[Retrieval
.first()
)

segment = cast(DocumentSegment, segment)
if not segment:
continue

segment = cast(DocumentSegment, segment)
include_segment_ids.add(segment.id)
record = {
"segment": segment,
Expand Down

0 comments on commit 127aa4b

Please sign in to comment.