hackrx / TESTING_GUIDE.md
Manjesh501's picture
Fi
598105d

πŸŽ‰ HackRx 6.0 - Testing Guide

βœ… WORKING URLs

Your app is now successfully deployed and accessible at:

Main App URLs:

API Endpoints:

πŸ§ͺ Testing Steps

1. Basic Endpoint Tests

Test Root Endpoint:

curl https://Manjesh501-hackrx.hf.space/

Expected Response:

{
  "message": "HackRx 6.0 - Intelligent Query-Retrieval System",
  "version": "1.0.0",
  "status": "running",
  "endpoints": {
    "main": "api/v1/hackrx/run",
    "legacy": "hackrx/run",
    "detailed": "api/v1/hackrx/run/detailed",
    "health": "health",
    "docs": "docs",
    "test": "test"
  }
}

Test Health Endpoint:

curl https://Manjesh501-hackrx.hf.space/health

Expected Response:

{
  "status": "healthy",
  "message": "HackRx 6.0 is running",
  "services": {
    "query_service": true,
    "embedding_service": true,
    "llm_service": true,
    "pinecone_service": false
  }
}

Test Endpoint:

curl https://Manjesh501-hackrx.hf.space/test

Expected Response:

{
  "message": "Test endpoint working!",
  "status": "success",
  "app_loaded": true,
  "mode": "app.py"
}

2. API Documentation Test

Visit: https://Manjesh501-hackrx.hf.space/docs

You should see:

  • βœ… Interactive API documentation
  • βœ… All endpoints listed
  • βœ… Request/response schemas
  • βœ… "Try it out" functionality

3. Main API Tests

Test Main Query Endpoint:

curl -X POST "https://Manjesh501-hackrx.hf.space/api/v1/hackrx/run" \
  -H "Content-Type: application/json" \
  -d '{
    "documents": "https://example.com/document.pdf",
    "questions": ["What is the main topic?"]
  }'

Test Legacy Query Endpoint:

curl -X POST "https://Manjesh501-hackrx.hf.space/hackrx/run" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "What is the main topic?",
    "document_url": "https://example.com/document.pdf"
  }'

4. Browser Testing

Open these URLs in your browser:

  1. Main App: https://Manjesh501-hackrx.hf.space

    • Should show app information and available endpoints
  2. Health Check: https://Manjesh501-hackrx.hf.space/health

    • Should show healthy status
  3. Test Endpoint: https://Manjesh501-hackrx.hf.space/test

    • Should show test success message
  4. API Docs: https://Manjesh501-hackrx.hf.space/docs

    • Should show interactive API documentation

🎯 What to Test

βœ… Basic Functionality:

  • Root endpoint returns app info
  • Health endpoint shows healthy status
  • Test endpoint works
  • API documentation loads
  • All endpoints are accessible

βœ… API Functionality:

  • Main query endpoint accepts requests
  • Legacy query endpoint works
  • Document analysis endpoint functions
  • Summarization endpoint works
  • Error handling works properly

βœ… Performance:

  • Response times are reasonable
  • No timeout errors
  • Memory usage is stable
  • Services initialize correctly

πŸš€ How to Use Your App

For Users:

  1. Visit: https://Manjesh501-hackrx.hf.space
  2. Read the documentation: https://Manjesh501-hackrx.hf.space/docs
  3. Test the API: Use the interactive docs to try endpoints
  4. Integrate: Use the API endpoints in your applications

For Developers:

  1. API Base URL: https://Manjesh501-hackrx.hf.space
  2. Documentation: Available at /docs
  3. Health Check: Available at /health
  4. Main Endpoint: POST /api/v1/hackrx/run

πŸ“Š Success Metrics

Your deployment is successful if:

  • βœ… All URLs return 200 OK
  • βœ… API documentation loads completely
  • βœ… Health endpoint shows all services as healthy
  • βœ… No 404 or 500 errors
  • βœ… Container logs show successful startup

πŸŽ‰ Congratulations!

Your HackRx 6.0 app is now:

  • βœ… Successfully deployed on Hugging Face Spaces
  • βœ… All endpoints working correctly
  • βœ… API documentation accessible
  • βœ… Ready for use by users and developers

Your app is live and working perfectly! πŸš€