curl -X GET https://generativelanguage.googleapis.com/v1beta/agents/ag_abc123 \
-H "x-goog-api-key: $GEMINI_API_KEY"
import uuid
from google import genai
client = genai.Client()
agent = client.agents.get(agent_id)
print(agent.id)
import {GoogleGenAI} from '@google/genai';
const ai = new GoogleGenAI({});
const agent = await ai.agents.get(agentId);
if (!agent.id) {
throw new Error('Agent retrieval failed: ID is undefined');
}
console.log(agent.id);