diff --git a/litellm/llms/foundry_local/audio_transcription/transformation.py b/litellm/llms/foundry_local/audio_transcription/transformation.py index 8463d7578a4..6c400fc33f5 100644 --- a/litellm/llms/foundry_local/audio_transcription/transformation.py +++ b/litellm/llms/foundry_local/audio_transcription/transformation.py @@ -63,7 +63,7 @@ class FoundryLocalAudioTranscriptionConfig(OpenAIWhisperAudioTranscriptionConfig litellm_params: Mapping[str, object], ) -> AudioTranscriptionRequestData: if not isinstance(audio_file, Path): - raise ValueError("Foundry Local audio must be prepared using audio_file_context") + raise TypeError("Foundry Local audio must be prepared using audio_file_context") if optional_params.get("stream"): raise ValueError("Streaming Foundry Local transcription is not supported by this integration") return AudioTranscriptionRequestData( diff --git a/tests/unit/llms/foundry_local/chat/test_transformation.py b/tests/unit/llms/foundry_local/chat/test_transformation.py index 8123c763436..10ff927b5d7 100644 --- a/tests/unit/llms/foundry_local/chat/test_transformation.py +++ b/tests/unit/llms/foundry_local/chat/test_transformation.py @@ -320,6 +320,12 @@ def test_should_reject_bare_audio_paths_and_unsupported_transcription_options(tm config.get_complete_url(None, None, "whisper-tiny", {}, {}) +def test_should_require_prepared_audio_for_transcription() -> None: + config: Final = FoundryLocalAudioTranscriptionConfig() + with pytest.raises(TypeError, match="must be prepared using audio_file_context"): + config.transform_audio_transcription_request("whisper-tiny", b"audio-content", {}, {}) + + @pytest.mark.asyncio @pytest.mark.parametrize("stream", [False, True]) async def test_should_complete_chat_asynchronously_over_foundry_http_service(stream: bool) -> None: