File size: 712 Bytes
673435a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import requests
import json

def test_api():
    base_url = "http://localhost:8000/api/v1"
    
    print("Testing TTS Voices endpoint...")
    try:
        response = requests.get(f"{base_url}/tts/voices")
        print(f"Status Code: {response.status_code}")
        if response.status_code == 200:
            data = response.json()
            print(f"Total Voices: {data.get('total', 0)}")
            print("First 3 voices:")
            for v in data.get("voices", [])[:3]:
                print(f"- {v['name']} ({v['language_code']})")
        else:
            print("Error:", response.text)
    except Exception as e:
        print(f"Connection failed: {e}")

if __name__ == "__main__":
    test_api()