curl -X DELETE 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()
client.agents.delete(agent_id)
print("Agent deleted successfully.")
import {GoogleGenAI} from '@google/genai';
const ai = new GoogleGenAI({});
await ai.agents.delete(agentId);
console.log('Agent deleted successfully.');
import com.google.genai.gaos.models.agents.Agent;
import com.google.genai.Client;
Client client = new Client();
client.agents.delete(agentId);
System.out.println("Agent deleted successfully.");
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
_, err = client.Agents.Delete(ctx, operations.DeleteAgentRequest{ID: agentID})
if err != nil {
log.Fatal(err)
}
fmt.Println("Agent deleted successfully.")
}