Skip to content

receptron/GUIChatPluginWeather

Repository files navigation

@gui-chat-plugin/weather

npm version

Weather forecast plugin for GUI Chat applications. Fetches weather data from Japan Meteorological Agency (JMA) API.

Features

  • Real-time weather forecast from JMA API
  • Support for all 47 Japanese prefectures and 59 regional areas
  • Interactive weather display with temperature charts
  • Extended forecast with daily cards
  • Precipitation probability visualization

Installation

yarn add @gui-chat-plugin/weather

Usage

Vue Integration

// In src/tools/index.ts
import WeatherPlugin from "@gui-chat-plugin/weather/vue";

const pluginList = [
  // ... other plugins
  WeatherPlugin,
];

// In src/main.ts
import "@gui-chat-plugin/weather/style.css";

Core-only Usage

import { executeWeather, TOOL_DEFINITION } from "@gui-chat-plugin/weather";

// Fetch weather for Tokyo
const result = await executeWeather(context, {
  areaCode: "130000",
});

API

WeatherArgs

interface WeatherArgs {
  areaCode: string; // JMA area code (e.g., "130000" for Tokyo)
}

Area Codes

Common area codes:

  • Tokyo: 130000
  • Osaka: 270000
  • Kyoto: 260000
  • Fukuoka: 400000
  • Hokkaido (Ishikari): 016000
  • Okinawa: 471000

Development

# Install dependencies
yarn install

# Run demo
yarn dev

# Build
yarn build

# Lint
yarn lint

Test Prompts

Try these prompts to test the plugin:

  1. "What's the weather forecast for Tokyo?"
  2. "Show me the weather in Osaka"
  3. "Will it rain in Hokkaido this week?"

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors