Skip to content

API Reference parrot_tools.openweather

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.openweather

View source

OpenWeather Tool migrated to use AbstractTool framework with aiohttp.

Alias AbstractTool

Re-exported from parrot_tools.abstract.AbstractTool.

Class OpenWeatherArgs

Arguments schema for OpenWeatherTool.

Fields:

Field Type Default Description
latitude float The latitude of the location you want weather information about
longitude float The longitude of the location you want weather information about
request_type Literal['weather', 'forecast'] Type of weather information: 'weather' for current conditions, 'forecast' for future predictions
units Literal['metric', 'imperial', 'standard'] Temperature units: 'metric' (Celsius), 'imperial' (Fahrenheit), 'standard' (Kelvin)
country str Country code for the location (ISO 3166 country codes)
forecast_days int Number of days for forecast (only used when request_type='forecast')

Method OpenWeatherArgs.validate_country

validate_country(v)

Parameter Type Default Description
v

Class OpenWeatherTool

Tool to get weather information for specific locations using OpenWeatherMap API.

This tool provides current weather conditions and weather forecasts for any location specified by latitude and longitude coordinates. It supports different temperature units and can be configured for different countries.

Features:

  • Current weather conditions
  • Weather forecasts (up to 16 days)
  • Multiple temperature units (Celsius, Fahrenheit, Kelvin)
  • Country-specific formatting
  • Comprehensive weather data including temperature, humidity, pressure, wind, etc.
Parameter Type Default Description
api_key Optional[str] None OpenWeatherMap API key (if None, reads from OPENWEATHER_APPID env var)
default_units str 'imperial' Default temperature units ('metric', 'imperial', 'standard')
default_country str 'us' Default country code
default_request_type str 'weather' Default request type ('weather' or 'forecast')
timeout int 10 Request timeout in seconds
**kwargs {} Additional arguments for AbstractTool

Method OpenWeatherTool.execute_sync

Execute weather request synchronously.

execute_sync(latitude: float, longitude: float, request_type: str = 'weather', units: str = 'imperial', country: str = 'us', forecast_days: int = 3) -> Dict[str, Any]

Parameter Type Default Description
latitude float Latitude coordinate
longitude float Longitude coordinate
request_type str 'weather' Type of request ('weather' or 'forecast')
units str 'imperial' Temperature units
country str 'us' Country code
forecast_days int 3 Number of forecast days

Returns: Dict[str, Any] — Formatted weather data

Method OpenWeatherTool.get_weather_summary

Generate a human-readable weather summary.

get_weather_summary(weather_data: ToolResult) -> str

Parameter Type Default Description
weather_data ToolResult

Returns: str — Human-readable weather summary

Method OpenWeatherTool.save_weather_data

Save weather data to JSON file.

save_weather_data(weather_result: ToolResult, filename: Optional[str] = None) -> Dict[str, Any]

Parameter Type Default Description
weather_result ToolResult ToolResult object containing weather data
filename Optional[str] None Optional filename

Returns: Dict[str, Any] — File information dictionary

Alias ToolResult

Re-exported from parrot_tools.abstract.ToolResult.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally