marks commited on
Commit
8e0a4a4
·
1 Parent(s): 3058f90

Reformat voice name

Browse files
Files changed (1) hide show
  1. api_clients.py +4 -3
api_clients.py CHANGED
@@ -117,13 +117,14 @@ class ElevenLabsClient:
117
 
118
  Returns:
119
  List of tuples containing (voice_id, display_name)
120
- where display_name combines name and description
121
  """
122
  try:
123
  voices = elevenlabs.voices()
124
  return [(
125
- voice.voice_id,
126
- f"{voice.name} - {voice.description[:50] + '...' if voice.description else ''}"
 
127
  ) for voice in voices]
128
  except Exception as e:
129
  logger.error("Failed to fetch voices from ElevenLabs", exc_info=True)
 
117
 
118
  Returns:
119
  List of tuples containing (voice_id, display_name)
120
+ where display_name shows the name and description but not the ID
121
  """
122
  try:
123
  voices = elevenlabs.voices()
124
  return [(
125
+ voice.voice_id, # Value (hidden from user)
126
+ f"{voice.name} ({voice.labels.get('accent', 'No accent')})" +
127
+ (f" - {voice.description[:50]}..." if voice.description else "")
128
  ) for voice in voices]
129
  except Exception as e:
130
  logger.error("Failed to fetch voices from ElevenLabs", exc_info=True)