Class SessionAgent
java.lang.Object
com.alibaba.dashscope.applications.agentstudio.param.SessionAgent
Session-level agent reference: an Agent ID string or an override object carrying
system/tools/mcp_servers/skills.
-
Method Summary
Modifier and TypeMethodDescriptionasString()booleaninthashCode()booleanisString()static SessionAgentofOverride(Map<String, Object> override) The Agent override object form (type=agent_with_overrideswith Session-levelsystem/tools/mcp_servers/skillsoverrides).static SessionAgentThe Agent ID string form — pins the latest version for the session.com.google.gson.JsonElementSerialize this reference to JSON: a string primitive or an override object.static com.google.gson.JsonElementtoJsonElement(Object agent) Serialize a raw agent value (SessionAgent, String, or Map) to JSON.toString()
-
Method Details
-
ofString
The Agent ID string form — pins the latest version for the session.- Throws:
IllegalArgumentException- ifagentIdisnull.
-
ofOverride
The Agent override object form (type=agent_with_overrideswith Session-levelsystem/tools/mcp_servers/skillsoverrides). The mapping is passed through verbatim.- Throws:
IllegalArgumentException- ifoverrideisnull.
-
isString
public boolean isString()- Returns:
trueif this is the Agent ID string form.
-
asString
- Returns:
- the Agent ID string, or
nullif this is the override form.
-
asOverride
- Returns:
- the override mapping, or
nullif this is the string form.
-
toJsonElement
public com.google.gson.JsonElement toJsonElement()Serialize this reference to JSON: a string primitive or an override object. -
toJsonElement
Serialize a raw agent value (SessionAgent, String, or Map) to JSON. -
toString
-
equals
-
hashCode
public int hashCode()
-