Class BetaManagedAgentsDeploymentInitialEventParams
-
- All Implemented Interfaces:
public final class BetaManagedAgentsDeploymentInitialEventParamsAn 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 interfaceBetaManagedAgentsDeploymentInitialEventParams.VisitorAn interface that defines how to map each variant of BetaManagedAgentsDeploymentInitialEventParams to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<BetaManagedAgentsUserMessageEventParams>userMessage()Parameters for sending a user message to the session. final Optional<BetaManagedAgentsUserDefineOutcomeEventParams>userDefineOutcome()Parameters for defining an outcome the agent should work toward. final Optional<BetaManagedAgentsSystemMessageEventParams>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 BetaManagedAgentsUserMessageEventParamsasUserMessage()Parameters for sending a user message to the session. final BetaManagedAgentsUserDefineOutcomeEventParamsasUserDefineOutcome()Parameters for defining an outcome the agent should work toward. final BetaManagedAgentsSystemMessageEventParamsasSystemMessage()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(BetaManagedAgentsDeploymentInitialEventParams.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaManagedAgentsDeploymentInitialEventParamsvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaManagedAgentsDeploymentInitialEventParamsofUserMessage(BetaManagedAgentsUserMessageEventParams userMessage)Parameters for sending a user message to the session. final static BetaManagedAgentsDeploymentInitialEventParamsofUserDefineOutcome(BetaManagedAgentsUserDefineOutcomeEventParams userDefineOutcome)Parameters for defining an outcome the agent should work toward. final static BetaManagedAgentsDeploymentInitialEventParamsofSystemMessage(BetaManagedAgentsSystemMessageEventParams 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<BetaManagedAgentsUserMessageEventParams> userMessage()
Parameters for sending a user message to the session.
-
userDefineOutcome
final Optional<BetaManagedAgentsUserDefineOutcomeEventParams> userDefineOutcome()
Parameters for defining an outcome the agent should work toward. The agent begins work on receipt.
-
systemMessage
final Optional<BetaManagedAgentsSystemMessageEventParams> 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. At most one per request: it must be the final event and immediately follow theuser.message,user.tool_result, oruser.custom_tool_resultit accompanies. Only supported on models that accept mid-conversation system messages.
-
isUserMessage
final Boolean isUserMessage()
-
isUserDefineOutcome
final Boolean isUserDefineOutcome()
-
isSystemMessage
final Boolean isSystemMessage()
-
asUserMessage
final BetaManagedAgentsUserMessageEventParams asUserMessage()
Parameters for sending a user message to the session.
-
asUserDefineOutcome
final BetaManagedAgentsUserDefineOutcomeEventParams asUserDefineOutcome()
Parameters for defining an outcome the agent should work toward. The agent begins work on receipt.
-
asSystemMessage
final BetaManagedAgentsSystemMessageEventParams 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. At most one per request: it must be the final event and immediately follow theuser.message,user.tool_result, oruser.custom_tool_resultit accompanies. Only supported on models that accept mid-conversation system messages.
-
accept
final <T extends Any> T accept(BetaManagedAgentsDeploymentInitialEventParams.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 = betaManagedAgentsDeploymentInitialEventParams.accept(new BetaManagedAgentsDeploymentInitialEventParams.Visitor<Optional<String>>() { @Override public Optional<String> visitUserMessage(BetaManagedAgentsUserMessageEventParams userMessage) { return Optional.of(userMessage.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaManagedAgentsDeploymentInitialEventParams 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 BetaManagedAgentsDeploymentInitialEventParams ofUserMessage(BetaManagedAgentsUserMessageEventParams userMessage)
Parameters for sending a user message to the session.
-
ofUserDefineOutcome
final static BetaManagedAgentsDeploymentInitialEventParams ofUserDefineOutcome(BetaManagedAgentsUserDefineOutcomeEventParams userDefineOutcome)
Parameters for defining an outcome the agent should work toward. The agent begins work on receipt.
-
ofSystemMessage
final static BetaManagedAgentsDeploymentInitialEventParams ofSystemMessage(BetaManagedAgentsSystemMessageEventParams 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. At most one per request: it must be the final event and immediately follow theuser.message,user.tool_result, oruser.custom_tool_resultit accompanies. Only supported on models that accept mid-conversation system messages.
-
-
-
-