langchain_community.document_loaders.weather.WeatherDataLoader

class langchain_community.document_loaders.weather.WeatherDataLoader(client: OpenWeatherMapAPIWrapper, places: Sequence[str])[source]

使用`Open Weather Map` API加载天气数据。

使用OpenWeatherMap的免费API读取任何位置的预报和当前天气。查看’https://openweathermap.org/appid’了解如何生成免费的OpenWeatherMap API。

使用参数进行初始化。

Methods

__init__(client, places)

使用参数进行初始化。

alazy_load()

一个用于文档的惰性加载器。

aload()

将数据加载到文档对象中。

from_params(places, *[, openweathermap_api_key])

lazy_load()

为给定的位置延迟加载天气数据。

load()

将数据加载到文档对象中。

load_and_split([text_splitter])

加载文档并分割成块。块作为文档返回。

Parameters
Return type

None

__init__(client: OpenWeatherMapAPIWrapper, places: Sequence[str]) None[source]

使用参数进行初始化。

Parameters
Return type

None

async alazy_load() AsyncIterator[Document]

一个用于文档的惰性加载器。

Return type

AsyncIterator[Document]

async aload() List[Document]

将数据加载到文档对象中。

Return type

List[Document]

classmethod from_params(places: Sequence[str], *, openweathermap_api_key: Optional[str] = None) WeatherDataLoader[source]
Parameters
  • places (Sequence[str]) –

  • openweathermap_api_key (Optional[str]) –

Return type

WeatherDataLoader

lazy_load() Iterator[Document][source]

为给定的位置延迟加载天气数据。

Return type

Iterator[Document]

load() List[Document]

将数据加载到文档对象中。

Return type

List[Document]

load_and_split(text_splitter: Optional[TextSplitter] = None) List[Document]

加载文档并分割成块。块作为文档返回。

不要覆盖此方法。应该被视为已弃用!

参数:
text_splitter: 用于分割文档的TextSplitter实例。

默认为RecursiveCharacterTextSplitter。

返回:

文档列表。

Parameters

text_splitter (Optional[TextSplitter]) –

Return type

List[Document]

Examples using WeatherDataLoader