updated skeleton with true data

This commit is contained in:
2025-12-09 08:40:18 +01:00
parent 61e6644158
commit 8cd91b6f22
27 changed files with 1193 additions and 14 deletions

View File

@ -1,2 +1,20 @@
#!/usr/bin/env python3
print(8000)
import socket
START, END = 8000, 8100
def port_free(port):
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
try:
s.bind(("0.0.0.0", port))
return True
except OSError:
return False
for port in range(START, END + 1):
if port_free(port):
print(port)
exit(0)
print("ERR_NO_FREE_PORT")
exit(1)

40
scripts/selftest.py Normal file
View File

@ -0,0 +1,40 @@
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()