41 lines
1.0 KiB
Python
41 lines
1.0 KiB
Python
import requests, sys, json
|
|
|
|
def main():
|
|
# Try read port file
|
|
try:
|
|
with open("gateway/port.txt") as f:
|
|
port = f.read().strip()
|
|
except:
|
|
print("❌ port.txt nicht gefunden")
|
|
return
|
|
|
|
base = f"http://localhost:{port}"
|
|
|
|
print("🔍 Healthcheck…")
|
|
try:
|
|
r = requests.get(base + "/health")
|
|
print("Health:", r.status_code, r.text)
|
|
except Exception as e:
|
|
print("❌ Healthcheck fehlgeschlagen:", e)
|
|
return
|
|
|
|
print("🎤 Test-Synthese…")
|
|
try:
|
|
payload = {
|
|
"model": "xtts-v2",
|
|
"input": "Dies ist ein Test.",
|
|
"voice": "auto",
|
|
"format": "wav"
|
|
}
|
|
r = requests.post(base + "/v1/audio/speech", json=payload)
|
|
print("TTS Status:", r.status_code)
|
|
if r.status_code == 200:
|
|
print("OK ✓")
|
|
else:
|
|
print("❌ TTS Fehler:", r.text)
|
|
except Exception as e:
|
|
print("❌ Synthese fehlgeschlagen:", e)
|
|
|
|
if __name__ == "__main__":
|
|
main()
|