| name | search-weather |
| description | Search real-time weather information by city name using OpenWeatherMap API. Use when the user asks about weather, current temperature, forecasts, or climate conditions for a specific city (e.g., "์์ธ ๋ ์จ", "Tokyo weather", "๋ด์ ๊ธฐ์จ"). Always pass city names in English to the script. |
Search Weather
OpenWeatherMap API๋ฅผ ํ์ฉํ์ฌ ๋์๋ณ ์ค์๊ฐ ๋ ์จ ์ ๋ณด๋ฅผ ๊ฒ์ํ๋ skill.
Quick Start
python skills/search-weather/scripts/weather_search.py "Seoul"
python skills/search-weather/scripts/weather_search.py "Tokyo" --format text
์ค์: ํญ์ ์ ์ฒด ๊ฒฝ๋ก skills/search-weather/scripts/weather_search.py๋ฅผ ์ฌ์ฉํ๋ค.
๋์๋ช
์ ๋ฐ๋์ ์๋ฌธ์ผ๋ก
์ฌ์ฉ์๊ฐ ํ๊ธ๋ก ๋์๋ฅผ ์์ฒญํ๋๋ผ๋, ์คํฌ๋ฆฝํธ์๋ ์๋ฌธ ๋์๋ช
์ ์ ๋ฌํ๋ค.
- "์์ธ ๋ ์จ" ->
"Seoul"
- "๋์ฟ ๋ ์จ" ->
"Tokyo"
- "๋ด์ ๋ ์จ" ->
"New York"
๋ช
๋ น์ด ์ต์
city (ํ์): ์๋ฌธ ๋์๋ช
(e.g., Seoul, Tokyo, New York)
--format [json|text]: ์ถ๋ ฅ ํ์ (๊ธฐ๋ณธ๊ฐ: json)
JSON ์๋ต ํ๋
| ํ๋ | ์ค๋ช
|
|---|
city | ๋์ ์ด๋ฆ |
overall | ๋ ์จ ์์ฝ (e.g., Clear, Clouds, Rain) |
description | ์์ธ ๋ ์จ ์ค๋ช
|
current_temp | ํ์ฌ ๊ธฐ์จ |
feels_like | ์ฒด๊ฐ ์จ๋ |
min_temp / max_temp | ์ต์ /์ต๊ณ ๊ธฐ์จ |
humidity | ์ต๋ |
pressure | ๊ธฐ์ |
wind_speed | ํ์ (m/s) |
wind_direction | ํํฅ (๋) |
clouds | ๊ตฌ๋ฆ๋ |
visibility | ๊ฐ์๊ฑฐ๋ฆฌ |
last_updated | ๋ง์ง๋ง ์
๋ฐ์ดํธ ์๊ฐ (UTC) |
status | success ๋๋ error |
error | ์๋ฌ ๋ฉ์์ง (status๊ฐ error์ผ ๋๋ง ํฌํจ) |
Agent ํตํฉ
import subprocess
import json
WEATHER_SCRIPT = "skills/search-weather/scripts/weather_search.py"
result = subprocess.run(
["python", WEATHER_SCRIPT, city_name, "--format", "json"],
capture_output=True,
text=True
)
response = json.loads(result.stdout)
API Key
OpenWeatherMap API key๋ ๋ค์ ์์๋ก ์กฐํ๋๋ค:
utils.weather_api_key (AWS Secrets Manager์์ ๋ก๋)
- ํ๊ฒฝ๋ณ์
OPENWEATHERMAP_API_KEY
์๊ตฌ์ฌํญ
- Python 3.6+
requests ๋ผ์ด๋ธ๋ฌ๋ฆฌ
- OpenWeatherMap API key
- ์ธํฐ๋ท ์ฐ๊ฒฐ