getModels method

Future<List<Map<String, dynamic>>> getModels()

Get available models

Implementation

Future<List<Map<String, dynamic>>> getModels() async {
  if (config.apiKey.isEmpty) {
    throw const AuthError('Missing ElevenLabs API key');
  }

  try {
    final models = await client.getList('models');
    return models.cast<Map<String, dynamic>>();
  } catch (e) {
    if (e is LLMError) rethrow;
    throw GenericError('Unexpected error: $e');
  }
}