curl -X POST https://generativelanguage.googleapis.com/v1/interactions \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-3.6-flash",
"tools": [{
"type": "google_maps",
"latitude": 37.7749,
"longitude": -122.4194
}],
"input": "What is the best food near me?"
}'
from google import genai
client = genai.Client()
response = client.interactions.create(
model="gemini-3.6-flash",
tools=[{
"type": "google_maps",
"latitude": 37.7749,
"longitude": -122.4194
}],
input="What is the best food near me?"
)
print(response.output_text)
import {GoogleGenAI} from '@google/genai';
const ai = new GoogleGenAI({});
const interaction = await ai.interactions.create({
model: 'gemini-3.6-flash',
tools: [{
type: 'google_maps',
latitude: 37.7749,
longitude: -122.4194
}],
input: 'What is the best food near me?'
});
console.log(interaction.output_text);
import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.CreateModelInteraction;
import com.google.genai.gaos.models.interactions.GoogleMaps;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
import com.google.genai.gaos.models.operations.CreateInteractionResponse;
import java.util.List;
Client client = new Client();
GoogleMaps tool = GoogleMaps.builder()
.latitude(37.7749)
.longitude(-122.4194)
.build();
CreateModelInteraction params =
CreateModelInteraction.builder()
.model("gemini-3.6-flash")
.tools(List.of(tool))
.input(InteractionsInput.of("What is the best food near me?"))
.build();
CreateInteractionResponse response =
client.interactions.create(CreateInteractionRequestBody.of(params));
Interaction interaction =
response.interaction().orElseThrow(() -> new RuntimeException("No interaction returned"));
System.out.println(interaction.outputText().orElse(""));