Attach a memory layer to a variation
client.Agents.Variations.AddMemoryLayer(ctx, workspaceID, agentID, variationID, body) (*VariationMemoryLayerAssignment, error)
POST/v1/workspaces/{workspaceId}/agents/{agentId}/variations/{variationId}/memory_layer_assignments
Attaches a memory layer to a variation at a given position in the variation’s baseline memory stack.
Attach a memory layer to a variation
package main
import (
"context"
"fmt"
"github.com/cadenya/cadenya-go"
"github.com/cadenya/cadenya-go/option"
)
func main() {
client := cadenya.NewClient(
option.WithAPIKey("My API Key"),
)
variationMemoryLayerAssignment, err := client.Agents.Variations.AddMemoryLayer(
context.TODO(),
"workspaceId",
"agentId",
"variationId",
cadenya.AgentVariationAddMemoryLayerParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", variationMemoryLayerAssignment.ID)
}
{
"id": "id",
"memoryLayer": {
"id": "id",
"name": "name"
},
"position": 0
}Returns Examples
{
"id": "id",
"memoryLayer": {
"id": "id",
"name": "name"
},
"position": 0
}