1212 RunsResourceWithStreamingResponse ,
1313 AsyncRunsResourceWithStreamingResponse ,
1414)
15- from ...types import agent_run_params
15+ from ...types import agent_run_params , agent_list_params
1616from ..._types import Body , Omit , Query , Headers , NotGiven , omit , not_given
1717from ..._utils import maybe_transform , async_maybe_transform
1818from ..._compat import cached_property
19+ from .schedules import (
20+ SchedulesResource ,
21+ AsyncSchedulesResource ,
22+ SchedulesResourceWithRawResponse ,
23+ AsyncSchedulesResourceWithRawResponse ,
24+ SchedulesResourceWithStreamingResponse ,
25+ AsyncSchedulesResourceWithStreamingResponse ,
26+ )
1927from ..._resource import SyncAPIResource , AsyncAPIResource
2028from ..._response import (
2129 to_raw_response_wrapper ,
2533)
2634from ..._base_client import make_request_options
2735from ...types .agent_run_response import AgentRunResponse
36+ from ...types .agent_list_response import AgentListResponse
2837from ...types .ambient_agent_config_param import AmbientAgentConfigParam
2938
3039__all__ = ["AgentResource" , "AsyncAgentResource" ]
@@ -35,6 +44,10 @@ class AgentResource(SyncAPIResource):
3544 def runs (self ) -> RunsResource :
3645 return RunsResource (self ._client )
3746
47+ @cached_property
48+ def schedules (self ) -> SchedulesResource :
49+ return SchedulesResource (self ._client )
50+
3851 @cached_property
3952 def with_raw_response (self ) -> AgentResourceWithRawResponse :
4053 """
@@ -54,6 +67,45 @@ def with_streaming_response(self) -> AgentResourceWithStreamingResponse:
5467 """
5568 return AgentResourceWithStreamingResponse (self )
5669
70+ def list (
71+ self ,
72+ * ,
73+ repo : str | Omit = omit ,
74+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
75+ # The extra values given here take precedence over values defined on the client or passed to this method.
76+ extra_headers : Headers | None = None ,
77+ extra_query : Query | None = None ,
78+ extra_body : Body | None = None ,
79+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
80+ ) -> AgentListResponse :
81+ """
82+ Retrieve a list of available agents (skills) that can be used to run tasks.
83+ Agents are discovered from environments or a specific repository.
84+
85+ Args:
86+ repo: Optional repository specification to list agents from (format: "owner/repo"). If
87+ not provided, lists agents from all accessible environments.
88+
89+ extra_headers: Send extra headers
90+
91+ extra_query: Add additional query parameters to the request
92+
93+ extra_body: Add additional JSON properties to the request
94+
95+ timeout: Override the client-level default timeout for this request, in seconds
96+ """
97+ return self ._get (
98+ "/agent" ,
99+ options = make_request_options (
100+ extra_headers = extra_headers ,
101+ extra_query = extra_query ,
102+ extra_body = extra_body ,
103+ timeout = timeout ,
104+ query = maybe_transform ({"repo" : repo }, agent_list_params .AgentListParams ),
105+ ),
106+ cast_to = AgentListResponse ,
107+ )
108+
57109 def run (
58110 self ,
59111 * ,
@@ -113,6 +165,10 @@ class AsyncAgentResource(AsyncAPIResource):
113165 def runs (self ) -> AsyncRunsResource :
114166 return AsyncRunsResource (self ._client )
115167
168+ @cached_property
169+ def schedules (self ) -> AsyncSchedulesResource :
170+ return AsyncSchedulesResource (self ._client )
171+
116172 @cached_property
117173 def with_raw_response (self ) -> AsyncAgentResourceWithRawResponse :
118174 """
@@ -132,6 +188,45 @@ def with_streaming_response(self) -> AsyncAgentResourceWithStreamingResponse:
132188 """
133189 return AsyncAgentResourceWithStreamingResponse (self )
134190
191+ async def list (
192+ self ,
193+ * ,
194+ repo : str | Omit = omit ,
195+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
196+ # The extra values given here take precedence over values defined on the client or passed to this method.
197+ extra_headers : Headers | None = None ,
198+ extra_query : Query | None = None ,
199+ extra_body : Body | None = None ,
200+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
201+ ) -> AgentListResponse :
202+ """
203+ Retrieve a list of available agents (skills) that can be used to run tasks.
204+ Agents are discovered from environments or a specific repository.
205+
206+ Args:
207+ repo: Optional repository specification to list agents from (format: "owner/repo"). If
208+ not provided, lists agents from all accessible environments.
209+
210+ extra_headers: Send extra headers
211+
212+ extra_query: Add additional query parameters to the request
213+
214+ extra_body: Add additional JSON properties to the request
215+
216+ timeout: Override the client-level default timeout for this request, in seconds
217+ """
218+ return await self ._get (
219+ "/agent" ,
220+ options = make_request_options (
221+ extra_headers = extra_headers ,
222+ extra_query = extra_query ,
223+ extra_body = extra_body ,
224+ timeout = timeout ,
225+ query = await async_maybe_transform ({"repo" : repo }, agent_list_params .AgentListParams ),
226+ ),
227+ cast_to = AgentListResponse ,
228+ )
229+
135230 async def run (
136231 self ,
137232 * ,
@@ -190,6 +285,9 @@ class AgentResourceWithRawResponse:
190285 def __init__ (self , agent : AgentResource ) -> None :
191286 self ._agent = agent
192287
288+ self .list = to_raw_response_wrapper (
289+ agent .list ,
290+ )
193291 self .run = to_raw_response_wrapper (
194292 agent .run ,
195293 )
@@ -198,11 +296,18 @@ def __init__(self, agent: AgentResource) -> None:
198296 def runs (self ) -> RunsResourceWithRawResponse :
199297 return RunsResourceWithRawResponse (self ._agent .runs )
200298
299+ @cached_property
300+ def schedules (self ) -> SchedulesResourceWithRawResponse :
301+ return SchedulesResourceWithRawResponse (self ._agent .schedules )
302+
201303
202304class AsyncAgentResourceWithRawResponse :
203305 def __init__ (self , agent : AsyncAgentResource ) -> None :
204306 self ._agent = agent
205307
308+ self .list = async_to_raw_response_wrapper (
309+ agent .list ,
310+ )
206311 self .run = async_to_raw_response_wrapper (
207312 agent .run ,
208313 )
@@ -211,11 +316,18 @@ def __init__(self, agent: AsyncAgentResource) -> None:
211316 def runs (self ) -> AsyncRunsResourceWithRawResponse :
212317 return AsyncRunsResourceWithRawResponse (self ._agent .runs )
213318
319+ @cached_property
320+ def schedules (self ) -> AsyncSchedulesResourceWithRawResponse :
321+ return AsyncSchedulesResourceWithRawResponse (self ._agent .schedules )
322+
214323
215324class AgentResourceWithStreamingResponse :
216325 def __init__ (self , agent : AgentResource ) -> None :
217326 self ._agent = agent
218327
328+ self .list = to_streamed_response_wrapper (
329+ agent .list ,
330+ )
219331 self .run = to_streamed_response_wrapper (
220332 agent .run ,
221333 )
@@ -224,15 +336,26 @@ def __init__(self, agent: AgentResource) -> None:
224336 def runs (self ) -> RunsResourceWithStreamingResponse :
225337 return RunsResourceWithStreamingResponse (self ._agent .runs )
226338
339+ @cached_property
340+ def schedules (self ) -> SchedulesResourceWithStreamingResponse :
341+ return SchedulesResourceWithStreamingResponse (self ._agent .schedules )
342+
227343
228344class AsyncAgentResourceWithStreamingResponse :
229345 def __init__ (self , agent : AsyncAgentResource ) -> None :
230346 self ._agent = agent
231347
348+ self .list = async_to_streamed_response_wrapper (
349+ agent .list ,
350+ )
232351 self .run = async_to_streamed_response_wrapper (
233352 agent .run ,
234353 )
235354
236355 @cached_property
237356 def runs (self ) -> AsyncRunsResourceWithStreamingResponse :
238357 return AsyncRunsResourceWithStreamingResponse (self ._agent .runs )
358+
359+ @cached_property
360+ def schedules (self ) -> AsyncSchedulesResourceWithStreamingResponse :
361+ return AsyncSchedulesResourceWithStreamingResponse (self ._agent .schedules )
0 commit comments