Skip to content

Commit 5088709

Browse files
committed
cleanup of stt
1 parent f185120 commit 5088709

File tree

9 files changed

+157
-1497
lines changed

9 files changed

+157
-1497
lines changed

plugins/deepgram/vision_agents/plugins/deepgram/stt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import logging
44
import os
55
import time
6-
from typing import TYPE_CHECKING, Any, Dict, Optional
6+
from typing import Any, Dict, Optional
77

88
import numpy as np
99
import websockets

plugins/fish/vision_agents/plugins/fish/stt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import logging
33
import os
44
import wave
5-
from typing import TYPE_CHECKING, Any, Dict, Optional
5+
from typing import Optional
66

77
import numpy as np
88
from fish_audio_sdk import Session, ASRRequest
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import pytest
2+
3+
from vision_agents.plugins import moonshine
4+
from conftest import STTSession
5+
6+
7+
class TestMoonshineSTT:
8+
"""Integration tests for Moonshine STT"""
9+
10+
@pytest.fixture
11+
async def stt(self):
12+
"""Create and manage Moonshine STT lifecycle"""
13+
stt = moonshine.STT()
14+
try:
15+
yield stt
16+
finally:
17+
await stt.close()
18+
19+
@pytest.mark.integration
20+
async def test_transcribe_mia_audio(self, stt, mia_audio_16khz):
21+
# Create session to collect transcripts and errors
22+
session = STTSession(stt)
23+
24+
# Process the audio
25+
await stt.process_audio(mia_audio_16khz)
26+
27+
# Wait for result
28+
await session.wait_for_result(timeout=30.0)
29+
assert not session.errors
30+
31+
# Verify transcript
32+
full_transcript = session.get_full_transcript()
33+
assert "forgotten treasures" in full_transcript.lower()
34+
35+
@pytest.mark.integration
36+
async def test_transcribe_mia_audio_48khz(self, stt, mia_audio_48khz):
37+
# Create session to collect transcripts and errors
38+
session = STTSession(stt)
39+
40+
# Process the audio
41+
await stt.process_audio(mia_audio_48khz)
42+
43+
# Wait for result
44+
await session.wait_for_result(timeout=30.0)
45+
assert not session.errors
46+
47+
# Verify transcript
48+
full_transcript = session.get_full_transcript()
49+
assert "forgotten treasures" in full_transcript.lower()
50+

0 commit comments

Comments
 (0)