Skip to content

Commit 88d4578

Browse files
release: 0.1.0-alpha.18 (#114)
* chore(internal): version bump * feat(api): api update * chore(internal): minor formatting changes * chore(internal): codegen related update * chore(ci): only use depot for staging repos * chore: broadly detect json family of content-type headers * feat(api): api update * release: 0.1.0-alpha.18 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent f0412ef commit 88d4578

23 files changed

+209
-35
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
name: CI
22
on:
33
push:
4-
branches:
5-
- main
6-
pull_request:
7-
branches:
8-
- main
9-
- next
4+
branches-ignore:
5+
- 'generated'
6+
- 'codegen/**'
7+
- 'integrated/**'
8+
- 'stl-preview-head/**'
9+
- 'stl-preview-base/**'
1010

1111
jobs:
1212
lint:
1313
timeout-minutes: 10
1414
name: lint
15-
runs-on: ubuntu-latest
15+
runs-on: ${{ github.repository == 'stainless-sdks/codex-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
1616
steps:
1717
- uses: actions/checkout@v4
1818

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0-alpha.17"
2+
".": "0.1.0-alpha.18"
33
}

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
configured_endpoints: 43
2-
openapi_spec_hash: 62b629dd5b215c1eebc57e0c6039eea7
2+
openapi_spec_hash: b7beefbd38b4fcdd191cdb81a18a023b
33
config_hash: 5e459b33c53ffa6e554087a779bdb790

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# Changelog
22

3+
## 0.1.0-alpha.18 (2025-04-24)
4+
5+
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)
6+
7+
### Features
8+
9+
* **api:** api update ([78f5727](https://github.com/cleanlab/codex-python/commit/78f5727b34cd29fcae1fb3c84f78f202fb68cd8a))
10+
* **api:** api update ([1472e6f](https://github.com/cleanlab/codex-python/commit/1472e6f83fe738c01e33e34d9eb6c7ec906d4ecc))
11+
12+
13+
### Chores
14+
15+
* broadly detect json family of content-type headers ([60ee0e2](https://github.com/cleanlab/codex-python/commit/60ee0e200415cc8c7d7a3ef21812ec0fd02c6821))
16+
* **ci:** only use depot for staging repos ([3f37e38](https://github.com/cleanlab/codex-python/commit/3f37e38210905a7bccc49779dfe2fef065b49ccd))
17+
* **internal:** codegen related update ([a19531f](https://github.com/cleanlab/codex-python/commit/a19531fbd2d2c81db2ff7accdd4599ecc82995ce))
18+
* **internal:** minor formatting changes ([379fc4f](https://github.com/cleanlab/codex-python/commit/379fc4f90da430329961e70bdbcf06e09330585d))
19+
* **internal:** version bump ([376681a](https://github.com/cleanlab/codex-python/commit/376681a8589de089ec2db967f23ee19a68f997e5))
20+
321
## 0.1.0-alpha.17 (2025-04-23)
422

523
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)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "codex-sdk"
3-
version = "0.1.0-alpha.17"
3+
version = "0.1.0-alpha.18"
44
description = "Internal SDK used within cleanlab-codex package. Refer to https://pypi.org/project/cleanlab-codex/ instead."
55
dynamic = ["readme"]
66
license = "MIT"

src/codex/_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
233233
# split is required to handle cases where additional information is included
234234
# in the response, e.g. application/json; charset=utf-8
235235
content_type, *_ = response.headers.get("content-type", "*").split(";")
236-
if content_type != "application/json":
236+
if not content_type.endswith("json"):
237237
if is_basemodel(cast_to):
238238
try:
239239
data = response.json()

src/codex/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "codex"
4-
__version__ = "0.1.0-alpha.17" # x-release-please-version
4+
__version__ = "0.1.0-alpha.18" # x-release-please-version

src/codex/resources/projects/clusters.py

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,21 @@ def list(
5252
*,
5353
eval_issue_types: List[Literal["hallucination", "search_failure", "unhelpful", "difficult_query"]]
5454
| NotGiven = NOT_GIVEN,
55+
instruction_adherence_failure: Optional[Literal["html_format", "content_structure"]] | NotGiven = NOT_GIVEN,
5556
limit: int | NotGiven = NOT_GIVEN,
5657
offset: int | NotGiven = NOT_GIVEN,
5758
order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
58-
sort: Optional[Literal["created_at", "answered_at", "cluster_frequency_count", "custom_rank", "eval_score"]]
59+
sort: Optional[
60+
Literal[
61+
"created_at",
62+
"answered_at",
63+
"cluster_frequency_count",
64+
"custom_rank",
65+
"eval_score",
66+
"html_format_score",
67+
"content_structure_score",
68+
]
69+
]
5970
| NotGiven = NOT_GIVEN,
6071
states: List[Literal["unanswered", "draft", "published", "published_with_draft"]] | NotGiven = NOT_GIVEN,
6172
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -90,6 +101,7 @@ def list(
90101
query=maybe_transform(
91102
{
92103
"eval_issue_types": eval_issue_types,
104+
"instruction_adherence_failure": instruction_adherence_failure,
93105
"limit": limit,
94106
"offset": offset,
95107
"order": order,
@@ -167,10 +179,21 @@ def list(
167179
*,
168180
eval_issue_types: List[Literal["hallucination", "search_failure", "unhelpful", "difficult_query"]]
169181
| NotGiven = NOT_GIVEN,
182+
instruction_adherence_failure: Optional[Literal["html_format", "content_structure"]] | NotGiven = NOT_GIVEN,
170183
limit: int | NotGiven = NOT_GIVEN,
171184
offset: int | NotGiven = NOT_GIVEN,
172185
order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
173-
sort: Optional[Literal["created_at", "answered_at", "cluster_frequency_count", "custom_rank", "eval_score"]]
186+
sort: Optional[
187+
Literal[
188+
"created_at",
189+
"answered_at",
190+
"cluster_frequency_count",
191+
"custom_rank",
192+
"eval_score",
193+
"html_format_score",
194+
"content_structure_score",
195+
]
196+
]
174197
| NotGiven = NOT_GIVEN,
175198
states: List[Literal["unanswered", "draft", "published", "published_with_draft"]] | NotGiven = NOT_GIVEN,
176199
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -205,6 +228,7 @@ def list(
205228
query=maybe_transform(
206229
{
207230
"eval_issue_types": eval_issue_types,
231+
"instruction_adherence_failure": instruction_adherence_failure,
208232
"limit": limit,
209233
"offset": offset,
210234
"order": order,

src/codex/resources/projects/projects.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,6 @@ def retrieve_analytics(
365365
project_id: str,
366366
*,
367367
end: int | NotGiven = NOT_GIVEN,
368-
sme_limit: int | NotGiven = NOT_GIVEN,
369368
start: int | NotGiven = NOT_GIVEN,
370369
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
371370
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -380,8 +379,6 @@ def retrieve_analytics(
380379
Args:
381380
end: End timestamp in seconds since epoch
382381
383-
sme_limit: Limit the number of top SME contributors to return.
384-
385382
start: Start timestamp in seconds since epoch
386383
387384
extra_headers: Send extra headers
@@ -404,7 +401,6 @@ def retrieve_analytics(
404401
query=maybe_transform(
405402
{
406403
"end": end,
407-
"sme_limit": sme_limit,
408404
"start": start,
409405
},
410406
project_retrieve_analytics_params.ProjectRetrieveAnalyticsParams,
@@ -723,7 +719,6 @@ async def retrieve_analytics(
723719
project_id: str,
724720
*,
725721
end: int | NotGiven = NOT_GIVEN,
726-
sme_limit: int | NotGiven = NOT_GIVEN,
727722
start: int | NotGiven = NOT_GIVEN,
728723
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
729724
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -738,8 +733,6 @@ async def retrieve_analytics(
738733
Args:
739734
end: End timestamp in seconds since epoch
740735
741-
sme_limit: Limit the number of top SME contributors to return.
742-
743736
start: Start timestamp in seconds since epoch
744737
745738
extra_headers: Send extra headers
@@ -762,7 +755,6 @@ async def retrieve_analytics(
762755
query=await async_maybe_transform(
763756
{
764757
"end": end,
765-
"sme_limit": sme_limit,
766758
"start": start,
767759
},
768760
project_retrieve_analytics_params.ProjectRetrieveAnalyticsParams,

src/codex/types/health_check_response.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
43
from .._models import BaseModel
54

65
__all__ = ["HealthCheckResponse"]

src/codex/types/organizations/billing/organization_billing_setup_intent.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
43
from ...._models import BaseModel
54

65
__all__ = ["OrganizationBillingSetupIntent"]

src/codex/types/organizations/organization_billing_invoices_schema.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
43
from ..._models import BaseModel
54

65
__all__ = ["OrganizationBillingInvoicesSchema"]

src/codex/types/organizations/organization_billing_usage_schema.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
43
from ..._models import BaseModel
54

65
__all__ = ["OrganizationBillingUsageSchema"]

src/codex/types/project_retrieve_analytics_params.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,5 @@ class ProjectRetrieveAnalyticsParams(TypedDict, total=False):
1111
end: int
1212
"""End timestamp in seconds since epoch"""
1313

14-
sme_limit: int
15-
"""Limit the number of top SME contributors to return."""
16-
1714
start: int
1815
"""Start timestamp in seconds since epoch"""

src/codex/types/project_retrieve_analytics_response.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@
99
"AnswersPublished",
1010
"AnswersPublishedAnswersByAuthor",
1111
"BadResponses",
12+
"BadResponsesResponsesByType",
1213
"Queries",
1314
]
1415

1516

1617
class AnswersPublishedAnswersByAuthor(BaseModel):
1718
answers_published: int
1819

20+
email: str
21+
1922
name: str
2023

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

2730

31+
class BadResponsesResponsesByType(BaseModel):
32+
num_prevented: int
33+
34+
total: int
35+
36+
2837
class BadResponses(BaseModel):
29-
responses_by_type: Dict[str, int]
38+
responses_by_type: Dict[str, BadResponsesResponsesByType]
3039

3140
total: int
3241

src/codex/types/projects/access_key_retrieve_project_id_response.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
43
from ..._models import BaseModel
54

65
__all__ = ["AccessKeyRetrieveProjectIDResponse"]

src/codex/types/projects/cluster_list_params.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,24 @@
1111
class ClusterListParams(TypedDict, total=False):
1212
eval_issue_types: List[Literal["hallucination", "search_failure", "unhelpful", "difficult_query"]]
1313

14+
instruction_adherence_failure: Optional[Literal["html_format", "content_structure"]]
15+
1416
limit: int
1517

1618
offset: int
1719

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

20-
sort: Optional[Literal["created_at", "answered_at", "cluster_frequency_count", "custom_rank", "eval_score"]]
22+
sort: Optional[
23+
Literal[
24+
"created_at",
25+
"answered_at",
26+
"cluster_frequency_count",
27+
"custom_rank",
28+
"eval_score",
29+
"html_format_score",
30+
"content_structure_score",
31+
]
32+
]
2133

2234
states: List[Literal["unanswered", "draft", "published", "published_with_draft"]]

src/codex/types/projects/cluster_list_response.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,31 @@
99
__all__ = [
1010
"ClusterListResponse",
1111
"ManagedMetadata",
12+
"ManagedMetadataContentStructureScores",
1213
"ManagedMetadataContextSufficiency",
14+
"ManagedMetadataHTMLFormatScores",
1315
"ManagedMetadataQueryEaseCustomized",
1416
"ManagedMetadataResponseHelpfulness",
1517
"ManagedMetadataTrustworthiness",
1618
]
1719

1820

21+
class ManagedMetadataContentStructureScores(BaseModel):
22+
average: Optional[float] = None
23+
"""The average of all scores."""
24+
25+
latest: Optional[float] = None
26+
"""The most recent score."""
27+
28+
max: Optional[float] = None
29+
"""The maximum score."""
30+
31+
min: Optional[float] = None
32+
"""The minimum score."""
33+
34+
scores: Optional[List[float]] = None
35+
36+
1937
class ManagedMetadataContextSufficiency(BaseModel):
2038
average: Optional[float] = None
2139
"""The average of all scores."""
@@ -32,6 +50,22 @@ class ManagedMetadataContextSufficiency(BaseModel):
3250
scores: Optional[List[float]] = None
3351

3452

53+
class ManagedMetadataHTMLFormatScores(BaseModel):
54+
average: Optional[float] = None
55+
"""The average of all scores."""
56+
57+
latest: Optional[float] = None
58+
"""The most recent score."""
59+
60+
max: Optional[float] = None
61+
"""The maximum score."""
62+
63+
min: Optional[float] = None
64+
"""The minimum score."""
65+
66+
scores: Optional[List[float]] = None
67+
68+
3569
class ManagedMetadataQueryEaseCustomized(BaseModel):
3670
average: Optional[float] = None
3771
"""The average of all scores."""
@@ -93,13 +127,19 @@ class ManagedMetadata(BaseModel):
93127
latest_location: Optional[str] = None
94128
"""The most recent location string."""
95129

130+
content_structure_scores: Optional[ManagedMetadataContentStructureScores] = None
131+
"""Holds a list of scores and computes aggregate statistics."""
132+
96133
context_sufficiency: Optional[ManagedMetadataContextSufficiency] = None
97134
"""Holds a list of scores and computes aggregate statistics."""
98135

99136
contexts: Optional[List[str]] = None
100137

101138
entry_points: Optional[List[str]] = None
102139

140+
html_format_scores: Optional[ManagedMetadataHTMLFormatScores] = None
141+
"""Holds a list of scores and computes aggregate statistics."""
142+
103143
llm_responses: Optional[List[str]] = None
104144

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

137177
client_query_metadata: Optional[List[object]] = None
138178

179+
content_structure_score: Optional[float] = None
180+
139181
draft_answer: Optional[str] = None
140182

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

192+
html_format_score: Optional[float] = None
193+
150194
representative_entry_id: Optional[str] = None

0 commit comments

Comments
 (0)