marks commited on
Commit ·
8e0a4a4
1
Parent(s): 3058f90
Reformat voice name
Browse files116 unmodified lines117118119120121122123124125126127128129116 unmodified linesReturns:List of tuples containing (voice_id, display_name)where display_name combines name and description"""try:voices = elevenlabs.voices()return [(voice.voice_id,f"{voice.name} - {voice.description[:50] + '...' if voice.description else ''}") for voice in voices]except Exception as e:logger.error("Failed to fetch voices from ElevenLabs", exc_info=True)116 unmodified lines117118119120121122123124125126127128129130116 unmodified linesReturns:List of tuples containing (voice_id, display_name)where display_name shows the name and description but not the ID"""try:voices = elevenlabs.voices()return [(voice.voice_id, # Value (hidden from user)f"{voice.name} ({voice.labels.get('accent', 'No accent')})" +(f" - {voice.description[:50]}..." if voice.description else "")) for voice in voices]except Exception as e:logger.error("Failed to fetch voices from ElevenLabs", exc_info=True)
api_clients.py+4-3