Skip to content

Commit 6893436

Browse files
feat(api): api update (#512)
1 parent fee06c3 commit 6893436

10 files changed

Lines changed: 75 additions & 8 deletions

File tree

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 66
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-5d84d2732400f196ddbe4b4e7c0e98b3f02bab9ce2ed750e69d399d898e496d1.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bf4f1f241c2a3a425dc7d12b7b7e415133bb696682d1a285836d1a36b7bd6160.yml

src/runloop_api_client/resources/repositories.py

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from __future__ import annotations
44

5+
from typing import Optional
6+
57
import httpx
68

79
from ..types import repository_list_params, repository_create_params
@@ -51,6 +53,7 @@ def create(
5153
*,
5254
name: str,
5355
owner: str,
56+
blueprint_id: Optional[str] | NotGiven = NOT_GIVEN,
5457
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5558
# The extra values given here take precedence over values defined on the client or passed to this method.
5659
extra_headers: Headers | None = None,
@@ -68,6 +71,8 @@ def create(
6871
6972
owner: Account owner of the repository.
7073
74+
blueprint_id: ID of blueprint to use as base for resulting RepositoryVersion blueprint.
75+
7176
extra_headers: Send extra headers
7277
7378
extra_query: Add additional query parameters to the request
@@ -84,6 +89,7 @@ def create(
8489
{
8590
"name": name,
8691
"owner": owner,
92+
"blueprint_id": blueprint_id,
8793
},
8894
repository_create_params.RepositoryCreateParams,
8995
),
@@ -110,7 +116,7 @@ def retrieve(
110116
) -> RepositoryConnectionView:
111117
"""
112118
Get Repository Connection details including latest inspection status and
113-
generated respository insights.
119+
generated repository insights.
114120
115121
Args:
116122
extra_headers: Send extra headers
@@ -135,6 +141,8 @@ def list(
135141
self,
136142
*,
137143
limit: int | NotGiven = NOT_GIVEN,
144+
name: str | NotGiven = NOT_GIVEN,
145+
owner: str | NotGiven = NOT_GIVEN,
138146
starting_after: str | NotGiven = NOT_GIVEN,
139147
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
140148
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -149,6 +157,10 @@ def list(
149157
Args:
150158
limit: The limit of items to return. Default is 20.
151159
160+
name: Filter by repository name
161+
162+
owner: Filter by repository owner
163+
152164
starting_after: Load the next page of data starting after the item with the given ID.
153165
154166
extra_headers: Send extra headers
@@ -170,6 +182,8 @@ def list(
170182
query=maybe_transform(
171183
{
172184
"limit": limit,
185+
"name": name,
186+
"owner": owner,
173187
"starting_after": starting_after,
174188
},
175189
repository_list_params.RepositoryListParams,
@@ -279,6 +293,7 @@ async def create(
279293
*,
280294
name: str,
281295
owner: str,
296+
blueprint_id: Optional[str] | NotGiven = NOT_GIVEN,
282297
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
283298
# The extra values given here take precedence over values defined on the client or passed to this method.
284299
extra_headers: Headers | None = None,
@@ -296,6 +311,8 @@ async def create(
296311
297312
owner: Account owner of the repository.
298313
314+
blueprint_id: ID of blueprint to use as base for resulting RepositoryVersion blueprint.
315+
299316
extra_headers: Send extra headers
300317
301318
extra_query: Add additional query parameters to the request
@@ -312,6 +329,7 @@ async def create(
312329
{
313330
"name": name,
314331
"owner": owner,
332+
"blueprint_id": blueprint_id,
315333
},
316334
repository_create_params.RepositoryCreateParams,
317335
),
@@ -338,7 +356,7 @@ async def retrieve(
338356
) -> RepositoryConnectionView:
339357
"""
340358
Get Repository Connection details including latest inspection status and
341-
generated respository insights.
359+
generated repository insights.
342360
343361
Args:
344362
extra_headers: Send extra headers
@@ -363,6 +381,8 @@ def list(
363381
self,
364382
*,
365383
limit: int | NotGiven = NOT_GIVEN,
384+
name: str | NotGiven = NOT_GIVEN,
385+
owner: str | NotGiven = NOT_GIVEN,
366386
starting_after: str | NotGiven = NOT_GIVEN,
367387
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
368388
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -377,6 +397,10 @@ def list(
377397
Args:
378398
limit: The limit of items to return. Default is 20.
379399
400+
name: Filter by repository name
401+
402+
owner: Filter by repository owner
403+
380404
starting_after: Load the next page of data starting after the item with the given ID.
381405
382406
extra_headers: Send extra headers
@@ -398,6 +422,8 @@ def list(
398422
query=maybe_transform(
399423
{
400424
"limit": limit,
425+
"name": name,
426+
"owner": owner,
401427
"starting_after": starting_after,
402428
},
403429
repository_list_params.RepositoryListParams,

src/runloop_api_client/resources/scenarios/runs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def list(
8282
self,
8383
*,
8484
limit: int | NotGiven = NOT_GIVEN,
85-
scenario_id: bool | NotGiven = NOT_GIVEN,
85+
scenario_id: str | NotGiven = NOT_GIVEN,
8686
starting_after: str | NotGiven = NOT_GIVEN,
8787
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
8888
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -266,7 +266,7 @@ async def list(
266266
self,
267267
*,
268268
limit: int | NotGiven = NOT_GIVEN,
269-
scenario_id: bool | NotGiven = NOT_GIVEN,
269+
scenario_id: str | NotGiven = NOT_GIVEN,
270270
starting_after: str | NotGiven = NOT_GIVEN,
271271
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
272272
# The extra values given here take precedence over values defined on the client or passed to this method.

src/runloop_api_client/types/benchmark_run_view.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,15 @@ class BenchmarkRunView(BaseModel):
1515
benchmark_id: str
1616
"""The ID of the Benchmark."""
1717

18+
start_time_ms: int
19+
"""The time the benchmark run execution started (Unix timestamp milliseconds)."""
20+
1821
state: Literal["running", "completed"]
1922
"""The state of the BenchmarkRun."""
2023

24+
duration_ms: Optional[int] = None
25+
"""The duration for the BenchmarkRun to complete."""
26+
2127
name: Optional[str] = None
2228
"""The name of the BenchmarkRun."""
2329

src/runloop_api_client/types/repository_create_params.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
from typing import Optional
56
from typing_extensions import Required, TypedDict
67

78
__all__ = ["RepositoryCreateParams"]
@@ -13,3 +14,6 @@ class RepositoryCreateParams(TypedDict, total=False):
1314

1415
owner: Required[str]
1516
"""Account owner of the repository."""
17+
18+
blueprint_id: Optional[str]
19+
"""ID of blueprint to use as base for resulting RepositoryVersion blueprint."""

src/runloop_api_client/types/repository_list_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,11 @@ class RepositoryListParams(TypedDict, total=False):
1111
limit: int
1212
"""The limit of items to return. Default is 20."""
1313

14+
name: str
15+
"""Filter by repository name"""
16+
17+
owner: str
18+
"""Filter by repository owner"""
19+
1420
starting_after: str
1521
"""Load the next page of data starting after the item with the given ID."""

src/runloop_api_client/types/scenario_run_view.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@ class ScenarioRunView(BaseModel):
3333

3434
scoring_contract_result: Optional[ScoringContractResultView] = None
3535
"""The input context for the Scenario."""
36+
37+
start_time_ms: Optional[int] = None
38+
"""The time that the scenario started"""

src/runloop_api_client/types/scenarios/run_list_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class RunListParams(TypedDict, total=False):
1111
limit: int
1212
"""The limit of items to return. Default is 20."""
1313

14-
scenario_id: bool
14+
scenario_id: str
1515
"""Filter runs associated to Scenario given ID"""
1616

1717
starting_after: str

tests/api_resources/scenarios/test_runs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def test_method_list(self, client: Runloop) -> None:
6464
def test_method_list_with_all_params(self, client: Runloop) -> None:
6565
run = client.scenarios.runs.list(
6666
limit=0,
67-
scenario_id=True,
67+
scenario_id="scenario_id",
6868
starting_after="starting_after",
6969
)
7070
assert_matches_type(ScenarioRunListView, run, path=["response"])
@@ -216,7 +216,7 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None:
216216
async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None:
217217
run = await async_client.scenarios.runs.list(
218218
limit=0,
219-
scenario_id=True,
219+
scenario_id="scenario_id",
220220
starting_after="starting_after",
221221
)
222222
assert_matches_type(ScenarioRunListView, run, path=["response"])

tests/api_resources/test_repositories.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ def test_method_create(self, client: Runloop) -> None:
2929
)
3030
assert_matches_type(RepositoryConnectionView, repository, path=["response"])
3131

32+
@parametrize
33+
def test_method_create_with_all_params(self, client: Runloop) -> None:
34+
repository = client.repositories.create(
35+
name="name",
36+
owner="owner",
37+
blueprint_id="blueprint_id",
38+
)
39+
assert_matches_type(RepositoryConnectionView, repository, path=["response"])
40+
3241
@parametrize
3342
def test_raw_response_create(self, client: Runloop) -> None:
3443
response = client.repositories.with_raw_response.create(
@@ -102,6 +111,8 @@ def test_method_list(self, client: Runloop) -> None:
102111
def test_method_list_with_all_params(self, client: Runloop) -> None:
103112
repository = client.repositories.list(
104113
limit=0,
114+
name="name",
115+
owner="owner",
105116
starting_after="starting_after",
106117
)
107118
assert_matches_type(SyncRepositoriesCursorIDPage[RepositoryConnectionView], repository, path=["response"])
@@ -214,6 +225,15 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None:
214225
)
215226
assert_matches_type(RepositoryConnectionView, repository, path=["response"])
216227

228+
@parametrize
229+
async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None:
230+
repository = await async_client.repositories.create(
231+
name="name",
232+
owner="owner",
233+
blueprint_id="blueprint_id",
234+
)
235+
assert_matches_type(RepositoryConnectionView, repository, path=["response"])
236+
217237
@parametrize
218238
async def test_raw_response_create(self, async_client: AsyncRunloop) -> None:
219239
response = await async_client.repositories.with_raw_response.create(
@@ -287,6 +307,8 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None:
287307
async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None:
288308
repository = await async_client.repositories.list(
289309
limit=0,
310+
name="name",
311+
owner="owner",
290312
starting_after="starting_after",
291313
)
292314
assert_matches_type(AsyncRepositoriesCursorIDPage[RepositoryConnectionView], repository, path=["response"])

0 commit comments

Comments
 (0)