Skip to content

Feat/weather tool - #5

Merged
saqlain2204 merged 5 commits into
mainfrom
feat/weather_tool
Mar 31, 2026
Merged

Feat/weather tool#5
saqlain2204 merged 5 commits into
mainfrom
feat/weather_tool

Conversation

@saqlain2204

@saqlain2204 saqlain2204 commented Mar 31, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes: #1
This PR created tools for weather information retrieval (No Auth) and created an example agent to demonstrate usage.

Changes

  • Created new tool
  • Created new agent to demonstrate tool usage

Checklist

  • Tests added or updated for every changed behaviour
  • All existing tests pass (python -m pytest -q)
  • Type annotations present on all new public symbols
  • mypy src/vantage passes
  • ruff check . passes
  • CHANGELOG.md updated under [Unreleased]

@saqlain2204
saqlain2204 requested review from Copilot and removed request for Copilot March 31, 2026 14:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new WeatherTool to fetch current weather from a no-auth public endpoint (wttr.in) and includes an example YAML agent + runner script demonstrating tool usage.

Changes:

  • Introduces WeatherTool and exports it via vantage.tools and top-level vantage.
  • Adds an example agent config (weather_agent.yaml) and a runnable demo script (run.py).
  • Adds new runtime/dev dependencies (requests, types-requests) and an (empty) test placeholder.

Reviewed changes

Copilot reviewed 6 out of 9 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/vantage/tools/weather_tool.py Implements the new weather-fetching tool via wttr.in.
src/vantage/tools/__init__.py Exposes WeatherTool from the tools package.
src/vantage/__init__.py Re-exports WeatherTool at the library top-level.
pyproject.toml Adds requests (runtime) and types-requests (dev).
tests/tools/test_weather_tool.py Placeholder for tests (currently empty).
examples/weather_agent/weather_agent.yaml Example agent configuration using weather_tool.
examples/weather_agent/run.py Example runner that injects WeatherTool() and saves a trace PNG.
examples/weather_agent/trace.png Committed example trace image (large generated artifact).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/vantage/tools/weather_tool.py Outdated
Comment on lines +32 to +36
location = str(kwargs.get("location", ""))
if not location.strip():
raise ValueError("location is required")
url = f"https://wttr.in/{location}?format=3"
response = requests.get(url)

Copilot AI Mar 31, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

location is interpolated directly into the URL path. Inputs with spaces (e.g. "New York") or reserved characters will produce an invalid URL or unexpected request path. URL-encode the location (e.g., urllib.parse.quote) and build the query via params rather than string concatenation.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Comment thread src/vantage/tools/weather_tool.py Outdated
Comment thread src/vantage/tools/weather_tool.py Outdated
Comment thread src/vantage/tools/weather_tool.py Outdated
Comment thread pyproject.toml Outdated
Comment thread src/vantage/tools/weather_tool.py Outdated
Comment thread examples/weather_agent/run.py Outdated
Comment thread examples/weather_agent/weather_agent.yaml Outdated
Comment thread examples/weather_agent/weather_agent.yaml
…g, timeout, error handling, and tests

Agent-Logs-Url: https://github.com/saqlain2204/Vantage/sessions/8580fb44-d014-4bfd-9531-deafbb2007d1

Co-authored-by: saqlain2204 <118016760+saqlain2204@users.noreply.github.com>
@saqlain2204 saqlain2204 self-assigned this Mar 31, 2026
@saqlain2204
saqlain2204 merged commit 7372903 into main Mar 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Tool] Weather Information (No Auth)

3 participants