Closed alexander-fischer closed 1 month ago
Hey there, @alexander-fischer! I'm here to help you with any bugs, questions, or contributions you might have. Let's squash those bugs together! 🐞
To address the UnauthorizedError: Invalid API Key provided
error in the OpenWeatherMapToolSpec
when calling forecast_tommorrow_at_location
, ensure that you are using a valid OpenWeatherMap API key. Here is an example of how to initialize the OpenWeatherMapToolSpec
correctly:
from llama_index.tools.weather import OpenWeatherMapToolSpec
# Replace 'your_valid_api_key' with your actual OpenWeatherMap API key
tool_spec = OpenWeatherMapToolSpec(key="your_valid_api_key")
print(tool_spec.forecast_tommorrow_at_location("Berlin"))
Make sure the API key you are using is correct and has the necessary permissions to access the OpenWeatherMap API. Additionally, ensure that the pyowm
package is installed, as it is required by the OpenWeatherMapToolSpec
class. You can install it using:
pip install pyowm
The specific version of the pyowm
package compatible with the llama-index-tools-weather
package in version 0.10.53 is 3.3.0
[1].
If the issue persists, it may be due to changes in the OpenWeatherMap API endpoints. The forecast_tommorrow_at_location
function uses the forecast_at_place(location, "daily")
endpoint, which might not be supported by newer API keys [2]. You can refer to the GitHub issue for more details on this problem.
To continue talking to Dosu, mention @dosu.
Bug Description
OpenWeatherMapToolSpec which is part of the llama-index agent tool
llama-index-tools-weather
throws an error whenever the agent call the functionforecast_tommorrow_at_location
.The error message is:
UnauthorizedError: Invalid API Key provided
This is a known issue for newer API keys for OpenWeatherMap, which don't support the old API endpoints anymore: https://github.com/csparpa/pyowm/issues/316
Version
0.10.53
Steps to Reproduce
Install the tool:
llama-index-tools-weather
After installation use the following code to reproduce:
Relevant Logs/Tracbacks
No response