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

Minor refactoring in ChromaDB class; renamed method; added description to method #214

Merged
merged 2 commits into from
Jan 30, 2024
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
14 changes: 12 additions & 2 deletions src/vanna/chromadb/chromadb_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ def remove_training_data(self, id: str, **kwargs) -> bool:
return True
else:
return False
def reomove_collection(self, collection_name: str) -> bool:

def remove_collection(self, collection_name: str) -> bool:
"""
This function can reset the collection to empty state.

Expand Down Expand Up @@ -184,9 +185,18 @@ def reomove_collection(self, collection_name: str) -> bool:
return True
else:
return False
# Static method to extract the documents from the results of a query

@staticmethod
def _extract_documents(query_results) -> list:
"""
Static method to extract the documents from the results of a query.

Args:
query_results (pd.DataFrame): The dataframe to use.

Returns:
List[str] or None: The extracted documents, or an empty list or single document if an error occurred.
"""
if query_results is None:
return []

Expand Down
Loading