Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -180,7 +180,7 @@ async def health_check():
|
|
| 180 |
return {"status": "healthy"}
|
| 181 |
|
| 182 |
@app.post("/search", response_model=SearchResponse)
|
| 183 |
-
async def search_ebikes(
|
| 184 |
"""
|
| 185 |
Search for e-bikes similar to the provided description
|
| 186 |
|
|
@@ -188,8 +188,8 @@ async def search_ebikes(description: str,filters:dict):
|
|
| 188 |
"""
|
| 189 |
try:
|
| 190 |
# Create embedding for the query
|
| 191 |
-
query_embedding = encoder.encode(description)[0]
|
| 192 |
-
filter_payload = build_filter(filters.get("product_type"), filters.get("category"))
|
| 193 |
|
| 194 |
# Query Pinecone
|
| 195 |
results = pinecone_index.query(
|
|
|
|
| 180 |
return {"status": "healthy"}
|
| 181 |
|
| 182 |
@app.post("/search", response_model=SearchResponse)
|
| 183 |
+
async def search_ebikes(request:SearchRequest):
|
| 184 |
"""
|
| 185 |
Search for e-bikes similar to the provided description
|
| 186 |
|
|
|
|
| 188 |
"""
|
| 189 |
try:
|
| 190 |
# Create embedding for the query
|
| 191 |
+
query_embedding = encoder.encode(request.description)[0]
|
| 192 |
+
filter_payload = build_filter(request.filters.get("product_type"), request.filters.get("category"))
|
| 193 |
|
| 194 |
# Query Pinecone
|
| 195 |
results = pinecone_index.query(
|