Spaces:
Running
Running
| # Test the generate endpoint with your JSON | |
| $apiUrl = "https://bravedims-ai-avatar-chat.hf.space/generate" | |
| $jsonPayload = @{ | |
| prompt = "A professional teacher explaining a mathematical concept with clear gestures" | |
| text_to_speech = "Hello students! Today we're going to learn about calculus and how derivatives work in real life." | |
| voice_id = "21m00Tcm4TlvDq8ikWAM" | |
| image_url = "https://example.com/teacher.jpg" | |
| guidance_scale = 5.0 | |
| audio_scale = 3.5 | |
| num_steps = 30 | |
| } | ConvertTo-Json -Depth 3 | |
| $headers = @{ | |
| "Content-Type" = "application/json" | |
| } | |
| Write-Host "Testing generate endpoint..." -ForegroundColor Yellow | |
| Write-Host "URL: $apiUrl" -ForegroundColor Cyan | |
| Write-Host "Payload:" -ForegroundColor Green | |
| Write-Host $jsonPayload -ForegroundColor White | |
| try { | |
| $response = Invoke-RestMethod -Uri $apiUrl -Method POST -Body $jsonPayload -Headers $headers -TimeoutSec 120 | |
| Write-Host "`n✅ Success! Response:" -ForegroundColor Green | |
| $response | ConvertTo-Json -Depth 3 | |
| } catch { | |
| Write-Host "`n❌ Error: $($_.Exception.Message)" -ForegroundColor Red | |
| if ($_.Exception.Response) { | |
| Write-Host "Status Code: $($_.Exception.Response.StatusCode)" -ForegroundColor Yellow | |
| } | |
| } | |