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.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.

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.4.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.4.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for llama_index_tools_weather-0.4.0.tar.gz
Algorithm Hash digest
SHA256 9335b52e0fb2baadb6667f6123ba09e3443d9e7a1de74e6c0cda285d104c44fa
MD5 7a54dc17d940f8aac0dd588dfcdae905
BLAKE2b-256 eae3309cfc49f25ce2e65c44581b7b59a7ebecc9c7a81b7e16dbdc179b989f95

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_tools_weather-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2facc4c6ed15b6424272464cec192d831591c3c5b012ddbcbee5efd99ed458ca
MD5 9775ed4f271f319659e973256eec4bde
BLAKE2b-256 d5d6620f7981a49aee0711d13dd488d0cd4813ecb161e8bb26cba264ca8c0a9d

See more details on using hashes here.

Supported by

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