Geolocation Tool and Example Agent#252
Conversation
There was a problem hiding this comment.
Pull Request Overview
Adds a new GeolocationTool to fetch local time, timezone, and public-IP-based location; updates tool registry, packaging, and provides an example agent.
- Introduces
GeolocationToolwith time, timezone, and IP-based location methods - Updates registry (
__init__.py) and packaging (pyproject.toml) to include geolocation dependencies - Adds a basic example agent demonstrating the new tool
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/agentic/tools/geolocation_tool.py | Implements new geolocation methods |
| src/agentic/tools/init.py | Registers GeolocationTool in the tool registry |
| src/agentic/tools/init.pyi | (Accidentally) deleted stub exports for many tools |
| pyproject.toml | Added tzlocal under [geolocation] extras |
| examples/geolocation_agent.py | Provides a sample agent for geolocation functionality |
Comments suppressed due to low confidence (2)
examples/geolocation_agent.py:12
- [nitpick] The instructions mention reporting the weather, but this agent demonstrates geolocation. Update the instructions to reflect location/time queries.
instructions="You are a helpful assistant that reports the weather.",
2ddc8b6 to
835c23b
Compare
|
This is cool! Limited to getting the "agent's" location vs. the human's location... I think we put the user's timezone in the ThreadContext, but we should add the IP address as well (which we could gather server-side in the API call) then you could get the human's location as well. I think if we added fa_request:Request to as an arg here to get the FastAPi request, we could get fa_request.client.host and add it to the TheadContext: Line 204 in 4448287 |
Adds a geolocation tool with the following capabilities:
Note: gets geolocation information based on public ip of the machine it is being run on, meaning inaccuracies can occur if agent is being run by a server or if ip points to a different location (such as if a vpn is being used).
Other addition:
Very basic agent also created to test the tool, added to agentic's example agents.