Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: add OpenWeather plugin #1880

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

kylebuildsstuff
Copy link
Contributor

Risks

Low - This is an additive change that introduces a new plugin without modifying existing functionality. The main risks are:

  • Rate limiting from OpenWeather API (1000 free API calls per day)
  • Potential timeout issues when the API is slow

Background

What does this PR do?

  • Adds a new OpenWeather plugin for weather checking
  • Implements a GET_CURRENT_WEATHER action that fetches the current weather for a specified city
  • Provides TypeScript types and interfaces for OpenWeather weather API responses
  • Includes environment validation for API key configuration
  • Adds error handling for API calls

What kind of change is this?

Features (non-breaking change which adds functionality):

  • New plugin implementation
  • New TypeScript types and validation

Why are we doing this? Any context or related work?

I thought it would be neat to create agents that can fetch the weather.

Documentation changes needed?

My changes require a change to the project documentation:

  • Add OpenWeather plugin setup instructions
  • Document required API key configuration
  • Add usage examples for weather checking
  • Update plugin list in main documentation
  • Add #/rate limit considerations

Testing

Where should a reviewer start?

  • Review the plugin implementation in plugin-openweather/src/
  • Check the main action implementation in actions/getCurrentWeather.ts
  • Verify API service in service.ts
  • Review type definitions in types.ts
  • Check template handling in template.ts

Detailed testing steps

  1. Set up environment:
OPEN_WEATHER_API_KEY=your_api_key
  1. Run agent locally and test natural language queries:
  • "What's the current weather in Toronto?"
  • "What's the weather like in Paris?"
  • "What's the weather like?"
  1. Verify error handling:
  • Try with invalid cities
  • Test API timeout scenarios
  • Check rate limit handling
eliza-openweather-plugin

Discord username

kylebuildsstuff

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kylebuildsstuff! Welcome to the ai16z community. Thanks for submitting your first pull request; your efforts are helping us accelerate towards AGI. We'll review it shortly. You are now a ai16z contributor!

Copy link
Member

@shakkernerd shakkernerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good.
Thanks!

@shakkernerd shakkernerd merged commit 85c5154 into elizaOS:develop Jan 6, 2025
3 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants