diff --git a/videodb/_constants.py b/videodb/_constants.py index 4591892..7c5c1e7 100644 --- a/videodb/_constants.py +++ b/videodb/_constants.py @@ -94,6 +94,7 @@ class Status: class MeetingStatus: initializing = "initializing" processing = "processing" + joined = "joined" done = "done" diff --git a/videodb/collection.py b/videodb/collection.py index 994cda6..a947266 100644 --- a/videodb/collection.py +++ b/videodb/collection.py @@ -167,7 +167,7 @@ def delete_image(self, image_id: str) -> None: ) def connect_rtstream( - self, url: str, name: str, sample_rate: int = None + self, url: str, name: str, sample_rate: int = None, audio: bool = False ) -> RTStream: """Connect to an rtstream. @@ -182,6 +182,7 @@ def connect_rtstream( "collection_id": self.id, "url": url, "name": name, + "audio": audio, "sample_rate": sample_rate, }, ) @@ -519,6 +520,7 @@ def record_meeting( bot_name: str = None, bot_image_url: str = None, meeting_title: str = None, + realtime_stream: bool = False, callback_url: str = None, callback_data: Optional[dict] = None, time_zone: str = "UTC", @@ -529,6 +531,7 @@ def record_meeting( :param str bot_name: Name of the recorder bot :param str bot_image_url: URL of the recorder bot image :param str meeting_title: Name of the meeting + :param bool realtime_stream: Whether to stream the meeting in realtime :param str callback_url: URL to receive callback once recording is done :param dict callback_data: Data to be sent in the callback (optional) :param str time_zone: Time zone for the meeting (default ``UTC``) @@ -545,6 +548,7 @@ def record_meeting( "bot_name": bot_name, "bot_image_url": bot_image_url, "meeting_title": meeting_title, + "realtime_stream": realtime_stream, "callback_url": callback_url, "callback_data": callback_data, "time_zone": time_zone, diff --git a/videodb/meeting.py b/videodb/meeting.py index 827f5c6..f7da814 100644 --- a/videodb/meeting.py +++ b/videodb/meeting.py @@ -45,6 +45,8 @@ def _update_attributes(self, data: dict) -> None: self.time_zone = data.get("time_zone") self.video_id = data.get("video_id") self.speaker_timeline = data.get("speaker_timeline") + self.realtime_stream = data.get("realtime_stream") + self.realtime_stream_url = data.get("realtime_stream_url") def refresh(self) -> "Meeting": """Refresh meeting data from the server. @@ -106,4 +108,4 @@ def wait_for_status( return True time.sleep(interval) - return False + return False \ No newline at end of file diff --git a/videodb/rtstream.py b/videodb/rtstream.py index 4be4a8c..58178e6 100644 --- a/videodb/rtstream.py +++ b/videodb/rtstream.py @@ -299,3 +299,41 @@ def get_scene_index(self, index_id: str) -> RTStreamSceneIndex: name=index_data.get("name"), status=index_data.get("status"), ) + + def get_transcript( + self, + page=1, + page_size=100, + start=None, + end=None, + since=None, + engine=None, + ): + """Get transcription data from the rtstream. + + :param int page: Page number (default: 1) + :param int page_size: Items per page (default: 100, max: 1000) + :param float start: Start timestamp filter (optional) + :param float end: End timestamp filter (optional) + :param float since: For polling - only get transcriptions after this timestamp (optional) + :param str engine: Transcription engine (default: "AAIS") + :return: Transcription data with segments and metadata + :rtype: dict + """ + params = { + "engine": engine, + "page": page, + "page_size": page_size, + } + if start is not None: + params["start"] = start + if end is not None: + params["end"] = end + if since is not None: + params["since"] = since + + transcription_data = self._connection.get( + f"{ApiPath.rtstream}/{self.id}/{ApiPath.transcription}", + params=params, + ) + return transcription_data