From b4f22a583c2f56c9cbcb4336f3c35d46472c3902 Mon Sep 17 00:00:00 2001 From: Daniel McKnight <34697904+NeonDaniel@users.noreply.github.com> Date: Thu, 28 Dec 2023 16:41:31 -0800 Subject: [PATCH] Add CLI command to get mapmaker geolocation responses (#53) # Description Add `iris get-mapmaker-response` for geolocation service # Issues # Other Notes Co-authored-by: Daniel McKnight --- neon_iris/cli.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/neon_iris/cli.py b/neon_iris/cli.py index 5b7fd59..74068ab 100644 --- a/neon_iris/cli.py +++ b/neon_iris/cli.py @@ -249,6 +249,23 @@ def get_wolfram_response(api, unit, latitude, longitude, question): click.echo(pformat(resp)) +@neon_iris_cli.command(help="Query Map Maker Geolocation endpoint") +@click.option('--latitude', '--lat', + help="location latitude") +@click.option('--longitude', '--lon', + help="location latitude") +@click.option('--query', '-q', help="Name of location to look up") +def get_mapmaker_response(latitude, longitude, query): + from neon_iris.util import query_api + _print_config() + query = {"lat": latitude, + "lon": longitude, + "address": query, + "service": "map_maker"} + resp = query_api(query) + click.echo(pformat(resp)) + + @neon_iris_cli.command(help="Converse with an LLM") @click.option('--llm', default="chat_gpt", help="LLM Queue to interact with ('chat_gpt' or 'fastchat')")