litellm/tests/unit/llms/soniox/test_soniox_provider_registration.py
devin-ai-integration[bot] b1e07d7a17
chore(cost-map): add Soniox v6 and date Soniox, Bedrock Claude and Azure Whisper retirements (#51620)
* chore(cost-map): add Soniox v6 rows and date the v5, v4, v3 and preview-v2 retirements

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* chore(cost-map): date Bedrock Claude 3.5/3.7 Sonnet EOL, fix Azure Whisper retirement, default Soniox placeholder to v6

Co-authored-by: llmintel <social@llmintel.ai>
Co-authored-by: granbellllc-png <granbell.llc@gmail.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix: absorb verified DeepInfra registry updates

Absorb #51649 and #51652 without unverified output limits.

Co-authored-by: xinglan163 <250816997+xinglan163@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix: correct Gemini TTS caching and Vertex cyber capabilities

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix: correct Bedrock limits and Azure Flex pricing metadata

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix: declare verified Fireworks prompt caching capabilities

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix: add Perplexity Hydrogen and Mistral embedding cache rates

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test: derive Azure Flex expectations from registered tier rates

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: llmintel <social@llmintel.ai>
Co-authored-by: granbellllc-png <granbell.llc@gmail.com>
Co-authored-by: xinglan163 <250816997+xinglan163@users.noreply.github.com>
2026-11-13 12:37:12 -08:00

70 lines
2.7 KiB
Python

"""Tests verifying Soniox is correctly registered as a litellm provider."""
import pytest
import litellm
class TestProviderRegistration:
def test_should_expose_soniox_in_llm_providers_enum(self):
assert litellm.LlmProviders.SONIOX.value == "soniox"
def test_should_list_soniox_in_provider_list(self):
assert "soniox" in litellm.provider_list
def test_should_list_soniox_in_models_by_provider(self):
assert "soniox" in litellm.models_by_provider
def test_should_lazy_import_soniox_audio_transcription_config(self):
cls = litellm.SonioxAudioTranscriptionConfig
assert cls.__name__ == "SonioxAudioTranscriptionConfig"
# Calling again should return the same class (cached).
assert litellm.SonioxAudioTranscriptionConfig is cls
def test_should_resolve_soniox_via_get_llm_provider(self, monkeypatch):
monkeypatch.setenv("SONIOX_API_KEY", "test-key")
model, provider, api_key, api_base = litellm.get_llm_provider(
model="soniox/stt-async-v4"
)
assert provider == "soniox"
assert model == "stt-async-v4"
assert api_key == "test-key"
assert api_base == "https://api.soniox.com"
def test_should_resolve_soniox_v5_via_get_llm_provider(self, monkeypatch):
monkeypatch.setenv("SONIOX_API_KEY", "test-key")
model, provider, api_key, api_base = litellm.get_llm_provider(
model="soniox/stt-async-v5"
)
assert provider == "soniox"
assert model == "stt-async-v5"
assert api_key == "test-key"
assert api_base == "https://api.soniox.com"
def test_should_resolve_soniox_v6_via_get_llm_provider(self, monkeypatch):
monkeypatch.setenv("SONIOX_API_KEY", "test-key")
model, provider, api_key, api_base = litellm.get_llm_provider(
model="soniox/stt-async-v6"
)
assert provider == "soniox"
assert model == "stt-async-v6"
assert api_key == "test-key"
assert api_base == "https://api.soniox.com"
model, provider, api_key, api_base = litellm.get_llm_provider(
model="soniox/stt-rt-v6"
)
assert provider == "soniox"
assert model == "stt-rt-v6"
assert api_key == "test-key"
assert api_base == "https://api.soniox.com"
def test_should_return_soniox_config_from_provider_config_manager(self):
from litellm.utils import ProviderConfigManager
cfg = ProviderConfigManager.get_provider_audio_transcription_config(
model="stt-async-v4",
provider=litellm.LlmProviders.SONIOX,
)
assert cfg is not None
assert cfg.__class__.__name__ == "SonioxAudioTranscriptionConfig"