Skip to content
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.1.0-alpha.31"
".": "0.1.0-alpha.32"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
configured_endpoints: 56
openapi_spec_hash: ef178c3ce0c31f0785212f1138ee8eee
openapi_spec_hash: 80b1836ebec22fc0dc25d5d8efe62a50
config_hash: 9e0ed146f9f6e6d1884a4c0589d6f1c2
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## 0.1.0-alpha.32 (2025-11-05)

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)

### Features

* **api:** api update ([e8c8537](https://github.com/cleanlab/codex-python/commit/e8c853706394437e0738d53594a7d635df224117))


### Bug Fixes

* **client:** close streams without requiring full consumption ([b5a889c](https://github.com/cleanlab/codex-python/commit/b5a889c4bdd788df03f310e30d6a3ee304193f53))


### Chores

* **internal/tests:** avoid race condition with implicit client cleanup ([8f06048](https://github.com/cleanlab/codex-python/commit/8f06048416bf39cdad0290b23fd8d930be869223))
* **internal:** grammar fix (it's -> its) ([9d4a431](https://github.com/cleanlab/codex-python/commit/9d4a4318fac51055f63af10ba451b26bc6c1f179))

## 0.1.0-alpha.31 (2025-10-28)

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)
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.31"
version = "0.1.0-alpha.32"
description = "Internal SDK used within cleanlab-codex package. Refer to https://pypi.org/project/cleanlab-codex/ instead."
dynamic = ["readme"]
license = "MIT"
Expand Down
10 changes: 4 additions & 6 deletions src/codex/_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ def __stream__(self) -> Iterator[_T]:
for sse in iterator:
yield process_data(data=sse.json(), cast_to=cast_to, response=response)

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

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

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

async def __aenter__(self) -> Self:
return self
Expand Down
2 changes: 1 addition & 1 deletion src/codex/_utils/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]:
# Type safe methods for narrowing types with TypeVars.
# The default narrowing for isinstance(obj, dict) is dict[unknown, unknown],
# however this cause Pyright to rightfully report errors. As we know we don't
# care about the contained types we can safely use `object` in it's place.
# care about the contained types we can safely use `object` in its place.
#
# There are two separate functions defined, `is_*` and `is_*_t` for different use cases.
# `is_*` is for when you're dealing with an unknown input
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.31" # x-release-please-version
__version__ = "0.1.0-alpha.32" # x-release-please-version
48 changes: 24 additions & 24 deletions src/codex/resources/projects/evals.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def create(
name: str,
context_identifier: Optional[str] | Omit = omit,
enabled: bool | Omit = omit,
guardrailed_fallback_message: Optional[str] | Omit = omit,
guardrailed_fallback: Optional[eval_create_params.GuardrailedFallback] | Omit = omit,
is_default: bool | Omit = omit,
priority: Optional[int] | Omit = omit,
query_identifier: Optional[str] | Omit = omit,
Expand Down Expand Up @@ -87,8 +87,7 @@ def create(

enabled: Allows the evaluation to be disabled without removing it

guardrailed_fallback_message: Fallback message to use if this eval fails and causes the response to be
guardrailed
guardrailed_fallback: message, priority, type

is_default: Whether the eval is a default, built-in eval or a custom eval

Expand Down Expand Up @@ -128,7 +127,7 @@ def create(
"name": name,
"context_identifier": context_identifier,
"enabled": enabled,
"guardrailed_fallback_message": guardrailed_fallback_message,
"guardrailed_fallback": guardrailed_fallback,
"is_default": is_default,
"priority": priority,
"query_identifier": query_identifier,
Expand Down Expand Up @@ -157,7 +156,8 @@ def update(
name: str,
context_identifier: Optional[str] | Omit = omit,
enabled: bool | Omit = omit,
guardrailed_fallback_message: Optional[str] | Omit = omit,
guardrailed_fallback: Optional[eval_update_params.CustomEvalCreateOrUpdateSchemaGuardrailedFallback]
| Omit = omit,
is_default: bool | Omit = omit,
priority: Optional[int] | Omit = omit,
query_identifier: Optional[str] | Omit = omit,
Expand Down Expand Up @@ -190,8 +190,7 @@ def update(

enabled: Allows the evaluation to be disabled without removing it

guardrailed_fallback_message: Fallback message to use if this eval fails and causes the response to be
guardrailed
guardrailed_fallback: message, priority, type

is_default: Whether the eval is a default, built-in eval or a custom eval

Expand Down Expand Up @@ -230,7 +229,7 @@ def update(
project_id: str,
body_eval_key: str,
enabled: bool | Omit = omit,
guardrailed_fallback_message: Optional[str] | Omit = omit,
guardrailed_fallback: Optional[eval_update_params.DefaultEvalUpdateSchemaGuardrailedFallback] | Omit = omit,
priority: Optional[int] | Omit = omit,
should_escalate: bool | Omit = omit,
should_guardrail: bool | Omit = omit,
Expand All @@ -252,8 +251,7 @@ def update(

enabled: Allows the evaluation to be disabled without removing it

guardrailed_fallback_message: Fallback message to use if this eval fails and causes the response to be
guardrailed
guardrailed_fallback: message, priority, type

priority: Priority order for evals (lower number = higher priority) to determine primary
eval issue to surface
Expand Down Expand Up @@ -288,7 +286,9 @@ def update(
name: str | Omit = omit,
context_identifier: Optional[str] | Omit = omit,
enabled: bool | Omit = omit,
guardrailed_fallback_message: Optional[str] | Omit = omit,
guardrailed_fallback: Optional[eval_update_params.CustomEvalCreateOrUpdateSchemaGuardrailedFallback]
| Optional[eval_update_params.DefaultEvalUpdateSchemaGuardrailedFallback]
| Omit = omit,
is_default: bool | Omit = omit,
priority: Optional[int] | Omit = omit,
query_identifier: Optional[str] | Omit = omit,
Expand Down Expand Up @@ -317,7 +317,7 @@ def update(
"name": name,
"context_identifier": context_identifier,
"enabled": enabled,
"guardrailed_fallback_message": guardrailed_fallback_message,
"guardrailed_fallback": guardrailed_fallback,
"is_default": is_default,
"priority": priority,
"query_identifier": query_identifier,
Expand Down Expand Up @@ -448,7 +448,7 @@ async def create(
name: str,
context_identifier: Optional[str] | Omit = omit,
enabled: bool | Omit = omit,
guardrailed_fallback_message: Optional[str] | Omit = omit,
guardrailed_fallback: Optional[eval_create_params.GuardrailedFallback] | Omit = omit,
is_default: bool | Omit = omit,
priority: Optional[int] | Omit = omit,
query_identifier: Optional[str] | Omit = omit,
Expand Down Expand Up @@ -481,8 +481,7 @@ async def create(

enabled: Allows the evaluation to be disabled without removing it

guardrailed_fallback_message: Fallback message to use if this eval fails and causes the response to be
guardrailed
guardrailed_fallback: message, priority, type

is_default: Whether the eval is a default, built-in eval or a custom eval

Expand Down Expand Up @@ -522,7 +521,7 @@ async def create(
"name": name,
"context_identifier": context_identifier,
"enabled": enabled,
"guardrailed_fallback_message": guardrailed_fallback_message,
"guardrailed_fallback": guardrailed_fallback,
"is_default": is_default,
"priority": priority,
"query_identifier": query_identifier,
Expand Down Expand Up @@ -551,7 +550,8 @@ async def update(
name: str,
context_identifier: Optional[str] | Omit = omit,
enabled: bool | Omit = omit,
guardrailed_fallback_message: Optional[str] | Omit = omit,
guardrailed_fallback: Optional[eval_update_params.CustomEvalCreateOrUpdateSchemaGuardrailedFallback]
| Omit = omit,
is_default: bool | Omit = omit,
priority: Optional[int] | Omit = omit,
query_identifier: Optional[str] | Omit = omit,
Expand Down Expand Up @@ -584,8 +584,7 @@ async def update(

enabled: Allows the evaluation to be disabled without removing it

guardrailed_fallback_message: Fallback message to use if this eval fails and causes the response to be
guardrailed
guardrailed_fallback: message, priority, type

is_default: Whether the eval is a default, built-in eval or a custom eval

Expand Down Expand Up @@ -624,7 +623,7 @@ async def update(
project_id: str,
body_eval_key: str,
enabled: bool | Omit = omit,
guardrailed_fallback_message: Optional[str] | Omit = omit,
guardrailed_fallback: Optional[eval_update_params.DefaultEvalUpdateSchemaGuardrailedFallback] | Omit = omit,
priority: Optional[int] | Omit = omit,
should_escalate: bool | Omit = omit,
should_guardrail: bool | Omit = omit,
Expand All @@ -646,8 +645,7 @@ async def update(

enabled: Allows the evaluation to be disabled without removing it

guardrailed_fallback_message: Fallback message to use if this eval fails and causes the response to be
guardrailed
guardrailed_fallback: message, priority, type

priority: Priority order for evals (lower number = higher priority) to determine primary
eval issue to surface
Expand Down Expand Up @@ -682,7 +680,9 @@ async def update(
name: str | Omit = omit,
context_identifier: Optional[str] | Omit = omit,
enabled: bool | Omit = omit,
guardrailed_fallback_message: Optional[str] | Omit = omit,
guardrailed_fallback: Optional[eval_update_params.CustomEvalCreateOrUpdateSchemaGuardrailedFallback]
| Optional[eval_update_params.DefaultEvalUpdateSchemaGuardrailedFallback]
| Omit = omit,
is_default: bool | Omit = omit,
priority: Optional[int] | Omit = omit,
query_identifier: Optional[str] | Omit = omit,
Expand Down Expand Up @@ -711,7 +711,7 @@ async def update(
"name": name,
"context_identifier": context_identifier,
"enabled": enabled,
"guardrailed_fallback_message": guardrailed_fallback_message,
"guardrailed_fallback": guardrailed_fallback,
"is_default": is_default,
"priority": priority,
"query_identifier": query_identifier,
Expand Down
Loading