Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide geolocation tool function with Open Meteo #40

Open
MrCsabaToth opened this issue Aug 24, 2024 · 1 comment
Open

Provide geolocation tool function with Open Meteo #40

MrCsabaToth opened this issue Aug 24, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request function tooling Generative AI Function / Tooling related

Comments

@MrCsabaToth
Copy link
Member

A new article shows weather forecast interaction with multiple rounds of function calls similarly to my example: https://medium.com/google-cloud/deep-dive-into-function-calling-in-gemini-b62e2618e3a7

The difference is that it doesn't only work with the current location, but also with any named geographic entity name. This is because it uses Open Meteo, which has a free API for converting location names to lat / lon.

@MrCsabaToth MrCsabaToth added the enhancement New feature or request label Aug 24, 2024
@MrCsabaToth MrCsabaToth added the function tooling Generative AI Function / Tooling related label Aug 24, 2024
@MrCsabaToth MrCsabaToth changed the title Provide geolocation tool function with OpenMeteo Provide geolocation tool function with Open Meteo Aug 24, 2024
@MrCsabaToth MrCsabaToth self-assigned this Sep 3, 2024
@MrCsabaToth
Copy link
Member Author

GET https://geocoding-api.open-meteo.com/v1/search?name=Yosemite%20Valley&count=1
Response:

{
  "results": [
    {
      "id": 7262586,
      "name": "Yosemite Valley",
      "latitude": 37.74075,
      "longitude": -119.57788,
      "elevation": 1208,
      "feature_code": "PPL",
      "country_code": "US",
      "admin1_id": 5332921,
      "admin2_id": 5370594,
      "timezone": "America/Los_Angeles",
      "population": 1035,
      "country_id": 6252001,
      "country": "United States",
      "admin1": "California",
      "admin2": "Mariposa"
    }
  ],
  "generationtime_ms": 1.2050867
}

GET https://geocoding-api.open-meteo.com/v1/search?name=Little%20Yosemite%20Valley&count=1

{
  "generationtime_ms": 0.8980036
}

GET https://geocoding-api.open-meteo.com/v1/search?name=Forestiere%20Underground%20Gardens&count=1
{"generationtime_ms":1.3049841}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request function tooling Generative AI Function / Tooling related
Projects
None yet
Development

No branches or pull requests

1 participant