This repository has been archived on 2026-08-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
ROCm-Research-Archive/_TestScripts/Scripts and Tests/_test_chat_then_tts.sh
T
2026-08-20 00:45:43 +02:00

31 lines
944 B
Bash

#!/bin/bash
# Simulate browser: chat stream + TTS call
echo "=== Chat Stream Test ==="
START=$(date +%s)
# Send chat request and capture response
curl -s --max-time 30 \
http://localhost:9090/api/proxy/chat \
-H 'Content-Type: application/json' \
-d '{"messages":[{"role":"user","content":"Say hi in one sentence."}],"stream":true}' \
-o /tmp/chat_stream.txt 2>&1
EXIT=$?
END=$(date +%s)
echo "curl exit: $EXIT, took: $((END-START))s"
echo "Last 5 lines of stream:"
tail -5 /tmp/chat_stream.txt
echo ""
echo "Has [DONE]:"
grep -c "DONE" /tmp/chat_stream.txt
echo ""
echo "=== Now TTS call ==="
curl -s -w '\nHTTP: %{http_code} Size: %{size_download}\n' \
-o /tmp/tts_after_chat.wav \
http://localhost:9090/api/proxy/tts \
-H 'Content-Type: application/json' \
-d '{"input":"Hello there!","voice":"Vivian","language":"en","speed":1.0}'
echo "=== Sidecar health ==="
curl -s http://localhost:9090/api/tts/sidecar/health
echo ""