Google Maps Platform
Google Maps Platform (ditagih per panggilan, field mask default yang hemat, tidak diulang kalau hasilnya tidak jelas), pencarian teks dan sekitar di Places (New), detail, autocomplete, foto, Geocoding v4, rute dan matriks Routes (matriks dari agent dibatasi)
Beta v0.1.0 Node.js 9 aksi
Tentang
Plugin Graphrt untuk tiga API Google Maps Platform dengan satu API key, yaitu Places API (New), Geocoding API v4 dan Routes API. Setiap operasi adalah node workflow dan tool agent.
Yang bisa dilakukan
- Places: search_text (text query with type, open-now, rating, price and location filters, paginated with limit/cursor), search_nearby (types within a radius), get_place (details by id), autocomplete_places (predictions with session tokens), get_place_photo (a short-lived photoUri for a photo name)
- Geocoding v4: geocode_address, reverse_geocode
- Routes: compute_routes (distance, duration, optional alternatives, intermediates, avoid tolls/highways/ferries), compute_route_matrix (every origin-destination pair, billed per element)
Aksi
Setiap aksi adalah langkah yang bisa ditambahkan ke workflow. Agent juga bisa memakai sebagian besar aksi sebagai tool.
- Search places by text
google-maps-platform.search_text - Search places nearby
google-maps-platform.search_nearby - Place details
google-maps-platform.get_place - Autocomplete places
google-maps-platform.autocomplete_places - Place photo URL
google-maps-platform.get_place_photo - Geocode an address
google-maps-platform.geocode_address - Reverse geocode
google-maps-platform.reverse_geocode - Compute a route
google-maps-platform.compute_routes - Compute a route matrix
google-maps-platform.compute_route_matrix
Pengaturan
Graphrt menyalakan plugin dengan environment yang bersih. Hanya nilai ini yang sampai ke plugin, dan secret tidak masuk log.
-
GOOGLE_MAPS_API_KEYWajibAPI key, sent as the X-Goog-Api-Key header (never in the URL) -
GOOGLE_MAPS_TOOL_MAX_MATRIX_ELEMENTSOpsionalMost elements (origins x destinations) an agent may request in one compute_route_matrix call (default 100) -
GOOGLE_MAPS_TOOL_ALLOW_EXPENSIVE_FIELDSOpsional1 lets agents request any field (*, rating, phone, website, opening hours, reviews, photos, ...) in search_text, search_nearby and get_place, without it agents get Essentials/Pro fields only
Cara memakainya
Di Graphrt Desktop
- Buka Plugins dan cari Google Maps Platform.
- Klik Install lalu setujui.
- Ikuti langkah setup di halaman plugin, lalu tempel pengaturan yang dibutuhkan.
- Jelaskan pekerjaan yang membutuhkannya, dan builder menambahkan langkahnya.
Dengan CLI
terminal
$ graphrt plugin install google-maps-platform workflow.yaml
- id: places
type: google-maps-platform.search_text
text_query: "nasi goreng near Blok M"
open_now: true
field_mask: "places.id,places.displayName,places.formattedAddress,places.rating,nextPageToken"
limit: 10
- id: route
type: google-maps-platform.compute_routes
origin: { address: "Blok M, Jakarta" }
destination: { placeId: "{{#places.data.0.id#}}" }
travel_mode: TWO_WHEELER