Skip to content

Commit 904a1b9

Browse files
authored
Merge pull request #131 from cleanlab/release-please--branches--main--changes--next
release: 0.1.0-alpha.32
2 parents 310ab65 + 10fff82 commit 904a1b9

27 files changed

+1616
-454
lines changed

.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.31"
2+
".": "0.1.0-alpha.32"
33
}

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
configured_endpoints: 56
2-
openapi_spec_hash: ef178c3ce0c31f0785212f1138ee8eee
2+
openapi_spec_hash: 80b1836ebec22fc0dc25d5d8efe62a50
33
config_hash: 9e0ed146f9f6e6d1884a4c0589d6f1c2

CHANGELOG.md

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

3+
## 0.1.0-alpha.32 (2025-11-05)
4+
5+
Full Changelog: [v0.1.0-alpha.31...v0.1.0-alpha.32](https://github.com/cleanlab/codex-python/compare/v0.1.0-alpha.31...v0.1.0-alpha.32)
6+
7+
### Features
8+
9+
* **api:** api update ([e8c8537](https://github.com/cleanlab/codex-python/commit/e8c853706394437e0738d53594a7d635df224117))
10+
11+
12+
### Bug Fixes
13+
14+
* **client:** close streams without requiring full consumption ([b5a889c](https://github.com/cleanlab/codex-python/commit/b5a889c4bdd788df03f310e30d6a3ee304193f53))
15+
16+
17+
### Chores
18+
19+
* **internal/tests:** avoid race condition with implicit client cleanup ([8f06048](https://github.com/cleanlab/codex-python/commit/8f06048416bf39cdad0290b23fd8d930be869223))
20+
* **internal:** grammar fix (it's -> its) ([9d4a431](https://github.com/cleanlab/codex-python/commit/9d4a4318fac51055f63af10ba451b26bc6c1f179))
21+
322
## 0.1.0-alpha.31 (2025-10-28)
423

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

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.31"
3+
version = "0.1.0-alpha.32"
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/_streaming.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,8 @@ def __stream__(self) -> Iterator[_T]:
5757
for sse in iterator:
5858
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
5959

60-
# Ensure the entire stream is consumed
61-
for _sse in iterator:
62-
...
60+
# As we might not fully consume the response stream, we need to close it explicitly
61+
response.close()
6362

6463
def __enter__(self) -> Self:
6564
return self
@@ -121,9 +120,8 @@ async def __stream__(self) -> AsyncIterator[_T]:
121120
async for sse in iterator:
122121
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
123122

124-
# Ensure the entire stream is consumed
125-
async for _sse in iterator:
126-
...
123+
# As we might not fully consume the response stream, we need to close it explicitly
124+
await response.aclose()
127125

128126
async def __aenter__(self) -> Self:
129127
return self

src/codex/_utils/_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]:
133133
# Type safe methods for narrowing types with TypeVars.
134134
# The default narrowing for isinstance(obj, dict) is dict[unknown, unknown],
135135
# however this cause Pyright to rightfully report errors. As we know we don't
136-
# care about the contained types we can safely use `object` in it's place.
136+
# care about the contained types we can safely use `object` in its place.
137137
#
138138
# There are two separate functions defined, `is_*` and `is_*_t` for different use cases.
139139
# `is_*` is for when you're dealing with an unknown input

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.31" # x-release-please-version
4+
__version__ = "0.1.0-alpha.32" # x-release-please-version

src/codex/resources/projects/evals.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def create(
5454
name: str,
5555
context_identifier: Optional[str] | Omit = omit,
5656
enabled: bool | Omit = omit,
57-
guardrailed_fallback_message: Optional[str] | Omit = omit,
57+
guardrailed_fallback: Optional[eval_create_params.GuardrailedFallback] | Omit = omit,
5858
is_default: bool | Omit = omit,
5959
priority: Optional[int] | Omit = omit,
6060
query_identifier: Optional[str] | Omit = omit,
@@ -87,8 +87,7 @@ def create(
8787
8888
enabled: Allows the evaluation to be disabled without removing it
8989
90-
guardrailed_fallback_message: Fallback message to use if this eval fails and causes the response to be
91-
guardrailed
90+
guardrailed_fallback: message, priority, type
9291
9392
is_default: Whether the eval is a default, built-in eval or a custom eval
9493
@@ -128,7 +127,7 @@ def create(
128127
"name": name,
129128
"context_identifier": context_identifier,
130129
"enabled": enabled,
131-
"guardrailed_fallback_message": guardrailed_fallback_message,
130+
"guardrailed_fallback": guardrailed_fallback,
132131
"is_default": is_default,
133132
"priority": priority,
134133
"query_identifier": query_identifier,
@@ -157,7 +156,8 @@ def update(
157156
name: str,
158157
context_identifier: Optional[str] | Omit = omit,
159158
enabled: bool | Omit = omit,
160-
guardrailed_fallback_message: Optional[str] | Omit = omit,
159+
guardrailed_fallback: Optional[eval_update_params.CustomEvalCreateOrUpdateSchemaGuardrailedFallback]
160+
| Omit = omit,
161161
is_default: bool | Omit = omit,
162162
priority: Optional[int] | Omit = omit,
163163
query_identifier: Optional[str] | Omit = omit,
@@ -190,8 +190,7 @@ def update(
190190
191191
enabled: Allows the evaluation to be disabled without removing it
192192
193-
guardrailed_fallback_message: Fallback message to use if this eval fails and causes the response to be
194-
guardrailed
193+
guardrailed_fallback: message, priority, type
195194
196195
is_default: Whether the eval is a default, built-in eval or a custom eval
197196
@@ -230,7 +229,7 @@ def update(
230229
project_id: str,
231230
body_eval_key: str,
232231
enabled: bool | Omit = omit,
233-
guardrailed_fallback_message: Optional[str] | Omit = omit,
232+
guardrailed_fallback: Optional[eval_update_params.DefaultEvalUpdateSchemaGuardrailedFallback] | Omit = omit,
234233
priority: Optional[int] | Omit = omit,
235234
should_escalate: bool | Omit = omit,
236235
should_guardrail: bool | Omit = omit,
@@ -252,8 +251,7 @@ def update(
252251
253252
enabled: Allows the evaluation to be disabled without removing it
254253
255-
guardrailed_fallback_message: Fallback message to use if this eval fails and causes the response to be
256-
guardrailed
254+
guardrailed_fallback: message, priority, type
257255
258256
priority: Priority order for evals (lower number = higher priority) to determine primary
259257
eval issue to surface
@@ -288,7 +286,9 @@ def update(
288286
name: str | Omit = omit,
289287
context_identifier: Optional[str] | Omit = omit,
290288
enabled: bool | Omit = omit,
291-
guardrailed_fallback_message: Optional[str] | Omit = omit,
289+
guardrailed_fallback: Optional[eval_update_params.CustomEvalCreateOrUpdateSchemaGuardrailedFallback]
290+
| Optional[eval_update_params.DefaultEvalUpdateSchemaGuardrailedFallback]
291+
| Omit = omit,
292292
is_default: bool | Omit = omit,
293293
priority: Optional[int] | Omit = omit,
294294
query_identifier: Optional[str] | Omit = omit,
@@ -317,7 +317,7 @@ def update(
317317
"name": name,
318318
"context_identifier": context_identifier,
319319
"enabled": enabled,
320-
"guardrailed_fallback_message": guardrailed_fallback_message,
320+
"guardrailed_fallback": guardrailed_fallback,
321321
"is_default": is_default,
322322
"priority": priority,
323323
"query_identifier": query_identifier,
@@ -448,7 +448,7 @@ async def create(
448448
name: str,
449449
context_identifier: Optional[str] | Omit = omit,
450450
enabled: bool | Omit = omit,
451-
guardrailed_fallback_message: Optional[str] | Omit = omit,
451+
guardrailed_fallback: Optional[eval_create_params.GuardrailedFallback] | Omit = omit,
452452
is_default: bool | Omit = omit,
453453
priority: Optional[int] | Omit = omit,
454454
query_identifier: Optional[str] | Omit = omit,
@@ -481,8 +481,7 @@ async def create(
481481
482482
enabled: Allows the evaluation to be disabled without removing it
483483
484-
guardrailed_fallback_message: Fallback message to use if this eval fails and causes the response to be
485-
guardrailed
484+
guardrailed_fallback: message, priority, type
486485
487486
is_default: Whether the eval is a default, built-in eval or a custom eval
488487
@@ -522,7 +521,7 @@ async def create(
522521
"name": name,
523522
"context_identifier": context_identifier,
524523
"enabled": enabled,
525-
"guardrailed_fallback_message": guardrailed_fallback_message,
524+
"guardrailed_fallback": guardrailed_fallback,
526525
"is_default": is_default,
527526
"priority": priority,
528527
"query_identifier": query_identifier,
@@ -551,7 +550,8 @@ async def update(
551550
name: str,
552551
context_identifier: Optional[str] | Omit = omit,
553552
enabled: bool | Omit = omit,
554-
guardrailed_fallback_message: Optional[str] | Omit = omit,
553+
guardrailed_fallback: Optional[eval_update_params.CustomEvalCreateOrUpdateSchemaGuardrailedFallback]
554+
| Omit = omit,
555555
is_default: bool | Omit = omit,
556556
priority: Optional[int] | Omit = omit,
557557
query_identifier: Optional[str] | Omit = omit,
@@ -584,8 +584,7 @@ async def update(
584584
585585
enabled: Allows the evaluation to be disabled without removing it
586586
587-
guardrailed_fallback_message: Fallback message to use if this eval fails and causes the response to be
588-
guardrailed
587+
guardrailed_fallback: message, priority, type
589588
590589
is_default: Whether the eval is a default, built-in eval or a custom eval
591590
@@ -624,7 +623,7 @@ async def update(
624623
project_id: str,
625624
body_eval_key: str,
626625
enabled: bool | Omit = omit,
627-
guardrailed_fallback_message: Optional[str] | Omit = omit,
626+
guardrailed_fallback: Optional[eval_update_params.DefaultEvalUpdateSchemaGuardrailedFallback] | Omit = omit,
628627
priority: Optional[int] | Omit = omit,
629628
should_escalate: bool | Omit = omit,
630629
should_guardrail: bool | Omit = omit,
@@ -646,8 +645,7 @@ async def update(
646645
647646
enabled: Allows the evaluation to be disabled without removing it
648647
649-
guardrailed_fallback_message: Fallback message to use if this eval fails and causes the response to be
650-
guardrailed
648+
guardrailed_fallback: message, priority, type
651649
652650
priority: Priority order for evals (lower number = higher priority) to determine primary
653651
eval issue to surface
@@ -682,7 +680,9 @@ async def update(
682680
name: str | Omit = omit,
683681
context_identifier: Optional[str] | Omit = omit,
684682
enabled: bool | Omit = omit,
685-
guardrailed_fallback_message: Optional[str] | Omit = omit,
683+
guardrailed_fallback: Optional[eval_update_params.CustomEvalCreateOrUpdateSchemaGuardrailedFallback]
684+
| Optional[eval_update_params.DefaultEvalUpdateSchemaGuardrailedFallback]
685+
| Omit = omit,
686686
is_default: bool | Omit = omit,
687687
priority: Optional[int] | Omit = omit,
688688
query_identifier: Optional[str] | Omit = omit,
@@ -711,7 +711,7 @@ async def update(
711711
"name": name,
712712
"context_identifier": context_identifier,
713713
"enabled": enabled,
714-
"guardrailed_fallback_message": guardrailed_fallback_message,
714+
"guardrailed_fallback": guardrailed_fallback,
715715
"is_default": is_default,
716716
"priority": priority,
717717
"query_identifier": query_identifier,

0 commit comments

Comments
 (0)