Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
OurBuilding Ambient Agents with LangGraph course is now available on LangChain Academy!
Open In ColabOpen on GitHub

Weather

OpenWeatherMap is an open-source weather service provider

This loader fetches the weather data from the OpenWeatherMap's OneCall API, using the pyowm Python package. You must initialize the loader with your OpenWeatherMap API token and the names of the cities you want the weather data for.

from langchain_community.document_loadersimport WeatherDataLoader
API Reference:WeatherDataLoader
%pip install--upgrade--quiet  pyowm
# Set API key either by passing it in to constructor directly
# or by setting the environment variable "OPENWEATHERMAP_API_KEY".

from getpassimport getpass

OPENWEATHERMAP_API_KEY= getpass()
loader= WeatherDataLoader.from_params(
["chennai","vellore"], openweathermap_api_key=OPENWEATHERMAP_API_KEY
)
documents= loader.load()
documents

Related


[8]ページ先頭

©2009-2025 Movatter.jp