Skip to content

Examples in documentation use types that don't exist. #320

@nicocesar

Description

@nicocesar

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions