// Create a session
session, err := client.Beta.Sessions.New(ctx, anthropic.BetaSessionNewParams{
Agent: anthropic.BetaSessionNewParamsAgentUnion{
OfString: anthropic.String(agent.ID),
},
EnvironmentID: environment.ID,
Title: anthropic.String("Financial analysis on Costco"),
})
if err != nil {
panic(err)
}
// Define the outcome — agent starts working on receipt
_, err = client.Beta.Sessions.Events.Send(ctx, session.ID, anthropic.BetaSessionEventSendParams{
Events: []anthropic.SendEventsParamsUnion{{
OfUserDefineOutcome: &anthropic.BetaManagedAgentsUserDefineOutcomeEventParams{
Description: "Build a DCF model for Costco in .xlsx",
Rubric: anthropic.BetaManagedAgentsUserDefineOutcomeEventParamsRubricUnion{
OfText: &anthropic.BetaManagedAgentsTextRubricParams{Content: rubric},
},
// or: OfFile: &anthropic.BetaManagedAgentsFileRubricParams{FileID: rubric.id},
MaxIterations: anthropic.Int(5), // optional; default 3, max 20
},
}},
})
if err != nil {
panic(err)
}
Uses SendEventsParamsUnion, anthropic.BetaManagedAgentsUserDefineOutcomeEventParams anthropic.BetaManagedAgentsUserDefineOutcomeEventParamsRubricUnion , anthropic.BetaManagedAgentsTextRubricParams{Content: rubric} that don't exist. Is this a soon to be released library or is there another anthropic-sdk-go with preview features? (it would be nice to have the full import code in the example too)
Using github.com/anthropics/anthropic-sdk-go v1.35.1 in go.mod but theexample I see in https://platform.claude.com/docs/en/managed-agents/define-outcomes#create-a-session-with-an-outcome for the Go Language:
Uses SendEventsParamsUnion, anthropic.BetaManagedAgentsUserDefineOutcomeEventParams anthropic.BetaManagedAgentsUserDefineOutcomeEventParamsRubricUnion , anthropic.BetaManagedAgentsTextRubricParams{Content: rubric} that don't exist. Is this a soon to be released library or is there another anthropic-sdk-go with preview features? (it would be nice to have the full import code in the example too)