feat(transcribe,telegram,config): voice notes, round videos and audio get a transcript from pluggable providers, an openai-compatible one built in
This commit is contained in:
1 parent
944b68e275
commit
42a7058f75
12 files changed
+454
-28
No files matched your search
@@ -1,6 +1,8 @@
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from beaver_gateway import config
|
||||
|
||||
|
||||
@@ -14,3 +16,15 @@ def test_config_imports_sibling_modules():
|
||||
)
|
||||
gw = config.load(root / "config.py")
|
||||
assert gw.agents == []
|
||||
|
||||
|
||||
def test_config_takes_transcribers_and_refuses_what_cannot_be_called():
|
||||
root = Path(tempfile.mkdtemp(prefix="beaver-cfg-"))
|
||||
(root / "config.py").write_text(
|
||||
"gateway = Gateway(transcribers=[OpenAITranscriber(language='ru')])\n"
|
||||
)
|
||||
(gw_stt,) = config.load(root / "config.py").transcribers
|
||||
assert gw_stt.language == "ru" and gw_stt.model == "whisper-1"
|
||||
(root / "config.py").write_text("gateway = Gateway(transcribers=['whisper'])\n")
|
||||
with pytest.raises(config.ConfigError, match=r"transcribers\[0\]"):
|
||||
config.load(root / "config.py")
|
||||
Reference in new issue
Block a user