Skip to content

Commit c303a71

Browse files
feat(api): api update
1 parent a25ccc9 commit c303a71

File tree

11 files changed

+621
-6
lines changed

11 files changed

+621
-6
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 81
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-88c3df1881ce3ca780736c14f781e2b1930abb2ceeadb5cdabeda4d67f877511.yml
3-
openapi_spec_hash: e47eece926740aba8272685c342a1d4b
4-
config_hash: e17450cd026f260f68713ad9f12bd999
1+
configured_endpoints: 84
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-da7ec5b4cc55e7316bc3de6a9c0a37f5ee3057d3d68fdda9cb570d1a1fee57ea.yml
3+
openapi_spec_hash: 5b89a8e3c67c4816dfab9a87fd67247d
4+
config_hash: 8c014837a658512c2e23c002bb0f2ab1

api.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Methods:
2222

2323
- <code title="post /v1/benchmarks">client.benchmarks.<a href="./src/runloop_api_client/resources/benchmarks/benchmarks.py">create</a>(\*\*<a href="src/runloop_api_client/types/benchmark_create_params.py">params</a>) -> <a href="./src/runloop_api_client/types/benchmark_view.py">BenchmarkView</a></code>
2424
- <code title="get /v1/benchmarks/{id}">client.benchmarks.<a href="./src/runloop_api_client/resources/benchmarks/benchmarks.py">retrieve</a>(id) -> <a href="./src/runloop_api_client/types/benchmark_view.py">BenchmarkView</a></code>
25+
- <code title="post /v1/benchmarks/{id}">client.benchmarks.<a href="./src/runloop_api_client/resources/benchmarks/benchmarks.py">update</a>(id, \*\*<a href="src/runloop_api_client/types/benchmark_update_params.py">params</a>) -> <a href="./src/runloop_api_client/types/benchmark_view.py">BenchmarkView</a></code>
2526
- <code title="get /v1/benchmarks">client.benchmarks.<a href="./src/runloop_api_client/resources/benchmarks/benchmarks.py">list</a>(\*\*<a href="src/runloop_api_client/types/benchmark_list_params.py">params</a>) -> <a href="./src/runloop_api_client/types/benchmark_view.py">SyncBenchmarksCursorIDPage[BenchmarkView]</a></code>
2627
- <code title="get /v1/benchmarks/list_public">client.benchmarks.<a href="./src/runloop_api_client/resources/benchmarks/benchmarks.py">list_public</a>(\*\*<a href="src/runloop_api_client/types/benchmark_list_public_params.py">params</a>) -> <a href="./src/runloop_api_client/types/benchmark_view.py">SyncBenchmarksCursorIDPage[BenchmarkView]</a></code>
2728
- <code title="post /v1/benchmarks/start_run">client.benchmarks.<a href="./src/runloop_api_client/resources/benchmarks/benchmarks.py">start_run</a>(\*\*<a href="src/runloop_api_client/types/benchmark_start_run_params.py">params</a>) -> <a href="./src/runloop_api_client/types/benchmark_run_view.py">BenchmarkRunView</a></code>
@@ -32,6 +33,7 @@ Methods:
3233

3334
- <code title="get /v1/benchmarks/runs/{id}">client.benchmarks.runs.<a href="./src/runloop_api_client/resources/benchmarks/runs.py">retrieve</a>(id) -> <a href="./src/runloop_api_client/types/benchmark_run_view.py">BenchmarkRunView</a></code>
3435
- <code title="get /v1/benchmarks/runs">client.benchmarks.runs.<a href="./src/runloop_api_client/resources/benchmarks/runs.py">list</a>(\*\*<a href="src/runloop_api_client/types/benchmarks/run_list_params.py">params</a>) -> <a href="./src/runloop_api_client/types/benchmark_run_view.py">SyncBenchmarkRunsCursorIDPage[BenchmarkRunView]</a></code>
36+
- <code title="post /v1/benchmarks/runs/{id}/cancel">client.benchmarks.runs.<a href="./src/runloop_api_client/resources/benchmarks/runs.py">cancel</a>(id) -> <a href="./src/runloop_api_client/types/benchmark_run_view.py">BenchmarkRunView</a></code>
3537
- <code title="post /v1/benchmarks/runs/{id}/complete">client.benchmarks.runs.<a href="./src/runloop_api_client/resources/benchmarks/runs.py">complete</a>(id) -> <a href="./src/runloop_api_client/types/benchmark_run_view.py">BenchmarkRunView</a></code>
3638

3739
# Blueprints
@@ -287,6 +289,7 @@ Methods:
287289

288290
- <code title="get /v1/scenarios/runs/{id}">client.scenarios.runs.<a href="./src/runloop_api_client/resources/scenarios/runs.py">retrieve</a>(id) -> <a href="./src/runloop_api_client/types/scenario_run_view.py">ScenarioRunView</a></code>
289291
- <code title="get /v1/scenarios/runs">client.scenarios.runs.<a href="./src/runloop_api_client/resources/scenarios/runs.py">list</a>(\*\*<a href="src/runloop_api_client/types/scenarios/run_list_params.py">params</a>) -> <a href="./src/runloop_api_client/types/scenario_run_view.py">SyncBenchmarkRunsCursorIDPage[ScenarioRunView]</a></code>
292+
- <code title="post /v1/scenarios/runs/{id}/cancel">client.scenarios.runs.<a href="./src/runloop_api_client/resources/scenarios/runs.py">cancel</a>(id) -> <a href="./src/runloop_api_client/types/scenario_run_view.py">ScenarioRunView</a></code>
290293
- <code title="post /v1/scenarios/runs/{id}/complete">client.scenarios.runs.<a href="./src/runloop_api_client/resources/scenarios/runs.py">complete</a>(id) -> <a href="./src/runloop_api_client/types/scenario_run_view.py">ScenarioRunView</a></code>
291294
- <code title="post /v1/scenarios/runs/{id}/score">client.scenarios.runs.<a href="./src/runloop_api_client/resources/scenarios/runs.py">score</a>(id) -> <a href="./src/runloop_api_client/types/scenario_run_view.py">ScenarioRunView</a></code>
292295

src/runloop_api_client/resources/benchmarks/benchmarks.py

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from ...types import (
1818
benchmark_list_params,
1919
benchmark_create_params,
20+
benchmark_update_params,
2021
benchmark_start_run_params,
2122
benchmark_list_public_params,
2223
)
@@ -153,6 +154,67 @@ def retrieve(
153154
cast_to=BenchmarkView,
154155
)
155156

