Coverage for integrations / service_tools / tts_audio_suite_tool.py: 100.0%

10 statements  

« prev     ^ index     » next       coverage.py v7.14.0, created at 2026-05-12 04:49 +0000

1""" 

2TTS-Audio-Suite tool wrapper — text-to-speech with multiple engines. 

3 

4Service: TTS-Audio-Suite (https://github.com/diodiogod/TTS-Audio-Suite) 

5Port: Dynamic (assigned by RuntimeToolManager) 

6""" 

7 

8from .registry import ServiceToolInfo, service_tool_registry 

9 

10 

11class TTSAudioSuiteTool: 

12 """Thin wrapper to register TTS-Audio-Suite with the ServiceToolRegistry.""" 

13 

14 REPO_URL = "https://github.com/diodiogod/TTS-Audio-Suite" 

15 

16 @classmethod 

17 def create_tool_info(cls, base_url: str) -> ServiceToolInfo: 

18 return ServiceToolInfo( 

19 name="tts_audio_suite", 

20 description=( 

21 "Text-to-speech with multiple TTS engines. Provides high-quality " 

22 "speech synthesis with support for various models including " 

23 "Coqui TTS, XTTS, and more. Supports voice cloning and " 

24 "multiple languages." 

25 ), 

26 base_url=base_url, 

27 endpoints={ 

28 "synthesize": { 

29 "path": "/synthesize", 

30 "method": "POST", 

31 "description": ( 

32 "Generate speech audio from text. " 

33 "Input: JSON with 'text' (string to speak), " 

34 "'model' (optional model name), " 

35 "'language' (optional language code). " 

36 "Returns audio file URL." 

37 ), 

38 "params_schema": { 

39 "text": {"type": "string", "description": "Text to synthesize"}, 

40 "model": {"type": "string", "description": "TTS model name (optional)"}, 

41 "language": {"type": "string", "description": "Language code (optional)"}, 

42 }, 

43 }, 

44 "list_models": { 

45 "path": "/models", 

46 "method": "GET", 

47 "description": "List available TTS models and their capabilities.", 

48 "params_schema": {}, 

49 }, 

50 }, 

51 health_endpoint="/health", 

52 tags=["tts", "speech", "audio", "voice", "synthesis"], 

53 timeout=120, 

54 ) 

55 

56 @classmethod 

57 def register(cls, base_url: str) -> bool: 

58 """Register TTS-Audio-Suite with the global service_tool_registry.""" 

59 tool_info = cls.create_tool_info(base_url) 

60 return service_tool_registry.register_tool(tool_info)