Skip to content

release: 0.20.0 #523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 4, 2025
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.19.0"
".": "0.20.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 68
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ad83f8f9f6d60b6ef468111bde705c475948948951ff9ec80c54c2df76ff5596.yml
configured_endpoints: 73
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-00234fd425f75dd0ac33cdfd2b9e806a7fa29638ffc4ed4b91d5042a17ff5cfd.yml
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 0.20.0 (2025-02-04)

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

### Features

* add helpers for blueprint and scenario run creation ([b00a7c1](https://github.com/runloopai/api-client-python/commit/b00a7c1b935db7c919d79ed10c135bf5ed2a9b4f))
* **api:** api update ([#526](https://github.com/runloopai/api-client-python/issues/526)) ([be26ed7](https://github.com/runloopai/api-client-python/commit/be26ed7c82017d9bff67c9920c078808f8a675e3))


### Chores

* **internal:** bummp ruff dependency ([#525](https://github.com/runloopai/api-client-python/issues/525)) ([84051db](https://github.com/runloopai/api-client-python/commit/84051db83a6347f28ee4891be52f5eee7fa9d02a))
* **internal:** change default timeout to an int ([#524](https://github.com/runloopai/api-client-python/issues/524)) ([a15ccaa](https://github.com/runloopai/api-client-python/commit/a15ccaa45f69331d57be0144a16ba3b1df387245))

## 0.19.0 (2025-02-03)

Full Changelog: [v0.18.0...v0.19.0](https://github.com/runloopai/api-client-python/compare/v0.18.0...v0.19.0)
Expand Down
22 changes: 22 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,28 @@ Methods:
- <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}/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

Types:

```python
from runloop_api_client.types.scenarios import (
ScorerCreateResponse,
ScorerRetrieveResponse,
ScorerUpdateResponse,
ScorerListResponse,
ScorerValidateResponse,
)
```

Methods:

- <code title="post /v1/scenarios/scorers">client.scenarios.scorers.<a href="./src/runloop_api_client/resources/scenarios/scorers.py">create</a>(\*\*<a href="src/runloop_api_client/types/scenarios/scorer_create_params.py">params</a>) -> <a href="./src/runloop_api_client/types/scenarios/scorer_create_response.py">ScorerCreateResponse</a></code>
- <code title="get /v1/scenarios/scorers/{id}">client.scenarios.scorers.<a href="./src/runloop_api_client/resources/scenarios/scorers.py">retrieve</a>(id) -> <a href="./src/runloop_api_client/types/scenarios/scorer_retrieve_response.py">ScorerRetrieveResponse</a></code>
- <code title="post /v1/scenarios/scorers/{id}">client.scenarios.scorers.<a href="./src/runloop_api_client/resources/scenarios/scorers.py">update</a>(id, \*\*<a href="src/runloop_api_client/types/scenarios/scorer_update_params.py">params</a>) -> <a href="./src/runloop_api_client/types/scenarios/scorer_update_response.py">ScorerUpdateResponse</a></code>
- <code title="get /v1/scenarios/scorers">client.scenarios.scorers.<a href="./src/runloop_api_client/resources/scenarios/scorers.py">list</a>(\*\*<a href="src/runloop_api_client/types/scenarios/scorer_list_params.py">params</a>) -> <a href="./src/runloop_api_client/types/scenarios/scorer_list_response.py">SyncScenarioScorersCursorIDPage[ScorerListResponse]</a></code>
- <code title="post /v1/scenarios/scorers/{id}/validate">client.scenarios.scorers.<a href="./src/runloop_api_client/resources/scenarios/scorers.py">validate</a>(id, \*\*<a href="src/runloop_api_client/types/scenarios/scorer_validate_params.py">params</a>) -> <a href="./src/runloop_api_client/types/scenarios/scorer_validate_response.py">ScorerValidateResponse</a></code>

# Repositories

Types:
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "runloop_api_client"
version = "0.19.0"
version = "0.20.0"
description = "The official Python library for the runloop API"
dynamic = ["readme"]
license = "MIT"
Expand Down Expand Up @@ -177,7 +177,7 @@ select = [
"T201",
"T203",
# misuse of typing.TYPE_CHECKING
"TCH004",
"TC004",
# import rules
"TID251",
]
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pytz==2023.3.post1
# via dirty-equals
respx==0.22.0
rich==13.7.1
ruff==0.6.9
ruff==0.9.4
setuptools==68.2.2
# via nodeenv
six==1.16.0
Expand Down
4 changes: 2 additions & 2 deletions scripts/utils/ruffen-docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _md_match(match: Match[str]) -> str:
with _collect_error(match):
code = format_code_block(code)
code = textwrap.indent(code, match["indent"])
return f'{match["before"]}{code}{match["after"]}'
return f"{match['before']}{code}{match['after']}"

def _pycon_match(match: Match[str]) -> str:
code = ""
Expand Down Expand Up @@ -97,7 +97,7 @@ def finish_fragment() -> None:
def _md_pycon_match(match: Match[str]) -> str:
code = _pycon_match(match)
code = textwrap.indent(code, match["indent"])
return f'{match["before"]}{code}{match["after"]}'
return f"{match['before']}{code}{match['after']}"

src = MD_RE.sub(_md_match, src)
src = MD_PYCON_RE.sub(_md_pycon_match, src)
Expand Down
2 changes: 1 addition & 1 deletion src/runloop_api_client/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
OVERRIDE_CAST_TO_HEADER = "____stainless_override_cast_to"

# default timeout is 1 minute
DEFAULT_TIMEOUT = httpx.Timeout(timeout=60.0, connect=5.0)
DEFAULT_TIMEOUT = httpx.Timeout(timeout=60, connect=5.0)
DEFAULT_MAX_RETRIES = 2
DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20)

Expand Down
2 changes: 1 addition & 1 deletion src/runloop_api_client/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def to_json(
@override
def __str__(self) -> str:
# mypy complains about an invalid self arg
return f'{self.__repr_name__()}({self.__repr_str__(", ")})' # type: ignore[misc]
return f"{self.__repr_name__()}({self.__repr_str__(', ')})" # type: ignore[misc]

# Override the 'construct' method in a way that supports recursive parsing without validation.
# Based on https://github.com/samuelcolvin/pydantic/issues/1168#issuecomment-817742836.
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.19.0" # x-release-please-version
__version__ = "0.20.0" # x-release-please-version
59 changes: 59 additions & 0 deletions src/runloop_api_client/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
"AsyncScenariosCursorIDPage",
"SyncScenarioRunsCursorIDPage",
"AsyncScenarioRunsCursorIDPage",
"SyncScenarioScorersCursorIDPage",
"AsyncScenarioScorersCursorIDPage",
]

_T = TypeVar("_T")
Expand Down Expand Up @@ -67,6 +69,11 @@ class ScenarioRunsCursorIDPageItem(Protocol):
id: str


@runtime_checkable
class ScenarioScorersCursorIDPageItem(Protocol):
id: str


class SyncBlueprintsCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]):
blueprints: List[_T]
has_more: Optional[bool] = None
Expand Down Expand Up @@ -481,3 +488,55 @@ def next_page_info(self) -> Optional[PageInfo]:
return None

return PageInfo(params={"starting_after": item.id})


class SyncScenarioScorersCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]):
scorers: List[_T]
has_more: Optional[bool] = None
total_count: Optional[int] = None

@override
def _get_page_items(self) -> List[_T]:
scorers = self.scorers
if not scorers:
return []
return scorers

@override
def next_page_info(self) -> Optional[PageInfo]:
scorers = self.scorers
if not scorers:
return None

item = cast(Any, scorers[-1])
if not isinstance(item, ScenarioScorersCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison]
# TODO emit warning log
return None

return PageInfo(params={"starting_after": item.id})


class AsyncScenarioScorersCursorIDPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
scorers: List[_T]
has_more: Optional[bool] = None
total_count: Optional[int] = None

@override
def _get_page_items(self) -> List[_T]:
scorers = self.scorers
if not scorers:
return []
return scorers

@override
def next_page_info(self) -> Optional[PageInfo]:
scorers = self.scorers
if not scorers:
return None

item = cast(Any, scorers[-1])
if not isinstance(item, ScenarioScorersCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison]
# TODO emit warning log
return None

return PageInfo(params={"starting_after": item.id})
14 changes: 14 additions & 0 deletions src/runloop_api_client/resources/scenarios/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
RunsResourceWithStreamingResponse,
AsyncRunsResourceWithStreamingResponse,
)
from .scorers import (
ScorersResource,
AsyncScorersResource,
ScorersResourceWithRawResponse,
AsyncScorersResourceWithRawResponse,
ScorersResourceWithStreamingResponse,
AsyncScorersResourceWithStreamingResponse,
)
from .scenarios import (
ScenariosResource,
AsyncScenariosResource,
Expand All @@ -24,6 +32,12 @@
"AsyncRunsResourceWithRawResponse",
"RunsResourceWithStreamingResponse",
"AsyncRunsResourceWithStreamingResponse",
"ScorersResource",
"AsyncScorersResource",
"ScorersResourceWithRawResponse",
"AsyncScorersResourceWithRawResponse",
"ScorersResourceWithStreamingResponse",
"AsyncScorersResourceWithStreamingResponse",
"ScenariosResource",
"AsyncScenariosResource",
"ScenariosResourceWithRawResponse",
Expand Down
32 changes: 32 additions & 0 deletions src/runloop_api_client/resources/scenarios/scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
scenario_start_run_params,
scenario_list_public_params,
)
from .scorers import (
ScorersResource,
AsyncScorersResource,
ScorersResourceWithRawResponse,
AsyncScorersResourceWithRawResponse,
ScorersResourceWithStreamingResponse,
AsyncScorersResourceWithStreamingResponse,
)
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._utils import (
maybe_transform,
Expand Down Expand Up @@ -50,6 +58,10 @@ class ScenariosResource(SyncAPIResource):
def runs(self) -> RunsResource:
return RunsResource(self._client)

@cached_property
def scorers(self) -> ScorersResource:
return ScorersResource(self._client)

@cached_property
def with_raw_response(self) -> ScenariosResourceWithRawResponse:
"""
Expand Down Expand Up @@ -381,6 +393,10 @@ class AsyncScenariosResource(AsyncAPIResource):
def runs(self) -> AsyncRunsResource:
return AsyncRunsResource(self._client)

@cached_property
def scorers(self) -> AsyncScorersResource:
return AsyncScorersResource(self._client)

@cached_property
def with_raw_response(self) -> AsyncScenariosResourceWithRawResponse:
"""
Expand Down Expand Up @@ -708,6 +724,10 @@ def __init__(self, scenarios: ScenariosResource) -> None:
def runs(self) -> RunsResourceWithRawResponse:
return RunsResourceWithRawResponse(self._scenarios.runs)

@cached_property
def scorers(self) -> ScorersResourceWithRawResponse:
return ScorersResourceWithRawResponse(self._scenarios.scorers)


class AsyncScenariosResourceWithRawResponse:
def __init__(self, scenarios: AsyncScenariosResource) -> None:
Expand All @@ -733,6 +753,10 @@ def __init__(self, scenarios: AsyncScenariosResource) -> None:
def runs(self) -> AsyncRunsResourceWithRawResponse:
return AsyncRunsResourceWithRawResponse(self._scenarios.runs)

@cached_property
def scorers(self) -> AsyncScorersResourceWithRawResponse:
return AsyncScorersResourceWithRawResponse(self._scenarios.scorers)


class ScenariosResourceWithStreamingResponse:
def __init__(self, scenarios: ScenariosResource) -> None:
Expand All @@ -758,6 +782,10 @@ def __init__(self, scenarios: ScenariosResource) -> None:
def runs(self) -> RunsResourceWithStreamingResponse:
return RunsResourceWithStreamingResponse(self._scenarios.runs)

@cached_property
def scorers(self) -> ScorersResourceWithStreamingResponse:
return ScorersResourceWithStreamingResponse(self._scenarios.scorers)


class AsyncScenariosResourceWithStreamingResponse:
def __init__(self, scenarios: AsyncScenariosResource) -> None:
Expand All @@ -782,3 +810,7 @@ def __init__(self, scenarios: AsyncScenariosResource) -> None:
@cached_property
def runs(self) -> AsyncRunsResourceWithStreamingResponse:
return AsyncRunsResourceWithStreamingResponse(self._scenarios.runs)

@cached_property
def scorers(self) -> AsyncScorersResourceWithStreamingResponse:
return AsyncScorersResourceWithStreamingResponse(self._scenarios.scorers)
Loading
Loading