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 mutable objects as default parameter values in a function #946

Merged
merged 2 commits into from
Feb 13, 2025
Merged
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
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
Loading