Skip to content

Commit

Permalink
Remove audiocast page and add docstrings to session manager methods
Browse files Browse the repository at this point in the history
  • Loading branch information
nwaughachukwuma committed Nov 3, 2024
1 parent 0b78ba2 commit e8cf5dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 66 deletions.
63 changes: 0 additions & 63 deletions pages/audiocast.py

This file was deleted.

6 changes: 3 additions & 3 deletions utils_pkg/session_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def _update(self, data: Dict):
return self._update_document(self.collection, self.doc_id, data)

def data(self) -> SessionModel | None:
"""Get session data"""
doc = self._get_document(self.collection, self.doc_id)

data = doc.to_dict()
Expand Down Expand Up @@ -75,9 +76,7 @@ def _update_title(self, title: str):
return self._update({"metadata.title": title})

def _add_chat(self, chat: SessionChatMessage):
return self._update_document(
self.collection, self.doc_id, {"chats": arrayUnion([chat.__dict__])}
)
return self._update_document(self.collection, self.doc_id, {"chats": arrayUnion([chat.__dict__])})

def _delete_chat(self, chat_id: str):
doc = self._get_document(self.collection, self.doc_id)
Expand Down Expand Up @@ -120,6 +119,7 @@ def _get_chats(self) -> List[SessionChatMessage]:
]

def subscribe_to_metadata_info(self, callback: Callable):
"""Subscribe to metadata.info"""
doc_ref = self._get_collection(self.collection).document(self.doc_id)

def on_snapshot(doc_snapshot, _changes, _read_time):
Expand Down

0 comments on commit e8cf5dc

Please sign in to comment.