Location params on best_local_bid / latest_prices (zip / GPS + radius)
CI / test (push) Successful in 17s
CI / build-push (push) Successful in 6s

Thread zip/lat/lng/radius_miles through the client and both tools; friendly
guard for the zip-XOR-gps rule. Formatters surface distance, the searched
center, and the nearest-source hint when nothing is in range.

- client: best()/latest() take zip/lat/lng/radius_miles
- server: location params + docstrings (note Ohio-concentrated coverage)
- format: distance column + center/nearest rendering
- README + CHANGELOG + advisor prompt library updated
- tests: location formatting cases

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-31 07:51:54 -04:00
parent ae15aa5c3c
commit fb50c103d3
7 changed files with 245 additions and 31 deletions
+13 -3
View File
@@ -128,10 +128,20 @@ targets above the seasonal normal.
`todays_summary()` (one call) — then drill in where it flags something.
**12. Best bid right now**
> "Where's the best corn bid near me today?"
**12. Best bid right now (location-aware)**
> "Where's the best corn bid within 40 miles of 45810?"
`best_local_bid("corn")` (or `latest_prices("corn")` to see every elevator).
`best_local_bid("corn", zip="45810", radius_miles=40)` — restricts to nearby
elevators and shows the distance. From GPS instead:
`best_local_bid("corn", lat=40.79, lng=-83.81)`. `latest_prices("corn",
zip="45810", radius_miles=40)` lists every nearby elevator nearest-first. Without
a location these consider every scraped elevator.
> Coverage note for the advisor: scraped cash bids are concentrated in **Ohio**
> today. If the farmer's zip/GPS is far from Ohio, `best_local_bid` returns "none
> in range" plus the nearest elevator's distance — say that plainly (it's a
> coverage gap, not a price of zero), and fall back to `price_trend(commodity,
> geo=<their state>)` for the national/state benchmark.
**13. Did futures move today?**
> "How far has corn moved today — off the open and on the day?"