From c38d94f82906db489cfbf9c1e574f20dfc5f2ccf Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Mon, 6 May 2024 13:25:01 -0700 Subject: [PATCH] Add `lang_code` param to geolocation requests --- neon_hana/mq_service_api.py | 1 + neon_hana/schema/api_requests.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/neon_hana/mq_service_api.py b/neon_hana/mq_service_api.py index ddd7dfa..89a6ebb 100644 --- a/neon_hana/mq_service_api.py +++ b/neon_hana/mq_service_api.py @@ -92,6 +92,7 @@ def get_session(self, node_data: NodeData) -> dict: def query_api_proxy(self, service_name: str, query_params: dict, timeout: int = 10): query_params['service'] = service_name + lang_code = query_params['lang_code'] response = send_mq_request("/neon_api", query_params, "neon_api_input", "neon_api_output", timeout) return self._validate_api_proxy_response(response, query_params) diff --git a/neon_hana/schema/api_requests.py b/neon_hana/schema/api_requests.py index 7ccd67b..e4d149a 100644 --- a/neon_hana/schema/api_requests.py +++ b/neon_hana/schema/api_requests.py @@ -69,23 +69,27 @@ class StockAPIQuoteRequest(BaseModel): class GeoAPIRequest(BaseModel): address: str + lang_code: str = "en" model_config = { "json_schema_extra": { "examples": [{ - "address": "1100 Bellevue Way NE Bellevue, WA" + "address": "1100 Bellevue Way NE Bellevue, WA", + "lang_code": "en" }]}} class GeoAPIReverseRequest(BaseModel): lat: float lon: float + lang_code: str = "en" model_config = { "json_schema_extra": { "examples": [{ "lat": 47.6815, "lon": -122.2087, - }]}} + "lang_code": "en" + }]}} class WolframAlphaAPIRequest(BaseModel):