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.44.0"
".": "0.45.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: 91
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ecb3d41adaf06e76fd95f11d6da77c7aa0119387a3f372e736edd1579ec2aa03.yml
openapi_spec_hash: 2671664b7d6b0107a6402746033a65ac
config_hash: c4d0f5cf7262a18f9254da07d289f3ec
configured_endpoints: 92
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1d4b018cbfb409baf83725737f00789a9ddbbdbdbe12db1ac7a1fd2cf9c453f0.yml
openapi_spec_hash: 1c533f386f6d3d3802d353cc6f1df547
config_hash: 33b544375e4a932cbb2890f79a9aa040
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 0.45.0 (2025-06-24)

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

### Features

* **api:** api update ([382b901](https://github.com/runloopai/api-client-python/commit/382b9018d26ce11e12d7143a84b80147be63ac2e))
* **api:** api update ([3f896cf](https://github.com/runloopai/api-client-python/commit/3f896cf907ef15fc2f0d01f681844eef0bca9479))
* **api:** api update ([9bb3abf](https://github.com/runloopai/api-client-python/commit/9bb3abf4b274d9e75940cc859eafd0f4f37027b8))


### Chores

* **tests:** skip some failing tests on the latest python versions ([27007c0](https://github.com/runloopai/api-client-python/commit/27007c0a1500e80cc9ac93cb634021a7cfb569e6))

## 0.44.0 (2025-06-21)

Full Changelog: [v0.43.0...v0.44.0](https://github.com/runloopai/api-client-python/compare/v0.43.0...v0.44.0)
Expand Down
3 changes: 3 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ Types:
```python
from runloop_api_client.types import (
InputContext,
InputContextUpdate,
ScenarioCreateParameters,
ScenarioEnvironment,
ScenarioRunListView,
Expand All @@ -272,6 +273,7 @@ from runloop_api_client.types import (
ScenarioView,
ScoringContract,
ScoringContractResultView,
ScoringContractUpdate,
ScoringFunction,
ScoringFunctionResultView,
StartScenarioRunParameters,
Expand All @@ -295,6 +297,7 @@ Methods:
- <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>
- <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>
- <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>
- <code title="post /v1/scenarios/runs/{id}/download_logs">client.scenarios.runs.<a href="./src/runloop_api_client/resources/scenarios/runs.py">download_logs</a>(id) -> BinaryAPIResponse</code>
- <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>

## Scorers
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.44.0"
version = "0.45.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.44.0" # x-release-please-version
__version__ = "0.45.0" # x-release-please-version
108 changes: 108 additions & 0 deletions src/runloop_api_client/resources/scenarios/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
BinaryAPIResponse,
AsyncBinaryAPIResponse,
StreamedBinaryAPIResponse,
AsyncStreamedBinaryAPIResponse,
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
to_custom_raw_response_wrapper,
async_to_streamed_response_wrapper,
to_custom_streamed_response_wrapper,
async_to_custom_raw_response_wrapper,
async_to_custom_streamed_response_wrapper,
)
from ...pagination import SyncBenchmarkRunsCursorIDPage, AsyncBenchmarkRunsCursorIDPage
from ..._exceptions import RunloopError
Expand Down Expand Up @@ -213,6 +221,48 @@ def complete(
cast_to=ScenarioRunView,
)

def download_logs(
self,
id: str,
*,
# 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,
idempotency_key: str | None = None,
) -> BinaryAPIResponse:
"""
Download a zip file containing all logs for a Scenario run from the associated
devbox.

Args:
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

idempotency_key: Specify a custom idempotency key for this request
"""
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
extra_headers = {"Accept": "application/zip", **(extra_headers or {})}
return self._post(
f"/v1/scenarios/runs/{id}/download_logs",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
idempotency_key=idempotency_key,
),
cast_to=BinaryAPIResponse,
)

def score(
self,
id: str,
Expand Down Expand Up @@ -583,6 +633,48 @@ async def complete(
cast_to=ScenarioRunView,
)

async def download_logs(
self,
id: str,
*,
# 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,
idempotency_key: str | None = None,
) -> AsyncBinaryAPIResponse:
"""
Download a zip file containing all logs for a Scenario run from the associated
devbox.

Args:
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

idempotency_key: Specify a custom idempotency key for this request
"""
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
extra_headers = {"Accept": "application/zip", **(extra_headers or {})}
return await self._post(
f"/v1/scenarios/runs/{id}/download_logs",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
idempotency_key=idempotency_key,
),
cast_to=AsyncBinaryAPIResponse,
)

async def score(
self,
id: str,
Expand Down Expand Up @@ -782,6 +874,10 @@ def __init__(self, runs: RunsResource) -> None:
self.complete = to_raw_response_wrapper(
runs.complete,
)
self.download_logs = to_custom_raw_response_wrapper(
runs.download_logs,
BinaryAPIResponse,
)
self.score = to_raw_response_wrapper(
runs.score,
)
Expand All @@ -803,6 +899,10 @@ def __init__(self, runs: AsyncRunsResource) -> None:
self.complete = async_to_raw_response_wrapper(
runs.complete,
)
self.download_logs = async_to_custom_raw_response_wrapper(
runs.download_logs,
AsyncBinaryAPIResponse,
)
self.score = async_to_raw_response_wrapper(
runs.score,
)
Expand All @@ -824,6 +924,10 @@ def __init__(self, runs: RunsResource) -> None:
self.complete = to_streamed_response_wrapper(
runs.complete,
)
self.download_logs = to_custom_streamed_response_wrapper(
runs.download_logs,
StreamedBinaryAPIResponse,
)
self.score = to_streamed_response_wrapper(
runs.score,
)
Expand All @@ -845,6 +949,10 @@ def __init__(self, runs: AsyncRunsResource) -> None:
self.complete = async_to_streamed_response_wrapper(
runs.complete,
)
self.download_logs = async_to_custom_streamed_response_wrapper(
runs.download_logs,
AsyncStreamedBinaryAPIResponse,
)
self.score = async_to_streamed_response_wrapper(
runs.score,
)
10 changes: 6 additions & 4 deletions src/runloop_api_client/resources/scenarios/scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@
from ...types.scenario_run_view import ScenarioRunView
from ...types.input_context_param import InputContextParam
from ...types.scoring_contract_param import ScoringContractParam
from ...types.input_context_update_param import InputContextUpdateParam
from ...types.scenario_environment_param import ScenarioEnvironmentParam
from ...types.scoring_contract_update_param import ScoringContractUpdateParam

__all__ = ["ScenariosResource", "AsyncScenariosResource"]

Expand Down Expand Up @@ -186,11 +188,11 @@ def update(
id: str,
*,
environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN,
input_context: Optional[InputContextParam] | NotGiven = NOT_GIVEN,
input_context: Optional[InputContextUpdateParam] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
name: Optional[str] | NotGiven = NOT_GIVEN,
reference_output: Optional[str] | NotGiven = NOT_GIVEN,
scoring_contract: Optional[ScoringContractParam] | NotGiven = NOT_GIVEN,
scoring_contract: Optional[ScoringContractUpdateParam] | 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,
Expand Down Expand Up @@ -613,11 +615,11 @@ async def update(
id: str,
*,
environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN,
input_context: Optional[InputContextParam] | NotGiven = NOT_GIVEN,
input_context: Optional[InputContextUpdateParam] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
name: Optional[str] | NotGiven = NOT_GIVEN,
reference_output: Optional[str] | NotGiven = NOT_GIVEN,
scoring_contract: Optional[ScoringContractParam] | NotGiven = NOT_GIVEN,
scoring_contract: Optional[ScoringContractUpdateParam] | 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,
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 @@ -54,6 +54,7 @@
from .benchmark_start_run_params import BenchmarkStartRunParams as BenchmarkStartRunParams
from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters
from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams
from .input_context_update_param import InputContextUpdateParam as InputContextUpdateParam
from .repository_connection_view import RepositoryConnectionView as RepositoryConnectionView
from .scenario_environment_param import ScenarioEnvironmentParam as ScenarioEnvironmentParam
from .devbox_create_tunnel_params import DevboxCreateTunnelParams as DevboxCreateTunnelParams
Expand All @@ -69,6 +70,7 @@
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 .scoring_contract_update_param import ScoringContractUpdateParam as ScoringContractUpdateParam
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
16 changes: 16 additions & 0 deletions src/runloop_api_client/types/input_context_update_param.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing import Optional
from typing_extensions import TypedDict

__all__ = ["InputContextUpdateParam"]


class InputContextUpdateParam(TypedDict, total=False):
additional_context: Optional[object]
"""Additional JSON structured input context."""

problem_statement: Optional[str]
"""The problem statement for the Scenario."""
8 changes: 4 additions & 4 deletions src/runloop_api_client/types/scenario_update_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from typing import Dict, Optional
from typing_extensions import TypedDict

from .input_context_param import InputContextParam
from .scoring_contract_param import ScoringContractParam
from .input_context_update_param import InputContextUpdateParam
from .scenario_environment_param import ScenarioEnvironmentParam
from .scoring_contract_update_param import ScoringContractUpdateParam

__all__ = ["ScenarioUpdateParams"]

Expand All @@ -16,7 +16,7 @@ class ScenarioUpdateParams(TypedDict, total=False):
environment_parameters: Optional[ScenarioEnvironmentParam]
"""The Environment in which the Scenario will run."""

input_context: Optional[InputContextParam]
input_context: Optional[InputContextUpdateParam]
"""The input context for the Scenario."""

metadata: Optional[Dict[str, str]]
Expand All @@ -32,5 +32,5 @@ class ScenarioUpdateParams(TypedDict, total=False):
apply to the environment.
"""

scoring_contract: Optional[ScoringContractParam]
scoring_contract: Optional[ScoringContractUpdateParam]
"""The scoring contract for the Scenario."""
15 changes: 15 additions & 0 deletions src/runloop_api_client/types/scoring_contract_update_param.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 import Iterable, Optional
from typing_extensions import TypedDict

from .scoring_function_param import ScoringFunctionParam

__all__ = ["ScoringContractUpdateParam"]


class ScoringContractUpdateParam(TypedDict, total=False):
scoring_function_parameters: Optional[Iterable[ScoringFunctionParam]]
"""A list of scoring functions used to evaluate the Scenario."""
Loading
Loading