Class BetaManagedAgentsActor
-
- All Implemented Interfaces:
public final class BetaManagedAgentsActorIdentifies who performed a write or redact operation. Captured at write time on the
memory_versionrow. The API key that created a session is not recorded on agent writes; attribution answers who made the write, not who is ultimately responsible. Look up session provenance separately via the /en/api/sessions-retrieve.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaManagedAgentsActor.VisitorAn interface that defines how to map each variant of BetaManagedAgentsActor to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<BetaManagedAgentsSessionActor>session()Attribution for a write made by an agent during a session, through the mounted filesystem at /mnt/memory/.final Optional<BetaManagedAgentsApiActor>api()Attribution for a write made directly via the public API (outside of any session). final Optional<BetaManagedAgentsUserActor>user()Attribution for a write made by a human user through the Anthropic Console. final BooleanisSession()final BooleanisApi()final BooleanisUser()final BetaManagedAgentsSessionActorasSession()Attribution for a write made by an agent during a session, through the mounted filesystem at /mnt/memory/.final BetaManagedAgentsApiActorasApi()Attribution for a write made directly via the public API (outside of any session). final BetaManagedAgentsUserActorasUser()Attribution for a write made by a human user through the Anthropic Console. final Optional<JsonValue>_json()final <T extends Any> Taccept(BetaManagedAgentsActor.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaManagedAgentsActorvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaManagedAgentsActorofSession(BetaManagedAgentsSessionActor session)Attribution for a write made by an agent during a session, through the mounted filesystem at /mnt/memory/.final static BetaManagedAgentsActorofApi(BetaManagedAgentsApiActor api)Attribution for a write made directly via the public API (outside of any session). final static BetaManagedAgentsActorofUser(BetaManagedAgentsUserActor user)Attribution for a write made by a human user through the Anthropic Console. -
-
Method Detail
-
session
final Optional<BetaManagedAgentsSessionActor> session()
Attribution for a write made by an agent during a session, through the mounted filesystem at
/mnt/memory/.
-
api
final Optional<BetaManagedAgentsApiActor> api()
Attribution for a write made directly via the public API (outside of any session).
-
user
final Optional<BetaManagedAgentsUserActor> user()
Attribution for a write made by a human user through the Anthropic Console.
-
asSession
final BetaManagedAgentsSessionActor asSession()
Attribution for a write made by an agent during a session, through the mounted filesystem at
/mnt/memory/.
-
asApi
final BetaManagedAgentsApiActor asApi()
Attribution for a write made directly via the public API (outside of any session).
-
asUser
final BetaManagedAgentsUserActor asUser()
Attribution for a write made by a human user through the Anthropic Console.
-
accept
final <T extends Any> T accept(BetaManagedAgentsActor.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.anthropic.core.JsonValue; import java.util.Optional; Optional<String> result = betaManagedAgentsActor.accept(new BetaManagedAgentsActor.Visitor<Optional<String>>() { @Override public Optional<String> visitSession(BetaManagedAgentsSessionActor session) { return Optional.of(session.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaManagedAgentsActor validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofSession
final static BetaManagedAgentsActor ofSession(BetaManagedAgentsSessionActor session)
Attribution for a write made by an agent during a session, through the mounted filesystem at
/mnt/memory/.
-
ofApi
final static BetaManagedAgentsActor ofApi(BetaManagedAgentsApiActor api)
Attribution for a write made directly via the public API (outside of any session).
-
ofUser
final static BetaManagedAgentsActor ofUser(BetaManagedAgentsUserActor user)
Attribution for a write made by a human user through the Anthropic Console.
-
-
-
-