java.lang.Object
com.alibaba.dashscope.applications.agentstudio.param.SessionAgent

public final class SessionAgent extends Object
Session-level agent reference: an Agent ID string or an override object carrying system/tools/mcp_servers/skills.
  • Method Details

    • ofString

      public static SessionAgent ofString(String agentId)
      The Agent ID string form — pins the latest version for the session.
      Throws:
      IllegalArgumentException - if agentId is null.
    • ofOverride

      public static SessionAgent ofOverride(Map<String,Object> override)
      The Agent override object form (type=agent_with_overrides with Session-level system/tools/mcp_servers/skills overrides). The mapping is passed through verbatim.
      Throws:
      IllegalArgumentException - if override is null.
    • isString

      public boolean isString()
      Returns:
      true if this is the Agent ID string form.
    • asString

      public String asString()
      Returns:
      the Agent ID string, or null if this is the override form.
    • asOverride

      public Map<String,Object> asOverride()
      Returns:
      the override mapping, or null if 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

      public static com.google.gson.JsonElement toJsonElement(Object agent)
      Serialize a raw agent value (SessionAgent, String, or Map) to JSON.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object