Skip to main content

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.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

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

agent = FunctionAgent(
    tools=tool_spec.to_tool_list(),
    llm=OpenAI(model="gpt-4.1"),
)

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

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

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

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.6.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llama_index_tools_weather-0.6.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_tools_weather-0.6.0.tar.gz.

File metadata

  • Download URL: llama_index_tools_weather-0.6.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_tools_weather-0.6.0.tar.gz
Algorithm Hash digest
SHA256 9c4d414b78f4dd5b0142d6df3b15964022caa0ea367528252c5b03706e6b7282
MD5 6750a7112919a225a60c57c32740bc42
BLAKE2b-256 0c43619c8cd8412bf8afc326cd3a5580ae1947695aafb73daceb188ee57f477a

See more details on using hashes here.

File details

Details for the file llama_index_tools_weather-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: llama_index_tools_weather-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_tools_weather-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36ebbeb691a9c5f4b8748d7f38f8a0bb957d8e676a6c79d4af7ad4837e141c8b
MD5 1a067ce751d4743feaed3066c7774910
BLAKE2b-256 db9c11b3ed5e8fe015e0d177972f7469f08c07124302349f0f31a6eebf6c6850

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page