diff --git a/src/runloop_api_client/sdk/async_.py b/src/runloop_api_client/sdk/async_.py index 6e6e828ff..27e5506e7 100644 --- a/src/runloop_api_client/sdk/async_.py +++ b/src/runloop_api_client/sdk/async_.py @@ -3,7 +3,7 @@ from __future__ import annotations import asyncio -from typing import Dict, Mapping, Optional +from typing import Dict, Mapping, Optional, cast from pathlib import Path from datetime import timedelta from typing_extensions import Unpack @@ -43,6 +43,7 @@ from .async_scenario_builder import AsyncScenarioBuilder from ..types.object_create_params import ContentType from ..types.shared_params.agent_source import Git, Npm, Pip, Object +from ..types import BlueprintView class AsyncDevboxOps: @@ -264,8 +265,11 @@ async def create( :return: Wrapper bound to the finished blueprint :rtype: AsyncBlueprint """ - blueprint = await self._client.blueprints.create_and_await_build_complete( - **params, + blueprint = cast( + BlueprintView, + await self._client.blueprints.create_and_await_build_complete( + **params, # type: ignore[call-arg] + ), ) return AsyncBlueprint(self._client, blueprint.id) diff --git a/src/runloop_api_client/sdk/async_benchmark.py b/src/runloop_api_client/sdk/async_benchmark.py index 63443e37b..2e012df25 100644 --- a/src/runloop_api_client/sdk/async_benchmark.py +++ b/src/runloop_api_client/sdk/async_benchmark.py @@ -107,6 +107,8 @@ async def start_run( benchmark_id=self._id, **params, ) + if run_view.benchmark_id is None: + raise ValueError("benchmark_id is required but was None in the response") return AsyncBenchmarkRun(self._client, run_view.id, run_view.benchmark_id) async def add_scenarios( @@ -157,8 +159,11 @@ async def list_runs( :return: List of async benchmark runs :rtype: List[AsyncBenchmarkRun] """ - page = await self._client.benchmarks.runs.list( + page = await self._client.benchmark_runs.list( benchmark_id=self._id, **params, ) - return [AsyncBenchmarkRun(self._client, run.id, run.benchmark_id) for run in page.runs] + return [ + AsyncBenchmarkRun(self._client, run.id, run.benchmark_id or self._id) + for run in page.runs + ] diff --git a/src/runloop_api_client/sdk/async_benchmark_run.py b/src/runloop_api_client/sdk/async_benchmark_run.py index f498d1408..58b2da40d 100644 --- a/src/runloop_api_client/sdk/async_benchmark_run.py +++ b/src/runloop_api_client/sdk/async_benchmark_run.py @@ -71,7 +71,7 @@ async def get_info( :return: Current benchmark run state info :rtype: BenchmarkRunView """ - return await self._client.benchmarks.runs.retrieve( + return await self._client.benchmark_runs.retrieve( self._id, **options, ) @@ -88,7 +88,7 @@ async def cancel( :return: Updated benchmark run state :rtype: BenchmarkRunView """ - return await self._client.benchmarks.runs.cancel( + return await self._client.benchmark_runs.cancel( self._id, **options, ) @@ -105,7 +105,7 @@ async def complete( :return: Completed benchmark run state :rtype: BenchmarkRunView """ - return await self._client.benchmarks.runs.complete( + return await self._client.benchmark_runs.complete( self._id, **options, ) @@ -120,7 +120,7 @@ async def list_scenario_runs( :return: List of async scenario run objects :rtype: List[AsyncScenarioRun] """ - page = await self._client.benchmarks.runs.list_scenario_runs( + page = await self._client.benchmark_runs.list_scenario_runs( self._id, **params, ) diff --git a/src/runloop_api_client/sdk/benchmark.py b/src/runloop_api_client/sdk/benchmark.py index 7e8ed826d..49e2d01b5 100644 --- a/src/runloop_api_client/sdk/benchmark.py +++ b/src/runloop_api_client/sdk/benchmark.py @@ -107,6 +107,8 @@ def start_run( benchmark_id=self._id, **params, ) + if run_view.benchmark_id is None: + raise ValueError("benchmark_id is required but was None in the response") return BenchmarkRun(self._client, run_view.id, run_view.benchmark_id) def add_scenarios( @@ -157,8 +159,11 @@ def list_runs( :return: List of benchmark runs :rtype: List[BenchmarkRun] """ - page = self._client.benchmarks.runs.list( + page = self._client.benchmark_runs.list( benchmark_id=self._id, **params, ) - return [BenchmarkRun(self._client, run.id, run.benchmark_id) for run in page.runs] + return [ + BenchmarkRun(self._client, run.id, run.benchmark_id or self._id) + for run in page.runs + ] diff --git a/src/runloop_api_client/sdk/benchmark_run.py b/src/runloop_api_client/sdk/benchmark_run.py index 10da7ba05..080e90148 100644 --- a/src/runloop_api_client/sdk/benchmark_run.py +++ b/src/runloop_api_client/sdk/benchmark_run.py @@ -71,7 +71,7 @@ def get_info( :return: Current benchmark run state info :rtype: BenchmarkRunView """ - return self._client.benchmarks.runs.retrieve( + return self._client.benchmark_runs.retrieve( self._id, **options, ) @@ -88,7 +88,7 @@ def cancel( :return: Updated benchmark run state :rtype: BenchmarkRunView """ - return self._client.benchmarks.runs.cancel( + return self._client.benchmark_runs.cancel( self._id, **options, ) @@ -105,7 +105,7 @@ def complete( :return: Completed benchmark run state :rtype: BenchmarkRunView """ - return self._client.benchmarks.runs.complete( + return self._client.benchmark_runs.complete( self._id, **options, ) @@ -120,7 +120,7 @@ def list_scenario_runs( :return: List of scenario run objects :rtype: List[ScenarioRun] """ - page = self._client.benchmarks.runs.list_scenario_runs( + page = self._client.benchmark_runs.list_scenario_runs( self._id, **params, ) diff --git a/src/runloop_api_client/sdk/sync.py b/src/runloop_api_client/sdk/sync.py index d83eb5a6e..747caed0f 100644 --- a/src/runloop_api_client/sdk/sync.py +++ b/src/runloop_api_client/sdk/sync.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, Mapping, Optional +from typing import Dict, Mapping, Optional, cast from pathlib import Path from datetime import timedelta from typing_extensions import Unpack @@ -42,6 +42,7 @@ from ..lib.context_loader import TarFilter, build_directory_tar from ..types.object_create_params import ContentType from ..types.shared_params.agent_source import Git, Npm, Pip, Object +from ..types import BlueprintView class DevboxOps: @@ -262,8 +263,11 @@ def create( :return: Wrapper bound to the finished blueprint :rtype: Blueprint """ - blueprint = self._client.blueprints.create_and_await_build_complete( - **params, + blueprint = cast( + BlueprintView, + self._client.blueprints.create_and_await_build_complete( + **params, # type: ignore[call-arg] + ), ) return Blueprint(self._client, blueprint.id)