Skip to content

Commit

Permalink
Added description to _extract_documents method; minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
andreped authored Jan 29, 2024
1 parent 6b65da7 commit 9ae8318
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/vanna/chromadb/chromadb_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def remove_training_data(self, id: str, **kwargs) -> bool:
return True
else:
return False

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 remove_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

0 comments on commit 9ae8318

Please sign in to comment.