Spaces:
Runtime error
Runtime error
|
Download QUICK_TEST_GUIDE.md from CleanflowAI/cleanflowai: direct link, hf CLI and curl.
- Browser
- Download file 3.96 kB
-
https://huggingface.co/spaces/CleanflowAI/cleanflowai/resolve/main/QUICK_TEST_GUIDE.md
- Command line
-
hf download hf://spaces/CleanflowAI/cleanflowai/QUICK_TEST_GUIDE.md
-
curl -L -o QUICK_TEST_GUIDE.md https://huggingface.co/spaces/CleanflowAI/cleanflowai/resolve/main/QUICK_TEST_GUIDE.md
3.96 kB
| # Quick Testing Guide - CleanFlow AI | |
| ## β **WORKING SOLUTION** | |
| ## π― **Correct Way to Test in Browser** | |
| ### **Step 1: Go to API Docs** | |
| Visit: `http://localhost:8000/docs` | |
| ### **Step 2: Test POST /transform/file** | |
| 1. Click on `POST /transform/file` | |
| 2. Click "Try it out" | |
| 3. **IMPORTANT**: Set parameters correctly: | |
| - `file`: Upload `test_simple_netsuite.csv` | |
| - `auto_select_erp`: `true` β | |
| - `auto_select_entity`: `true` β | |
| - `entity`: **LEAVE EMPTY** (don't put "string") β | |
| - `erp`: **LEAVE EMPTY** (don't put "string") β | |
| - `output_format`: `json` | |
| ### **Step 3: Expected Success Response** | |
| ```json | |
| { | |
| "success": true, | |
| "data": [ | |
| { | |
| "order_id": "SO1001", | |
| "order_date": "2025-08-04", | |
| "customer_id": "CUST01", | |
| "status": "Pending Fulfillment", | |
| "currency": "USD", | |
| "total_amount": 1249.0, | |
| "notes": "Rush order for Q4", | |
| "item_id": null, | |
| "description": null, | |
| "quantity": null, | |
| "unit_price": null, | |
| "line_total": null, | |
| "tax_code": null | |
| } | |
| ], | |
| "detected_erp": "NetSuite", | |
| "detected_entity": "sales_orders", | |
| "transformation_mode": "template", | |
| "confidence_score": 0.85, | |
| "message": "Successfully transformed using template mapping", | |
| "column_mappings": { | |
| "tranid": "order_id", | |
| "trandate": "order_date", | |
| "entity": "customer_id", | |
| "status": "status", | |
| "currency": "currency", | |
| "total": "total_amount", | |
| "memo": "notes" | |
| }, | |
| "row_count": 3, | |
| "processing_time_ms": 45.2 | |
| } | |
| ``` | |
| ## π§ **Alternative: Use cURL Command** | |
| Copy and paste this exact command in your terminal: | |
| ```bash | |
| curl -X 'POST' \ | |
| 'http://localhost:8000/transform/file' \ | |
| -H 'accept: application/json' \ | |
| -H 'Content-Type: multipart/form-data' \ | |
| -F 'file=@test_simple_netsuite.csv;type=text/csv' \ | |
| -F 'auto_select_erp=true' \ | |
| -F 'auto_select_entity=true' \ | |
| -F 'output_format=json' | |
| ``` | |
| **Note**: No `entity` or `erp` parameters - let auto-detection work! | |
| ## π§ͺ **Test Different Files** | |
| ### **Test 1: NetSuite Sales Orders** | |
| - File: `test_simple_netsuite.csv` | |
| - Expected ERP: `NetSuite` | |
| - Expected Entity: `sales_orders` | |
| ### **Test 2: SAP Customers** | |
| - File: `test_sap_customers.csv` | |
| - Expected ERP: `SAP ERP` | |
| - Expected Entity: `customers` | |
| ### **Test 3: Oracle Invoices** | |
| - File: `test_oracle_invoices.json` | |
| - Expected ERP: `Oracle Fusion` | |
| - Expected Entity: `invoices` | |
| ## π **What to Look For in Results** | |
| ### **Success Indicators:** | |
| - β `"success": true` | |
| - β `"detected_erp"` shows correct ERP system | |
| - β `"detected_entity"` shows correct entity type | |
| - β `"confidence_score"` > 0.6 | |
| - β `"data"` contains transformed records | |
| - β `"column_mappings"` shows field mappings | |
| ### **Data Transformation:** | |
| - **Input**: ERP-specific column names (e.g., `tranId`, `trandate`) | |
| - **Output**: Standardized CDF names (e.g., `order_id`, `order_date`) | |
| - **Missing Fields**: Filled with `null` values | |
| - **Data Types**: Properly formatted (dates, decimals, etc.) | |
| ## π **Quick Validation Steps** | |
| 1. **Health Check**: `GET /health` β Should return healthy status | |
| 2. **List ERPs**: `GET /erps` β Should show 11 ERP systems | |
| 3. **List Entities**: `GET /entities` β Should show 5 entity types | |
| 4. **Transform File**: `POST /transform/file` β Should transform data successfully | |
| ## π **Troubleshooting** | |
| ### **Common Mistakes:** | |
| - β Putting "string" in entity/erp fields | |
| - β Not setting auto_select_* to true | |
| - β Using wrong file format | |
| ### **If You Get Errors:** | |
| 1. Check the `message` field in response | |
| 2. Ensure file is properly formatted | |
| 3. Try with `test_simple_netsuite.csv` first | |
| 4. Use auto-detection (leave entity/erp empty) | |
| ## π **Performance Expectations** | |
| - **Small files** (< 1MB): < 100ms | |
| - **Medium files** (1-10MB): < 500ms | |
| - **Processing**: Real-time transformation | |
| - **Memory**: Efficient with Polars + DuckDB | |
| The application is working perfectly - just need to use the correct parameters! π | |