Documentation
¶
Overview ¶
Package agentplatform provides a client for interacting with Agent Platform APIs.
New users are encouraged to use the Google GenAI Go SDK available at google.golang.org/genai.
See cloud.google.com/go/agentplatform for the currently supported functionality.
Example (AgentEngineSandboxTemplatesAndSnapshots) ¶
Example_agentEngineSandboxTemplatesAndSnapshots demonstrates using the Go SDK to perform operations on Agent Engine sandbox environment templates and snapshots.
It reuses the createClient helper, projectID, and location declared in example_test.go.
package main
import (
"context"
"fmt"
"time"
"cloud.google.com/go/agentplatform"
"cloud.google.com/go/agentplatform/types"
"google.golang.org/genai"
)
// Example_agentEngineSandboxTemplatesAndSnapshots demonstrates using the Go SDK
// to perform operations on Agent Engine sandbox environment templates and
// snapshots.
//
// It reuses the createClient helper, projectID, and location declared in
// example_test.go.
func main() {
ctx := context.Background()
client := createClient(ctx)
// Create a temporary Agent Engine to own the sandboxes.
createOp, err := client.AgentEngines.Create(
ctx, &types.CreateAgentEngineConfig{DisplayName: "sandbox-example"})
if err != nil {
panic(fmt.Sprintf("AgentEngines.Create() failed: %+v", err))
}
for !createOp.Done {
time.Sleep(10 * time.Second)
createOp, err = client.AgentEngines.GetAgentOperation(ctx, createOp.Name, nil)
if err != nil {
panic(fmt.Sprintf("GetAgentOperation() failed: %+v", err))
}
}
if createOp.Error != nil {
panic(fmt.Sprintf("Agent engine creation operation failed: %+v", createOp.Error))
}
agentEngineName := createOp.Response.Name
fmt.Println("Created Agent Engine:", agentEngineName)
// Clean up the Agent Engine (and all child resources) when finished.
deleteAllResources := true
defer client.AgentEngines.Delete(ctx, agentEngineName, &deleteAllResources, nil)
sandboxTemplatesExample(ctx, client, agentEngineName)
sandboxSnapshotsExample(ctx, client, agentEngineName)
}
// sandboxTemplatesExample demonstrates the sandbox templates submodule.
func sandboxTemplatesExample(ctx context.Context, client *agentplatform.Client, agentEngineName string) {
// 1. Create a sandbox environment template.
templateOp, err := client.AgentEngines.Sandboxes.Templates.Create(
ctx, agentEngineName, "Example Sandbox Template", computerUseTemplateConfig())
if err != nil {
panic(fmt.Sprintf("Templates.Create() failed: %+v", err))
}
for !templateOp.Done {
time.Sleep(10 * time.Second)
templateOp, err = client.AgentEngines.Sandboxes.Templates.GetSandboxEnvironmentTemplateOperation(
ctx, templateOp.Name, nil)
if err != nil {
panic(fmt.Sprintf("GetSandboxEnvironmentTemplateOperation() failed: %+v", err))
}
}
if templateOp.Error != nil {
panic(fmt.Sprintf("Template creation operation failed: %+v", templateOp.Error))
}
templateName := templateOp.Response.Name
fmt.Println("Created Sandbox Template:", templateName)
// 2. Get the template.
template, err := client.AgentEngines.Sandboxes.Templates.Get(ctx, templateName, nil)
if err != nil {
panic(fmt.Sprintf("Templates.Get() failed: %+v", err))
}
fmt.Println("Template display name:", template.DisplayName)
// 3. List templates.
listResp, err := client.AgentEngines.Sandboxes.Templates.List(ctx, agentEngineName, nil)
if err != nil {
panic(fmt.Sprintf("Templates.List() failed: %+v", err))
}
fmt.Println("Templates found:", len(listResp.SandboxEnvironmentTemplates))
// 4. Delete the template.
if _, err := client.AgentEngines.Sandboxes.Templates.Delete(ctx, templateName, nil); err != nil {
panic(fmt.Sprintf("Templates.Delete() failed: %+v", err))
}
fmt.Println("Deleted Sandbox Template.")
}
// sandboxSnapshotsExample demonstrates the sandbox snapshots submodule.
//
// Snapshots can only be taken of template-based (e.g. computer-use) sandboxes,
// so it first creates a computer-use template, then a sandbox from that
// template, snapshots the running sandbox, and finally restores a new sandbox
// from the snapshot.
func sandboxSnapshotsExample(ctx context.Context, client *agentplatform.Client, agentEngineName string) {
// Create a computer-use template to base the source sandbox on.
templateOp, err := client.AgentEngines.Sandboxes.Templates.Create(
ctx, agentEngineName, "Snapshot Source Template", computerUseTemplateConfig())
if err != nil {
panic(fmt.Sprintf("Templates.Create() failed: %+v", err))
}
for !templateOp.Done {
time.Sleep(10 * time.Second)
templateOp, err = client.AgentEngines.Sandboxes.Templates.GetSandboxEnvironmentTemplateOperation(
ctx, templateOp.Name, nil)
if err != nil {
panic(fmt.Sprintf("GetSandboxEnvironmentTemplateOperation() failed: %+v", err))
}
}
if templateOp.Error != nil {
panic(fmt.Sprintf("Template creation operation failed: %+v", templateOp.Error))
}
templateName := templateOp.Response.Name
fmt.Println("Created Sandbox Template:", templateName)
defer client.AgentEngines.Sandboxes.Templates.Delete(ctx, templateName, nil)
// Create a sandbox from the template so it has a snapshottable state.
sandboxOp, err := client.AgentEngines.Sandboxes.Create(
ctx,
agentEngineName,
nil, // No spec: the sandbox is created from the template.
&types.CreateAgentEngineSandboxConfig{
DisplayName: "Snapshot Source Sandbox",
SandboxEnvironmentTemplate: templateName,
},
)
if err != nil {
panic(fmt.Sprintf("Sandboxes.Create() failed: %+v", err))
}
for !sandboxOp.Done {
time.Sleep(10 * time.Second)
sandboxOp, err = client.AgentEngines.Sandboxes.GetSandboxOperation(ctx, sandboxOp.Name, nil)
if err != nil {
panic(fmt.Sprintf("GetSandboxOperation() failed: %+v", err))
}
}
if sandboxOp.Error != nil {
panic(fmt.Sprintf("Sandbox creation operation failed: %+v", sandboxOp.Error))
}
sandboxName := sandboxOp.Response.Name
fmt.Println("Created source Sandbox:", sandboxName)
defer client.AgentEngines.Sandboxes.Delete(ctx, sandboxName, nil)
// 1. Create a snapshot of the running sandbox.
snapshotOp, err := client.AgentEngines.Sandboxes.Snapshots.Create(
ctx,
sandboxName,
&types.CreateAgentEngineSandboxSnapshotConfig{
DisplayName: "Example Sandbox Snapshot",
TTL: 3600 * time.Second,
},
)
if err != nil {
panic(fmt.Sprintf("Snapshots.Create() failed: %+v", err))
}
for !snapshotOp.Done {
time.Sleep(10 * time.Second)
snapshotOp, err = client.AgentEngines.Sandboxes.Snapshots.GetSandboxSnapshotOperation(
ctx, snapshotOp.Name, nil)
if err != nil {
panic(fmt.Sprintf("GetSandboxSnapshotOperation() failed: %+v", err))
}
}
if snapshotOp.Error != nil {
panic(fmt.Sprintf("Snapshot creation operation failed: %+v", snapshotOp.Error))
}
snapshotName := snapshotOp.Response.Name
fmt.Println("Created Sandbox Snapshot:", snapshotName)
// 2. Get the snapshot.
snapshot, err := client.AgentEngines.Sandboxes.Snapshots.Get(ctx, snapshotName, nil)
if err != nil {
panic(fmt.Sprintf("Snapshots.Get() failed: %+v", err))
}
fmt.Println("Snapshot Name:", snapshot.Name)
// 3. List snapshots.
listResp, err := client.AgentEngines.Sandboxes.Snapshots.List(ctx, agentEngineName, nil)
if err != nil {
panic(fmt.Sprintf("Snapshots.List() failed: %+v", err))
}
fmt.Println("Snapshots found:", len(listResp.SandboxEnvironmentSnapshots))
// 4. Restore a new sandbox from the snapshot.
restoreOp, err := client.AgentEngines.Sandboxes.Create(
ctx,
agentEngineName,
nil, // No spec: the sandbox is restored from the snapshot.
&types.CreateAgentEngineSandboxConfig{
DisplayName: "Restored Sandbox",
SandboxEnvironmentSnapshot: snapshotName,
},
)
if err != nil {
panic(fmt.Sprintf("Sandboxes.Create() from snapshot failed: %+v", err))
}
for !restoreOp.Done {
time.Sleep(10 * time.Second)
restoreOp, err = client.AgentEngines.Sandboxes.GetSandboxOperation(ctx, restoreOp.Name, nil)
if err != nil {
panic(fmt.Sprintf("GetSandboxOperation() failed: %+v", err))
}
}
if restoreOp.Error != nil {
panic(fmt.Sprintf("Sandbox restore operation failed: %+v", restoreOp.Error))
}
restoredSandboxName := restoreOp.Response.Name
fmt.Println("Restored Sandbox:", restoredSandboxName)
defer client.AgentEngines.Sandboxes.Delete(ctx, restoredSandboxName, nil)
// 5. Delete the snapshot.
if _, err := client.AgentEngines.Sandboxes.Snapshots.Delete(ctx, snapshotName, nil); err != nil {
panic(fmt.Sprintf("Snapshots.Delete() failed: %+v", err))
}
fmt.Println("Deleted Sandbox Snapshot.")
}
// computerUseTemplateConfig returns the config for a computer-use sandbox
// template with internet access.
func computerUseTemplateConfig() *types.CreateSandboxEnvironmentTemplateConfig {
return &types.CreateSandboxEnvironmentTemplateConfig{
DefaultContainerEnvironment: &types.SandboxEnvironmentTemplateDefaultContainerEnvironment{
DefaultContainerCategory: types.DefaultContainerCategoryComputerUse,
},
EgressControlConfig: &types.SandboxEnvironmentTemplateEgressControlConfig{
InternetAccess: genai.Ptr(true),
},
}
}
Output:
Index ¶
- type AgentEngines
- func (m AgentEngines) Create(ctx context.Context, config *types.CreateAgentEngineConfig) (*types.AgentEngineOperation, error)
- func (m AgentEngines) Delete(ctx context.Context, name string, force *bool, ...) (*types.DeleteAgentEngineOperation, error)
- func (m AgentEngines) Get(ctx context.Context, name string, config *types.GetAgentEngineConfig) (*types.ReasoningEngine, error)
- func (m AgentEngines) GetAgentOperation(ctx context.Context, operationName string, ...) (*types.AgentEngineOperation, error)
- func (m AgentEngines) List(ctx context.Context, config *types.ListAgentEngineConfig) (*types.ListReasoningEnginesResponse, error)
- func (m AgentEngines) Query(ctx context.Context, name string, config *types.QueryAgentEngineConfig) (*types.QueryReasoningEngineResponse, error)
- func (m AgentEngines) Update(ctx context.Context, name string, config *types.UpdateAgentEngineConfig) (*types.AgentEngineOperation, error)
- type Client
- type Memories
- func (m Memories) Create(ctx context.Context, name string, fact string, scope map[string]string, ...) (*types.MemoryOperation, error)
- func (m Memories) Delete(ctx context.Context, name string, config *types.DeleteMemoryConfig) (*types.DeleteMemoryOperation, error)
- func (m Memories) Generate(ctx context.Context, name string, ...) (*types.GenerateMemoriesOperation, error)
- func (m Memories) Get(ctx context.Context, name string, config *types.GetMemoryConfig) (*types.Memory, error)
- func (m Memories) GetGenerateMemoriesOperation(ctx context.Context, operationName string, ...) (*types.GenerateMemoriesOperation, error)
- func (m Memories) GetMemoryOperation(ctx context.Context, operationName string, ...) (*types.MemoryOperation, error)
- func (m Memories) List(ctx context.Context, name string, config *types.ListMemoriesConfig) (*types.ListMemoriesResponse, error)
- func (m Memories) Purge(ctx context.Context, name string, filter *string, ...) (*types.PurgeMemoriesOperation, error)
- func (m Memories) Retrieve(ctx context.Context, name string, scope map[string]string, ...) (*types.RetrieveMemoriesResponse, error)
- func (m Memories) RetrieveProfiles(ctx context.Context, name string, scope map[string]string, ...) (*types.RetrieveProfilesResponse, error)
- func (m Memories) Rollback(ctx context.Context, name string, targetRevisionId string, ...) (*types.RollbackMemoryOperation, error)
- func (m Memories) Update(ctx context.Context, name string, fact *string, scope *map[string]string, ...) (*types.MemoryOperation, error)
- type MemoryBanks
- type MemoryRevisions
- type SandboxSnapshots
- func (m SandboxSnapshots) Create(ctx context.Context, sourceSandboxEnvironmentName string, ...) (*types.AgentEngineSandboxSnapshotOperation, error)
- func (m SandboxSnapshots) Delete(ctx context.Context, name string, ...) (*types.DeleteSandboxEnvironmentSnapshotOperation, error)
- func (m SandboxSnapshots) Get(ctx context.Context, name string, ...) (*types.SandboxEnvironmentSnapshot, error)
- func (m SandboxSnapshots) GetSandboxSnapshotOperation(ctx context.Context, operationName string, ...) (*types.AgentEngineSandboxSnapshotOperation, error)
- func (m SandboxSnapshots) List(ctx context.Context, name string, ...) (*types.ListSandboxEnvironmentSnapshotsResponse, error)
- type SandboxTemplates
- func (m SandboxTemplates) Create(ctx context.Context, name string, displayName string, ...) (*types.SandboxEnvironmentTemplateOperation, error)
- func (m SandboxTemplates) Delete(ctx context.Context, name string, ...) (*types.DeleteSandboxEnvironmentTemplateOperation, error)
- func (m SandboxTemplates) Get(ctx context.Context, name string, ...) (*types.SandboxEnvironmentTemplate, error)
- func (m SandboxTemplates) GetSandboxEnvironmentTemplateOperation(ctx context.Context, operationName string, ...) (*types.SandboxEnvironmentTemplateOperation, error)
- func (m SandboxTemplates) List(ctx context.Context, name string, ...) (*types.ListSandboxEnvironmentTemplatesResponse, error)
- type Sandboxes
- func (m Sandboxes) Create(ctx context.Context, name string, spec *types.SandboxEnvironmentSpec, ...) (*types.AgentEngineSandboxOperation, error)
- func (m Sandboxes) Delete(ctx context.Context, name string, config *types.DeleteAgentEngineSandboxConfig) (*types.DeleteAgentEngineSandboxOperation, error)
- func (m Sandboxes) ExecuteCode(ctx context.Context, name string, inputs []*types.Chunk, ...) (*types.ExecuteSandboxEnvironmentResponse, error)
- func (m Sandboxes) Get(ctx context.Context, name string, config *types.GetAgentEngineSandboxConfig) (*types.SandboxEnvironment, error)
- func (m Sandboxes) GetSandboxOperation(ctx context.Context, operationName string, ...) (*types.AgentEngineSandboxOperation, error)
- func (m Sandboxes) List(ctx context.Context, name string, config *types.ListAgentEngineSandboxesConfig) (*types.ListAgentEngineSandboxesResponse, error)
- type SessionEvents
- type Sessions
- func (m Sessions) Create(ctx context.Context, name string, userId string, ...) (*types.AgentEngineSessionOperation, error)
- func (m Sessions) Delete(ctx context.Context, name string, config *types.DeleteAgentEngineSessionConfig) (*types.DeleteAgentEngineSessionOperation, error)
- func (m Sessions) Get(ctx context.Context, name string, config *types.GetAgentEngineSessionConfig) (*types.Session, error)
- func (m Sessions) GetSessionOperation(ctx context.Context, operationName string, ...) (*types.AgentEngineSessionOperation, error)
- func (m Sessions) List(ctx context.Context, name string, config *types.ListAgentEngineSessionsConfig) (*types.ListReasoningEnginesSessionsResponse, error)
- func (m Sessions) Update(ctx context.Context, name string, config *types.UpdateAgentEngineSessionConfig) (*types.Session, error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentEngines ¶
type AgentEngines struct {
// contains filtered or unexported fields
}
func (AgentEngines) Create ¶
func (m AgentEngines) Create(ctx context.Context, config *types.CreateAgentEngineConfig) (*types.AgentEngineOperation, error)
Create creates an agent engine based on the provided configuration and returns the operation object representing the creation process.
func (AgentEngines) Delete ¶
func (m AgentEngines) Delete(ctx context.Context, name string, force *bool, config *types.DeleteAgentEngineConfig) (*types.DeleteAgentEngineOperation, error)
Delete deletes the agent engine with the specified name and returns the operation object representing the deletion process.
func (AgentEngines) Get ¶
func (m AgentEngines) Get(ctx context.Context, name string, config *types.GetAgentEngineConfig) (*types.ReasoningEngine, error)
Get returns the agent engine with the specified name and returns the agent engine object representing the get agent engine process.
func (AgentEngines) GetAgentOperation ¶
func (m AgentEngines) GetAgentOperation(ctx context.Context, operationName string, config *types.GetAgentEngineOperationConfig) (*types.AgentEngineOperation, error)
GetAgentOperation returns the operation object representing the get agent operation process.
func (AgentEngines) List ¶
func (m AgentEngines) List(ctx context.Context, config *types.ListAgentEngineConfig) (*types.ListReasoningEnginesResponse, error)
List lists the agent engines that match the provided configuration and returns the list of agent engines and the operation object representing the listing process.
func (AgentEngines) Query ¶
func (m AgentEngines) Query(ctx context.Context, name string, config *types.QueryAgentEngineConfig) (*types.QueryReasoningEngineResponse, error)
Query queries the agent engine with the specified name and returns the response object representing the query agent engine process.
func (AgentEngines) Update ¶
func (m AgentEngines) Update(ctx context.Context, name string, config *types.UpdateAgentEngineConfig) (*types.AgentEngineOperation, error)
Update updates the agent engine with the specified name and returns the operation object representing the update process.
type Client ¶
type Client struct {
AgentEngines *clientAgentEngines
MemoryBanks *clientMemoryBanks
}
A Client is a Google Vertex AI client.
type Memories ¶
type Memories struct {
// contains filtered or unexported fields
}
func (Memories) Create ¶
func (m Memories) Create(ctx context.Context, name string, fact string, scope map[string]string, config *types.MemoryConfig) (*types.MemoryOperation, error)
Create creates a new memory for the given name, fact, scope, and config.
func (Memories) Delete ¶
func (m Memories) Delete(ctx context.Context, name string, config *types.DeleteMemoryConfig) (*types.DeleteMemoryOperation, error)
func (Memories) Generate ¶
func (m Memories) Generate(ctx context.Context, name string, vertexSessionSource *types.GenerateMemoriesRequestVertexSessionSource, directContentsSource *types.GenerateMemoriesRequestDirectContentsSource, directMemoriesSource *types.GenerateMemoriesRequestDirectMemoriesSource, scope *map[string]string, config *types.GenerateMemoriesConfig) (*types.GenerateMemoriesOperation, error)
Generate generates the memories for the given name, vertex session source, direct contents source, direct memories source, scope, and config, and returns the operation.
func (Memories) GetGenerateMemoriesOperation ¶
func (m Memories) GetGenerateMemoriesOperation(ctx context.Context, operationName string, config *types.GetMemoryBankOperationConfig) (*types.GenerateMemoriesOperation, error)
GetGenerateMemoriesOperation returns the generate memories operation for the given operation name, vertex session source, direct contents source, direct memories source, scope, and config.
func (Memories) GetMemoryOperation ¶
func (m Memories) GetMemoryOperation(ctx context.Context, operationName string, config *types.GetMemoryBankOperationConfig) (*types.MemoryOperation, error)
GetMemoryOperation returns the memory operation for the given operation name and config.
func (Memories) List ¶
func (m Memories) List(ctx context.Context, name string, config *types.ListMemoriesConfig) (*types.ListMemoriesResponse, error)
List lists the memories for the given name and config, and returns the response.
func (Memories) Purge ¶
func (m Memories) Purge(ctx context.Context, name string, filter *string, filterGroups []*types.MemoryConjunctionFilter, force *bool, config *types.PurgeMemoriesConfig) (*types.PurgeMemoriesOperation, error)
Purge purges the memory for the given name, filter, filter groups, force, and config, and returns the purge memory operation.
func (Memories) Retrieve ¶
func (m Memories) Retrieve(ctx context.Context, name string, scope map[string]string, similaritySearchParams *types.RetrieveMemoriesRequestSimilaritySearchParams, simpleRetrievalParams *types.RetrieveMemoriesRequestSimpleRetrievalParams, config *types.RetrieveMemoriesConfig) (*types.RetrieveMemoriesResponse, error)
Retrieve retrieves the memories for the given name, scope, similarity search params, simple retrieval params, and config, and returns the response.
func (Memories) RetrieveProfiles ¶
type MemoryBanks ¶ added in v0.22.0
type MemoryBanks struct {
// contains filtered or unexported fields
}
type MemoryRevisions ¶
type MemoryRevisions struct {
// contains filtered or unexported fields
}
func (MemoryRevisions) Get ¶
func (m MemoryRevisions) Get(ctx context.Context, name string, config *types.GetMemoryRevisionConfig) (*types.MemoryRevision, error)
func (MemoryRevisions) List ¶
func (m MemoryRevisions) List(ctx context.Context, name string, config *types.ListMemoryRevisionsConfig) (*types.ListMemoryRevisionsResponse, error)
List lists the memory revisions for the given name and config, and returns the response.
type SandboxSnapshots ¶ added in v0.22.0
type SandboxSnapshots struct {
// contains filtered or unexported fields
}
func (SandboxSnapshots) Create ¶ added in v0.22.0
func (m SandboxSnapshots) Create(ctx context.Context, sourceSandboxEnvironmentName string, config *types.CreateAgentEngineSandboxSnapshotConfig) (*types.AgentEngineSandboxSnapshotOperation, error)
Create creates a snapshot of the given source sandbox environment and returns the operation.
func (SandboxSnapshots) Delete ¶ added in v0.22.0
func (m SandboxSnapshots) Delete(ctx context.Context, name string, config *types.DeleteSandboxEnvironmentSnapshotConfig) (*types.DeleteSandboxEnvironmentSnapshotOperation, error)
Delete deletes the sandbox environment snapshot with the specified name and returns the operation representing the deletion process.
func (SandboxSnapshots) Get ¶ added in v0.22.0
func (m SandboxSnapshots) Get(ctx context.Context, name string, config *types.GetSandboxEnvironmentSnapshotConfig) (*types.SandboxEnvironmentSnapshot, error)
Get returns the sandbox environment snapshot with the specified name.
func (SandboxSnapshots) GetSandboxSnapshotOperation ¶ added in v0.22.0
func (m SandboxSnapshots) GetSandboxSnapshotOperation(ctx context.Context, operationName string, config *types.GetAgentEngineOperationConfig) (*types.AgentEngineSandboxSnapshotOperation, error)
func (SandboxSnapshots) List ¶ added in v0.22.0
func (m SandboxSnapshots) List(ctx context.Context, name string, config *types.ListSandboxEnvironmentSnapshotsConfig) (*types.ListSandboxEnvironmentSnapshotsResponse, error)
List lists the sandbox environment snapshots for the given name and config, and returns the response.
type SandboxTemplates ¶ added in v0.22.0
type SandboxTemplates struct {
// contains filtered or unexported fields
}
func (SandboxTemplates) Create ¶ added in v0.22.0
func (m SandboxTemplates) Create(ctx context.Context, name string, displayName string, config *types.CreateSandboxEnvironmentTemplateConfig) (*types.SandboxEnvironmentTemplateOperation, error)
Create creates a sandbox environment template for the given name, display name, and config, and returns the operation.
func (SandboxTemplates) Delete ¶ added in v0.22.0
func (m SandboxTemplates) Delete(ctx context.Context, name string, config *types.DeleteSandboxEnvironmentTemplateConfig) (*types.DeleteSandboxEnvironmentTemplateOperation, error)
Delete deletes the sandbox environment template with the specified name and returns the operation representing the deletion process.
func (SandboxTemplates) Get ¶ added in v0.22.0
func (m SandboxTemplates) Get(ctx context.Context, name string, config *types.GetSandboxEnvironmentTemplateConfig) (*types.SandboxEnvironmentTemplate, error)
Get returns the sandbox environment template with the specified name.
func (SandboxTemplates) GetSandboxEnvironmentTemplateOperation ¶ added in v0.22.0
func (m SandboxTemplates) GetSandboxEnvironmentTemplateOperation(ctx context.Context, operationName string, config *types.GetAgentEngineOperationConfig) (*types.SandboxEnvironmentTemplateOperation, error)
func (SandboxTemplates) List ¶ added in v0.22.0
func (m SandboxTemplates) List(ctx context.Context, name string, config *types.ListSandboxEnvironmentTemplatesConfig) (*types.ListSandboxEnvironmentTemplatesResponse, error)
List lists the sandbox environment templates for the given name and config, and returns the response.
type Sandboxes ¶
type Sandboxes struct {
// contains filtered or unexported fields
}
func (Sandboxes) Create ¶
func (m Sandboxes) Create(ctx context.Context, name string, spec *types.SandboxEnvironmentSpec, config *types.CreateAgentEngineSandboxConfig) (*types.AgentEngineSandboxOperation, error)
Create creates a sandbox for the given name, spec, and config, and returns the sandbox operation.
func (Sandboxes) Delete ¶
func (m Sandboxes) Delete(ctx context.Context, name string, config *types.DeleteAgentEngineSandboxConfig) (*types.DeleteAgentEngineSandboxOperation, error)
Delete deletes the sandbox with the specified name and returns the sandbox operation representing the deletion process.
func (Sandboxes) ExecuteCode ¶
func (m Sandboxes) ExecuteCode(ctx context.Context, name string, inputs []*types.Chunk, config *types.ExecuteCodeAgentEngineSandboxConfig) (*types.ExecuteSandboxEnvironmentResponse, error)
ExecuteCode executes the code for the given name, inputs, and config, and returns the response.
func (Sandboxes) Get ¶
func (m Sandboxes) Get(ctx context.Context, name string, config *types.GetAgentEngineSandboxConfig) (*types.SandboxEnvironment, error)
Get returns the sandbox with the specified name and returns the sandbox object representing the get sandbox process.
func (Sandboxes) GetSandboxOperation ¶
func (m Sandboxes) GetSandboxOperation(ctx context.Context, operationName string, config *types.GetAgentEngineOperationConfig) (*types.AgentEngineSandboxOperation, error)
GetSandboxOperation returns the sandbox operation for the given operation name and config, and returns the sandbox operation.
type SessionEvents ¶
type SessionEvents struct {
// contains filtered or unexported fields
}
func (SessionEvents) Append ¶
func (m SessionEvents) Append(ctx context.Context, name string, author string, invocationId string, timestamp time.Time, config *types.AppendAgentEngineSessionEventConfig) (*types.AppendAgentEngineSessionEventResponse, error)
func (SessionEvents) List ¶
func (m SessionEvents) List(ctx context.Context, name string, config *types.ListAgentEngineSessionEventsConfig) (*types.ListAgentEngineSessionEventsResponse, error)
List lists the session events for the given name and config, and returns the response.
type Sessions ¶
type Sessions struct {
// contains filtered or unexported fields
}
func (Sessions) Create ¶
func (m Sessions) Create(ctx context.Context, name string, userId string, config *types.CreateAgentEngineSessionConfig) (*types.AgentEngineSessionOperation, error)
Create creates a session for the given name, user ID, and config, and returns the session operation.
func (Sessions) Delete ¶
func (m Sessions) Delete(ctx context.Context, name string, config *types.DeleteAgentEngineSessionConfig) (*types.DeleteAgentEngineSessionOperation, error)
func (Sessions) GetSessionOperation ¶
func (m Sessions) GetSessionOperation(ctx context.Context, operationName string, config *types.GetAgentEngineOperationConfig) (*types.AgentEngineSessionOperation, error)
GetSessionOperation returns the session operation for the given operation name and config, and returns the session operation representing the get session process.