Skip to content

Commit cd867d1

Browse files
committed
chore: regenerate openapi and proto spec
1 parent 441c450 commit cd867d1

26 files changed

Lines changed: 937 additions & 701 deletions

generate_webrtc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fi
4141

4242
# Install Python dependencies
4343
echo "Installing Python dependencies..."
44-
uv add "twirp>=0.0.7" "protobuf>=4.25.1" "python-dateutil>=2.8.2" "aiortc>=1.10.1" --optional webrtc
44+
uv add "twirp>=0.0.7" "protobuf>=6.31.1" "python-dateutil>=2.8.2" "aiortc>=1.10.1" --optional webrtc
4545

4646
# Ensure Go tools are available for Twirp
4747
if ! command -v go &> /dev/null; then

getstream/models/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ class AsyncExportErrorEvent(DataClassJsonMixin):
475475
task_id: str = dc_field(metadata=dc_config(field_name="task_id"))
476476
custom: Dict[str, object] = dc_field(metadata=dc_config(field_name="custom"))
477477
type: str = dc_field(
478-
default="export.moderation_logs.error", metadata=dc_config(field_name="type")
478+
default="export.channels.error", metadata=dc_config(field_name="type")
479479
)
480480
received_at: Optional[datetime] = dc_field(
481481
default=None,
@@ -1789,8 +1789,8 @@ class CallParticipant(DataClassJsonMixin):
17891789
)
17901790
)
17911791
online: bool = dc_field(metadata=dc_config(field_name="online"))
1792-
role: str = dc_field(metadata=dc_config(field_name="Role"))
17931792
role: str = dc_field(metadata=dc_config(field_name="role"))
1793+
role: str = dc_field(metadata=dc_config(field_name="Role"))
17941794
user_session_id: str = dc_field(metadata=dc_config(field_name="UserSessionID"))
17951795
custom: Dict[str, object] = dc_field(metadata=dc_config(field_name="custom"))
17961796
teams_role: "Dict[str, str]" = dc_field(metadata=dc_config(field_name="teams_role"))
@@ -8575,7 +8575,7 @@ class ModerationFlagResponse(DataClassJsonMixin):
85758575
moderation_payload: "Optional[ModerationPayload]" = dc_field(
85768576
default=None, metadata=dc_config(field_name="moderation_payload")
85778577
)
8578-
review_queue_item: "Optional[ReviewQueueItem]" = dc_field(
8578+
review_queue_item: "Optional[ReviewQueueItemResponse]" = dc_field(
85798579
default=None, metadata=dc_config(field_name="review_queue_item")
85808580
)
85818581
user: "Optional[UserResponse]" = dc_field(

getstream/plugins/deepgram/tests/test_realtime.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,18 +188,18 @@ def on_partial_transcript(text, user, metadata):
188188

189189
# Check that we received the partial transcript events
190190
assert len(partial_transcript_events) == 2, "Expected 2 partial transcript events"
191-
assert (
192-
partial_transcript_events[0][0] == "typing in prog"
193-
), "Incorrect partial transcript text"
194-
assert (
195-
partial_transcript_events[1][0] == "typing in progress"
196-
), "Incorrect partial transcript text"
191+
assert partial_transcript_events[0][0] == "typing in prog", (
192+
"Incorrect partial transcript text"
193+
)
194+
assert partial_transcript_events[1][0] == "typing in progress", (
195+
"Incorrect partial transcript text"
196+
)
197197

198198
# Check that we received the final transcript event
199199
assert len(transcript_events) == 1, "Expected 1 final transcript event"
200-
assert (
201-
transcript_events[0][0] == "typing in progress complete"
202-
), "Incorrect final transcript text"
200+
assert transcript_events[0][0] == "typing in progress complete", (
201+
"Incorrect final transcript text"
202+
)
203203

204204
# Cleanup
205205
await stt.close()

getstream/plugins/deepgram/tests/test_stt.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ def on_error(error):
412412
max_retries = 3
413413
for attempt in range(max_retries):
414414
try:
415-
print(f"Attempt {attempt+1}/{max_retries}: Sending audio to Deepgram")
415+
print(f"Attempt {attempt + 1}/{max_retries}: Sending audio to Deepgram")
416416

417417
# Instead of sending all at once, let's chunk the audio
418418
# This simulates real-time audio streaming better
@@ -465,7 +465,7 @@ def on_error(error):
465465
except Exception as e:
466466
if attempt < max_retries - 1:
467467
# Log the error and retry
468-
print(f"Retry {attempt+1}/{max_retries} failed: {e}")
468+
print(f"Retry {attempt + 1}/{max_retries} failed: {e}")
469469
await asyncio.sleep(1.0) # Wait before retrying
470470
# Try to create a fresh STT instance
471471
await stt.close()
@@ -498,9 +498,9 @@ def on_error(error):
498498
else:
499499
# Final attempt failed
500500
print(f"All retry attempts failed: {e}")
501-
assert (
502-
False
503-
), f"Failed to process audio after {max_retries} attempts: {e}"
501+
assert False, (
502+
f"Failed to process audio after {max_retries} attempts: {e}"
503+
)
504504

505505
# Cleanup and close the connection
506506
try:
@@ -510,9 +510,9 @@ def on_error(error):
510510
print(f"Error closing STT: {e}")
511511

512512
# We should have received transcripts
513-
assert (
514-
len(transcripts) > 0 or len(partial_transcripts) > 0
515-
), "No transcripts received after sending audio"
513+
assert len(transcripts) > 0 or len(partial_transcripts) > 0, (
514+
"No transcripts received after sending audio"
515+
)
516516
print(
517517
f"Received {len(transcripts)} transcripts and {len(partial_transcripts)} partial transcripts"
518518
)
@@ -541,9 +541,9 @@ async def test_deepgram_keep_alive_mechanism():
541541
await asyncio.sleep(0.2)
542542

543543
# We should see that keep-alive messages have been sent
544-
assert (
545-
len(connection.sent_text_messages) > 0
546-
), "No keep-alive messages sent after wait"
544+
assert len(connection.sent_text_messages) > 0, (
545+
"No keep-alive messages sent after wait"
546+
)
547547

548548
# Cleanup
549549
await stt.close()
@@ -569,9 +569,9 @@ async def test_deepgram_keep_alive_after_audio():
569569
await asyncio.sleep(0.2)
570570

571571
# We should see that keep-alive messages have been sent
572-
assert (
573-
len(connection.sent_text_messages) > 0
574-
), "No keep-alive messages sent after audio processing"
572+
assert len(connection.sent_text_messages) > 0, (
573+
"No keep-alive messages sent after audio processing"
574+
)
575575

576576
# Cleanup
577577
await stt.close()
@@ -594,9 +594,9 @@ async def test_deepgram_keep_alive_direct():
594594
assert success, "Failed to send keep-alive message"
595595

596596
# The connection should have received the message
597-
assert (
598-
len(connection.sent_text_messages) > 0
599-
), "No keep-alive messages were recorded"
597+
assert len(connection.sent_text_messages) > 0, (
598+
"No keep-alive messages were recorded"
599+
)
600600

601601
# If the connection has a keep_alive method, then the send_text method should not be used
602602
if hasattr(connection, "keep_alive"):
@@ -853,15 +853,15 @@ def on_error(error):
853853

854854
if transcripts:
855855
for i, (text, user, metadata) in enumerate(transcripts):
856-
print(f"Final transcript {i+1}: {text}")
856+
print(f"Final transcript {i + 1}: {text}")
857857
print(f"Metadata: {metadata}")
858858

859859
if partial_transcripts:
860860
print(f"Total partial transcripts: {len(partial_transcripts)}")
861861

862862
if errors:
863863
for i, error in enumerate(errors):
864-
print(f"Error {i+1}: {error}")
864+
print(f"Error {i + 1}: {error}")
865865

866866
# Validation
867867
assert len(errors) == 0, f"Received errors: {errors}"
@@ -904,14 +904,14 @@ def on_error(error):
904904
print(f"Key words found: {found_key_words}")
905905

906906
# We should find at least some key words from the story
907-
assert (
908-
len(found_key_words) >= 2
909-
), f"Expected to find at least 2 key words from {key_words}, but only found {found_key_words}"
907+
assert len(found_key_words) >= 2, (
908+
f"Expected to find at least 2 key words from {key_words}, but only found {found_key_words}"
909+
)
910910

911911
# Check that we got a reasonable amount of text
912-
assert (
913-
len(actual_words) >= 10
914-
), f"Expected at least 10 words, but got {len(actual_words)}: {combined_text}"
912+
assert len(actual_words) >= 10, (
913+
f"Expected at least 10 words, but got {len(actual_words)}: {combined_text}"
914+
)
915915

916916
# Verify metadata structure
917917
assert "confidence" in metadata

getstream/plugins/moonshine/tests/test_stt.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -696,17 +696,17 @@ def on_error(error):
696696

697697
if transcripts:
698698
for i, (text, user, metadata) in enumerate(transcripts):
699-
print(f"Transcript {i+1}: {text}")
699+
print(f"Transcript {i + 1}: {text}")
700700
print(f"Metadata: {metadata}")
701701

702702
if errors:
703703
for i, error in enumerate(errors):
704-
print(f"Error {i+1}: {error}")
704+
print(f"Error {i + 1}: {error}")
705705

706706
# We should either get transcripts or errors, but not silence
707-
assert (
708-
len(transcripts) > 0 or len(errors) > 0
709-
), "No transcripts or errors received"
707+
assert len(transcripts) > 0 or len(errors) > 0, (
708+
"No transcripts or errors received"
709+
)
710710

711711
# If we got transcripts, verify they contain reasonable content
712712
if transcripts:
@@ -745,14 +745,14 @@ def on_error(error):
745745
print(f"Key words found: {found_key_words}")
746746

747747
# We should find at least some key words from the story
748-
assert (
749-
len(found_key_words) >= 2
750-
), f"Expected to find at least 2 key words from {key_words}, but only found {found_key_words}"
748+
assert len(found_key_words) >= 2, (
749+
f"Expected to find at least 2 key words from {key_words}, but only found {found_key_words}"
750+
)
751751

752752
# Check that we got a reasonable amount of text
753-
assert (
754-
len(actual_words) >= 10
755-
), f"Expected at least 10 words, but got {len(actual_words)}: {combined_text}"
753+
assert len(actual_words) >= 10, (
754+
f"Expected at least 10 words, but got {len(actual_words)}: {combined_text}"
755+
)
756756

757757
# Verify metadata structure
758758
assert "processing_time_ms" in metadata

getstream/plugins/silero/tests/test_bench.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,6 @@ async def test_vad_benchmark_onnx():
161161
print(f" Speech segments detected: {results['speech_segments']}")
162162

163163
# Verify that the ONNX implementation is reasonably efficient
164-
assert (
165-
results["rtf"] < 2.0
166-
), f"ONNX VAD performance too slow: RTF = {results['rtf']:.3f}"
164+
assert results["rtf"] < 2.0, (
165+
f"ONNX VAD performance too slow: RTF = {results['rtf']:.3f}"
166+
)

getstream/plugins/silero/tests/test_vad.py

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,9 @@ def verify_detected_speech(
225225

226226
# Verify number of turns if specified
227227
if expected_turns is not None:
228-
assert (
229-
len(detected_segments) == expected_turns
230-
), f"Expected {expected_turns} speech turns, got {len(detected_segments)}"
228+
assert len(detected_segments) == expected_turns, (
229+
f"Expected {expected_turns} speech turns, got {len(detected_segments)}"
230+
)
231231

232232
# Calculate total detected duration
233233
total_detected_duration = sum(segment["duration"] for segment in detected_segments)
@@ -241,19 +241,19 @@ def verify_detected_speech(
241241
logger.info(f"Expected speech duration: {expected_duration:.2f} seconds")
242242
logger.info(f"Detected speech duration: {total_detected_duration:.2f} seconds")
243243
logger.info(
244-
f"Tolerance: ±{tolerance*100:.0f}% ({min_expected:.2f} - {max_expected:.2f}s)"
244+
f"Tolerance: ±{tolerance * 100:.0f}% ({min_expected:.2f} - {max_expected:.2f}s)"
245245
)
246246

247247
if len(detected_segments) > 0:
248248
logger.info(f"Number of detected segments: {len(detected_segments)}")
249249
# Log the speech segments for inspection
250250
for i, segment in enumerate(detected_segments):
251-
logger.info(f"Speech segment {i+1}: {segment['duration']:.2f}s")
251+
logger.info(f"Speech segment {i + 1}: {segment['duration']:.2f}s")
252252

253253
# Verify that the duration is within expected range
254-
assert (
255-
min_expected <= total_detected_duration <= max_expected
256-
), f"Expected speech duration {expected_duration}s (±{tolerance*100:.0f}%), got {total_detected_duration}s"
254+
assert min_expected <= total_detected_duration <= max_expected, (
255+
f"Expected speech duration {expected_duration}s (±{tolerance * 100:.0f}%), got {total_detected_duration}s"
256+
)
257257

258258

259259
def verify_partial_events(partial_segments, detected_segments):
@@ -269,9 +269,9 @@ def verify_partial_events(partial_segments, detected_segments):
269269

270270
# Each detected segment should have at least one corresponding partial event
271271
# For simplicity, we just check that we have at least one partial event per detected segment
272-
assert (
273-
len(partial_segments) >= len(detected_segments)
274-
), f"Expected at least {len(detected_segments)} partial events, got {len(partial_segments)}"
272+
assert len(partial_segments) >= len(detected_segments), (
273+
f"Expected at least {len(detected_segments)} partial events, got {len(partial_segments)}"
274+
)
275275

276276

277277
@pytest.mark.asyncio
@@ -512,9 +512,9 @@ def on_partial(event, user=None):
512512

513513
# Verify that partial events were received before the final audio event
514514
assert len(partial_events) > 0, "No partial events detected"
515-
assert (
516-
len(partial_events) >= len(detected_speech)
517-
), f"Expected at least {len(detected_speech)} partial events, got {len(partial_events)}"
515+
assert len(partial_events) >= len(detected_speech), (
516+
f"Expected at least {len(detected_speech)} partial events, got {len(partial_events)}"
517+
)
518518
logger.info(f"Detected {len(partial_events)} partial events")
519519

520520
# Clean up
@@ -600,9 +600,9 @@ def on_partial_16k(event, user=None):
600600
# Load 16 kHz audio file
601601
audio_path_16k = get_audio_asset("formant_speech_16k.wav")
602602
audio_data_16k, sample_rate_16k = sf.read(audio_path_16k, dtype="int16")
603-
assert (
604-
sample_rate_16k == 16000
605-
), f"Expected sample rate 16000, got {sample_rate_16k}"
603+
assert sample_rate_16k == 16000, (
604+
f"Expected sample rate 16000, got {sample_rate_16k}"
605+
)
606606

607607
# Process the 16 kHz audio
608608
await vad_16k.process_audio(
@@ -634,9 +634,9 @@ def on_partial_48k(event, user=None):
634634
# Load 48 kHz audio file
635635
audio_path_48k = get_audio_asset("formant_speech_48k.wav")
636636
audio_data_48k, sample_rate_48k = sf.read(audio_path_48k, dtype="int16")
637-
assert (
638-
sample_rate_48k == 48000
639-
), f"Expected sample rate 48000, got {sample_rate_48k}"
637+
assert sample_rate_48k == 48000, (
638+
f"Expected sample rate 48000, got {sample_rate_48k}"
639+
)
640640

641641
# Process the 48 kHz audio
642642
await vad_48k.process_audio(
@@ -646,12 +646,12 @@ def on_partial_48k(event, user=None):
646646
await asyncio.sleep(0.1)
647647

648648
# Verify both detected speech segments and partial events
649-
assert (
650-
len(detected_speech_16k) > 0
651-
), "No speech segments detected in 16 kHz audio"
652-
assert (
653-
len(detected_speech_48k) > 0
654-
), "No speech segments detected in 48 kHz audio"
649+
assert len(detected_speech_16k) > 0, (
650+
"No speech segments detected in 16 kHz audio"
651+
)
652+
assert len(detected_speech_48k) > 0, (
653+
"No speech segments detected in 48 kHz audio"
654+
)
655655
logger.info(
656656
f"Detected {len(detected_speech_16k)} speech segments in 16 kHz audio"
657657
)
@@ -779,9 +779,9 @@ async def test_cuda_fallback(self):
779779
)
780780

781781
# Check that the device fell back to CPU
782-
assert (
783-
vad.device_name == "cpu"
784-
), "Failed to fall back to CPU when CUDA unavailable"
782+
assert vad.device_name == "cpu", (
783+
"Failed to fall back to CPU when CUDA unavailable"
784+
)
785785
assert vad.device.type == "cpu", "Device is not CPU after fallback"
786786

787787
# Create a short silence for inference
@@ -837,9 +837,9 @@ def on_audio(event, user=None):
837837

838838
# Verify that at least one speech segment was emitted due to the flush
839839
assert len(detected_speech) > 0, "No speech segments detected after flush"
840-
assert detected_speech[-1][
841-
"from_flush"
842-
], "Last speech segment was not triggered by flush"
840+
assert detected_speech[-1]["from_flush"], (
841+
"Last speech segment was not triggered by flush"
842+
)
843843

844844
# Clean up
845845
await vad.close()

getstream/stream.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from getstream.video.client import VideoClient
1515

1616

17-
1817
BASE_URL = "https://chat.stream-io-api.com/"
1918

2019

0 commit comments

Comments
 (0)