The Gemini Enterprise Agent Platform SDK for Go enables you to use Google's state-of-the-art generative AI models (like Gemini) to build AI-powered features and applications.
For the latest list of available Gemini models on Agent Platform, see the Model information page in Agent Platform documentation.
Add the SDK to your module with go get cloud.google.com/go/agentplatform.
You can find complete documentation for the Gemini Enterprise Agent Platform, on quickstart.
For a list of the supported models and their capabilities, see model overview
client, err := agentplatform.NewGenAIClient(ctx, &genai.ClientConfig{ Project: project, // If not set, will read from the GOOGLE_CLOUD_PROJECT env var Location: location, // If not set, will read from the GOOGLE_CLOUD_LOCATION env var }) if err != nil { panic(err) }
if _, err := client.AgentEngines.Create(ctx, &types.CreateAgentEngineConfig{}); err != nil {
panic(err)
}
operationName := "projects/PROJEDCT/locations/LOCATION/reasoningEngines/RESOURCE_ID/operations/OPERATION_ID"
for {
if op, err := client.AgentEngines.GetAgentOperation(ctx, operationName, nil); err != nil {
panic(err)
} else if op.Done {
break
}
time.Sleep(5 * time.Second)
}
resourceName := "projects/PROJEDCT/locations/LOCATION/reasoningEngines/RESOURCE_ID"
if _, err := client.AgentEngines.Get(ctx, resourceName, nil); err == nil {
panic(err)
}
resourceName := "projects/PROJEDCT/locations/LOCATION/reasoningEngines/RESOURCE_ID"
if _, err := client.AgentEngines.Delete(ctx, resourceName, nil); err == nil {
panic(err)
}
See Contributing for more information on contributing to the Vertex AI Go SDK.
The contents of this repository are licensed under the Apache License, version 2.0.