curl -X POST https://aiplatform.googleapis.com/v1beta1/projects/{project}/locations/global/interactions \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-H "Api-Revision: 2026-05-20" \
-d '{
"agent": "deep-research-preview-04-2026",
"tools": [{
"type": "function",
"name": "get_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
}
},
"required": ["location"]
}
}],
"input": "What is the weather like in Boston, MA?"
}'
from google import genai
client = genai.Client(vertexai=True, location='global')
response = client.interactions.create(
agent="deep-research-preview-04-2026",
tools=[{
"type": "function",
"name": "get_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
}
},
"required": ["location"]
}
}],
input="What is the weather like in Boston?"
)
print(response.steps[-1])
import {GoogleGenAI} from '@google/genai';
const ai = new GoogleGenAI({vertexai: true, location: 'global'});
const interaction = await ai.interactions.create({
agent: 'deep-research-preview-04-2026',
tools: [{
type: 'function',
name: 'get_weather',
description: 'Get the current weather in a given location',
parameters: {
type: 'object',
properties: {
location: {
type: 'string',
description: 'The city and state, e.g. San Francisco, CA'
}
},
required: ['location']
}
}],
input: 'What is the weather like in Boston?'
});
console.log(interaction.steps.at(-1));