Class BetaManagedAgentsDeploymentInitialEvent
-
- All Implemented Interfaces:
public final class BetaManagedAgentsDeploymentInitialEventAn event sent to a session immediately after it is created. Supports
user.message,user.define_outcome, andsystem.message.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaManagedAgentsDeploymentInitialEvent.VisitorAn interface that defines how to map each variant of BetaManagedAgentsDeploymentInitialEvent to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<BetaManagedAgentsDeploymentUserMessageEvent>userMessage()A user message sent to the session. final Optional<BetaManagedAgentsDeploymentUserDefineOutcomeEvent>userDefineOutcome()An outcome the agent should work toward. final Optional<BetaManagedAgentsDeploymentSystemMessageEvent>systemMessage()Privileged context for the accompanying turn and all subsequent turns, appended to the session's system context as a role: "system"turn rather than replacing the top-level system prompt.final BooleanisUserMessage()final BooleanisUserDefineOutcome()final BooleanisSystemMessage()final BetaManagedAgentsDeploymentUserMessageEventasUserMessage()A user message sent to the session. final BetaManagedAgentsDeploymentUserDefineOutcomeEventasUserDefineOutcome()An outcome the agent should work toward. final BetaManagedAgentsDeploymentSystemMessageEventasSystemMessage()Privileged context for the accompanying turn and all subsequent turns, appended to the session's system context as a role: "system"turn rather than replacing the top-level system prompt.final Optional<JsonValue>_json()final <T extends Any> Taccept(BetaManagedAgentsDeploymentInitialEvent.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaManagedAgentsDeploymentInitialEventvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaManagedAgentsDeploymentInitialEventofUserMessage(BetaManagedAgentsDeploymentUserMessageEvent userMessage)A user message sent to the session. final static BetaManagedAgentsDeploymentInitialEventofUserDefineOutcome(BetaManagedAgentsDeploymentUserDefineOutcomeEvent userDefineOutcome)An outcome the agent should work toward. final static BetaManagedAgentsDeploymentInitialEventofSystemMessage(BetaManagedAgentsDeploymentSystemMessageEvent systemMessage)Privileged context for the accompanying turn and all subsequent turns, appended to the session's system context as a role: "system"turn rather than replacing the top-level system prompt.-
-
Method Detail
-
userMessage
final Optional<BetaManagedAgentsDeploymentUserMessageEvent> userMessage()
A user message sent to the session.
-
userDefineOutcome
final Optional<BetaManagedAgentsDeploymentUserDefineOutcomeEvent> userDefineOutcome()
An outcome the agent should work toward. The agent begins work on receipt.
-
systemMessage
final Optional<BetaManagedAgentsDeploymentSystemMessageEvent> systemMessage()
Privileged context for the accompanying turn and all subsequent turns, appended to the session's system context as a
role: "system"turn rather than replacing the top-level system prompt.
-
isUserMessage
final Boolean isUserMessage()
-
isUserDefineOutcome
final Boolean isUserDefineOutcome()
-
isSystemMessage
final Boolean isSystemMessage()
-
asUserMessage
final BetaManagedAgentsDeploymentUserMessageEvent asUserMessage()
A user message sent to the session.
-
asUserDefineOutcome
final BetaManagedAgentsDeploymentUserDefineOutcomeEvent asUserDefineOutcome()
An outcome the agent should work toward. The agent begins work on receipt.
-
asSystemMessage
final BetaManagedAgentsDeploymentSystemMessageEvent asSystemMessage()
Privileged context for the accompanying turn and all subsequent turns, appended to the session's system context as a
role: "system"turn rather than replacing the top-level system prompt.
-
accept
final <T extends Any> T accept(BetaManagedAgentsDeploymentInitialEvent.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 = betaManagedAgentsDeploymentInitialEvent.accept(new BetaManagedAgentsDeploymentInitialEvent.Visitor<Optional<String>>() { @Override public Optional<String> visitUserMessage(BetaManagedAgentsDeploymentUserMessageEvent userMessage) { return Optional.of(userMessage.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaManagedAgentsDeploymentInitialEvent 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.
-
ofUserMessage
final static BetaManagedAgentsDeploymentInitialEvent ofUserMessage(BetaManagedAgentsDeploymentUserMessageEvent userMessage)
A user message sent to the session.
-
ofUserDefineOutcome
final static BetaManagedAgentsDeploymentInitialEvent ofUserDefineOutcome(BetaManagedAgentsDeploymentUserDefineOutcomeEvent userDefineOutcome)
An outcome the agent should work toward. The agent begins work on receipt.
-
ofSystemMessage
final static BetaManagedAgentsDeploymentInitialEvent ofSystemMessage(BetaManagedAgentsDeploymentSystemMessageEvent systemMessage)
Privileged context for the accompanying turn and all subsequent turns, appended to the session's system context as a
role: "system"turn rather than replacing the top-level system prompt.
-
-
-
-