Skip to content

release: 0.1.0-alpha.18 #114

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 8 commits into from
Apr 24, 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
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
- next
branches-ignore:
- 'generated'
- 'codegen/**'
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'

jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ubuntu-latest
runs-on: ${{ github.repository == 'stainless-sdks/codex-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4

Expand Down
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.1.0-alpha.17"
".": "0.1.0-alpha.18"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
configured_endpoints: 43
openapi_spec_hash: 62b629dd5b215c1eebc57e0c6039eea7
openapi_spec_hash: b7beefbd38b4fcdd191cdb81a18a023b
config_hash: 5e459b33c53ffa6e554087a779bdb790
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## 0.1.0-alpha.18 (2025-04-24)

Full Changelog: [v0.1.0-alpha.17...v0.1.0-alpha.18](https://github.com/cleanlab/codex-python/compare/v0.1.0-alpha.17...v0.1.0-alpha.18)

### Features

* **api:** api update ([78f5727](https://github.com/cleanlab/codex-python/commit/78f5727b34cd29fcae1fb3c84f78f202fb68cd8a))
* **api:** api update ([1472e6f](https://github.com/cleanlab/codex-python/commit/1472e6f83fe738c01e33e34d9eb6c7ec906d4ecc))


### Chores

* broadly detect json family of content-type headers ([60ee0e2](https://github.com/cleanlab/codex-python/commit/60ee0e200415cc8c7d7a3ef21812ec0fd02c6821))
* **ci:** only use depot for staging repos ([3f37e38](https://github.com/cleanlab/codex-python/commit/3f37e38210905a7bccc49779dfe2fef065b49ccd))
* **internal:** codegen related update ([a19531f](https://github.com/cleanlab/codex-python/commit/a19531fbd2d2c81db2ff7accdd4599ecc82995ce))
* **internal:** minor formatting changes ([379fc4f](https://github.com/cleanlab/codex-python/commit/379fc4f90da430329961e70bdbcf06e09330585d))
* **internal:** version bump ([376681a](https://github.com/cleanlab/codex-python/commit/376681a8589de089ec2db967f23ee19a68f997e5))

## 0.1.0-alpha.17 (2025-04-23)

Full Changelog: [v0.1.0-alpha.16...v0.1.0-alpha.17](https://github.com/cleanlab/codex-python/compare/v0.1.0-alpha.16...v0.1.0-alpha.17)
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 = "codex-sdk"
version = "0.1.0-alpha.17"
version = "0.1.0-alpha.18"
description = "Internal SDK used within cleanlab-codex package. Refer to https://pypi.org/project/cleanlab-codex/ instead."
dynamic = ["readme"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion src/codex/_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
# split is required to handle cases where additional information is included
# in the response, e.g. application/json; charset=utf-8
content_type, *_ = response.headers.get("content-type", "*").split(";")
if content_type != "application/json":
if not content_type.endswith("json"):
if is_basemodel(cast_to):
try:
data = response.json()
Expand Down
2 changes: 1 addition & 1 deletion src/codex/_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__ = "codex"
__version__ = "0.1.0-alpha.17" # x-release-please-version
__version__ = "0.1.0-alpha.18" # x-release-please-version
28 changes: 26 additions & 2 deletions src/codex/resources/projects/clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,21 @@ def list(
*,
eval_issue_types: List[Literal["hallucination", "search_failure", "unhelpful", "difficult_query"]]
| NotGiven = NOT_GIVEN,
instruction_adherence_failure: Optional[Literal["html_format", "content_structure"]] | NotGiven = NOT_GIVEN,
limit: int | NotGiven = NOT_GIVEN,
offset: int | NotGiven = NOT_GIVEN,
order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
sort: Optional[Literal["created_at", "answered_at", "cluster_frequency_count", "custom_rank", "eval_score"]]
sort: Optional[
Literal[
"created_at",
"answered_at",
"cluster_frequency_count",
"custom_rank",
"eval_score",
"html_format_score",
"content_structure_score",
]
]
| NotGiven = NOT_GIVEN,
states: List[Literal["unanswered", "draft", "published", "published_with_draft"]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -90,6 +101,7 @@ def list(
query=maybe_transform(
{
"eval_issue_types": eval_issue_types,
"instruction_adherence_failure": instruction_adherence_failure,
"limit": limit,
"offset": offset,
"order": order,
Expand Down Expand Up @@ -167,10 +179,21 @@ def list(
*,
eval_issue_types: List[Literal["hallucination", "search_failure", "unhelpful", "difficult_query"]]
| NotGiven = NOT_GIVEN,
instruction_adherence_failure: Optional[Literal["html_format", "content_structure"]] | NotGiven = NOT_GIVEN,
limit: int | NotGiven = NOT_GIVEN,
offset: int | NotGiven = NOT_GIVEN,
order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
sort: Optional[Literal["created_at", "answered_at", "cluster_frequency_count", "custom_rank", "eval_score"]]
sort: Optional[
Literal[
"created_at",
"answered_at",
"cluster_frequency_count",
"custom_rank",
"eval_score",
"html_format_score",
"content_structure_score",
]
]
| NotGiven = NOT_GIVEN,
states: List[Literal["unanswered", "draft", "published", "published_with_draft"]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -205,6 +228,7 @@ def list(
query=maybe_transform(
{
"eval_issue_types": eval_issue_types,
"instruction_adherence_failure": instruction_adherence_failure,
"limit": limit,
"offset": offset,
"order": order,
Expand Down
8 changes: 0 additions & 8 deletions src/codex/resources/projects/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ def retrieve_analytics(
project_id: str,
*,
end: int | NotGiven = NOT_GIVEN,
sme_limit: int | NotGiven = NOT_GIVEN,
start: int | 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.
Expand All @@ -380,8 +379,6 @@ def retrieve_analytics(
Args:
end: End timestamp in seconds since epoch

sme_limit: Limit the number of top SME contributors to return.

start: Start timestamp in seconds since epoch

extra_headers: Send extra headers
Expand All @@ -404,7 +401,6 @@ def retrieve_analytics(
query=maybe_transform(
{
"end": end,
"sme_limit": sme_limit,
"start": start,
},
project_retrieve_analytics_params.ProjectRetrieveAnalyticsParams,
Expand Down Expand Up @@ -723,7 +719,6 @@ async def retrieve_analytics(
project_id: str,
*,
end: int | NotGiven = NOT_GIVEN,
sme_limit: int | NotGiven = NOT_GIVEN,
start: int | 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.
Expand All @@ -738,8 +733,6 @@ async def retrieve_analytics(
Args:
end: End timestamp in seconds since epoch

sme_limit: Limit the number of top SME contributors to return.

start: Start timestamp in seconds since epoch

extra_headers: Send extra headers
Expand All @@ -762,7 +755,6 @@ async def retrieve_analytics(
query=await async_maybe_transform(
{
"end": end,
"sme_limit": sme_limit,
"start": start,
},
project_retrieve_analytics_params.ProjectRetrieveAnalyticsParams,
Expand Down
1 change: 0 additions & 1 deletion src/codex/types/health_check_response.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.


from .._models import BaseModel

__all__ = ["HealthCheckResponse"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.


from ...._models import BaseModel

__all__ = ["OrganizationBillingSetupIntent"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.


from ..._models import BaseModel

__all__ = ["OrganizationBillingInvoicesSchema"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.


from ..._models import BaseModel

__all__ = ["OrganizationBillingUsageSchema"]
Expand Down
3 changes: 0 additions & 3 deletions src/codex/types/project_retrieve_analytics_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@ class ProjectRetrieveAnalyticsParams(TypedDict, total=False):
end: int
"""End timestamp in seconds since epoch"""

sme_limit: int
"""Limit the number of top SME contributors to return."""

start: int
"""Start timestamp in seconds since epoch"""
11 changes: 10 additions & 1 deletion src/codex/types/project_retrieve_analytics_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@
"AnswersPublished",
"AnswersPublishedAnswersByAuthor",
"BadResponses",
"BadResponsesResponsesByType",
"Queries",
]


class AnswersPublishedAnswersByAuthor(BaseModel):
answers_published: int

email: str

name: str

user_id: str
Expand All @@ -25,8 +28,14 @@ class AnswersPublished(BaseModel):
answers_by_author: List[AnswersPublishedAnswersByAuthor]


class BadResponsesResponsesByType(BaseModel):
num_prevented: int

total: int


class BadResponses(BaseModel):
responses_by_type: Dict[str, int]
responses_by_type: Dict[str, BadResponsesResponsesByType]

total: int

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.


from ..._models import BaseModel

__all__ = ["AccessKeyRetrieveProjectIDResponse"]
Expand Down
14 changes: 13 additions & 1 deletion src/codex/types/projects/cluster_list_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,24 @@
class ClusterListParams(TypedDict, total=False):
eval_issue_types: List[Literal["hallucination", "search_failure", "unhelpful", "difficult_query"]]

instruction_adherence_failure: Optional[Literal["html_format", "content_structure"]]

limit: int

offset: int

order: Literal["asc", "desc"]

sort: Optional[Literal["created_at", "answered_at", "cluster_frequency_count", "custom_rank", "eval_score"]]
sort: Optional[
Literal[
"created_at",
"answered_at",
"cluster_frequency_count",
"custom_rank",
"eval_score",
"html_format_score",
"content_structure_score",
]
]

states: List[Literal["unanswered", "draft", "published", "published_with_draft"]]
44 changes: 44 additions & 0 deletions src/codex/types/projects/cluster_list_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,31 @@
__all__ = [
"ClusterListResponse",
"ManagedMetadata",
"ManagedMetadataContentStructureScores",
"ManagedMetadataContextSufficiency",
"ManagedMetadataHTMLFormatScores",
"ManagedMetadataQueryEaseCustomized",
"ManagedMetadataResponseHelpfulness",
"ManagedMetadataTrustworthiness",
]


class ManagedMetadataContentStructureScores(BaseModel):
average: Optional[float] = None
"""The average of all scores."""

latest: Optional[float] = None
"""The most recent score."""

max: Optional[float] = None
"""The maximum score."""

min: Optional[float] = None
"""The minimum score."""

scores: Optional[List[float]] = None


class ManagedMetadataContextSufficiency(BaseModel):
average: Optional[float] = None
"""The average of all scores."""
Expand All @@ -32,6 +50,22 @@ class ManagedMetadataContextSufficiency(BaseModel):
scores: Optional[List[float]] = None


class ManagedMetadataHTMLFormatScores(BaseModel):
average: Optional[float] = None
"""The average of all scores."""

latest: Optional[float] = None
"""The most recent score."""

max: Optional[float] = None
"""The maximum score."""

min: Optional[float] = None
"""The minimum score."""

scores: Optional[List[float]] = None


class ManagedMetadataQueryEaseCustomized(BaseModel):
average: Optional[float] = None
"""The average of all scores."""
Expand Down Expand Up @@ -93,13 +127,19 @@ class ManagedMetadata(BaseModel):
latest_location: Optional[str] = None
"""The most recent location string."""

content_structure_scores: Optional[ManagedMetadataContentStructureScores] = None
"""Holds a list of scores and computes aggregate statistics."""

context_sufficiency: Optional[ManagedMetadataContextSufficiency] = None
"""Holds a list of scores and computes aggregate statistics."""

contexts: Optional[List[str]] = None

entry_points: Optional[List[str]] = None

html_format_scores: Optional[ManagedMetadataHTMLFormatScores] = None
"""Holds a list of scores and computes aggregate statistics."""

llm_responses: Optional[List[str]] = None

locations: Optional[List[str]] = None
Expand Down Expand Up @@ -136,6 +176,8 @@ class ClusterListResponse(BaseModel):

client_query_metadata: Optional[List[object]] = None

content_structure_score: Optional[float] = None

draft_answer: Optional[str] = None

draft_answer_last_edited: Optional[datetime] = None
Expand All @@ -147,4 +189,6 @@ class ClusterListResponse(BaseModel):
frequency_count: Optional[int] = None
"""number of times the entry matched for a /query request"""

html_format_score: Optional[float] = None

representative_entry_id: Optional[str] = None
Loading