diff --git a/extension_service/app/app_test.py b/extension_service/app/app_test.py index 4d3bfdf6..030f663b 100644 --- a/extension_service/app/app_test.py +++ b/extension_service/app/app_test.py @@ -66,7 +66,7 @@ def test_get_airport(app): def test_get_amenity(app): with TestClient(app) as client: response = client.get( - "/amenities", + "/airports", params={ "id": 1, }, @@ -77,10 +77,25 @@ def test_get_amenity(app): assert output[0] -def test_get_airport(app): +def test_airports_semantic_lookup(app): with TestClient(app) as client: response = client.get( - "/airports", + "/airports/semantic_lookup", + params={ + "query": "What is the airport in san francisco.", + "top_k": 5, + }, + ) + assert response.status_code == 200 + output = response.json() + assert len(output) == 5 + assert output[0] + + +def test_get_amenity(app): + with TestClient(app) as client: + response = client.get( + "/amenities", params={ "id": 1, }, diff --git a/extension_service/app/routes.py b/extension_service/app/routes.py index 12fdce9b..e4bee449 100644 --- a/extension_service/app/routes.py +++ b/extension_service/app/routes.py @@ -49,12 +49,6 @@ async def amenities_search(query: str, top_k: int, request: Request): query_embedding = embed_service.embed_query(query) results = await ds.amenities_search(query_embedding, 0.7, top_k) - - -@routes.get("/airports") -async def get_airport(id: int, request: Request): - ds: datastore.Client = request.app.state.datastore - results = await ds.get_airport(id) return results