#!/bin/bash echo "Testing Chat via WebUI (localhost:3000)" echo "========================================" echo "" # Generate unique IDs MESSAGE_ID="msg-$(date +%s)-$$" CHAT_ID="chat-$(date +%s)-$$" # Create the request payload with minimal required fields PAYLOAD=$(cat <&1) EXIT_CODE=$? echo "Response:" echo "=========" if [ $EXIT_CODE -eq 0 ]; then if [ -z "$RESPONSE" ]; then echo "⚠ Empty response received" else # Show first 100 lines of response echo "$RESPONSE" | head -100 echo "" LINE_COUNT=$(echo "$RESPONSE" | wc -l) echo "Total lines: $LINE_COUNT" echo "Response length: $(echo "$RESPONSE" | wc -c) bytes" fi else echo "✗ Request failed with exit code: $EXIT_CODE" echo "$RESPONSE" fi echo "" echo "========================================"