Skip to content

Commit cd722b3

Browse files
feat: Add axon list filters by id and name (#8384)
1 parent 1edfb84 commit cd722b3

4 files changed

Lines changed: 28 additions & 2 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 124
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-35b6520bcf973e54e439003a1a33bd0ef0de9a362818a23590509e0486fb9a6c.yml
3-
openapi_spec_hash: f6ffa73ae683b4c8bbbce7de13b23aaa
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-73c5043b0241a05714822d00b348e6b467dc0c64d6fa1c0d490a8753e16b170a.yml
3+
openapi_spec_hash: c5d438e50b3bd850c6c8613eb063a15a
44
config_hash: a759c23a5a04ad26f8740acc7e094c01

src/runloop_api_client/resources/axons/axons.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,10 @@ def retrieve(
137137
def list(
138138
self,
139139
*,
140+
id: str | Omit = omit,
140141
include_total_count: bool | Omit = omit,
141142
limit: int | Omit = omit,
143+
name: str | Omit = omit,
142144
starting_after: str | Omit = omit,
143145
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
144146
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -151,11 +153,15 @@ def list(
151153
[Beta] List all active axons.
152154
153155
Args:
156+
id: Filter by axon ID.
157+
154158
include_total_count: If true (default), includes total_count in the response. Set to false to skip
155159
the count query for better performance on large datasets.
156160
157161
limit: The limit of items to return. Default is 20. Max is 5000.
158162
163+
name: Filter by axon name (prefix match supported).
164+
159165
starting_after: Load the next page of data starting after the item with the given ID.
160166
161167
extra_headers: Send extra headers
@@ -175,8 +181,10 @@ def list(
175181
timeout=timeout,
176182
query=maybe_transform(
177183
{
184+
"id": id,
178185
"include_total_count": include_total_count,
179186
"limit": limit,
187+
"name": name,
180188
"starting_after": starting_after,
181189
},
182190
axon_list_params.AxonListParams,
@@ -385,8 +393,10 @@ async def retrieve(
385393
async def list(
386394
self,
387395
*,
396+
id: str | Omit = omit,
388397
include_total_count: bool | Omit = omit,
389398
limit: int | Omit = omit,
399+
name: str | Omit = omit,
390400
starting_after: str | Omit = omit,
391401
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
392402
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -399,11 +409,15 @@ async def list(
399409
[Beta] List all active axons.
400410
401411
Args:
412+
id: Filter by axon ID.
413+
402414
include_total_count: If true (default), includes total_count in the response. Set to false to skip
403415
the count query for better performance on large datasets.
404416
405417
limit: The limit of items to return. Default is 20. Max is 5000.
406418
419+
name: Filter by axon name (prefix match supported).
420+
407421
starting_after: Load the next page of data starting after the item with the given ID.
408422
409423
extra_headers: Send extra headers
@@ -423,8 +437,10 @@ async def list(
423437
timeout=timeout,
424438
query=await async_maybe_transform(
425439
{
440+
"id": id,
426441
"include_total_count": include_total_count,
427442
"limit": limit,
443+
"name": name,
428444
"starting_after": starting_after,
429445
},
430446
axon_list_params.AxonListParams,

src/runloop_api_client/types/axon_list_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99

1010
class AxonListParams(TypedDict, total=False):
11+
id: str
12+
"""Filter by axon ID."""
13+
1114
include_total_count: bool
1215
"""If true (default), includes total_count in the response.
1316
@@ -17,5 +20,8 @@ class AxonListParams(TypedDict, total=False):
1720
limit: int
1821
"""The limit of items to return. Default is 20. Max is 5000."""
1922

23+
name: str
24+
"""Filter by axon name (prefix match supported)."""
25+
2026
starting_after: str
2127
"""Load the next page of data starting after the item with the given ID."""

tests/api_resources/test_axons.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,10 @@ def test_method_list(self, client: Runloop) -> None:
9999
@parametrize
100100
def test_method_list_with_all_params(self, client: Runloop) -> None:
101101
axon = client.axons.list(
102+
id="id",
102103
include_total_count=True,
103104
limit=0,
105+
name="name",
104106
starting_after="starting_after",
105107
)
106108
assert_matches_type(AxonListView, axon, path=["response"])
@@ -300,8 +302,10 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None:
300302
@parametrize
301303
async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None:
302304
axon = await async_client.axons.list(
305+
id="id",
303306
include_total_count=True,
304307
limit=0,
308+
name="name",
305309
starting_after="starting_after",
306310
)
307311
assert_matches_type(AxonListView, axon, path=["response"])

0 commit comments

Comments
 (0)