Skip to content

Commit e0e4e0d

Browse files
committed
feat: add OO SDK support for new Agent API calls
1 parent eb3ad2c commit e0e4e0d

6 files changed

Lines changed: 100 additions & 1 deletion

File tree

src/runloop_api_client/sdk/_types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
McpConfigListParams,
2020
ObjectDownloadParams,
2121
ScenarioUpdateParams,
22+
AgentListPublicParams,
2223
BenchmarkCreateParams,
2324
BenchmarkUpdateParams,
2425
BlueprintCreateParams,
@@ -191,6 +192,10 @@ class SDKAgentListParams(AgentListParams, BaseRequestOptions):
191192
pass
192193

193194

195+
class SDKAgentListPublicParams(AgentListPublicParams, BaseRequestOptions):
196+
pass
197+
198+
194199
class SDKAxonListParams(AxonListParams, BaseRequestOptions):
195200
pass
196201

src/runloop_api_client/sdk/agent.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from ._types import (
99
BaseRequestOptions,
10+
LongRequestOptions,
1011
)
1112
from .._client import Runloop
1213
from ..types.agent_view import AgentView
@@ -68,3 +69,18 @@ def get_info(
6869
self._id,
6970
**options,
7071
)
72+
73+
def delete(
74+
self,
75+
**options: Unpack[LongRequestOptions],
76+
) -> object:
77+
"""Delete this agent. This action is irreversible.
78+
79+
:param options: Optional request configuration
80+
:return: API response acknowledging deletion
81+
:rtype: object
82+
"""
83+
return self._client.agents.delete(
84+
self._id,
85+
**options,
86+
)

src/runloop_api_client/sdk/async_.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
SDKBenchmarkListParams,
2828
SDKBlueprintListParams,
2929
SDKMcpConfigListParams,
30+
SDKAgentListPublicParams,
3031
SDKBenchmarkCreateParams,
3132
SDKBlueprintCreateParams,
3233
SDKMcpConfigCreateParams,
@@ -57,6 +58,7 @@
5758
from .async_storage_object import AsyncStorageObject
5859
from .async_scenario_builder import AsyncScenarioBuilder
5960
from ..types.object_create_params import ContentType
61+
from ..types.agent_devbox_counts_view import AgentDevboxCountsView
6062
from ..types.shared_params.agent_source import Git, Npm, Pip, Object
6163

6264

@@ -805,6 +807,35 @@ async def list(
805807
)
806808
return [AsyncAgent(self._client, item.id, item) for item in page.agents]
807809

810+
async def list_public(
811+
self,
812+
**params: Unpack[SDKAgentListPublicParams],
813+
) -> list[AsyncAgent]:
814+
"""List public agents.
815+
816+
:param params: See :typeddict:`~runloop_api_client.sdk._types.SDKAgentListPublicParams` for available parameters
817+
:return: Collection of public agent wrappers
818+
:rtype: list[AsyncAgent]
819+
"""
820+
page = await self._client.agents.list_public(
821+
**params,
822+
)
823+
return [AsyncAgent(self._client, item.id, item) for item in page.agents]
824+
825+
async def devbox_counts(
826+
self,
827+
**options: Unpack[BaseRequestOptions],
828+
) -> AgentDevboxCountsView:
829+
"""Get devbox counts grouped by agent name.
830+
831+
:param options: Optional request configuration
832+
:return: Devbox counts per agent name and total
833+
:rtype: AgentDevboxCountsView
834+
"""
835+
return await self._client.agents.devbox_counts(
836+
**options,
837+
)
838+
808839

809840
class AsyncScenarioOps:
810841
"""Manage scenarios (async). Access via ``runloop.scenario``.

src/runloop_api_client/sdk/async_agent.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from ._types import (
99
BaseRequestOptions,
10+
LongRequestOptions,
1011
)
1112
from .._client import AsyncRunloop
1213
from ..types.agent_view import AgentView
@@ -68,3 +69,18 @@ async def get_info(
6869
self._id,
6970
**options,
7071
)
72+
73+
async def delete(
74+
self,
75+
**options: Unpack[LongRequestOptions],
76+
) -> object:
77+
"""Delete this agent. This action is irreversible.
78+
79+
:param options: Optional request configuration
80+
:return: API response acknowledging deletion
81+
:rtype: object
82+
"""
83+
return await self._client.agents.delete(
84+
self._id,
85+
**options,
86+
)

src/runloop_api_client/sdk/sync.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
SDKBenchmarkListParams,
2929
SDKBlueprintListParams,
3030
SDKMcpConfigListParams,
31+
SDKAgentListPublicParams,
3132
SDKBenchmarkCreateParams,
3233
SDKBlueprintCreateParams,
3334
SDKMcpConfigCreateParams,
@@ -56,6 +57,7 @@
5657
from ..types.secret_view import SecretView
5758
from ..lib.context_loader import TarFilter, build_directory_tar
5859
from ..types.object_create_params import ContentType
60+
from ..types.agent_devbox_counts_view import AgentDevboxCountsView
5961
from ..types.shared_params.agent_source import Git, Npm, Pip, Object
6062

6163

@@ -830,6 +832,35 @@ def list(
830832
)
831833
return [Agent(self._client, item.id, item) for item in page.agents]
832834

835+
def list_public(
836+
self,
837+
**params: Unpack[SDKAgentListPublicParams],
838+
) -> list[Agent]:
839+
"""List public agents.
840+
841+
:param params: See :typeddict:`~runloop_api_client.sdk._types.SDKAgentListPublicParams` for available parameters
842+
:return: Collection of public agent wrappers
843+
:rtype: list[Agent]
844+
"""
845+
page = self._client.agents.list_public(
846+
**params,
847+
)
848+
return [Agent(self._client, item.id, item) for item in page.agents]
849+
850+
def devbox_counts(
851+
self,
852+
**options: Unpack[BaseRequestOptions],
853+
) -> AgentDevboxCountsView:
854+
"""Get devbox counts grouped by agent name.
855+
856+
:param options: Optional request configuration
857+
:return: Devbox counts per agent name and total
858+
:rtype: AgentDevboxCountsView
859+
"""
860+
return self._client.agents.devbox_counts(
861+
**options,
862+
)
863+
833864

834865
class ScenarioOps:
835866
"""Manage scenarios. Access via ``runloop.scenario``.

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)