Skip to content
Open
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 @@
{
".": "3.7.0"
".": "3.8.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 31
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/scorecard%2Fscorecard-01e01e74f4fc1b108f0446c197c6d187bb79560234a33671ea2b3f33eb52954a.yml
openapi_spec_hash: f34c136d551da1fcce69b811557c48a2
config_hash: 0b3b3dc41414f1a27e10168e44aeccd9
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/scorecard%2Fscorecard-fa56fcaa5a33929c01761841ded012553aee4881c47b78329c5f2007f64a3817.yml
openapi_spec_hash: 5c630f7b73df78a0fe9c0cd984f73c53
config_hash: 68b2970b9abfab636bc4fe68812940b5
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 3.8.0 (2026-03-10)

Full Changelog: [v3.7.0...v3.8.0](https://github.com/scorecard-ai/scorecard-python/compare/v3.7.0...v3.8.0)

### Features

* **api:** api update ([4d66da2](https://github.com/scorecard-ai/scorecard-python/commit/4d66da28832c634c8dc3fb0c78a1bb101db0f62b))

## 3.7.0 (2026-03-10)

Full Changelog: [v3.6.0...v3.7.0](https://github.com/scorecard-ai/scorecard-python/compare/v3.6.0...v3.7.0)
Expand Down
18 changes: 15 additions & 3 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,21 @@ from scorecard_ai.types import Record, RecordListResponse, RecordDeleteResponse

Methods:

- <code title="post /runs/{runId}/records">client.records.<a href="./src/scorecard_ai/resources/records.py">create</a>(run_id, \*\*<a href="src/scorecard_ai/types/record_create_params.py">params</a>) -> <a href="./src/scorecard_ai/types/record.py">Record</a></code>
- <code title="get /runs/{runId}/records">client.records.<a href="./src/scorecard_ai/resources/records.py">list</a>(run_id, \*\*<a href="src/scorecard_ai/types/record_list_params.py">params</a>) -> <a href="./src/scorecard_ai/types/record_list_response.py">SyncPaginatedResponse[RecordListResponse]</a></code>
- <code title="delete /records/{recordId}">client.records.<a href="./src/scorecard_ai/resources/records.py">delete</a>(record_id) -> <a href="./src/scorecard_ai/types/record_delete_response.py">RecordDeleteResponse</a></code>
- <code title="post /runs/{runId}/records">client.records.<a href="./src/scorecard_ai/resources/records/records.py">create</a>(run_id, \*\*<a href="src/scorecard_ai/types/record_create_params.py">params</a>) -> <a href="./src/scorecard_ai/types/record.py">Record</a></code>
- <code title="get /runs/{runId}/records">client.records.<a href="./src/scorecard_ai/resources/records/records.py">list</a>(run_id, \*\*<a href="src/scorecard_ai/types/record_list_params.py">params</a>) -> <a href="./src/scorecard_ai/types/record_list_response.py">SyncPaginatedResponse[RecordListResponse]</a></code>
- <code title="delete /records/{recordId}">client.records.<a href="./src/scorecard_ai/resources/records/records.py">delete</a>(record_id) -> <a href="./src/scorecard_ai/types/record_delete_response.py">RecordDeleteResponse</a></code>

## Annotations

Types:

```python
from scorecard_ai.types.records import Annotation, AnnotationListResponse
```

Methods:

- <code title="get /records/{recordId}/annotations">client.records.annotations.<a href="./src/scorecard_ai/resources/records/annotations.py">list</a>(record_id) -> <a href="./src/scorecard_ai/types/records/annotation_list_response.py">AnnotationListResponse</a></code>

# Scores

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "scorecard-ai"
version = "3.7.0"
version = "3.8.0"
description = "The official Python library for the Scorecard API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/scorecard_ai/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
from .resources.runs import RunsResource, AsyncRunsResource
from .resources.scores import ScoresResource, AsyncScoresResource
from .resources.metrics import MetricsResource, AsyncMetricsResource
from .resources.records import RecordsResource, AsyncRecordsResource
from .resources.projects import ProjectsResource, AsyncProjectsResource
from .resources.testsets import TestsetsResource, AsyncTestsetsResource
from .resources.testcases import TestcasesResource, AsyncTestcasesResource
from .resources.records.records import RecordsResource, AsyncRecordsResource
from .resources.systems.systems import SystemsResource, AsyncSystemsResource

__all__ = [
Expand Down
2 changes: 1 addition & 1 deletion src/scorecard_ai/_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__ = "scorecard_ai"
__version__ = "3.7.0" # x-release-please-version
__version__ = "3.8.0" # x-release-please-version
33 changes: 33 additions & 0 deletions src/scorecard_ai/resources/records/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from .records import (
RecordsResource,
AsyncRecordsResource,
RecordsResourceWithRawResponse,
AsyncRecordsResourceWithRawResponse,
RecordsResourceWithStreamingResponse,
AsyncRecordsResourceWithStreamingResponse,
)
from .annotations import (
AnnotationsResource,
AsyncAnnotationsResource,
AnnotationsResourceWithRawResponse,
AsyncAnnotationsResourceWithRawResponse,
AnnotationsResourceWithStreamingResponse,
AsyncAnnotationsResourceWithStreamingResponse,
)

__all__ = [
"AnnotationsResource",
"AsyncAnnotationsResource",
"AnnotationsResourceWithRawResponse",
"AsyncAnnotationsResourceWithRawResponse",
"AnnotationsResourceWithStreamingResponse",
"AsyncAnnotationsResourceWithStreamingResponse",
"RecordsResource",
"AsyncRecordsResource",
"RecordsResourceWithRawResponse",
"AsyncRecordsResourceWithRawResponse",
"RecordsResourceWithStreamingResponse",
"AsyncRecordsResourceWithStreamingResponse",
]
163 changes: 163 additions & 0 deletions src/scorecard_ai/resources/records/annotations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

import httpx

from ..._types import Body, Query, Headers, NotGiven, not_given
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from ..._base_client import make_request_options
from ...types.records.annotation_list_response import AnnotationListResponse

__all__ = ["AnnotationsResource", "AsyncAnnotationsResource"]


class AnnotationsResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> AnnotationsResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/scorecard-ai/scorecard-python#accessing-raw-response-data-eg-headers
"""
return AnnotationsResourceWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> AnnotationsResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.

For more information, see https://www.github.com/scorecard-ai/scorecard-python#with_streaming_response
"""
return AnnotationsResourceWithStreamingResponse(self)

def list(
self,
record_id: str,
*,
# 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AnnotationListResponse:
"""
List all annotations (ratings and comments) for a specific Record.

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
if not record_id:
raise ValueError(f"Expected a non-empty value for `record_id` but received {record_id!r}")
return self._get(
f"/records/{record_id}/annotations",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=AnnotationListResponse,
)


class AsyncAnnotationsResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncAnnotationsResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/scorecard-ai/scorecard-python#accessing-raw-response-data-eg-headers
"""
return AsyncAnnotationsResourceWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> AsyncAnnotationsResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.

For more information, see https://www.github.com/scorecard-ai/scorecard-python#with_streaming_response
"""
return AsyncAnnotationsResourceWithStreamingResponse(self)

async def list(
self,
record_id: str,
*,
# 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AnnotationListResponse:
"""
List all annotations (ratings and comments) for a specific Record.

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
if not record_id:
raise ValueError(f"Expected a non-empty value for `record_id` but received {record_id!r}")
return await self._get(
f"/records/{record_id}/annotations",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=AnnotationListResponse,
)


class AnnotationsResourceWithRawResponse:
def __init__(self, annotations: AnnotationsResource) -> None:
self._annotations = annotations

self.list = to_raw_response_wrapper(
annotations.list,
)


class AsyncAnnotationsResourceWithRawResponse:
def __init__(self, annotations: AsyncAnnotationsResource) -> None:
self._annotations = annotations

self.list = async_to_raw_response_wrapper(
annotations.list,
)


class AnnotationsResourceWithStreamingResponse:
def __init__(self, annotations: AnnotationsResource) -> None:
self._annotations = annotations

self.list = to_streamed_response_wrapper(
annotations.list,
)


class AsyncAnnotationsResourceWithStreamingResponse:
def __init__(self, annotations: AsyncAnnotationsResource) -> None:
self._annotations = annotations

self.list = async_to_streamed_response_wrapper(
annotations.list,
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,39 @@

import httpx

from ..types import record_list_params, record_create_params
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
from ...types import record_list_params, record_create_params
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from ..pagination import SyncPaginatedResponse, AsyncPaginatedResponse
from .._base_client import AsyncPaginator, make_request_options
from ..types.record import Record
from ..types.record_list_response import RecordListResponse
from ..types.record_delete_response import RecordDeleteResponse
from .annotations import (
AnnotationsResource,
AsyncAnnotationsResource,
AnnotationsResourceWithRawResponse,
AsyncAnnotationsResourceWithRawResponse,
AnnotationsResourceWithStreamingResponse,
AsyncAnnotationsResourceWithStreamingResponse,
)
from ...pagination import SyncPaginatedResponse, AsyncPaginatedResponse
from ..._base_client import AsyncPaginator, make_request_options
from ...types.record import Record
from ...types.record_list_response import RecordListResponse
from ...types.record_delete_response import RecordDeleteResponse

__all__ = ["RecordsResource", "AsyncRecordsResource"]


class RecordsResource(SyncAPIResource):
@cached_property
def annotations(self) -> AnnotationsResource:
return AnnotationsResource(self._client)

@cached_property
def with_raw_response(self) -> RecordsResourceWithRawResponse:
"""
Expand Down Expand Up @@ -194,6 +206,10 @@ def delete(


class AsyncRecordsResource(AsyncAPIResource):
@cached_property
def annotations(self) -> AsyncAnnotationsResource:
return AsyncAnnotationsResource(self._client)

@cached_property
def with_raw_response(self) -> AsyncRecordsResourceWithRawResponse:
"""
Expand Down Expand Up @@ -374,6 +390,10 @@ def __init__(self, records: RecordsResource) -> None:
records.delete,
)

@cached_property
def annotations(self) -> AnnotationsResourceWithRawResponse:
return AnnotationsResourceWithRawResponse(self._records.annotations)


class AsyncRecordsResourceWithRawResponse:
def __init__(self, records: AsyncRecordsResource) -> None:
Expand All @@ -389,6 +409,10 @@ def __init__(self, records: AsyncRecordsResource) -> None:
records.delete,
)

@cached_property
def annotations(self) -> AsyncAnnotationsResourceWithRawResponse:
return AsyncAnnotationsResourceWithRawResponse(self._records.annotations)


class RecordsResourceWithStreamingResponse:
def __init__(self, records: RecordsResource) -> None:
Expand All @@ -404,6 +428,10 @@ def __init__(self, records: RecordsResource) -> None:
records.delete,
)

@cached_property
def annotations(self) -> AnnotationsResourceWithStreamingResponse:
return AnnotationsResourceWithStreamingResponse(self._records.annotations)


class AsyncRecordsResourceWithStreamingResponse:
def __init__(self, records: AsyncRecordsResource) -> None:
Expand All @@ -418,3 +446,7 @@ def __init__(self, records: AsyncRecordsResource) -> None:
self.delete = async_to_streamed_response_wrapper(
records.delete,
)

@cached_property
def annotations(self) -> AsyncAnnotationsResourceWithStreamingResponse:
return AsyncAnnotationsResourceWithStreamingResponse(self._records.annotations)
6 changes: 6 additions & 0 deletions src/scorecard_ai/types/records/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from .annotation import Annotation as Annotation
from .annotation_list_response import AnnotationListResponse as AnnotationListResponse
Loading