File size: 2,269 Bytes
8be8b4b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
ο»Ώ# Test ElevenLabs API directly
Write-Host "πŸ§ͺ Testing ElevenLabs API Integration..." -ForegroundColor Yellow

# Test 1: Check if your API is accessible
try {
    Write-Host "`n1. Testing API health..." -ForegroundColor Cyan
    $health = Invoke-RestMethod -Uri "https://bravedims-ai-avatar-chat.hf.space/health" -Method GET
    Write-Host "βœ… API Status: $($health.status)" -ForegroundColor Green
    Write-Host "βœ… ElevenLabs Configured: $($health.elevenlabs_api_configured)" -ForegroundColor Green
} catch {
    Write-Host "❌ API Health Check Failed: $($_.Exception.Message)" -ForegroundColor Red
}

# Test 2: Try a simple generate request with better voice ID
try {
    Write-Host "`n2. Testing generation with Rachel voice (most reliable)..." -ForegroundColor Cyan
    
    $testPayload = @{
        prompt = "A simple test"
        text_to_speech = "This is a test message."
        voice_id = "21m00Tcm4TlvDq8ikWAM"
        guidance_scale = 5.0
        audio_scale = 3.5
        num_steps = 20
    } | ConvertTo-Json -Depth 3
    
    Write-Host "Payload:" -ForegroundColor Gray
    Write-Host $testPayload -ForegroundColor White
    
    $headers = @{"Content-Type" = "application/json"}
    $response = Invoke-RestMethod -Uri "https://bravedims-ai-avatar-chat.hf.space/generate" -Method POST -Body $testPayload -Headers $headers -TimeoutSec 120
    
    Write-Host "βœ… Generation successful!" -ForegroundColor Green
    $response | ConvertTo-Json -Depth 3
    
} catch {
    Write-Host "❌ Generation failed: $($_.Exception.Message)" -ForegroundColor Red
    if ($_.Exception.Response) {
        Write-Host "Status Code: $($_.Exception.Response.StatusCode)" -ForegroundColor Yellow
        $reader = New-Object System.IO.StreamReader($_.Exception.Response.GetResponseStream())
        $responseBody = $reader.ReadToEnd()
        Write-Host "Response Body: $responseBody" -ForegroundColor Yellow
    }
}

Write-Host "`nπŸ“‹ Common ElevenLabs Issues:" -ForegroundColor Magenta
Write-Host "1. API Key expired or invalid" -ForegroundColor White
Write-Host "2. Voice ID doesn't exist in your account" -ForegroundColor White  
Write-Host "3. Rate limit exceeded" -ForegroundColor White
Write-Host "4. Account credit/quota exhausted" -ForegroundColor White