From 7664372659f1b7c63ee4e93ca4e2873402030733 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 23:35:58 +0000 Subject: [PATCH 1/2] feat(api): api update (#512) --- .stats.yml | 2 +- .../resources/repositories.py | 30 +++++++++++++++++-- .../resources/scenarios/runs.py | 4 +-- .../types/benchmark_run_view.py | 6 ++++ .../types/repository_create_params.py | 4 +++ .../types/repository_list_params.py | 6 ++++ .../types/scenario_run_view.py | 3 ++ .../types/scenarios/run_list_params.py | 2 +- tests/api_resources/scenarios/test_runs.py | 4 +-- tests/api_resources/test_repositories.py | 22 ++++++++++++++ 10 files changed, 75 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index c981a627f..c25634d0b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 66 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-5d84d2732400f196ddbe4b4e7c0e98b3f02bab9ce2ed750e69d399d898e496d1.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bf4f1f241c2a3a425dc7d12b7b7e415133bb696682d1a285836d1a36b7bd6160.yml diff --git a/src/runloop_api_client/resources/repositories.py b/src/runloop_api_client/resources/repositories.py index 115ed94a4..5ebca0116 100644 --- a/src/runloop_api_client/resources/repositories.py +++ b/src/runloop_api_client/resources/repositories.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing import Optional + import httpx from ..types import repository_list_params, repository_create_params @@ -51,6 +53,7 @@ def create( *, name: str, owner: str, + blueprint_id: Optional[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, @@ -68,6 +71,8 @@ def create( owner: Account owner of the repository. + blueprint_id: ID of blueprint to use as base for resulting RepositoryVersion blueprint. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -84,6 +89,7 @@ def create( { "name": name, "owner": owner, + "blueprint_id": blueprint_id, }, repository_create_params.RepositoryCreateParams, ), @@ -110,7 +116,7 @@ def retrieve( ) -> RepositoryConnectionView: """ Get Repository Connection details including latest inspection status and - generated respository insights. + generated repository insights. Args: extra_headers: Send extra headers @@ -135,6 +141,8 @@ def list( self, *, limit: int | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + owner: str | 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. @@ -149,6 +157,10 @@ def list( Args: limit: The limit of items to return. Default is 20. + name: Filter by repository name + + owner: Filter by repository owner + starting_after: Load the next page of data starting after the item with the given ID. extra_headers: Send extra headers @@ -170,6 +182,8 @@ def list( query=maybe_transform( { "limit": limit, + "name": name, + "owner": owner, "starting_after": starting_after, }, repository_list_params.RepositoryListParams, @@ -279,6 +293,7 @@ async def create( *, name: str, owner: str, + blueprint_id: Optional[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, @@ -296,6 +311,8 @@ async def create( owner: Account owner of the repository. + blueprint_id: ID of blueprint to use as base for resulting RepositoryVersion blueprint. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -312,6 +329,7 @@ async def create( { "name": name, "owner": owner, + "blueprint_id": blueprint_id, }, repository_create_params.RepositoryCreateParams, ), @@ -338,7 +356,7 @@ async def retrieve( ) -> RepositoryConnectionView: """ Get Repository Connection details including latest inspection status and - generated respository insights. + generated repository insights. Args: extra_headers: Send extra headers @@ -363,6 +381,8 @@ def list( self, *, limit: int | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + owner: str | 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. @@ -377,6 +397,10 @@ def list( Args: limit: The limit of items to return. Default is 20. + name: Filter by repository name + + owner: Filter by repository owner + starting_after: Load the next page of data starting after the item with the given ID. extra_headers: Send extra headers @@ -398,6 +422,8 @@ def list( query=maybe_transform( { "limit": limit, + "name": name, + "owner": owner, "starting_after": starting_after, }, repository_list_params.RepositoryListParams, diff --git a/src/runloop_api_client/resources/scenarios/runs.py b/src/runloop_api_client/resources/scenarios/runs.py index 2226123ae..53549a00a 100644 --- a/src/runloop_api_client/resources/scenarios/runs.py +++ b/src/runloop_api_client/resources/scenarios/runs.py @@ -82,7 +82,7 @@ def list( self, *, limit: int | NotGiven = NOT_GIVEN, - scenario_id: bool | NotGiven = NOT_GIVEN, + scenario_id: str | 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. @@ -266,7 +266,7 @@ async def list( self, *, limit: int | NotGiven = NOT_GIVEN, - scenario_id: bool | NotGiven = NOT_GIVEN, + scenario_id: str | 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. diff --git a/src/runloop_api_client/types/benchmark_run_view.py b/src/runloop_api_client/types/benchmark_run_view.py index bce32b0ce..cf46d855c 100644 --- a/src/runloop_api_client/types/benchmark_run_view.py +++ b/src/runloop_api_client/types/benchmark_run_view.py @@ -15,9 +15,15 @@ class BenchmarkRunView(BaseModel): benchmark_id: str """The ID of the Benchmark.""" + start_time_ms: int + """The time the benchmark run execution started (Unix timestamp milliseconds).""" + state: Literal["running", "completed"] """The state of the BenchmarkRun.""" + duration_ms: Optional[int] = None + """The duration for the BenchmarkRun to complete.""" + name: Optional[str] = None """The name of the BenchmarkRun.""" diff --git a/src/runloop_api_client/types/repository_create_params.py b/src/runloop_api_client/types/repository_create_params.py index 06864a447..78e31175e 100644 --- a/src/runloop_api_client/types/repository_create_params.py +++ b/src/runloop_api_client/types/repository_create_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Required, TypedDict __all__ = ["RepositoryCreateParams"] @@ -13,3 +14,6 @@ class RepositoryCreateParams(TypedDict, total=False): owner: Required[str] """Account owner of the repository.""" + + blueprint_id: Optional[str] + """ID of blueprint to use as base for resulting RepositoryVersion blueprint.""" diff --git a/src/runloop_api_client/types/repository_list_params.py b/src/runloop_api_client/types/repository_list_params.py index 363c4ec2b..91fd7f352 100644 --- a/src/runloop_api_client/types/repository_list_params.py +++ b/src/runloop_api_client/types/repository_list_params.py @@ -11,5 +11,11 @@ class RepositoryListParams(TypedDict, total=False): limit: int """The limit of items to return. Default is 20.""" + name: str + """Filter by repository name""" + + owner: str + """Filter by repository owner""" + starting_after: str """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/scenario_run_view.py b/src/runloop_api_client/types/scenario_run_view.py index 33da17227..89d64dfd1 100644 --- a/src/runloop_api_client/types/scenario_run_view.py +++ b/src/runloop_api_client/types/scenario_run_view.py @@ -33,3 +33,6 @@ class ScenarioRunView(BaseModel): scoring_contract_result: Optional[ScoringContractResultView] = None """The input context for the Scenario.""" + + start_time_ms: Optional[int] = None + """The time that the scenario started""" diff --git a/src/runloop_api_client/types/scenarios/run_list_params.py b/src/runloop_api_client/types/scenarios/run_list_params.py index 86a3b1efd..17a2715c4 100644 --- a/src/runloop_api_client/types/scenarios/run_list_params.py +++ b/src/runloop_api_client/types/scenarios/run_list_params.py @@ -11,7 +11,7 @@ class RunListParams(TypedDict, total=False): limit: int """The limit of items to return. Default is 20.""" - scenario_id: bool + scenario_id: str """Filter runs associated to Scenario given ID""" starting_after: str diff --git a/tests/api_resources/scenarios/test_runs.py b/tests/api_resources/scenarios/test_runs.py index 8a83be2ce..d375cb45e 100644 --- a/tests/api_resources/scenarios/test_runs.py +++ b/tests/api_resources/scenarios/test_runs.py @@ -64,7 +64,7 @@ def test_method_list(self, client: Runloop) -> None: def test_method_list_with_all_params(self, client: Runloop) -> None: run = client.scenarios.runs.list( limit=0, - scenario_id=True, + scenario_id="scenario_id", starting_after="starting_after", ) assert_matches_type(ScenarioRunListView, run, path=["response"]) @@ -216,7 +216,7 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None: async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: run = await async_client.scenarios.runs.list( limit=0, - scenario_id=True, + scenario_id="scenario_id", starting_after="starting_after", ) assert_matches_type(ScenarioRunListView, run, path=["response"]) diff --git a/tests/api_resources/test_repositories.py b/tests/api_resources/test_repositories.py index 6107fe5f9..47e0798c8 100644 --- a/tests/api_resources/test_repositories.py +++ b/tests/api_resources/test_repositories.py @@ -29,6 +29,15 @@ def test_method_create(self, client: Runloop) -> None: ) assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + @parametrize + def test_method_create_with_all_params(self, client: Runloop) -> None: + repository = client.repositories.create( + name="name", + owner="owner", + blueprint_id="blueprint_id", + ) + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + @parametrize def test_raw_response_create(self, client: Runloop) -> None: response = client.repositories.with_raw_response.create( @@ -102,6 +111,8 @@ def test_method_list(self, client: Runloop) -> None: def test_method_list_with_all_params(self, client: Runloop) -> None: repository = client.repositories.list( limit=0, + name="name", + owner="owner", starting_after="starting_after", ) assert_matches_type(SyncRepositoriesCursorIDPage[RepositoryConnectionView], repository, path=["response"]) @@ -214,6 +225,15 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: ) assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: + repository = await async_client.repositories.create( + name="name", + owner="owner", + blueprint_id="blueprint_id", + ) + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + @parametrize async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: response = await async_client.repositories.with_raw_response.create( @@ -287,6 +307,8 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None: async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: repository = await async_client.repositories.list( limit=0, + name="name", + owner="owner", starting_after="starting_after", ) assert_matches_type(AsyncRepositoriesCursorIDPage[RepositoryConnectionView], repository, path=["response"]) From 6f44b092ac133d7f5b4757296f3458ea9fdc21c8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 23:36:21 +0000 Subject: [PATCH 2/2] release: 0.17.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b4e9013ba..6db19b956 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.16.0" + ".": "0.17.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e1cf569dd..b6aff999a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.17.0 (2025-01-31) + +Full Changelog: [v0.16.0...v0.17.0](https://github.com/runloopai/api-client-python/compare/v0.16.0...v0.17.0) + +### Features + +* **api:** api update ([#512](https://github.com/runloopai/api-client-python/issues/512)) ([7664372](https://github.com/runloopai/api-client-python/commit/7664372659f1b7c63ee4e93ca4e2873402030733)) + ## 0.16.0 (2025-01-31) Full Changelog: [v0.15.0...v0.16.0](https://github.com/runloopai/api-client-python/compare/v0.15.0...v0.16.0) diff --git a/pyproject.toml b/pyproject.toml index f02034ee6..5e7d26ec3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.16.0" +version = "0.17.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 e302279f7..d2dd301f2 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.16.0" # x-release-please-version +__version__ = "0.17.0" # x-release-please-version