Spaces:
Sleeping
Sleeping
Fix: Update README.md with error handling
Browse files
README.md
CHANGED
|
@@ -8,29 +8,50 @@ pinned: false
|
|
| 8 |
license: mit
|
| 9 |
---
|
| 10 |
|
| 11 |
-
# NEED AI API
|
| 12 |
|
| 13 |
-
REST API for NEED service marketplace
|
| 14 |
|
| 15 |
-
## API
|
| 16 |
-
`https://yogami9-need-ai-api.hf.space`
|
| 17 |
|
| 18 |
-
|
| 19 |
-
- `GET /health` - Health check
|
| 20 |
-
- `POST /api/category` - Category prediction
|
| 21 |
-
- `POST /api/chat` - Chat support
|
| 22 |
-
- `POST /api/service` - Service description
|
| 23 |
-
- `POST /api/search` - Semantic search
|
| 24 |
-
- `POST /api/moderate` - Content moderation
|
| 25 |
|
| 26 |
-
##
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
-
## Python Example
|
| 32 |
```python
|
| 33 |
import requests
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
print(response.json())
|
| 36 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
license: mit
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# NEED AI API (Fixed Version)
|
| 12 |
|
| 13 |
+
Production REST API with robust error handling for NEED service marketplace.
|
| 14 |
|
| 15 |
+
## 🚀 Live API
|
|
|
|
| 16 |
|
| 17 |
+
**Base URL**: `https://yogami9-need-ai-api.hf.space`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
+
## 📚 Endpoints
|
| 20 |
+
|
| 21 |
+
All endpoints return detailed error messages if models are unavailable.
|
| 22 |
+
|
| 23 |
+
- GET `/health` - System health and model availability
|
| 24 |
+
- POST `/api/category` - Predict service category
|
| 25 |
+
- POST `/api/chat` - Answer support questions
|
| 26 |
+
- POST `/api/service` - Generate service descriptions
|
| 27 |
+
- POST `/api/search` - Semantic search
|
| 28 |
+
- POST `/api/moderate` - Content moderation
|
| 29 |
+
|
| 30 |
+
## 🐍 Usage
|
| 31 |
|
|
|
|
| 32 |
```python
|
| 33 |
import requests
|
| 34 |
+
|
| 35 |
+
# Check health
|
| 36 |
+
response = requests.get("https://yogami9-need-ai-api.hf.space/health")
|
| 37 |
+
print(response.json())
|
| 38 |
+
|
| 39 |
+
# Use API
|
| 40 |
+
response = requests.post(
|
| 41 |
+
"https://yogami9-need-ai-api.hf.space/api/category",
|
| 42 |
+
json={"query": "I need house cleaning"}
|
| 43 |
+
)
|
| 44 |
print(response.json())
|
| 45 |
```
|
| 46 |
+
|
| 47 |
+
## 🔧 Troubleshooting
|
| 48 |
+
|
| 49 |
+
If models are not loading:
|
| 50 |
+
1. Check models exist: https://huggingface.co/yogami9
|
| 51 |
+
2. Verify models are PUBLIC
|
| 52 |
+
3. Wait 2-3 minutes for first load
|
| 53 |
+
4. Check logs for specific errors
|
| 54 |
+
|
| 55 |
+
## 📧 Contact
|
| 56 |
+
|
| 57 |
+
needserviceapp@gmail.com
|