Skip to content

Commit a527929

Browse files
authored
Directly access metadata in Metadata Lookup tool (#1815)
1 parent 34d7a66 commit a527929

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

lumen/ai/tools/metadata_lookup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,7 @@ async def _query_documents(
453453
filters = {"type": "document"}
454454

455455
# Get all document filenames from vector store
456-
all_doc_results = await doc_store.query(text="", top_k=1000, filters=filters)
457-
all_filenames = {r["metadata"]["filename"] for r in all_doc_results if "filename" in r["metadata"]}
456+
all_filenames = {md["filename"] for md in doc_store.metadata if "filename" in md}
458457

459458
# Get visible docs (if specified, only include these; otherwise include all)
460459
visible_docs = context.get("visible_docs")

0 commit comments

Comments
 (0)