Skip to main content

llama-index tools weather integration

Project description

Open Weather Map Tool

This tool connects to the OpenWeatherMap's OneCall API, using the pyowm Python package. You must initialize the tool with your OpenWeatherMap API token

The tool has access to the following functions:

  • the current weather
  • the weather tomorrow

Usage

Here's an example usage of the OpenWeatherMapToolSpec.

from llama_index.tools.weather import OpenWeatherMapToolSpec
from llama_index.agent.openai import OpenAIAgent

tool_spec = OpenWeatherMapToolSpec(key="...")

agent = OpenAIAgent.from_tools(tool_spec.to_tool_list())

agent.chat("What is the temperature like in Paris?")
agent.chat("What is the wind like in Budapest tomorrow?")

weather_at_location: Use pyowm to get current weather details at a location

forecast_tommorrow_at_location: Use pyowm to get the forecast for tomorrow at a location.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_tools_weather-0.1.4.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

llama_index_tools_weather-0.1.4-py3-none-any.whl (3.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page