Skip to content

Commit

Permalink
Polishing (#946)
Browse files Browse the repository at this point in the history
  • Loading branch information
davorrunje authored Feb 13, 2025
1 parent 8870478 commit 27b3749
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion autogen/agentchat/contrib/rag/docling_query_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def query(self, question: str) -> str:

return str(response)

def add_docs(self, new_doc_dir: Optional[str] = "", new_doc_paths: Optional[list[str]] = []) -> None:
def add_docs(self, new_doc_dir: Optional[str] = None, new_doc_paths: Optional[list[str]] = None) -> None:
"""
Add additional documents to the existing vector index.
Expand All @@ -137,6 +137,8 @@ def add_docs(self, new_doc_dir: Optional[str] = "", new_doc_paths: Optional[list
new_doc_paths: A list of file paths specifying additional documents to load.
Each file should be a Docling-parsed Markdown file.
"""
new_doc_dir = new_doc_dir or ""
new_doc_paths = new_doc_paths or []
new_docs = self._load_doc(input_dir=new_doc_dir, input_docs=new_doc_paths)
for doc in new_docs:
self.index.insert(doc)
Expand Down

0 comments on commit 27b3749

Please sign in to comment.