Files
wp-agentic-writer/downloads/agentic-writer-local-backend/test-connection.sh
Dwindi Ramadhana d2c10756ab Add AI writing assistant plugin with local backend, brave search, and image generation support
- Implement local backend AI provider with Ollama integration
- Add Brave Search API integration for real-time search suggestions
- Add image generation manager with multiple AI providers
- Create hybrid provider system with local/cloud fallback
- Add comprehensive settings UI with provider management
- Implement Gutenberg sidebar with writing assistance controls
- Add SEO schema generation for AI-generated content
- Multiple provider support: OpenRouter, local backend, Codex
2026-05-17 10:48:05 +07:00

43 lines
1.4 KiB
Bash

#!/bin/bash
echo "Testing local backend connection..."
echo ""
# Test /ping endpoint
echo "1. Testing health check..."
PING_RESPONSE=$(curl -s http://localhost:8080/ping 2>&1)
if [ "$PING_RESPONSE" = "pong" ]; then
echo " ✅ Health check passed"
else
echo " ❌ Health check failed"
echo " Response: $PING_RESPONSE"
echo ""
echo "Is the proxy running? Check: ps aux | grep claude-proxy"
exit 1
fi
# Test /v1/messages endpoint
echo "2. Testing inference..."
RESPONSE=$(curl -s -X POST http://localhost:8080/v1/messages \
-H "Content-Type: application/json" \
-d '{"messages":[{"role":"user","content":"Reply with exactly: Test successful"}]}' 2>&1)
echo " Response: $RESPONSE"
if echo "$RESPONSE" | grep -q "choices"; then
echo " ✅ Inference endpoint working"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "✅ Local Backend is working correctly!"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
else
echo " ❌ Inference test failed"
echo ""
echo "Troubleshooting:"
echo " 1. Check Claude CLI: echo 'test' | claude"
echo " 2. Check logs: tail -f proxy.log"
echo " 3. Restart proxy: ./stop-proxy.sh && ./start-proxy.sh"
exit 1
fi