Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.36.0"
".": "0.37.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 85
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3484df665f4c2b7cb17ad044b825223fc69ad67b05d967fbb6dfbb6a6ac9ccac.yml
openapi_spec_hash: 58c0860078f5f26c8b517603956700b5
config_hash: c03c6a4c057a38e2809a102c48fafe6c
configured_endpoints: 86
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-141cac5a78c04271425090df61bb3f19446c1c065ae66a5b7a6329c53628aafa.yml
openapi_spec_hash: 2380917eddc78d715847c7ef6bfa3b4a
config_hash: 5b50498887b4fdca175b8377a9cb675f
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 0.37.0 (2025-06-04)

Full Changelog: [v0.36.0...v0.37.0](https://github.com/runloopai/api-client-python/compare/v0.36.0...v0.37.0)

### Features

* **api:** api update ([a167d0b](https://github.com/runloopai/api-client-python/commit/a167d0b2dbab59cb4ffbb029ea6dae22d0d7c2f4))
* **client:** add follow_redirects request option ([c29d24c](https://github.com/runloopai/api-client-python/commit/c29d24c5483ee2ca7e4d53dfdf8d40278f04f1fe))


### Chores

* **docs:** remove reference to rye shell ([af51a95](https://github.com/runloopai/api-client-python/commit/af51a958afb08cc728959b154c52d0ca31f4206c))
* **docs:** remove unnecessary param examples ([a29553d](https://github.com/runloopai/api-client-python/commit/a29553d048fa85207e28e5b3dbc4ad9ea326ad86))

## 0.36.0 (2025-06-02)

Full Changelog: [v0.35.0...v0.36.0](https://github.com/runloopai/api-client-python/compare/v0.35.0...v0.36.0)
Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ $ rye sync --all-features
You can then run scripts using `rye run python script.py` or by activating the virtual environment:

```sh
$ rye shell
# or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work
# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
$ source .venv/bin/activate

# now you can omit the `rye run` prefix
Expand Down
18 changes: 1 addition & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,23 +146,7 @@ from runloop_api_client import Runloop
client = Runloop()

devbox_view = client.devboxes.create(
launch_parameters={
"after_idle": {
"idle_time_seconds": 0,
"on_idle": "shutdown",
},
"architecture": "x86_64",
"available_ports": [0],
"custom_cpu_cores": 0,
"custom_gb_memory": 0,
"keep_alive_time_seconds": 0,
"launch_commands": ["string"],
"resource_size_request": "X_SMALL",
"user_parameters": {
"uid": 0,
"username": "username",
},
},
launch_parameters={},
)
print(devbox_view.launch_parameters)
```
Expand Down
1 change: 1 addition & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Methods:
- <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>
- <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>
- <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>
- <code title="get /v1/benchmarks/runs/{id}/scenario_runs">client.benchmarks.runs.<a href="./src/runloop_api_client/resources/benchmarks/runs.py">list_scenario_runs</a>(id, \*\*<a href="src/runloop_api_client/types/benchmarks/run_list_scenario_runs_params.py">params</a>) -> <a href="./src/runloop_api_client/types/scenario_run_view.py">SyncBenchmarkRunsCursorIDPage[ScenarioRunView]</a></code>

# Blueprints

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "runloop_api_client"
version = "0.36.0"
version = "0.37.0"
description = "The official Python library for the runloop API"
dynamic = ["readme"]
license = "MIT"
Expand Down
6 changes: 6 additions & 0 deletions src/runloop_api_client/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,9 @@ def request(
if self.custom_auth is not None:
kwargs["auth"] = self.custom_auth

if options.follow_redirects is not None:
kwargs["follow_redirects"] = options.follow_redirects

log.debug("Sending HTTP Request: %s %s", request.method, request.url)

response = None
Expand Down Expand Up @@ -1460,6 +1463,9 @@ async def request(
if self.custom_auth is not None:
kwargs["auth"] = self.custom_auth

if options.follow_redirects is not None:
kwargs["follow_redirects"] = options.follow_redirects

log.debug("Sending HTTP Request: %s %s", request.method, request.url)

response = None
Expand Down
2 changes: 2 additions & 0 deletions src/runloop_api_client/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,7 @@ class FinalRequestOptionsInput(TypedDict, total=False):
idempotency_key: str
json_data: Body
extra_json: AnyMapping
follow_redirects: bool


@final
Expand All @@ -750,6 +751,7 @@ class FinalRequestOptions(pydantic.BaseModel):
files: Union[HttpxRequestFiles, None] = None
idempotency_key: Union[str, None] = None
post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven()
follow_redirects: Union[bool, None] = None

# It should be noted that we cannot use `json` here as that would override
# a BaseModel method in an incompatible fashion.
Expand Down
2 changes: 2 additions & 0 deletions src/runloop_api_client/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class RequestOptions(TypedDict, total=False):
params: Query
extra_json: AnyMapping
idempotency_key: str
follow_redirects: bool


# Sentinel class used until PEP 0661 is accepted
Expand Down Expand Up @@ -215,3 +216,4 @@ class _GenericAlias(Protocol):

class HttpxSendArgs(TypedDict, total=False):
auth: httpx.Auth
follow_redirects: bool
2 changes: 1 addition & 1 deletion src/runloop_api_client/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "runloop_api_client"
__version__ = "0.36.0" # x-release-please-version
__version__ = "0.37.0" # x-release-please-version
115 changes: 114 additions & 1 deletion src/runloop_api_client/resources/benchmarks/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
)
from ...pagination import SyncBenchmarkRunsCursorIDPage, AsyncBenchmarkRunsCursorIDPage
from ..._base_client import AsyncPaginator, make_request_options
from ...types.benchmarks import run_list_params
from ...types.benchmarks import run_list_params, run_list_scenario_runs_params
from ...types.scenario_run_view import ScenarioRunView
from ...types.benchmark_run_view import BenchmarkRunView

__all__ = ["RunsResource", "AsyncRunsResource"]
Expand Down Expand Up @@ -206,6 +207,56 @@ def complete(
cast_to=BenchmarkRunView,
)

def list_scenario_runs(
self,
id: str,
*,
limit: int | NotGiven = NOT_GIVEN,
starting_after: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncBenchmarkRunsCursorIDPage[ScenarioRunView]:
"""
List started scenario runs for a benchmark run.

Args:
limit: The limit of items to return. Default is 20.

starting_after: Load the next page of data starting after the item with the given ID.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._get_api_list(
f"/v1/benchmarks/runs/{id}/scenario_runs",
page=SyncBenchmarkRunsCursorIDPage[ScenarioRunView],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform(
{
"limit": limit,
"starting_after": starting_after,
},
run_list_scenario_runs_params.RunListScenarioRunsParams,
),
),
model=ScenarioRunView,
)


class AsyncRunsResource(AsyncAPIResource):
@cached_property
Expand Down Expand Up @@ -391,6 +442,56 @@ async def complete(
cast_to=BenchmarkRunView,
)

def list_scenario_runs(
self,
id: str,
*,
limit: int | NotGiven = NOT_GIVEN,
starting_after: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[ScenarioRunView, AsyncBenchmarkRunsCursorIDPage[ScenarioRunView]]:
"""
List started scenario runs for a benchmark run.

Args:
limit: The limit of items to return. Default is 20.

starting_after: Load the next page of data starting after the item with the given ID.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._get_api_list(
f"/v1/benchmarks/runs/{id}/scenario_runs",
page=AsyncBenchmarkRunsCursorIDPage[ScenarioRunView],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform(
{
"limit": limit,
"starting_after": starting_after,
},
run_list_scenario_runs_params.RunListScenarioRunsParams,
),
),
model=ScenarioRunView,
)


class RunsResourceWithRawResponse:
def __init__(self, runs: RunsResource) -> None:
Expand All @@ -408,6 +509,9 @@ def __init__(self, runs: RunsResource) -> None:
self.complete = to_raw_response_wrapper(
runs.complete,
)
self.list_scenario_runs = to_raw_response_wrapper(
runs.list_scenario_runs,
)


class AsyncRunsResourceWithRawResponse:
Expand All @@ -426,6 +530,9 @@ def __init__(self, runs: AsyncRunsResource) -> None:
self.complete = async_to_raw_response_wrapper(
runs.complete,
)
self.list_scenario_runs = async_to_raw_response_wrapper(
runs.list_scenario_runs,
)


class RunsResourceWithStreamingResponse:
Expand All @@ -444,6 +551,9 @@ def __init__(self, runs: RunsResource) -> None:
self.complete = to_streamed_response_wrapper(
runs.complete,
)
self.list_scenario_runs = to_streamed_response_wrapper(
runs.list_scenario_runs,
)


class AsyncRunsResourceWithStreamingResponse:
Expand All @@ -462,3 +572,6 @@ def __init__(self, runs: AsyncRunsResource) -> None:
self.complete = async_to_streamed_response_wrapper(
runs.complete,
)
self.list_scenario_runs = async_to_streamed_response_wrapper(
runs.list_scenario_runs,
)
1 change: 1 addition & 0 deletions src/runloop_api_client/types/benchmarks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
from __future__ import annotations

from .run_list_params import RunListParams as RunListParams
from .run_list_scenario_runs_params import RunListScenarioRunsParams as RunListScenarioRunsParams
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing_extensions import TypedDict

__all__ = ["RunListScenarioRunsParams"]


class RunListScenarioRunsParams(TypedDict, total=False):
limit: int
"""The limit of items to return. Default is 20."""

starting_after: str
"""Load the next page of data starting after the item with the given ID."""
Loading
Loading