-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.http
More file actions
102 lines (77 loc) · 4.82 KB
/
Copy pathapi.http
File metadata and controls
102 lines (77 loc) · 4.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
### FastAPI Document Processing API Tests
@baseUrl = http://localhost:8000
###############################################
# Health Check
###############################################
### Root endpoint
GET {{baseUrl}}/
### Vector Store health check
GET {{baseUrl}}/api/health/vector-store
###############################################
# HTS Code Search (Vector Search)
###############################################
### Search HTS codes - English query
GET {{baseUrl}}/api/search-hts?query=textile products&top_k=5
### Search HTS codes - Korean query
GET {{baseUrl}}/api/search-hts?query=섬유 제품&top_k=5
### Search HTS codes - Animals
GET {{baseUrl}}/api/search-hts?query=live animals horses&top_k=3
### Search HTS codes - Food products
GET {{baseUrl}}/api/search-hts?query=dairy products milk cheese&top_k=5
### Search HTS codes - Electronics
GET {{baseUrl}}/api/search-hts?query=electronic equipment computers&top_k=3
### Search HTS codes - Long product description (Bracket)
GET {{baseUrl}}/api/search-hts?query=Bracket, Secondary Rack, Extended. Made from steel, galvanized or treated for corrosion resistance. Designed for mounting secondary racks on utility poles or support structures. Used in electrical distribution systems to support and organize low-voltage service wires.&top_k=5
### Search HTS codes - Simple version (Bracket)
GET {{baseUrl}}/api/search-hts?query=steel bracket for electrical utility pole mounting&top_k=5
### Search HTS codes - POST with long description (Basic)
POST {{baseUrl}}/api/search-hts
Content-Type: application/json
{
"query": "Product Name: Bracket, Secondary Rack, Extended (Ext). Material/Composition: Made from steel, likely galvanized or otherwise treated for corrosion resistance, suitable for outdoor use in varying weather conditions. Intended Use: This bracket is specifically designed for mounting secondary racks on utility poles or other support structures. Secondary racks are crucial components in electrical distribution systems, used to support and organize low-voltage service wires (secondary conductors). Key Characteristics: As an extended variant, it may feature a longer reach or greater offset from the mounting surface to accommodate specific installation requirements or larger capacity racks. It is a robust, essential piece of hardware for the stable and safe configuration of overhead power lines.",
"top_k": 4,
"use_reranking": false
}
### Search HTS codes - POST with LLM Reranking (Most Accurate! ⭐)
POST {{baseUrl}}/api/search-hts
Content-Type: application/json
{
"query": "Product Name: Bracket, Secondary Rack, Extended (Ext). Material/Composition: Made from steel, likely galvanized or otherwise treated for corrosion resistance, suitable for outdoor use in varying weather conditions. Intended Use: This bracket is specifically designed for mounting secondary racks on utility poles or other support structures. Secondary racks are crucial components in electrical distribution systems, used to support and organize low-voltage service wires (secondary conductors). Key Characteristics: As an extended variant, it may feature a longer reach or greater offset from the mounting surface to accommodate specific installation requirements or larger capacity racks. It is a robust, essential piece of hardware for the stable and safe configuration of overhead power lines.",
"top_k": 5,
"use_reranking": true
}
### Search HTS codes - POST with simple query
POST {{baseUrl}}/api/search-hts
Content-Type: application/json
{
"query": "steel brackets and mounting hardware",
"top_k": 3
}
### Get specific HTS code details
GET {{baseUrl}}/api/hts/0101
### Get another HTS code details
GET {{baseUrl}}/api/hts/0201
###############################################
# Document Processing Endpoints
###############################################
### Process documents - Multiple files (PDF + Excel)
POST {{baseUrl}}/api/process-documents
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="files"; filename="sample_bill_of_lading.pdf"
Content-Type: application/pdf
< ./data/sample_bill_of_lading.pdf
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="files"; filename="sample_invoice.xlsx"
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
< ./data/sample_invoice.xlsx
------WebKitFormBoundary7MA4YWxkTrZu0gW--
###############################################
# Notes:
# 1. Build vector store first: python build_vector_store.py
# 2. Start the server: uvicorn app.main:app --reload
# 3. For VS Code: Install "REST Client" extension by Huachao Mao
# 4. For IntelliJ/PyCharm: Built-in HTTP Client support
# 5. Click "Send Request" above each ### section to execute
# 6. Swagger UI: http://localhost:8000/docs
###############################################