tree: d7745e533f099ff73089dfbf131a29ea0894a202
  1. internal/
  2. types/
  3. agentengines.go
  4. agentengines_test.go
  5. CHANGES.md
  6. client.go
  7. client_test.go
  8. doc.go
  9. example_test.go
  10. go.mod
  11. go.sum
  12. helpers_test.go
  13. license.txt
  14. memories.go
  15. memories_test.go
  16. memoryrevisions.go
  17. memoryrevisions_test.go
  18. mock_server_test.go
  19. README.md
  20. replay_test.go
  21. sandboxes.go
  22. sandboxes_test.go
  23. sessionevents.go
  24. sessionevents_test.go
  25. sessions.go
  26. sessions_test.go
agentplatform/README.md

Gemini Enterprise Agent Platform Go SDK

Go Reference

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.

Installation

Add the SDK to your module with go get cloud.google.com/go/agentplatform.

Documentation

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

Usage Examples

Create Client:

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)
}

Create Reasoning Engine:

if _, err := client.AgentEngines.Create(ctx, &types.CreateAgentEngineConfig{}); err != nil {
  panic(err)
}

Wait For Operation

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)
}

Get a Reasoning Engine

resourceName := "projects/PROJEDCT/locations/LOCATION/reasoningEngines/RESOURCE_ID"
if _, err := client.AgentEngines.Get(ctx, resourceName, nil); err == nil {
  panic(err)
}

Delete a reasoning engine

resourceName := "projects/PROJEDCT/locations/LOCATION/reasoningEngines/RESOURCE_ID"
if _, err := client.AgentEngines.Delete(ctx, resourceName, nil); err == nil {
  panic(err)
}

Contributing

See Contributing for more information on contributing to the Vertex AI Go SDK.

License

The contents of this repository are licensed under the Apache License, version 2.0.