Feat/weather tool - #5
Merged
Merged
Conversation
There was a problem hiding this comment.
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
WeatherTooland exports it viavantage.toolsand top-levelvantage. - 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 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) |
There was a problem hiding this comment.
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.
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes: #1
This PR created tools for weather information retrieval (No Auth) and created an example agent to demonstrate usage.
Changes
Checklist
python -m pytest -q)mypy src/vantagepassesruff check .passesCHANGELOG.mdupdated under[Unreleased]