Class BetaManagedAgentsEventParams
-
- All Implemented Interfaces:
public final class BetaManagedAgentsEventParamsUnion type for event parameters that can be sent to a session.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaManagedAgentsEventParams.VisitorAn interface that defines how to map each variant of BetaManagedAgentsEventParams 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<BetaManagedAgentsUserInterruptEventParams>userInterrupt()Parameters for sending an interrupt to pause the agent. final Optional<BetaManagedAgentsUserToolConfirmationEventParams>userToolConfirmation()Parameters for confirming or denying a tool execution request. final Optional<BetaManagedAgentsUserCustomToolResultEventParams>userCustomToolResult()Parameters for providing the result of a custom tool execution. final Optional<BetaManagedAgentsUserDefineOutcomeEventParams>userDefineOutcome()Parameters for defining an outcome the agent should work toward. final Optional<BetaManagedAgentsUserToolResultEventParams>userToolResult()Parameters for providing the result of an agent-toolset tool execution. 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 BooleanisUserInterrupt()final BooleanisUserToolConfirmation()final BooleanisUserCustomToolResult()final BooleanisUserDefineOutcome()final BooleanisUserToolResult()final BooleanisSystemMessage()final BetaManagedAgentsUserMessageEventParamsasUserMessage()Parameters for sending a user message to the session. final BetaManagedAgentsUserInterruptEventParamsasUserInterrupt()Parameters for sending an interrupt to pause the agent. final BetaManagedAgentsUserToolConfirmationEventParamsasUserToolConfirmation()Parameters for confirming or denying a tool execution request. final BetaManagedAgentsUserCustomToolResultEventParamsasUserCustomToolResult()Parameters for providing the result of a custom tool execution. final BetaManagedAgentsUserDefineOutcomeEventParamsasUserDefineOutcome()Parameters for defining an outcome the agent should work toward. final BetaManagedAgentsUserToolResultEventParamsasUserToolResult()Parameters for providing the result of an agent-toolset tool execution. 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(BetaManagedAgentsEventParams.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaManagedAgentsEventParamsvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaManagedAgentsEventParamsofUserMessage(BetaManagedAgentsUserMessageEventParams userMessage)Parameters for sending a user message to the session. final static BetaManagedAgentsEventParamsofUserInterrupt(BetaManagedAgentsUserInterruptEventParams userInterrupt)Parameters for sending an interrupt to pause the agent. final static BetaManagedAgentsEventParamsofUserToolConfirmation(BetaManagedAgentsUserToolConfirmationEventParams userToolConfirmation)Parameters for confirming or denying a tool execution request. final static BetaManagedAgentsEventParamsofUserCustomToolResult(BetaManagedAgentsUserCustomToolResultEventParams userCustomToolResult)Parameters for providing the result of a custom tool execution. final static BetaManagedAgentsEventParamsofUserDefineOutcome(BetaManagedAgentsUserDefineOutcomeEventParams userDefineOutcome)Parameters for defining an outcome the agent should work toward. final static BetaManagedAgentsEventParamsofUserToolResult(BetaManagedAgentsUserToolResultEventParams userToolResult)Parameters for providing the result of an agent-toolset tool execution. final static BetaManagedAgentsEventParamsofSystemMessage(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.
-
userInterrupt
final Optional<BetaManagedAgentsUserInterruptEventParams> userInterrupt()
Parameters for sending an interrupt to pause the agent.
-
userToolConfirmation
final Optional<BetaManagedAgentsUserToolConfirmationEventParams> userToolConfirmation()
Parameters for confirming or denying a tool execution request.
-
userCustomToolResult
final Optional<BetaManagedAgentsUserCustomToolResultEventParams> userCustomToolResult()
Parameters for providing the result of a custom tool execution.
-
userDefineOutcome
final Optional<BetaManagedAgentsUserDefineOutcomeEventParams> userDefineOutcome()
Parameters for defining an outcome the agent should work toward. The agent begins work on receipt.
-
userToolResult
final Optional<BetaManagedAgentsUserToolResultEventParams> userToolResult()
Parameters for providing the result of an agent-toolset tool execution. Only valid on
self_hostedenvironments, where sandbox-routed tools are executed by the client rather than the server.
-
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()
-
isUserInterrupt
final Boolean isUserInterrupt()
-
isUserToolConfirmation
final Boolean isUserToolConfirmation()
-
isUserCustomToolResult
final Boolean isUserCustomToolResult()
-
isUserDefineOutcome
final Boolean isUserDefineOutcome()
-
isUserToolResult
final Boolean isUserToolResult()
-
isSystemMessage
final Boolean isSystemMessage()
-
asUserMessage
final BetaManagedAgentsUserMessageEventParams asUserMessage()
Parameters for sending a user message to the session.
-
asUserInterrupt
final BetaManagedAgentsUserInterruptEventParams asUserInterrupt()
Parameters for sending an interrupt to pause the agent.
-
asUserToolConfirmation
final BetaManagedAgentsUserToolConfirmationEventParams asUserToolConfirmation()
Parameters for confirming or denying a tool execution request.
-
asUserCustomToolResult
final BetaManagedAgentsUserCustomToolResultEventParams asUserCustomToolResult()
Parameters for providing the result of a custom tool execution.
-
asUserDefineOutcome
final BetaManagedAgentsUserDefineOutcomeEventParams asUserDefineOutcome()
Parameters for defining an outcome the agent should work toward. The agent begins work on receipt.
-
asUserToolResult
final BetaManagedAgentsUserToolResultEventParams asUserToolResult()
Parameters for providing the result of an agent-toolset tool execution. Only valid on
self_hostedenvironments, where sandbox-routed tools are executed by the client rather than the server.
-
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(BetaManagedAgentsEventParams.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 = betaManagedAgentsEventParams.accept(new BetaManagedAgentsEventParams.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 BetaManagedAgentsEventParams 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 BetaManagedAgentsEventParams ofUserMessage(BetaManagedAgentsUserMessageEventParams userMessage)
Parameters for sending a user message to the session.
-
ofUserInterrupt
final static BetaManagedAgentsEventParams ofUserInterrupt(BetaManagedAgentsUserInterruptEventParams userInterrupt)
Parameters for sending an interrupt to pause the agent.
-
ofUserToolConfirmation
final static BetaManagedAgentsEventParams ofUserToolConfirmation(BetaManagedAgentsUserToolConfirmationEventParams userToolConfirmation)
Parameters for confirming or denying a tool execution request.
-
ofUserCustomToolResult
final static BetaManagedAgentsEventParams ofUserCustomToolResult(BetaManagedAgentsUserCustomToolResultEventParams userCustomToolResult)
Parameters for providing the result of a custom tool execution.
-
ofUserDefineOutcome
final static BetaManagedAgentsEventParams ofUserDefineOutcome(BetaManagedAgentsUserDefineOutcomeEventParams userDefineOutcome)
Parameters for defining an outcome the agent should work toward. The agent begins work on receipt.
-
ofUserToolResult
final static BetaManagedAgentsEventParams ofUserToolResult(BetaManagedAgentsUserToolResultEventParams userToolResult)
Parameters for providing the result of an agent-toolset tool execution. Only valid on
self_hostedenvironments, where sandbox-routed tools are executed by the client rather than the server.
-
ofSystemMessage
final static BetaManagedAgentsEventParams 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.
-
-
-
-