157+
def update(
158+
self,
159+
id: str,
160+
*,
161+
is_public: bool,
162+
name: str,
163+
metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
164+
scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
165+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
166+
# The extra values given here take precedence over values defined on the client or passed to this method.
167+
extra_headers: Headers | None = None,
168+
extra_query: Query | None = None,
169+
extra_body: Body | None = None,
170+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
171+
idempotency_key: str | None = None,
172+
) -> BenchmarkView:
173+
"""
174+
Update a Benchmark with a set of Scenarios.
175+
176+
Args:
177+
is_public: Whether this benchmark is public.
178+
179+
name: The name of the Benchmark. This must be unique.
180+
181+
metadata: User defined metadata to attach to the benchmark for organization.
182+
183+
scenario_ids: The Scenario IDs that make up the Benchmark.
184+
185+
extra_headers: Send extra headers
186+
187+
extra_query: Add additional query parameters to the request
188+
189+
extra_body: Add additional JSON properties to the request
190+
191+
timeout: Override the client-level default timeout for this request, in seconds
192+
193+
idempotency_key: Specify a custom idempotency key for this request
194+
"""
195+
if not id:
196+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
197+
return self._post(
198+
f"/v1/benchmarks/{id}",
199+
body=maybe_transform(
200+
{
201+
"is_public": is_public,
202+
"name": name,
203+
"metadata": metadata,
204+
"scenario_ids": scenario_ids,
205+
},
206+
benchmark_update_params.BenchmarkUpdateParams,
207+
),
208+
options=make_request_options(
209+
extra_headers=extra_headers,
210+
extra_query=extra_query,
211+
extra_body=extra_body,
212+
timeout=timeout,
213+
idempotency_key=idempotency_key,
214+
),
215+
cast_to=BenchmarkView,
216+
)
217+
156218
def list(
157219
self,
158220
*,
@@ -417,6 +479,67 @@ async def retrieve(
417479
cast_to=BenchmarkView,
418480
)
419481

482+
async def update(
483+
self,
484+
id: str,
485+
*,
486+
is_public: bool,
487+
name: str,
488+
metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
489+
scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
490+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
491+
# The extra values given here take precedence over values defined on the client or passed to this method.
492+
extra_headers: Headers | None = None,
493+
extra_query: Query | None = None,
494+
extra_body: Body | None = None,
495+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
496+
idempotency_key: str | None = None,
497+
) -> BenchmarkView:
498+
"""
499+
Update a Benchmark with a set of Scenarios.
500+
501+
Args:
502+
is_public: Whether this benchmark is public.
503+
504+
name: The name of the Benchmark. This must be unique.
505+
506+
metadata: User defined metadata to attach to the benchmark for organization.
507+
508+
scenario_ids: The Scenario IDs that make up the Benchmark.
509+
510+
extra_headers: Send extra headers
511+
512+
extra_query: Add additional query parameters to the request
513+
514+
extra_body: Add additional JSON properties to the request
515+
516+
timeout: Override the client-level default timeout for this request, in seconds
517+
518+
idempotency_key: Specify a custom idempotency key for this request
519+
"""
520+
if not id:
521+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
522+
return await self._post(
523+
f"/v1/benchmarks/{id}",
524+
body=await async_maybe_transform(
525+
{
526+
"is_public": is_public,
527+
"name": name,
528+
"metadata": metadata,
529+
"scenario_ids": scenario_ids,
530+
},
531+
benchmark_update_params.BenchmarkUpdateParams,
532+
),
533+
options=make_request_options(
534+
extra_headers=extra_headers,
535+
extra_query=extra_query,
536+
extra_body=extra_body,
537+
timeout=timeout,
538+
idempotency_key=idempotency_key,
539+
),
540+
cast_to=BenchmarkView,
541+
)
542+
420543
def list(
421544
self,
422545
*,
@@ -576,6 +699,9 @@ def __init__(self, benchmarks: BenchmarksResource) -> None:
576699
self.retrieve = to_raw_response_wrapper(
577700
benchmarks.retrieve,
578701
)
702+
self.update = to_raw_response_wrapper(
703+
benchmarks.update,
704+
)
579705
self.list = to_raw_response_wrapper(
580706
benchmarks.list,
581707
)
@@ -601,6 +727,9 @@ def __init__(self, benchmarks: AsyncBenchmarksResource) -> None:
601727
self.retrieve = async_to_raw_response_wrapper(
602728
benchmarks.retrieve,
603729
)
730+
self.update = async_to_raw_response_wrapper(
731+
benchmarks.update,
732+
)
604733
self.list = async_to_raw_response_wrapper(
605734
benchmarks.list,
606735
)
@@ -626,6 +755,9 @@ def __init__(self, benchmarks: BenchmarksResource) -> None:
626755
self.retrieve = to_streamed_response_wrapper(
627756
benchmarks.retrieve,
628757
)
758+
self.update = to_streamed_response_wrapper(
759+
benchmarks.update,
760+
)
629761
self.list = to_streamed_response_wrapper(
630762
benchmarks.list,
631763
)
@@ -651,6 +783,9 @@ def __init__(self, benchmarks: AsyncBenchmarksResource) -> None:
651783
self.retrieve = async_to_streamed_response_wrapper(
652784
benchmarks.retrieve,
653785
)
786+
self.update = async_to_streamed_response_wrapper(
787+
benchmarks.update,
788+
)
654789
self.list = async_to_streamed_response_wrapper(
655790
benchmarks.list,
656791
)

src/runloop_api_client/resources/benchmarks/runs.py

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,46 @@ def list(
126126
model=BenchmarkRunView,
127127
)
128128

129+
def cancel(
130+
self,
131+
id: str,
132+
*,
133+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
134+
# The extra values given here take precedence over values defined on the client or passed to this method.
135+
extra_headers: Headers | None = None,
136+
extra_query: Query | None = None,
137+
extra_body: Body | None = None,
138+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
139+
idempotency_key: str | None = None,
140+
) -> BenchmarkRunView:
141+
"""
142+
Cancel a currently running Benchmark run.
143+
144+
Args:
145+
extra_headers: Send extra headers
146+
147+
extra_query: Add additional query parameters to the request
148+
149+
extra_body: Add additional JSON properties to the request
150+
151+
timeout: Override the client-level default timeout for this request, in seconds
152+
153+
idempotency_key: Specify a custom idempotency key for this request
154+
"""
155+
if not id:
156+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
157+
return self._post(
158+
f"/v1/benchmarks/runs/{id}/cancel",
159+
options=make_request_options(
160+
extra_headers=extra_headers,
161+
extra_query=extra_query,
162+
extra_body=extra_body,
163+
timeout=timeout,
164+
idempotency_key=idempotency_key,
165+
),
166+
cast_to=BenchmarkRunView,
167+
)
168+
129169
def complete(
130170
self,
131171
id: str,
@@ -271,6 +311,46 @@ def list(
271311
model=BenchmarkRunView,
272312
)
273313

314+
async def cancel(
315+
self,
316+
id: str,
317+
*,
318+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
319+
# The extra values given here take precedence over values defined on the client or passed to this method.
320+
extra_headers: Headers | None = None,
321+
extra_query: Query | None = None,
322+
extra_body: Body | None = None,
323+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
324+
idempotency_key: str | None = None,
325+
) -> BenchmarkRunView:
326+
"""
327+
Cancel a currently running Benchmark run.
328+
329+
Args:
330+
extra_headers: Send extra headers
331+
332+
extra_query: Add additional query parameters to the request
333+
334+
extra_body: Add additional JSON properties to the request
335+
336+
timeout: Override the client-level default timeout for this request, in seconds
337+
338+
idempotency_key: Specify a custom idempotency key for this request
339+
"""
340+
if not id:
341+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
342+
return await self._post(
343+
f"/v1/benchmarks/runs/{id}/cancel",
344+
options=make_request_options(
345+
extra_headers=extra_headers,
346+
extra_query=extra_query,
347+
extra_body=extra_body,
348+
timeout=timeout,
349+
idempotency_key=idempotency_key,
350+
),
351+
cast_to=BenchmarkRunView,
352+
)
353+
274354
async def complete(
275355
self,
276356
id: str,
@@ -322,6 +402,9 @@ def __init__(self, runs: RunsResource) -> None:
322402
self.list = to_raw_response_wrapper(
323403
runs.list,
324404
)
405+
self.cancel = to_raw_response_wrapper(
406+
runs.cancel,
407+
)
325408
self.complete = to_raw_response_wrapper(
326409
runs.complete,
327410
)
@@ -337,6 +420,9 @@ def __init__(self, runs: AsyncRunsResource) -> None:
337420
self.list = async_to_raw_response_wrapper(
338421
runs.list,
339422
)
423+
self.cancel = async_to_raw_response_wrapper(
424+
runs.cancel,
425+
)
340426
self.complete = async_to_raw_response_wrapper(
341427
runs.complete,
342428
)
@@ -352,6 +438,9 @@ def __init__(self, runs: RunsResource) -> None:
352438
self.list = to_streamed_response_wrapper(
353439
runs.list,
354440
)
441+
self.cancel = to_streamed_response_wrapper(
442+
runs.cancel,
443+
)
355444
self.complete = to_streamed_response_wrapper(
356445
runs.complete,
357446
)
@@ -367,6 +456,9 @@ def __init__(self, runs: AsyncRunsResource) -> None:
367456
self.list = async_to_streamed_response_wrapper(
368457
runs.list,
369458
)
459+
self.cancel = async_to_streamed_response_wrapper(
460+
runs.cancel,
461+
)
370462
self.complete = async_to_streamed_response_wrapper(
371463
runs.complete,
372464
)

0 commit comments

Comments
 (0)