Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions videodb/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class Status:
class MeetingStatus:
initializing = "initializing"
processing = "processing"
joined = "joined"
done = "done"


Expand Down
6 changes: 5 additions & 1 deletion videodb/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -182,6 +182,7 @@ def connect_rtstream(
"collection_id": self.id,
"url": url,
"name": name,
"audio": audio,
"sample_rate": sample_rate,
},
)
Expand Down Expand Up @@ -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",
Expand All @@ -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``)
Expand All @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion videodb/meeting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -106,4 +108,4 @@ def wait_for_status(
return True
time.sleep(interval)

return False
return False
38 changes: 38 additions & 0 deletions videodb/rtstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -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