diff --git a/griptape/configs/drivers/azure_openai_drivers_config.py b/griptape/configs/drivers/azure_openai_drivers_config.py index a29ba3c2f..3ced8f9cd 100644 --- a/griptape/configs/drivers/azure_openai_drivers_config.py +++ b/griptape/configs/drivers/azure_openai_drivers_config.py @@ -10,6 +10,7 @@ AzureOpenAiEmbeddingDriver, AzureOpenAiImageGenerationDriver, AzureOpenAiImageQueryDriver, + AzureOpenAiTextToSpeechDriver, LocalVectorStoreDriver, ) from griptape.utils.decorators import lazy_property @@ -92,3 +93,13 @@ def vector_store_driver(self) -> LocalVectorStoreDriver: azure_ad_token_provider=self.azure_ad_token_provider, ) ) + + @lazy_property() + def text_to_speech_driver(self) -> AzureOpenAiTextToSpeechDriver: + return AzureOpenAiTextToSpeechDriver( + model="tts", + azure_endpoint=self.azure_endpoint, + api_key=self.api_key, + azure_ad_token=self.azure_ad_token, + azure_ad_token_provider=self.azure_ad_token_provider, + ) diff --git a/tests/unit/configs/drivers/test_azure_openai_drivers_config.py b/tests/unit/configs/drivers/test_azure_openai_drivers_config.py index 01886962e..83b9dd77c 100644 --- a/tests/unit/configs/drivers/test_azure_openai_drivers_config.py +++ b/tests/unit/configs/drivers/test_azure_openai_drivers_config.py @@ -85,6 +85,16 @@ def test_to_dict(self, config): }, "type": "LocalVectorStoreDriver", }, - "text_to_speech_driver": {"type": "DummyTextToSpeechDriver"}, + "text_to_speech_driver": { + "base_url": None, + "format": "mp3", + "model": "tts", + "api_version": "2024-07-01-preview", + "azure_deployment": "tts", + "azure_endpoint": "http://localhost:8080", + "organization": None, + "type": "AzureOpenAiTextToSpeechDriver", + "voice": "alloy", + }, "audio_transcription_driver": {"type": "DummyAudioTranscriptionDriver"}, }