@@ -80,6 +80,46 @@ def delete(self):
8080 """
8181 return self .client ._perform_empty ("DELETE" , "/projects/%s/agents/%s" % (self .project_key , self .id ))
8282
83+ def shutdown (self , version_id = None , force = False ):
84+ """
85+ Shutdown all instances of the given version of this agent
86+
87+ :param version_id: If unspecified, uses the active version.
88+ :type version_id: str | None
89+ :param force: If True, cancel requests being processed and stop the instances. If False, let those active requests complete before stopping.
90+ :type force: bool
91+ """
92+ return self .client ._perform_empty (
93+ "POST" , "/projects/%s/agents/%s/actions/shutdown" % (self .project_key , self .id ), body = {
94+ "versionId" : version_id ,
95+ "force" : force
96+ })
97+
98+ def status (self , version_id = None ):
99+ """
100+ Query status of instances of the given version of this agent
101+
102+ :param version_id: If unspecified, uses the active version.
103+ :type version_id: str | None
104+ :return: A dict holding the list of the status for each instance.
105+ """
106+ return self .client ._perform_json (
107+ "GET" , "/projects/%s/agents/%s/status" % (self .project_key , self .id ), body = {
108+ "versionId" : version_id
109+ })
110+
111+ def wake_up (self , version_id = None ):
112+ """
113+ Start an instance of an agent if none is started
114+
115+ :param version_id: If unspecified, uses the active version.
116+ :type version_id: str | None
117+ """
118+ return self .client ._perform_empty (
119+ "POST" , "/projects/%s/agents/%s/actions/wakeup" % (self .project_key , self .id ), body = {
120+ "versionId" : version_id
121+ })
122+
83123class DSSAgentSettings (DSSTaggableObjectSettings ):
84124 """
85125 Settings for a agent
@@ -149,13 +189,13 @@ def llm_id(self):
149189 :rtype: :class:`str`
150190 """
151191 if not self ._agent_settings .type == "TOOLS_USING_AGENT" :
152- raise ValueError ("Only valid for Visual Agents" )
192+ raise ValueError ("Only valid for Simple Visual Agents" )
153193 return self ._version_settings ["toolsUsingAgentSettings" ]["llmId" ]
154194
155195 @llm_id .setter
156196 def llm_id (self , value ):
157197 if not self ._agent_settings .type == "TOOLS_USING_AGENT" :
158- raise ValueError ("Only valid for Visual Agents" )
198+ raise ValueError ("Only valid for Simple Visual Agents" )
159199 self ._version_settings ["toolsUsingAgentSettings" ]["llmId" ] = value
160200
161201 @property
@@ -166,6 +206,8 @@ def tools(self):
166206 Each tool is a dict, containing at least "toolRef", which is the identifier of the tool.
167207 The dict may also contain "additionalDescription" which is added to the description of the tool
168208 """
209+ if not self ._agent_settings .type == "TOOLS_USING_AGENT" :
210+ raise ValueError ("Only valid for Simple Visual Agents" )
169211 return self ._version_settings ["toolsUsingAgentSettings" ]["tools" ]
170212
171213
0 commit comments