Spaces:
Running
Running
File size: 1,231 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 |
# 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
}
}
|