mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 00:16:23 +02:00
Filter answers from document lists (#683)
This commit is contained in:
parent
e1bc4c04a4
commit
ca525b679f
1 changed files with 2 additions and 1 deletions
|
|
@ -245,12 +245,13 @@ class Librarian:
|
|||
|
||||
docs = await self.table_store.list_documents(request.user)
|
||||
|
||||
# Filter out child documents by default unless include_children is True
|
||||
# Filter out child documents and answer documents by default
|
||||
include_children = getattr(request, 'include_children', False)
|
||||
if not include_children:
|
||||
docs = [
|
||||
doc for doc in docs
|
||||
if not doc.parent_id # Only include top-level documents
|
||||
and doc.document_type != "answer" # Exclude GraphRAG answers
|
||||
]
|
||||
|
||||
return LibrarianResponse(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue