Skip to content
Closed
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
10 changes: 7 additions & 3 deletions src/runloop_api_client/sdk/async_.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)

Expand Down
9 changes: 7 additions & 2 deletions src/runloop_api_client/sdk/async_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
]
8 changes: 4 additions & 4 deletions src/runloop_api_client/sdk/async_benchmark_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand All @@ -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,
)
Expand All @@ -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,
)
Expand All @@ -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,
)
Expand Down
9 changes: 7 additions & 2 deletions src/runloop_api_client/sdk/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
]
8 changes: 4 additions & 4 deletions src/runloop_api_client/sdk/benchmark_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand All @@ -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,
)
Expand All @@ -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,
)
Expand All @@ -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,
)
Expand Down
10 changes: 7 additions & 3 deletions src/runloop_api_client/sdk/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)

Expand Down
Loading