-
Notifications
You must be signed in to change notification settings - Fork 676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new weather API function to fetch additional open weather data #328
Conversation
I suspect that the test failure might be attributed to the lack of an API KEY for https://openweathermap.org/api in the repository's environment variables, necessitating only the application for a free plan. I would deeply appreciate any support or guidance the project maintainers could offer regarding this matter. Thank you in advance for your time and assistance. |
Thanks @yiyiyi0817 for the PR! The current implementation is based on There is a geocoding-api from openweathermap: https://openweathermap.org/api/geocoding-api. We can also use Here is an example of how we can do it by https://chat.openai.com/share/cb43a906-0d28-4894-8037-01d795617c6f |
Thank you very much for @lightaime. I noticed that open weather map needs to use geocoding-api to obtain the latitude and longitude of the city. However, I am not sure whether geocoding-api should be a separate geocoding_functions, because it may not only need the weather query function to use the latitude and longitude and city name conversion, but may also need geocoding-api for other needs, such as calculating the time difference and so on. |
How about let's use
|
Sounds good! Let's use pyowm. Thanks for providing the example! Using pyowm seems like it might be more convenient and robust compared to requests. I'll make the necessary changes to my code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are doing well, keep trying!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current implementation looks very good! Thank you.
A small improvement can be adding an exmaple to let a ChatAgent use this API. After finishing @lightaime 's request, could you consider adding this?
@dandansamax Of course. I'd be happy to add an example of role-playing with a weather function after completing this. |
Move to #334 |
Closed since this is a duplicated PR: #334. |
Description
This PR introduces a new API function, and a set of test cases to validate its functionality. This feature enhancement enhances the CAMEL project by providing access to current weather data based on geographical coordinates.
This update integrates features related to the OpenWeatherMap API, enabling new weather-related functionality.
In order to use these new features, an API key from OpenWeatherMap is required. Contributors and users who want to run this code will need to:
Please ensure the 'OPENWEATHER_API_KEY' is correctly configured in the environment before running the application. Incorrect handling of the API key may lead to errors or unexpected behavior.
Thank you for your attention to this requirement as we integrate these exciting new weather features.
Motivation and Context
Motivation:
Weather data is a valuable resource for a wide range of applications, from optimizing energy consumption to improving travel safety. Users of the CAMEL project have expressed the need for a reliable and easy-to-use way to access current weather information based on geographical coordinates. This addition of the
fetch_current_weather
API fulfills that need, providing real-time weather data to CAMEL users, enhancing their experience, and enabling new possibilities for data analysis.Context:
Prior to this change, users had to rely on external services or implement custom solutions to obtain weather data. The
fetch_current_weather
API simplifies this process, making it more accessible and integrated within the CAMEL framework. This addition aligns with our project's goal of providing comprehensive and user-friendly AI capabilities. It leverages the OpenWeatherMap API to retrieve accurate and up-to-date weather information, which complements the existing functionality of CAMEL.An issue has been raised to propose this change (#57)
Types of changes
Implemented Tasks
Checklist