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.38.0"
".": "0.39.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 86
configured_endpoints: 87
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4cd38d2f4180cc9bd949f182a221d6221c44e7e0ec1ddc110dd7677ba822b51a.yml
openapi_spec_hash: e186fd7fd5f09ba496f0b7bb87365f3b
config_hash: 5b50498887b4fdca175b8377a9cb675f
config_hash: 4514558503b7aa6eba8c2941564c247d
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 0.39.0 (2025-06-04)

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

### Features

* **api:** api update ([fbabb53](https://github.com/runloopai/api-client-python/commit/fbabb538a0dc6662841cb4cb4e489dae3f4f4e4c))
* **api:** api update ([7fa8636](https://github.com/runloopai/api-client-python/commit/7fa8636459ea96553b9d65a4475fce3815c1b2e7))

## 0.38.0 (2025-06-04)

Full Changelog: [v0.37.0...v0.38.0](https://github.com/runloopai/api-client-python/compare/v0.37.0...v0.38.0)
Expand Down
2 changes: 2 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ from runloop_api_client.types import (
BenchmarkRunListView,
BenchmarkRunView,
BenchmarkView,
ScenarioDefinitionListView,
StartBenchmarkRunParameters,
)
```
Expand All @@ -24,6 +25,7 @@ Methods:
- <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>
- <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>
- <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>
- <code title="get /v1/benchmarks/{id}/definitions">client.benchmarks.<a href="./src/runloop_api_client/resources/benchmarks/benchmarks.py">definitions</a>(id, \*\*<a href="src/runloop_api_client/types/benchmark_definitions_params.py">params</a>) -> <a href="./src/runloop_api_client/types/scenario_definition_list_view.py">ScenarioDefinitionListView</a></code>
- <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>
- <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>

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.38.0"
version = "0.39.0"
description = "The official Python library for the runloop API"
dynamic = ["readme"]
license = "MIT"
Expand Down
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.38.0" # x-release-please-version
__version__ = "0.39.0" # x-release-please-version
112 changes: 112 additions & 0 deletions src/runloop_api_client/resources/benchmarks/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
benchmark_create_params,
benchmark_update_params,
benchmark_start_run_params,
benchmark_definitions_params,
benchmark_list_public_params,
)
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
Expand All @@ -35,6 +36,7 @@
from ..._base_client import AsyncPaginator, make_request_options
from ...types.benchmark_view import BenchmarkView
from ...types.benchmark_run_view import BenchmarkRunView
from ...types.scenario_definition_list_view import ScenarioDefinitionListView

__all__ = ["BenchmarksResource", "AsyncBenchmarksResource"]

Expand Down Expand Up @@ -262,6 +264,55 @@ def list(
model=BenchmarkView,
)

def definitions(
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,
) -> ScenarioDefinitionListView:
"""
Get scenario definitions for a previously created Benchmark.

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(
f"/v1/benchmarks/{id}/definitions",
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,
},
benchmark_definitions_params.BenchmarkDefinitionsParams,
),
),
cast_to=ScenarioDefinitionListView,
)

def list_public(
self,
*,
Expand Down Expand Up @@ -587,6 +638,55 @@ def list(
model=BenchmarkView,
)

async def definitions(
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,
) -> ScenarioDefinitionListView:
"""
Get scenario definitions for a previously created Benchmark.

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 await self._get(
f"/v1/benchmarks/{id}/definitions",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform(
{
"limit": limit,
"starting_after": starting_after,
},
benchmark_definitions_params.BenchmarkDefinitionsParams,
),
),
cast_to=ScenarioDefinitionListView,
)

def list_public(
self,
*,
Expand Down Expand Up @@ -705,6 +805,9 @@ def __init__(self, benchmarks: BenchmarksResource) -> None:
self.list = to_raw_response_wrapper(
benchmarks.list,
)
self.definitions = to_raw_response_wrapper(
benchmarks.definitions,
)
self.list_public = to_raw_response_wrapper(
benchmarks.list_public,
)
Expand Down Expand Up @@ -733,6 +836,9 @@ def __init__(self, benchmarks: AsyncBenchmarksResource) -> None:
self.list = async_to_raw_response_wrapper(
benchmarks.list,
)
self.definitions = async_to_raw_response_wrapper(
benchmarks.definitions,
)
self.list_public = async_to_raw_response_wrapper(
benchmarks.list_public,
)
Expand Down Expand Up @@ -761,6 +867,9 @@ def __init__(self, benchmarks: BenchmarksResource) -> None:
self.list = to_streamed_response_wrapper(
benchmarks.list,
)
self.definitions = to_streamed_response_wrapper(
benchmarks.definitions,
)
self.list_public = to_streamed_response_wrapper(
benchmarks.list_public,
)
Expand Down Expand Up @@ -789,6 +898,9 @@ def __init__(self, benchmarks: AsyncBenchmarksResource) -> None:
self.list = async_to_streamed_response_wrapper(
benchmarks.list,
)
self.definitions = async_to_streamed_response_wrapper(
benchmarks.definitions,
)
self.list_public = async_to_streamed_response_wrapper(
benchmarks.list_public,
)
Expand Down
2 changes: 2 additions & 0 deletions src/runloop_api_client/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@
from .devbox_remove_tunnel_params import DevboxRemoveTunnelParams as DevboxRemoveTunnelParams
from .devbox_snapshot_disk_params import DevboxSnapshotDiskParams as DevboxSnapshotDiskParams
from .scenario_list_public_params import ScenarioListPublicParams as ScenarioListPublicParams
from .benchmark_definitions_params import BenchmarkDefinitionsParams as BenchmarkDefinitionsParams
from .benchmark_list_public_params import BenchmarkListPublicParams as BenchmarkListPublicParams
from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView
from .scoring_contract_result_view import ScoringContractResultView as ScoringContractResultView
from .scoring_function_result_view import ScoringFunctionResultView as ScoringFunctionResultView
from .repository_inspection_details import RepositoryInspectionDetails as RepositoryInspectionDetails
from .scenario_definition_list_view import ScenarioDefinitionListView as ScenarioDefinitionListView
from .blueprint_build_logs_list_view import BlueprintBuildLogsListView as BlueprintBuildLogsListView
from .devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse as DevboxCreateSSHKeyResponse
from .repository_connection_list_view import RepositoryConnectionListView as RepositoryConnectionListView
Expand Down
15 changes: 15 additions & 0 deletions src/runloop_api_client/types/benchmark_definitions_params.py
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__ = ["BenchmarkDefinitionsParams"]


class BenchmarkDefinitionsParams(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."""
19 changes: 19 additions & 0 deletions src/runloop_api_client/types/scenario_definition_list_view.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List

from .._models import BaseModel
from .scenario_view import ScenarioView

__all__ = ["ScenarioDefinitionListView"]


class ScenarioDefinitionListView(BaseModel):
has_more: bool

remaining_count: int

scenarios: List[ScenarioView]
"""List of Scenarios matching filter."""

total_count: int
95 changes: 95 additions & 0 deletions tests/api_resources/test_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from runloop_api_client.types import (
BenchmarkView,
BenchmarkRunView,
ScenarioDefinitionListView,
)
from runloop_api_client.pagination import SyncBenchmarksCursorIDPage, AsyncBenchmarksCursorIDPage

Expand Down Expand Up @@ -193,6 +194,53 @@ def test_streaming_response_list(self, client: Runloop) -> None:

assert cast(Any, response.is_closed) is True

@parametrize
def test_method_definitions(self, client: Runloop) -> None:
benchmark = client.benchmarks.definitions(
id="id",
)
assert_matches_type(ScenarioDefinitionListView, benchmark, path=["response"])

@parametrize
def test_method_definitions_with_all_params(self, client: Runloop) -> None:
benchmark = client.benchmarks.definitions(
id="id",
limit=0,
starting_after="starting_after",
)
assert_matches_type(ScenarioDefinitionListView, benchmark, path=["response"])

@parametrize
def test_raw_response_definitions(self, client: Runloop) -> None:
response = client.benchmarks.with_raw_response.definitions(
id="id",
)

assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
benchmark = response.parse()
assert_matches_type(ScenarioDefinitionListView, benchmark, path=["response"])

@parametrize
def test_streaming_response_definitions(self, client: Runloop) -> None:
with client.benchmarks.with_streaming_response.definitions(
id="id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

benchmark = response.parse()
assert_matches_type(ScenarioDefinitionListView, benchmark, path=["response"])

assert cast(Any, response.is_closed) is True

@parametrize
def test_path_params_definitions(self, client: Runloop) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
client.benchmarks.with_raw_response.definitions(
id="",
)

@parametrize
def test_method_list_public(self, client: Runloop) -> None:
benchmark = client.benchmarks.list_public()
Expand Down Expand Up @@ -442,6 +490,53 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None

assert cast(Any, response.is_closed) is True

@parametrize
async def test_method_definitions(self, async_client: AsyncRunloop) -> None:
benchmark = await async_client.benchmarks.definitions(
id="id",
)
assert_matches_type(ScenarioDefinitionListView, benchmark, path=["response"])

@parametrize
async def test_method_definitions_with_all_params(self, async_client: AsyncRunloop) -> None:
benchmark = await async_client.benchmarks.definitions(
id="id",
limit=0,
starting_after="starting_after",
)
assert_matches_type(ScenarioDefinitionListView, benchmark, path=["response"])

@parametrize
async def test_raw_response_definitions(self, async_client: AsyncRunloop) -> None:
response = await async_client.benchmarks.with_raw_response.definitions(
id="id",
)

assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
benchmark = await response.parse()
assert_matches_type(ScenarioDefinitionListView, benchmark, path=["response"])

@parametrize
async def test_streaming_response_definitions(self, async_client: AsyncRunloop) -> None:
async with async_client.benchmarks.with_streaming_response.definitions(
id="id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

benchmark = await response.parse()
assert_matches_type(ScenarioDefinitionListView, benchmark, path=["response"])

assert cast(Any, response.is_closed) is True

@parametrize
async def test_path_params_definitions(self, async_client: AsyncRunloop) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
await async_client.benchmarks.with_raw_response.definitions(
id="",
)

@parametrize
async def test_method_list_public(self, async_client: AsyncRunloop) -> None:
benchmark = await async_client.benchmarks.list_public()
Expand Down
Loading