chatgpt-api/docs/tools/weather.mdx

37 wiersze
722 B
Plaintext
Czysty Zwykły widok Historia

2024-08-07 02:19:51 +00:00
---
title: Weather
description: Simple Weather API client for accessing weather data based on location.
---
- package: `@agentic/weather`
- exports: `class WeatherClient`, `namespace weather`
- env vars: `WEATHER_API_KEY`
- [source](https://github.com/transitive-bullshit/agentic/blob/main/packages/weather/src/weather-client.ts)
2024-08-17 11:03:17 +00:00
- [weatherapi.com api docs](https://www.weatherapi.com)
2024-08-07 02:19:51 +00:00
## Install
<CodeGroup>
```bash npm
npm install @agentic/weather
```
```bash yarn
yarn add @agentic/weather
```
```bash pnpm
pnpm add @agentic/weather
```
</CodeGroup>
## Usage
```ts
import { WeatherClient } from '@agentic/weather'
const weather = new WeatherClient()
const res = await weather.getCurrentWeather('new york')
```