Class BetaManagedAgentsSessionThread.Agent
-
- All Implemented Interfaces:
public final class BetaManagedAgentsSessionThread.AgentResolved agent definition for this thread. Snapshot of the agent at thread creation time.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaManagedAgentsSessionThread.Agent.VisitorAn interface that defines how to map each variant of Agent to a value of type T.
public final classBetaManagedAgentsSessionThread.Agent.Type
-
Method Summary
Modifier and Type Method Description final Optional<BetaManagedAgentsSessionThreadAgent>agent()Resolved agentdefinition for a singlesession_thread.final Optional<BetaManagedAgentsAdvisor>advisor()Platform advisor roster entry: a model the session's primary thread may consult mid-turn. final Optional<BetaManagedAgentsInlineAgent>inline()An agent that has no Agent resource, and so no idorversion.final Optional<JsonValue>_json()final BetaManagedAgentsSessionThread.Agent.Typetype()final Optional<String>description()final Optional<BetaManagedAgentsExecutionIdentity>executionIdentity()final Optional<List<BetaManagedAgentsMcpServerUrlDefinition>>mcpServers()final Optional<String>name()final Optional<String>system()final BooleanisAgent()final BooleanisAdvisor()final BooleanisInline()final BetaManagedAgentsSessionThreadAgentasAgent()Resolved agentdefinition for a singlesession_thread.final BetaManagedAgentsAdvisorasAdvisor()Platform advisor roster entry: a model the session's primary thread may consult mid-turn. final BetaManagedAgentsInlineAgentasInline()An agent that has no Agent resource, and so no idorversion.final <T extends Any> Taccept(BetaManagedAgentsSessionThread.Agent.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaManagedAgentsSessionThread.Agentvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaManagedAgentsSessionThread.AgentofAgent(BetaManagedAgentsSessionThreadAgent agent)Resolved agentdefinition for a singlesession_thread.final static BetaManagedAgentsSessionThread.AgentofAdvisor(BetaManagedAgentsAdvisor advisor)Platform advisor roster entry: a model the session's primary thread may consult mid-turn. final static BetaManagedAgentsSessionThread.AgentofAdvisor(String model)Returns an immutable instance of Agent whose ofAdvisor variant is built from the given required model. final static BetaManagedAgentsSessionThread.AgentofInline(BetaManagedAgentsInlineAgent inline)An agent that has no Agent resource, and so no idorversion.-
-
Method Detail
-
agent
final Optional<BetaManagedAgentsSessionThreadAgent> agent()
Resolved
agentdefinition for a singlesession_thread. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it fromSession.agent.
-
advisor
final Optional<BetaManagedAgentsAdvisor> advisor()
Platform advisor roster entry: a model the session's primary thread may consult mid-turn.
-
inline
final Optional<BetaManagedAgentsInlineAgent> inline()
An agent that has no Agent resource, and so no
idorversion. It is defined inline, in a workflow run's plan or when a session thread is spawned, and is not saved.
-
type
final BetaManagedAgentsSessionThread.Agent.Type type()
-
description
final Optional<String> description()
-
executionIdentity
final Optional<BetaManagedAgentsExecutionIdentity> executionIdentity()
-
mcpServers
final Optional<List<BetaManagedAgentsMcpServerUrlDefinition>> mcpServers()
-
asAgent
final BetaManagedAgentsSessionThreadAgent asAgent()
Resolved
agentdefinition for a singlesession_thread. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it fromSession.agent.
-
asAdvisor
final BetaManagedAgentsAdvisor asAdvisor()
Platform advisor roster entry: a model the session's primary thread may consult mid-turn.
-
asInline
final BetaManagedAgentsInlineAgent asInline()
An agent that has no Agent resource, and so no
idorversion. It is defined inline, in a workflow run's plan or when a session thread is spawned, and is not saved.
-
accept
final <T extends Any> T accept(BetaManagedAgentsSessionThread.Agent.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 = agent.accept(new Agent.Visitor<Optional<String>>() { @Override public Optional<String> visitAgent(BetaManagedAgentsSessionThreadAgent agent) { return Optional.of(agent.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaManagedAgentsSessionThread.Agent 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.
-
ofAgent
final static BetaManagedAgentsSessionThread.Agent ofAgent(BetaManagedAgentsSessionThreadAgent agent)
Resolved
agentdefinition for a singlesession_thread. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it fromSession.agent.
-
ofAdvisor
final static BetaManagedAgentsSessionThread.Agent ofAdvisor(BetaManagedAgentsAdvisor advisor)
Platform advisor roster entry: a model the session's primary thread may consult mid-turn.
-
ofAdvisor
final static BetaManagedAgentsSessionThread.Agent ofAdvisor(String model)
Returns an immutable instance of Agent whose ofAdvisor variant is built from the given required model.
-
ofInline
final static BetaManagedAgentsSessionThread.Agent ofInline(BetaManagedAgentsInlineAgent inline)
An agent that has no Agent resource, and so no
idorversion. It is defined inline, in a workflow run's plan or when a session thread is spawned, and is not saved.
-
-
-
-