Skip to content

Commit

Permalink
📘 docs: add OpenWeather plugin configuration and usage instructions (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaddington authored Jan 10, 2025
1 parent 36f89b7 commit e12240b
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pages/docs/configuration/tools/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ description: Tools and Plugins setup instructions
### Google Search
- [Google Search](/docs/configuration/tools/google_search)

### OpenWeather
- [OpenWeather](/docs/configuration/tools/openweather)

### Stable Diffusion
- [Stable Diffusion](/docs/configuration/tools/stable_diffusion)

Expand Down
100 changes: 100 additions & 0 deletions pages/docs/configuration/tools/openweather.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
title: 🌤️ OpenWeather Plugin
description: Configure the OpenWeather plugin for LibreChat
---

# OpenWeather Plugin Configuration

The OpenWeather plugin allows you to get weather data including current conditions, forecasts, historical data, and daily summaries using OpenWeather's One Call API 3.0.

## Prerequisites

- An OpenWeather account
- An OpenWeather API key (specifically for the One Call API 3.0)

## Getting an API Key

1. Sign up for an OpenWeather account at [OpenWeather](https://home.openweathermap.org/users/sign_up)
2. After signing in, go to your [API keys](https://home.openweathermap.org/api_keys) page
3. Generate a new API key if you don't have one
4. Subscribe to the [One Call API 3.0](https://openweathermap.org/api/one-call-3) plan
5. Wait for your API key to be activated (can take up to 2 hours)

## Configuration

### Environment Variables

Add the following to your `.env` file:

```bash
OPENWEATHER_API_KEY=your_api_key_here
```

### Plugin Configuration

Add the plugin to any [agent](https://www.librechat.ai/docs/features/agents)

## Usage

The OpenWeather plugin supports the following actions:

- `current_forecast`: Get current weather and forecast data
- `timestamp`: Get historical weather data for a specific date
- `daily_aggregation`: Get aggregated weather data for a specific date
- `overview`: Get a human-readable weather summary

### Example Prompts

```
What's the current weather in London?
What was the weather like in Paris on 2023-01-01?
Give me a weather summary for Tokyo.
What's the temperature in New York in Fahrenheit?
```

### Parameters

- `city`: Name of the city (if lat/lon not provided)
- `lat`: Latitude coordinate (optional if city provided)
- `lon`: Longitude coordinate (optional if city provided)
- `units`: Temperature units ("Celsius", "Kelvin", or "Fahrenheit")
- `lang`: Language code for weather descriptions (e.g., "en", "fr", "es")
- `date`: Date in YYYY-MM-DD format (required for timestamp and daily_aggregation actions)
- `tz`: Timezone (optional, for daily_aggregation action)

## Troubleshooting

Common issues and solutions:

1. **403 Unauthorized Error**
- Verify your API key is correct
- Check if your API key has been activated (wait 2 hours after creation)
- Ensure you have subscribed to the One Call API 3.0

2. **City Not Found**
- Check the spelling of the city name
- Try adding the country code (e.g., "London,UK")
- Use latitude and longitude coordinates instead

3. **Invalid Date Format**
- Ensure dates are in YYYY-MM-DD format
- Historical data is only available from 1979-01-01
- Future data is limited to 1.5 years ahead

## API Limits

- Check your [OpenWeather subscription](https://home.openweathermap.org/subscriptions) for your specific limits
- Consider implementing rate limiting in high-traffic environments

## Support

For issues with the plugin:
- You may open an issue at https://github.com/jmaddington/LibreChat/issues or
- Check the [LibreChat Issues](https://github.com/danny-avila/LibreChat/issues)
- Review OpenWeather's [API documentation](https://openweathermap.org/api/one-call-3)
- Contact OpenWeather [support](https://openweathermap.org/support) for API-specific issues

## Notes

- Temperature values are automatically rounded to the nearest degree
- Default temperature unit is Celsius if not specified

0 comments on commit e12240b

Please sign in to comment.