Skip to content

Implement WeatherTool using Open-Meteo API#26

Merged
IreneXY merged 1 commit intomainfrom
031903
Mar 27, 2026
Merged

Implement WeatherTool using Open-Meteo API#26
IreneXY merged 1 commit intomainfrom
031903

Conversation

@IreneXY
Copy link
Copy Markdown
Member

@IreneXY IreneXY commented Mar 27, 2026

Summary

  • Add WeatherTool as cross-platform built-in example tool in core
  • Uses Open-Meteo geocoding API with count=5 (returns multiple matches for city disambiguation)
  • Returns raw JSON from both geocoding and weather APIs, letting LLM interpret and format
  • No API key required, pure HTTP — works on all platforms
  • Injectable http.Client for testing
  • Place in toolbox/ directory (separate from tool/ which holds interface definitions)

Directory structure

chat_core/lib/src/
├── tool/        # Interface definitions (Tool, ToolRegistry)
└── toolbox/     # Concrete tool implementations (WeatherTool)

Test plan

  • dart analyze passes
  • dart format --set-exit-if-changed . passes
  • dart test — 63 tests passed (4 new unit + 1 integration)
  • Integration test: LLM calls weather tool for "San Jose", disambiguates California from Costa Rica

🤖 Generated with Claude Code

Co-Authored-By: Claude Code noreply@anthropic.com

Add cross-platform weather tool as built-in example in core:
- Uses Open-Meteo geocoding API (returns multiple matches for disambiguation)
- Returns raw JSON from both geocoding and weather APIs, letting LLM interpret
- No API key required, pure HTTP, works on all platforms
- Injectable http.Client for testing
- Place in toolbox/ directory (separate from tool/ which holds interfaces)
- Integration test: LLM queries San Jose weather, disambiguates California

Co-Authored-By: Claude Code <noreply@anthropic.com>
@IreneXY IreneXY merged commit f43ecee into main Mar 27, 2026
1 check passed
@IreneXY IreneXY deleted the 031903 branch March 27, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants