From 5d9b8330d37d53bb5c1e8393c5d9798323a0a2ca Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 12 Jul 2025 02:07:36 +0000 Subject: [PATCH 1/5] fix(client): don't send Content-Type header on GET requests --- pyproject.toml | 2 +- src/runloop_api_client/_base_client.py | 11 +++++++++-- tests/test_client.py | 4 ++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c4ef8d070..413339099 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ Homepage = "https://github.com/runloopai/api-client-python" Repository = "https://github.com/runloopai/api-client-python" [project.optional-dependencies] -aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.6"] +aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"] [tool.rye] managed = true diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index d2758d8cc..d3b08b71d 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -529,6 +529,15 @@ def _build_request( # work around https://github.com/encode/httpx/discussions/2880 kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")} + is_body_allowed = options.method.lower() != "get" + + if is_body_allowed: + kwargs["json"] = json_data if is_given(json_data) else None + kwargs["files"] = files + else: + headers.pop("Content-Type", None) + kwargs.pop("data", None) + # TODO: report this error to httpx return self._client.build_request( # pyright: ignore[reportUnknownMemberType] headers=headers, @@ -540,8 +549,6 @@ def _build_request( # so that passing a `TypedDict` doesn't cause an error. # https://github.com/microsoft/pyright/issues/3526#event-6715453066 params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None, - json=json_data if is_given(json_data) else None, - files=files, **kwargs, ) diff --git a/tests/test_client.py b/tests/test_client.py index ed6595b46..cb84f9ebe 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -473,7 +473,7 @@ def test_request_extra_query(self) -> None: def test_multipart_repeating_array(self, client: Runloop) -> None: request = client._build_request( FinalRequestOptions.construct( - method="get", + method="post", url="/foo", headers={"Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82"}, json_data={"array": ["foo", "bar"]}, @@ -1329,7 +1329,7 @@ def test_request_extra_query(self) -> None: def test_multipart_repeating_array(self, async_client: AsyncRunloop) -> None: request = async_client._build_request( FinalRequestOptions.construct( - method="get", + method="post", url="/foo", headers={"Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82"}, json_data={"array": ["foo", "bar"]}, From 27c4579ac003a2e211c5b421a1cc4714f86c6e57 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 20:40:28 +0000 Subject: [PATCH 2/5] feat(api): api update --- .stats.yml | 6 ++-- .../resources/benchmarks/benchmarks.py | 28 +++++++++++++++++++ .../resources/blueprints.py | 8 +++--- .../resources/scenarios/scenarios.py | 28 ++++++++++++++++++- .../types/benchmark_create_params.py | 6 ++++ .../types/benchmark_run_view.py | 6 ++++ .../types/benchmark_start_run_params.py | 17 +++++++++-- .../types/benchmark_update_params.py | 6 ++++ .../types/benchmark_view.py | 6 ++++ .../types/blueprint_build_parameters.py | 2 +- .../types/blueprint_create_params.py | 2 +- .../types/blueprint_preview_params.py | 2 +- .../types/repository_inspection_details.py | 5 ++-- .../types/scenario_create_params.py | 8 +++++- .../types/scenario_run_view.py | 6 ++++ .../types/scenario_start_run_params.py | 17 +++++++++-- .../types/scenario_update_params.py | 8 ++++-- src/runloop_api_client/types/scenario_view.py | 9 +++++- .../types/shared/launch_parameters.py | 3 ++ .../types/shared_params/launch_parameters.py | 3 ++ tests/api_resources/scenarios/test_scorers.py | 2 ++ tests/api_resources/test_benchmarks.py | 12 ++++++++ tests/api_resources/test_blueprints.py | 4 +++ tests/api_resources/test_devboxes.py | 2 ++ tests/api_resources/test_scenarios.py | 16 +++++++++++ 25 files changed, 191 insertions(+), 21 deletions(-) diff --git a/.stats.yml b/.stats.yml index b6e2c2d76..e6d3acdb6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 92 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-75c0dc94dd629772c98b3e6f763d8b3a1bdb732aa3eb92d49a59fb446fb2410d.yml -openapi_spec_hash: 12286e648ea1156bfa23020ed0c7598b -config_hash: aeb178e14a85ac4cd585f0667484c7c3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e5ce0fefdcb08eeb8d337329c89374e8a11a26dd986c75cffd93ad2756fb6ed7.yml +openapi_spec_hash: e2807c1c3955b268937eb33f345dbfe5 +config_hash: 60681f589a9e641fdb7f19af2021a033 diff --git a/src/runloop_api_client/resources/benchmarks/benchmarks.py b/src/runloop_api_client/resources/benchmarks/benchmarks.py index d4270d242..af8a721b3 100644 --- a/src/runloop_api_client/resources/benchmarks/benchmarks.py +++ b/src/runloop_api_client/resources/benchmarks/benchmarks.py @@ -70,6 +70,7 @@ def create( *, name: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, scenario_ids: Optional[List[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. @@ -87,6 +88,9 @@ def create( metadata: User defined metadata to attach to the benchmark for organization. + required_environment_variables: Environment variables required to run the benchmark. If these variables are not + supplied, the benchmark will fail to start + scenario_ids: The Scenario IDs that make up the Benchmark. extra_headers: Send extra headers @@ -105,6 +109,7 @@ def create( { "name": name, "metadata": metadata, + "required_environment_variables": required_environment_variables, "scenario_ids": scenario_ids, }, benchmark_create_params.BenchmarkCreateParams, @@ -158,6 +163,7 @@ def update( *, name: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, scenario_ids: Optional[List[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. @@ -175,6 +181,9 @@ def update( metadata: User defined metadata to attach to the benchmark for organization. + required_environment_variables: Environment variables required to run the benchmark. If these variables are not + supplied, the benchmark will fail to start + scenario_ids: The Scenario IDs that make up the Benchmark. extra_headers: Send extra headers @@ -195,6 +204,7 @@ def update( { "name": name, "metadata": metadata, + "required_environment_variables": required_environment_variables, "scenario_ids": scenario_ids, }, benchmark_update_params.BenchmarkUpdateParams, @@ -358,6 +368,7 @@ def start_run( benchmark_id: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, run_name: Optional[str] | NotGiven = NOT_GIVEN, + run_profile: Optional[benchmark_start_run_params.RunProfile] | 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, @@ -376,6 +387,8 @@ def start_run( run_name: Display name of the run. + run_profile: Runtime configuration to use for this benchmark run + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -393,6 +406,7 @@ def start_run( "benchmark_id": benchmark_id, "metadata": metadata, "run_name": run_name, + "run_profile": run_profile, }, benchmark_start_run_params.BenchmarkStartRunParams, ), @@ -436,6 +450,7 @@ async def create( *, name: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, scenario_ids: Optional[List[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. @@ -453,6 +468,9 @@ async def create( metadata: User defined metadata to attach to the benchmark for organization. + required_environment_variables: Environment variables required to run the benchmark. If these variables are not + supplied, the benchmark will fail to start + scenario_ids: The Scenario IDs that make up the Benchmark. extra_headers: Send extra headers @@ -471,6 +489,7 @@ async def create( { "name": name, "metadata": metadata, + "required_environment_variables": required_environment_variables, "scenario_ids": scenario_ids, }, benchmark_create_params.BenchmarkCreateParams, @@ -524,6 +543,7 @@ async def update( *, name: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, scenario_ids: Optional[List[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. @@ -541,6 +561,9 @@ async def update( metadata: User defined metadata to attach to the benchmark for organization. + required_environment_variables: Environment variables required to run the benchmark. If these variables are not + supplied, the benchmark will fail to start + scenario_ids: The Scenario IDs that make up the Benchmark. extra_headers: Send extra headers @@ -561,6 +584,7 @@ async def update( { "name": name, "metadata": metadata, + "required_environment_variables": required_environment_variables, "scenario_ids": scenario_ids, }, benchmark_update_params.BenchmarkUpdateParams, @@ -724,6 +748,7 @@ async def start_run( benchmark_id: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, run_name: Optional[str] | NotGiven = NOT_GIVEN, + run_profile: Optional[benchmark_start_run_params.RunProfile] | 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, @@ -742,6 +767,8 @@ async def start_run( run_name: Display name of the run. + run_profile: Runtime configuration to use for this benchmark run + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -759,6 +786,7 @@ async def start_run( "benchmark_id": benchmark_id, "metadata": metadata, "run_name": run_name, + "run_profile": run_profile, }, benchmark_start_run_params.BenchmarkStartRunParams, ), diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index 85ce6c2b1..d3e59ede1 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -82,7 +82,7 @@ def create( dockerfile: Dockerfile contents to be used to build the Blueprint. - file_mounts: (Optional) Map of paths and file contents to write before setup.. + file_mounts: (Optional) Map of paths and file contents to write before setup. launch_parameters: Parameters to configure your Devbox at launch time. @@ -420,7 +420,7 @@ def preview( dockerfile: Dockerfile contents to be used to build the Blueprint. - file_mounts: (Optional) Map of paths and file contents to write before setup.. + file_mounts: (Optional) Map of paths and file contents to write before setup. launch_parameters: Parameters to configure your Devbox at launch time. @@ -511,7 +511,7 @@ async def create( dockerfile: Dockerfile contents to be used to build the Blueprint. - file_mounts: (Optional) Map of paths and file contents to write before setup.. + file_mounts: (Optional) Map of paths and file contents to write before setup. launch_parameters: Parameters to configure your Devbox at launch time. @@ -849,7 +849,7 @@ async def preview( dockerfile: Dockerfile contents to be used to build the Blueprint. - file_mounts: (Optional) Map of paths and file contents to write before setup.. + file_mounts: (Optional) Map of paths and file contents to write before setup. launch_parameters: Parameters to configure your Devbox at launch time. diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index 05f255a2f..a585b21cf 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, Optional +from typing import Dict, List, Optional import httpx @@ -90,6 +90,7 @@ def create( environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, reference_output: Optional[str] | NotGiven = NOT_GIVEN, + required_environment_variables: Optional[List[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, @@ -117,6 +118,9 @@ def create( can be the result of a git diff or a sequence of command actions to apply to the environment. + required_environment_variables: Environment variables required to run the scenario. If these variables are not + provided, the scenario will fail to start. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -137,6 +141,7 @@ def create( "environment_parameters": environment_parameters, "metadata": metadata, "reference_output": reference_output, + "required_environment_variables": required_environment_variables, }, scenario_create_params.ScenarioCreateParams, ), @@ -192,6 +197,7 @@ def update( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, reference_output: Optional[str] | NotGiven = NOT_GIVEN, + required_env_vars: Optional[List[str]] | 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. @@ -219,6 +225,8 @@ def update( can be the result of a git diff or a sequence of command actions to apply to the environment. + required_env_vars: Environment variables required to run the benchmark. + scoring_contract: The scoring contract for the Scenario. extra_headers: Send extra headers @@ -242,6 +250,7 @@ def update( "metadata": metadata, "name": name, "reference_output": reference_output, + "required_env_vars": required_env_vars, "scoring_contract": scoring_contract, }, scenario_update_params.ScenarioUpdateParams, @@ -369,6 +378,7 @@ def start_run( benchmark_run_id: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, run_name: Optional[str] | NotGiven = NOT_GIVEN, + run_profile: Optional[scenario_start_run_params.RunProfile] | 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, @@ -389,6 +399,8 @@ def start_run( run_name: Display name of the run. + run_profile: Runtime configuration to use for this benchmark run + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -407,6 +419,7 @@ def start_run( "benchmark_run_id": benchmark_run_id, "metadata": metadata, "run_name": run_name, + "run_profile": run_profile, }, scenario_start_run_params.ScenarioStartRunParams, ), @@ -513,6 +526,7 @@ async def create( environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, reference_output: Optional[str] | NotGiven = NOT_GIVEN, + required_environment_variables: Optional[List[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, @@ -540,6 +554,9 @@ async def create( can be the result of a git diff or a sequence of command actions to apply to the environment. + required_environment_variables: Environment variables required to run the scenario. If these variables are not + provided, the scenario will fail to start. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -560,6 +577,7 @@ async def create( "environment_parameters": environment_parameters, "metadata": metadata, "reference_output": reference_output, + "required_environment_variables": required_environment_variables, }, scenario_create_params.ScenarioCreateParams, ), @@ -615,6 +633,7 @@ async def update( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, reference_output: Optional[str] | NotGiven = NOT_GIVEN, + required_env_vars: Optional[List[str]] | 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. @@ -642,6 +661,8 @@ async def update( can be the result of a git diff or a sequence of command actions to apply to the environment. + required_env_vars: Environment variables required to run the benchmark. + scoring_contract: The scoring contract for the Scenario. extra_headers: Send extra headers @@ -665,6 +686,7 @@ async def update( "metadata": metadata, "name": name, "reference_output": reference_output, + "required_env_vars": required_env_vars, "scoring_contract": scoring_contract, }, scenario_update_params.ScenarioUpdateParams, @@ -792,6 +814,7 @@ async def start_run( benchmark_run_id: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, run_name: Optional[str] | NotGiven = NOT_GIVEN, + run_profile: Optional[scenario_start_run_params.RunProfile] | 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, @@ -812,6 +835,8 @@ async def start_run( run_name: Display name of the run. + run_profile: Runtime configuration to use for this benchmark run + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -830,6 +855,7 @@ async def start_run( "benchmark_run_id": benchmark_run_id, "metadata": metadata, "run_name": run_name, + "run_profile": run_profile, }, scenario_start_run_params.ScenarioStartRunParams, ), diff --git a/src/runloop_api_client/types/benchmark_create_params.py b/src/runloop_api_client/types/benchmark_create_params.py index 2a46ff0df..7906b0e91 100644 --- a/src/runloop_api_client/types/benchmark_create_params.py +++ b/src/runloop_api_client/types/benchmark_create_params.py @@ -15,5 +15,11 @@ class BenchmarkCreateParams(TypedDict, total=False): metadata: Optional[Dict[str, str]] """User defined metadata to attach to the benchmark for organization.""" + required_environment_variables: Optional[List[str]] + """Environment variables required to run the benchmark. + + If these variables are not supplied, the benchmark will fail to start + """ + scenario_ids: Optional[List[str]] """The Scenario IDs that make up the Benchmark.""" diff --git a/src/runloop_api_client/types/benchmark_run_view.py b/src/runloop_api_client/types/benchmark_run_view.py index baf97cf52..aad3cd68b 100644 --- a/src/runloop_api_client/types/benchmark_run_view.py +++ b/src/runloop_api_client/types/benchmark_run_view.py @@ -27,9 +27,15 @@ class BenchmarkRunView(BaseModel): duration_ms: Optional[int] = None """The duration for the BenchmarkRun to complete.""" + environment_variables: Optional[Dict[str, str]] = None + """Environment variables used to run the benchmark.""" + name: Optional[str] = None """The name of the BenchmarkRun.""" + purpose: Optional[str] = None + """Purpose of the run.""" + score: Optional[float] = None """The final score across the BenchmarkRun, present once completed. diff --git a/src/runloop_api_client/types/benchmark_start_run_params.py b/src/runloop_api_client/types/benchmark_start_run_params.py index 9a0a70057..1a5ca1d54 100644 --- a/src/runloop_api_client/types/benchmark_start_run_params.py +++ b/src/runloop_api_client/types/benchmark_start_run_params.py @@ -3,9 +3,11 @@ from __future__ import annotations from typing import Dict, Optional -from typing_extensions import Required, TypedDict +from typing_extensions import Required, Annotated, TypedDict -__all__ = ["BenchmarkStartRunParams"] +from .._utils import PropertyInfo + +__all__ = ["BenchmarkStartRunParams", "RunProfile"] class BenchmarkStartRunParams(TypedDict, total=False): @@ -17,3 +19,14 @@ class BenchmarkStartRunParams(TypedDict, total=False): run_name: Optional[str] """Display name of the run.""" + + run_profile: Annotated[Optional[RunProfile], PropertyInfo(alias="runProfile")] + """Runtime configuration to use for this benchmark run""" + + +class RunProfile(TypedDict, total=False): + env_vars: Annotated[Optional[Dict[str, str]], PropertyInfo(alias="envVars")] + """Environment variables.""" + + purpose: Optional[str] + """Purpose of the run.""" diff --git a/src/runloop_api_client/types/benchmark_update_params.py b/src/runloop_api_client/types/benchmark_update_params.py index b3c0fd1fe..b4cb08dc2 100644 --- a/src/runloop_api_client/types/benchmark_update_params.py +++ b/src/runloop_api_client/types/benchmark_update_params.py @@ -15,5 +15,11 @@ class BenchmarkUpdateParams(TypedDict, total=False): metadata: Optional[Dict[str, str]] """User defined metadata to attach to the benchmark for organization.""" + required_environment_variables: Optional[List[str]] + """Environment variables required to run the benchmark. + + If these variables are not supplied, the benchmark will fail to start + """ + scenario_ids: Optional[List[str]] """The Scenario IDs that make up the Benchmark.""" diff --git a/src/runloop_api_client/types/benchmark_view.py b/src/runloop_api_client/types/benchmark_view.py index ceab4ff95..777aab50a 100644 --- a/src/runloop_api_client/types/benchmark_view.py +++ b/src/runloop_api_client/types/benchmark_view.py @@ -24,3 +24,9 @@ class BenchmarkView(BaseModel): is_public: Optional[bool] = None """Whether this benchmark is public.""" + + required_environment_variables: Optional[List[str]] = None + """Required environment variables used to run the benchmark. + + If any required environment are missing, the benchmark will fail to start. + """ diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index 2ce8c69bd..ee067a13d 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -20,7 +20,7 @@ class BlueprintBuildParameters(BaseModel): """Dockerfile contents to be used to build the Blueprint.""" file_mounts: Optional[Dict[str, str]] = None - """(Optional) Map of paths and file contents to write before setup..""" + """(Optional) Map of paths and file contents to write before setup.""" launch_parameters: Optional[LaunchParameters] = None """Parameters to configure your Devbox at launch time.""" diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index b851ecdd4..9fe859df3 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -22,7 +22,7 @@ class BlueprintCreateParams(TypedDict, total=False): """Dockerfile contents to be used to build the Blueprint.""" file_mounts: Optional[Dict[str, str]] - """(Optional) Map of paths and file contents to write before setup..""" + """(Optional) Map of paths and file contents to write before setup.""" launch_parameters: Optional[LaunchParameters] """Parameters to configure your Devbox at launch time.""" diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index 20d1bcd17..81aa5c29e 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -22,7 +22,7 @@ class BlueprintPreviewParams(TypedDict, total=False): """Dockerfile contents to be used to build the Blueprint.""" file_mounts: Optional[Dict[str, str]] - """(Optional) Map of paths and file contents to write before setup..""" + """(Optional) Map of paths and file contents to write before setup.""" launch_parameters: Optional[LaunchParameters] """Parameters to configure your Devbox at launch time.""" diff --git a/src/runloop_api_client/types/repository_inspection_details.py b/src/runloop_api_client/types/repository_inspection_details.py index c978586a7..8b36909e4 100644 --- a/src/runloop_api_client/types/repository_inspection_details.py +++ b/src/runloop_api_client/types/repository_inspection_details.py @@ -30,8 +30,6 @@ class RepositoryInspectionDetails(BaseModel): "inspection_pending", "inspection_failed", "inspection_success", - "image_build_success", - "image_build_failure", "inspection_user_manifest_added", ] """The status of the repository inspection.""" @@ -42,6 +40,9 @@ class RepositoryInspectionDetails(BaseModel): blueprint_name: Optional[str] = None """The blueprint name associated with this inspection if successful.""" + build_status: Optional[Literal["image_building", "image_build_success", "image_build_failure"]] = None + """The status of the linked Blueprint build.""" + user_manifest: Optional[RepositoryManifestView] = None """ User uploaded repository manifest containing container config and workspace diff --git a/src/runloop_api_client/types/scenario_create_params.py b/src/runloop_api_client/types/scenario_create_params.py index 5bd2f3d90..37438bc02 100644 --- a/src/runloop_api_client/types/scenario_create_params.py +++ b/src/runloop_api_client/types/scenario_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, Optional +from typing import Dict, List, Optional from typing_extensions import Required, TypedDict from .input_context_param import InputContextParam @@ -34,3 +34,9 @@ class ScenarioCreateParams(TypedDict, total=False): Commonly can be the result of a git diff or a sequence of command actions to apply to the environment. """ + + required_environment_variables: Optional[List[str]] + """Environment variables required to run the scenario. + + If these variables are not provided, the scenario will fail to start. + """ diff --git a/src/runloop_api_client/types/scenario_run_view.py b/src/runloop_api_client/types/scenario_run_view.py index 71c805446..1b667865d 100644 --- a/src/runloop_api_client/types/scenario_run_view.py +++ b/src/runloop_api_client/types/scenario_run_view.py @@ -31,9 +31,15 @@ class ScenarioRunView(BaseModel): duration_ms: Optional[int] = None """Duration scenario took to run.""" + environment_variables: Optional[Dict[str, str]] = None + """Environment variables used to run the Scenario.""" + name: Optional[str] = None """Optional name of ScenarioRun.""" + purpose: Optional[str] = None + """Purpose of the ScenarioRun.""" + scoring_contract_result: Optional[ScoringContractResultView] = None """The scoring result of the ScenarioRun.""" diff --git a/src/runloop_api_client/types/scenario_start_run_params.py b/src/runloop_api_client/types/scenario_start_run_params.py index f9161aa2f..3a7fb80c5 100644 --- a/src/runloop_api_client/types/scenario_start_run_params.py +++ b/src/runloop_api_client/types/scenario_start_run_params.py @@ -3,9 +3,11 @@ from __future__ import annotations from typing import Dict, Optional -from typing_extensions import Required, TypedDict +from typing_extensions import Required, Annotated, TypedDict -__all__ = ["ScenarioStartRunParams"] +from .._utils import PropertyInfo + +__all__ = ["ScenarioStartRunParams", "RunProfile"] class ScenarioStartRunParams(TypedDict, total=False): @@ -20,3 +22,14 @@ class ScenarioStartRunParams(TypedDict, total=False): run_name: Optional[str] """Display name of the run.""" + + run_profile: Annotated[Optional[RunProfile], PropertyInfo(alias="runProfile")] + """Runtime configuration to use for this benchmark run""" + + +class RunProfile(TypedDict, total=False): + env_vars: Annotated[Optional[Dict[str, str]], PropertyInfo(alias="envVars")] + """Environment variables.""" + + purpose: Optional[str] + """Purpose of the run.""" diff --git a/src/runloop_api_client/types/scenario_update_params.py b/src/runloop_api_client/types/scenario_update_params.py index 1bc7524ca..6007bf844 100644 --- a/src/runloop_api_client/types/scenario_update_params.py +++ b/src/runloop_api_client/types/scenario_update_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import Dict, Optional -from typing_extensions import TypedDict +from typing import Dict, List, Optional +from typing_extensions import Annotated, TypedDict +from .._utils import PropertyInfo from .input_context_update_param import InputContextUpdateParam from .scenario_environment_param import ScenarioEnvironmentParam from .scoring_contract_update_param import ScoringContractUpdateParam @@ -32,5 +33,8 @@ class ScenarioUpdateParams(TypedDict, total=False): apply to the environment. """ + required_env_vars: Annotated[Optional[List[str]], PropertyInfo(alias="requiredEnvVars")] + """Environment variables required to run the benchmark.""" + scoring_contract: Optional[ScoringContractUpdateParam] """The scoring contract for the Scenario.""" diff --git a/src/runloop_api_client/types/scenario_view.py b/src/runloop_api_client/types/scenario_view.py index 1a3233ab7..816fef1b5 100644 --- a/src/runloop_api_client/types/scenario_view.py +++ b/src/runloop_api_client/types/scenario_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Optional +from typing import Dict, List, Optional from .._models import BaseModel from .input_context import InputContext @@ -38,3 +38,10 @@ class ScenarioView(BaseModel): Commonly can be the result of a git diff or a sequence of command actions to apply to the environment. """ + + required_environment_variables: Optional[List[str]] = None + """Environment variables required to run the scenario. + + If any required environment variables are missing, the scenario will fail to + start. + """ diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index f2f78f3da..123ec0efc 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -37,6 +37,9 @@ class LaunchParameters(BaseModel): custom_cpu_cores: Optional[int] = None """custom resource size, number of cpu cores, must be multiple of 2.""" + custom_disk_size: Optional[int] = None + """custom disk size, number in Gi, must be a multiple of 2.""" + custom_gb_memory: Optional[int] = None """custom memory size, number in Gi, must be a multiple of 2.""" diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index d51d06d99..300c6da0d 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -38,6 +38,9 @@ class LaunchParameters(TypedDict, total=False): custom_cpu_cores: Optional[int] """custom resource size, number of cpu cores, must be multiple of 2.""" + custom_disk_size: Optional[int] + """custom disk size, number in Gi, must be a multiple of 2.""" + custom_gb_memory: Optional[int] """custom memory size, number in Gi, must be a multiple of 2.""" diff --git a/tests/api_resources/scenarios/test_scorers.py b/tests/api_resources/scenarios/test_scorers.py index 5388ad044..bff5423a9 100644 --- a/tests/api_resources/scenarios/test_scorers.py +++ b/tests/api_resources/scenarios/test_scorers.py @@ -198,6 +198,7 @@ def test_method_validate_with_all_params(self, client: Runloop) -> None: "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, + "custom_disk_size": 0, "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], @@ -428,6 +429,7 @@ async def test_method_validate_with_all_params(self, async_client: AsyncRunloop) "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, + "custom_disk_size": 0, "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], diff --git a/tests/api_resources/test_benchmarks.py b/tests/api_resources/test_benchmarks.py index 615ff95da..bbbbd0e05 100644 --- a/tests/api_resources/test_benchmarks.py +++ b/tests/api_resources/test_benchmarks.py @@ -34,6 +34,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: benchmark = client.benchmarks.create( name="name", metadata={"foo": "string"}, + required_environment_variables=["string"], scenario_ids=["string"], ) assert_matches_type(BenchmarkView, benchmark, path=["response"]) @@ -114,6 +115,7 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: id="id", name="name", metadata={"foo": "string"}, + required_environment_variables=["string"], scenario_ids=["string"], ) assert_matches_type(BenchmarkView, benchmark, path=["response"]) @@ -278,6 +280,10 @@ def test_method_start_run_with_all_params(self, client: Runloop) -> None: benchmark_id="benchmark_id", metadata={"foo": "string"}, run_name="run_name", + run_profile={ + "env_vars": {"foo": "string"}, + "purpose": "purpose", + }, ) assert_matches_type(BenchmarkRunView, benchmark, path=["response"]) @@ -323,6 +329,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - benchmark = await async_client.benchmarks.create( name="name", metadata={"foo": "string"}, + required_environment_variables=["string"], scenario_ids=["string"], ) assert_matches_type(BenchmarkView, benchmark, path=["response"]) @@ -403,6 +410,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - id="id", name="name", metadata={"foo": "string"}, + required_environment_variables=["string"], scenario_ids=["string"], ) assert_matches_type(BenchmarkView, benchmark, path=["response"]) @@ -567,6 +575,10 @@ async def test_method_start_run_with_all_params(self, async_client: AsyncRunloop benchmark_id="benchmark_id", metadata={"foo": "string"}, run_name="run_name", + run_profile={ + "env_vars": {"foo": "string"}, + "purpose": "purpose", + }, ) assert_matches_type(BenchmarkRunView, benchmark, path=["response"]) diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index f2f3f7c67..e4c611950 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -51,6 +51,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, + "custom_disk_size": 0, "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], @@ -265,6 +266,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, + "custom_disk_size": 0, "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], @@ -337,6 +339,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, + "custom_disk_size": 0, "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], @@ -551,6 +554,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, + "custom_disk_size": 0, "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index f06af54f3..e2b3c9fea 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -71,6 +71,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, + "custom_disk_size": 0, "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], @@ -1281,6 +1282,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, + "custom_disk_size": 0, "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index 170a63476..5c5ae84c8 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -74,6 +74,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, + "custom_disk_size": 0, "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], @@ -89,6 +90,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: }, metadata={"foo": "string"}, reference_output="reference_output", + required_environment_variables=["string"], ) assert_matches_type(ScenarioView, scenario, path=["response"]) @@ -203,6 +205,7 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, + "custom_disk_size": 0, "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], @@ -223,6 +226,7 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: metadata={"foo": "string"}, name="name", reference_output="reference_output", + required_env_vars=["string"], scoring_contract={ "scoring_function_parameters": [ { @@ -354,6 +358,10 @@ def test_method_start_run_with_all_params(self, client: Runloop) -> None: benchmark_run_id="benchmark_run_id", metadata={"foo": "string"}, run_name="run_name", + run_profile={ + "env_vars": {"foo": "string"}, + "purpose": "purpose", + }, ) assert_matches_type(ScenarioRunView, scenario, path=["response"]) @@ -440,6 +448,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, + "custom_disk_size": 0, "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], @@ -455,6 +464,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - }, metadata={"foo": "string"}, reference_output="reference_output", + required_environment_variables=["string"], ) assert_matches_type(ScenarioView, scenario, path=["response"]) @@ -569,6 +579,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, + "custom_disk_size": 0, "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], @@ -589,6 +600,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - metadata={"foo": "string"}, name="name", reference_output="reference_output", + required_env_vars=["string"], scoring_contract={ "scoring_function_parameters": [ { @@ -720,6 +732,10 @@ async def test_method_start_run_with_all_params(self, async_client: AsyncRunloop benchmark_run_id="benchmark_run_id", metadata={"foo": "string"}, run_name="run_name", + run_profile={ + "env_vars": {"foo": "string"}, + "purpose": "purpose", + }, ) assert_matches_type(ScenarioRunView, scenario, path=["response"]) From e3a125d0bde927ff142d1817ce4c40489a3217c0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 15 Jul 2025 02:07:37 +0000 Subject: [PATCH 3/5] feat: clean up environment call outs --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 2fd90a111..7270a5281 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,6 @@ pip install runloop_api_client[aiohttp] Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: ```python -import os import asyncio from runloop_api_client import DefaultAioHttpClient from runloop_api_client import AsyncRunloop @@ -87,7 +86,7 @@ from runloop_api_client import AsyncRunloop async def main() -> None: async with AsyncRunloop( - bearer_token=os.environ.get("RUNLOOP_API_KEY"), # This is the default and can be omitted + bearer_token="My Bearer Token", http_client=DefaultAioHttpClient(), ) as client: devbox_view = await client.devboxes.create() From 60227681f91e9eabc2b8da030fc6ef61834ce761 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 15 Jul 2025 17:55:31 +0000 Subject: [PATCH 4/5] feat(api): api update --- .stats.yml | 4 ++-- .../resources/blueprints.py | 20 +++++++++++++++++++ .../types/blueprint_build_parameters.py | 6 ++++++ .../types/blueprint_create_params.py | 6 ++++++ .../types/blueprint_preview_params.py | 6 ++++++ .../types/blueprint_view.py | 3 +++ tests/api_resources/test_blueprints.py | 4 ++++ 7 files changed, 47 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e6d3acdb6..51a944b95 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 92 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e5ce0fefdcb08eeb8d337329c89374e8a11a26dd986c75cffd93ad2756fb6ed7.yml -openapi_spec_hash: e2807c1c3955b268937eb33f345dbfe5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b3ce005070de130c689c5e82a0decb0515feedc16f6aed5b68a620c0e2c33c99.yml +openapi_spec_hash: a6d282538829a82c412ed65565d33c9c config_hash: 60681f589a9e641fdb7f19af2021a033 diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index d3e59ede1..5c527e560 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -55,6 +55,7 @@ def create( self, *, name: str, + base_blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, code_mounts: Optional[Iterable[CodeMountParameters]] | NotGiven = NOT_GIVEN, dockerfile: Optional[str] | NotGiven = NOT_GIVEN, file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, @@ -78,6 +79,9 @@ def create( Args: name: Name of the Blueprint. + base_blueprint_id: (Optional) ID of previously built blueprint to use as a base blueprint for this + build. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -103,6 +107,7 @@ def create( body=maybe_transform( { "name": name, + "base_blueprint_id": base_blueprint_id, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, @@ -395,6 +400,7 @@ def preview( self, *, name: str, + base_blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, code_mounts: Optional[Iterable[CodeMountParameters]] | NotGiven = NOT_GIVEN, dockerfile: Optional[str] | NotGiven = NOT_GIVEN, file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, @@ -416,6 +422,9 @@ def preview( Args: name: Name of the Blueprint. + base_blueprint_id: (Optional) ID of previously built blueprint to use as a base blueprint for this + build. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -441,6 +450,7 @@ def preview( body=maybe_transform( { "name": name, + "base_blueprint_id": base_blueprint_id, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, @@ -484,6 +494,7 @@ async def create( self, *, name: str, + base_blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, code_mounts: Optional[Iterable[CodeMountParameters]] | NotGiven = NOT_GIVEN, dockerfile: Optional[str] | NotGiven = NOT_GIVEN, file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, @@ -507,6 +518,9 @@ async def create( Args: name: Name of the Blueprint. + base_blueprint_id: (Optional) ID of previously built blueprint to use as a base blueprint for this + build. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -532,6 +546,7 @@ async def create( body=await async_maybe_transform( { "name": name, + "base_blueprint_id": base_blueprint_id, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, @@ -824,6 +839,7 @@ async def preview( self, *, name: str, + base_blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, code_mounts: Optional[Iterable[CodeMountParameters]] | NotGiven = NOT_GIVEN, dockerfile: Optional[str] | NotGiven = NOT_GIVEN, file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, @@ -845,6 +861,9 @@ async def preview( Args: name: Name of the Blueprint. + base_blueprint_id: (Optional) ID of previously built blueprint to use as a base blueprint for this + build. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -870,6 +889,7 @@ async def preview( body=await async_maybe_transform( { "name": name, + "base_blueprint_id": base_blueprint_id, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index ee067a13d..e3742d185 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -13,6 +13,12 @@ class BlueprintBuildParameters(BaseModel): name: str """Name of the Blueprint.""" + base_blueprint_id: Optional[str] = None + """ + (Optional) ID of previously built blueprint to use as a base blueprint for this + build. + """ + code_mounts: Optional[List[CodeMountParameters]] = None """A list of code mounts to be included in the Blueprint.""" diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index 9fe859df3..a588a6a0b 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -15,6 +15,12 @@ class BlueprintCreateParams(TypedDict, total=False): name: Required[str] """Name of the Blueprint.""" + base_blueprint_id: Optional[str] + """ + (Optional) ID of previously built blueprint to use as a base blueprint for this + build. + """ + code_mounts: Optional[Iterable[CodeMountParameters]] """A list of code mounts to be included in the Blueprint.""" diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index 81aa5c29e..d7384f54c 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -15,6 +15,12 @@ class BlueprintPreviewParams(TypedDict, total=False): name: Required[str] """Name of the Blueprint.""" + base_blueprint_id: Optional[str] + """ + (Optional) ID of previously built blueprint to use as a base blueprint for this + build. + """ + code_mounts: Optional[Iterable[CodeMountParameters]] """A list of code mounts to be included in the Blueprint.""" diff --git a/src/runloop_api_client/types/blueprint_view.py b/src/runloop_api_client/types/blueprint_view.py index a6cd9c412..971c6e636 100644 --- a/src/runloop_api_client/types/blueprint_view.py +++ b/src/runloop_api_client/types/blueprint_view.py @@ -28,5 +28,8 @@ class BlueprintView(BaseModel): status: Literal["provisioning", "building", "failed", "build_complete"] """The status of the Blueprint build.""" + base_blueprint_id: Optional[str] = None + """The ID of the base Blueprint.""" + failure_reason: Optional[Literal["out_of_memory", "out_of_disk", "build_failed"]] = None """The failure reason if the Blueprint build failed, if any.""" diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index e4c611950..25871a9e0 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -33,6 +33,7 @@ def test_method_create(self, client: Runloop) -> None: def test_method_create_with_all_params(self, client: Runloop) -> None: blueprint = client.blueprints.create( name="name", + base_blueprint_id="base_blueprint_id", code_mounts=[ { "repo_name": "repo_name", @@ -248,6 +249,7 @@ def test_method_preview(self, client: Runloop) -> None: def test_method_preview_with_all_params(self, client: Runloop) -> None: blueprint = client.blueprints.preview( name="name", + base_blueprint_id="base_blueprint_id", code_mounts=[ { "repo_name": "repo_name", @@ -321,6 +323,7 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: blueprint = await async_client.blueprints.create( name="name", + base_blueprint_id="base_blueprint_id", code_mounts=[ { "repo_name": "repo_name", @@ -536,6 +539,7 @@ async def test_method_preview(self, async_client: AsyncRunloop) -> None: async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) -> None: blueprint = await async_client.blueprints.preview( name="name", + base_blueprint_id="base_blueprint_id", code_mounts=[ { "repo_name": "repo_name", From 2ad520d8952bb0e6120a2e5f4614ded566199da3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 15 Jul 2025 17:55:51 +0000 Subject: [PATCH 5/5] release: 0.49.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 15 +++++++++++++++ pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0c2fee4ac..dd7ced1c3 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.48.2" + ".": "0.49.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e365c7ce..fa018be21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 0.49.0 (2025-07-15) + +Full Changelog: [v0.48.2...v0.49.0](https://github.com/runloopai/api-client-python/compare/v0.48.2...v0.49.0) + +### Features + +* **api:** api update ([6022768](https://github.com/runloopai/api-client-python/commit/60227681f91e9eabc2b8da030fc6ef61834ce761)) +* **api:** api update ([27c4579](https://github.com/runloopai/api-client-python/commit/27c4579ac003a2e211c5b421a1cc4714f86c6e57)) +* clean up environment call outs ([e3a125d](https://github.com/runloopai/api-client-python/commit/e3a125d0bde927ff142d1817ce4c40489a3217c0)) + + +### Bug Fixes + +* **client:** don't send Content-Type header on GET requests ([5d9b833](https://github.com/runloopai/api-client-python/commit/5d9b8330d37d53bb5c1e8393c5d9798323a0a2ca)) + ## 0.48.2 (2025-07-11) Full Changelog: [v0.48.1...v0.48.2](https://github.com/runloopai/api-client-python/compare/v0.48.1...v0.48.2) diff --git a/pyproject.toml b/pyproject.toml index 413339099..bd9708ac2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.48.2" +version = "0.49.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index a8f5b6493..5ac0de8a0 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.48.2" # x-release-please-version +__version__ = "0.49.0" # x-release-please-version