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.26"
".": "0.1.0-alpha.27"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
configured_endpoints: 56
openapi_spec_hash: 12260ab88069ff15d254606e041debfb
config_hash: 6c3ad84d97bf1d0989ad2ec0cae64078
configured_endpoints: 54
openapi_spec_hash: f263c6c6d8d75a8f7c1e9c65188e7ef2
config_hash: 04312af86542d1127f09d3f3cbe5bb50
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.27 (2025-09-19)

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

### Features

* **api:** api update ([7075aca](https://github.com/cleanlab/codex-python/commit/7075aca8381929be65bd7d0310a501620bbede90))
* **api:** api update ([54beb02](https://github.com/cleanlab/codex-python/commit/54beb025117a30e6b0e56986bde48457e6539d01))
* **api:** api update ([16ec26b](https://github.com/cleanlab/codex-python/commit/16ec26b53edf9724bf78f1267a641eb711bdc3e5))
* **api:** api update ([9a65cae](https://github.com/cleanlab/codex-python/commit/9a65cae3b351709a98eb4bc8f695e91f397c4994))
* **api:** api update ([7ccf252](https://github.com/cleanlab/codex-python/commit/7ccf252ba391da0a565e0fd1dd33cc9223a1eb9a))


### Chores

* **internal:** update pydantic dependency ([2c0bd75](https://github.com/cleanlab/codex-python/commit/2c0bd7546c46ad96707d948d34f60df28c701697))
* **tests:** simplify `get_platform` test ([1c03b05](https://github.com/cleanlab/codex-python/commit/1c03b059628ef850cde4760950bc4e7a4d830015))
* **types:** change optional parameter type from NotGiven to Omit ([5cd7ee0](https://github.com/cleanlab/codex-python/commit/5cd7ee0987fe4e29292e3e9c738fe2bd5945d008))

## 0.1.0-alpha.26 (2025-09-05)

Full Changelog: [v0.1.0-alpha.25...v0.1.0-alpha.26](https://github.com/cleanlab/codex-python/compare/v0.1.0-alpha.25...v0.1.0-alpha.26)
Expand Down
13 changes: 0 additions & 13 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,16 +252,3 @@ Methods:
- <code title="patch /api/projects/{project_id}/remediations/{remediation_id}/pause">client.projects.remediations.<a href="./src/codex/resources/projects/remediations.py">pause</a>(remediation_id, \*, project_id) -> <a href="./src/codex/types/projects/remediation_pause_response.py">RemediationPauseResponse</a></code>
- <code title="patch /api/projects/{project_id}/remediations/{remediation_id}/publish">client.projects.remediations.<a href="./src/codex/resources/projects/remediations.py">publish</a>(remediation_id, \*, project_id) -> <a href="./src/codex/types/projects/remediation_publish_response.py">RemediationPublishResponse</a></code>
- <code title="patch /api/projects/{project_id}/remediations/{remediation_id}/unpause">client.projects.remediations.<a href="./src/codex/resources/projects/remediations.py">unpause</a>(remediation_id, \*, project_id) -> <a href="./src/codex/types/projects/remediation_unpause_response.py">RemediationUnpauseResponse</a></code>

# Tlm

Types:

```python
from codex.types import TlmPromptResponse, TlmScoreResponse
```

Methods:

- <code title="post /api/tlm/prompt">client.tlm.<a href="./src/codex/resources/tlm.py">prompt</a>(\*\*<a href="src/codex/types/tlm_prompt_params.py">params</a>) -> <a href="./src/codex/types/tlm_prompt_response.py">TlmPromptResponse</a></code>
- <code title="post /api/tlm/score">client.tlm.<a href="./src/codex/resources/tlm.py">score</a>(\*\*<a href="src/codex/types/tlm_score_params.py">params</a>) -> <a href="./src/codex/types/tlm_score_response.py">TlmScoreResponse</a></code>
3 changes: 1 addition & 2 deletions 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.26"
version = "0.1.0-alpha.27"
description = "Internal SDK used within cleanlab-codex package. Refer to https://pypi.org/project/cleanlab-codex/ instead."
dynamic = ["readme"]
license = "MIT"
Expand Down Expand Up @@ -56,7 +56,6 @@ dev-dependencies = [
"dirty-equals>=0.6.0",
"importlib-metadata>=6.7.0",
"rich>=13.7.1",
"nest_asyncio==1.6.0",
"pytest-xdist>=3.6.1",
]

Expand Down
8 changes: 5 additions & 3 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ multidict==6.4.4
mypy==1.14.1
mypy-extensions==1.0.0
# via mypy
nest-asyncio==1.6.0
nodeenv==1.8.0
# via pyright
nox==2023.4.22
Expand All @@ -89,9 +88,9 @@ pluggy==1.5.0
propcache==0.3.1
# via aiohttp
# via yarl
pydantic==2.10.3
pydantic==2.11.9
# via codex-sdk
pydantic-core==2.27.1
pydantic-core==2.33.2
# via pydantic
pygments==2.18.0
# via rich
Expand Down Expand Up @@ -127,6 +126,9 @@ typing-extensions==4.12.2
# via pydantic
# via pydantic-core
# via pyright
# via typing-inspection
typing-inspection==0.4.1
# via pydantic
virtualenv==20.24.5
# via nox
yarl==1.20.0
Expand Down
7 changes: 5 additions & 2 deletions requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ multidict==6.4.4
propcache==0.3.1
# via aiohttp
# via yarl
pydantic==2.10.3
pydantic==2.11.9
# via codex-sdk
pydantic-core==2.27.1
pydantic-core==2.33.2
# via pydantic
sniffio==1.3.0
# via anyio
Expand All @@ -68,5 +68,8 @@ typing-extensions==4.12.2
# via multidict
# via pydantic
# via pydantic-core
# via typing-inspection
typing-inspection==0.4.1
# via pydantic
yarl==1.20.0
# via aiohttp
4 changes: 3 additions & 1 deletion src/codex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import typing as _t

from . import types
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes, omit, not_given
from ._utils import file_from_path
from ._client import (
ENVIRONMENTS,
Expand Down Expand Up @@ -49,7 +49,9 @@
"ProxiesTypes",
"NotGiven",
"NOT_GIVEN",
"not_given",
"Omit",
"omit",
"CodexError",
"APIError",
"APIStatusError",
Expand Down
18 changes: 9 additions & 9 deletions src/codex/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
from ._qs import Querystring
from ._files import to_httpx_files, async_to_httpx_files
from ._types import (
NOT_GIVEN,
Body,
Omit,
Query,
Expand All @@ -57,6 +56,7 @@
RequestOptions,
HttpxRequestFiles,
ModelBuilderProtocol,
not_given,
)
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
from ._compat import PYDANTIC_V1, model_copy, model_dump
Expand Down Expand Up @@ -145,9 +145,9 @@ def __init__(
def __init__(
self,
*,
url: URL | NotGiven = NOT_GIVEN,
json: Body | NotGiven = NOT_GIVEN,
params: Query | NotGiven = NOT_GIVEN,
url: URL | NotGiven = not_given,
json: Body | NotGiven = not_given,
params: Query | NotGiven = not_given,
) -> None:
self.url = url
self.json = json
Expand Down Expand Up @@ -595,7 +595,7 @@ def _maybe_override_cast_to(self, cast_to: type[ResponseT], options: FinalReques
# we internally support defining a temporary header to override the
# default `cast_to` type for use with `.with_raw_response` and `.with_streaming_response`
# see _response.py for implementation details
override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, NOT_GIVEN)
override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, not_given)
if is_given(override_cast_to):
options.headers = headers
return cast(Type[ResponseT], override_cast_to)
Expand Down Expand Up @@ -825,7 +825,7 @@ def __init__(
version: str,
base_url: str | URL,
max_retries: int = DEFAULT_MAX_RETRIES,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.Client | None = None,
custom_headers: Mapping[str, str] | None = None,
custom_query: Mapping[str, object] | None = None,
Expand Down Expand Up @@ -1356,7 +1356,7 @@ def __init__(
base_url: str | URL,
_strict_response_validation: bool,
max_retries: int = DEFAULT_MAX_RETRIES,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.AsyncClient | None = None,
custom_headers: Mapping[str, str] | None = None,
custom_query: Mapping[str, object] | None = None,
Expand Down Expand Up @@ -1818,8 +1818,8 @@ def make_request_options(
extra_query: Query | None = None,
extra_body: Body | None = None,
idempotency_key: str | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
post_parser: PostParser | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
post_parser: PostParser | NotGiven = not_given,
) -> RequestOptions:
"""Create a dict of type RequestOptions without keys of NotGiven values."""
options: RequestOptions = {}
Expand Down
34 changes: 13 additions & 21 deletions src/codex/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
from __future__ import annotations

import os
from typing import Any, Dict, Union, Mapping, cast
from typing import Any, Dict, Mapping, cast
from typing_extensions import Self, Literal, override

import httpx

from . import _exceptions
from ._qs import Querystring
from ._types import (
NOT_GIVEN,
Omit,
Headers,
Timeout,
NotGiven,
Transport,
ProxiesTypes,
RequestOptions,
not_given,
)
from ._utils import is_given, get_async_library
from ._version import __version__
from .resources import tlm, health
from .resources import health
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
from ._exceptions import APIStatusError
from ._base_client import (
Expand Down Expand Up @@ -58,7 +58,6 @@ class Codex(SyncAPIClient):
organizations: organizations.OrganizationsResource
users: users.UsersResource
projects: projects.ProjectsResource
tlm: tlm.TlmResource
with_raw_response: CodexWithRawResponse
with_streaming_response: CodexWithStreamedResponse

Expand All @@ -75,9 +74,9 @@ def __init__(
auth_token: str | None = None,
api_key: str | None = None,
access_key: str | None = None,
environment: Literal["production", "staging", "local"] | NotGiven = NOT_GIVEN,
base_url: str | httpx.URL | None | NotGiven = NOT_GIVEN,
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
environment: Literal["production", "staging", "local"] | NotGiven = not_given,
base_url: str | httpx.URL | None | NotGiven = not_given,
timeout: float | Timeout | None | NotGiven = not_given,
max_retries: int = DEFAULT_MAX_RETRIES,
default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
Expand Down Expand Up @@ -143,7 +142,6 @@ def __init__(
self.organizations = organizations.OrganizationsResource(self)
self.users = users.UsersResource(self)
self.projects = projects.ProjectsResource(self)
self.tlm = tlm.TlmResource(self)
self.with_raw_response = CodexWithRawResponse(self)
self.with_streaming_response = CodexWithStreamedResponse(self)

Expand Down Expand Up @@ -216,9 +214,9 @@ def copy(
access_key: str | None = None,
environment: Literal["production", "staging", "local"] | None = None,
base_url: str | httpx.URL | None = None,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.Client | None = None,
max_retries: int | NotGiven = NOT_GIVEN,
max_retries: int | NotGiven = not_given,
default_headers: Mapping[str, str] | None = None,
set_default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
Expand Down Expand Up @@ -304,7 +302,6 @@ class AsyncCodex(AsyncAPIClient):
organizations: organizations.AsyncOrganizationsResource
users: users.AsyncUsersResource
projects: projects.AsyncProjectsResource
tlm: tlm.AsyncTlmResource
with_raw_response: AsyncCodexWithRawResponse
with_streaming_response: AsyncCodexWithStreamedResponse

Expand All @@ -321,9 +318,9 @@ def __init__(
auth_token: str | None = None,
api_key: str | None = None,
access_key: str | None = None,
environment: Literal["production", "staging", "local"] | NotGiven = NOT_GIVEN,
base_url: str | httpx.URL | None | NotGiven = NOT_GIVEN,
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
environment: Literal["production", "staging", "local"] | NotGiven = not_given,
base_url: str | httpx.URL | None | NotGiven = not_given,
timeout: float | Timeout | None | NotGiven = not_given,
max_retries: int = DEFAULT_MAX_RETRIES,
default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
Expand Down Expand Up @@ -389,7 +386,6 @@ def __init__(
self.organizations = organizations.AsyncOrganizationsResource(self)
self.users = users.AsyncUsersResource(self)
self.projects = projects.AsyncProjectsResource(self)
self.tlm = tlm.AsyncTlmResource(self)
self.with_raw_response = AsyncCodexWithRawResponse(self)
self.with_streaming_response = AsyncCodexWithStreamedResponse(self)

Expand Down Expand Up @@ -462,9 +458,9 @@ def copy(
access_key: str | None = None,
environment: Literal["production", "staging", "local"] | None = None,
base_url: str | httpx.URL | None = None,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.AsyncClient | None = None,
max_retries: int | NotGiven = NOT_GIVEN,
max_retries: int | NotGiven = not_given,
default_headers: Mapping[str, str] | None = None,
set_default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
Expand Down Expand Up @@ -551,7 +547,6 @@ def __init__(self, client: Codex) -> None:
self.organizations = organizations.OrganizationsResourceWithRawResponse(client.organizations)
self.users = users.UsersResourceWithRawResponse(client.users)
self.projects = projects.ProjectsResourceWithRawResponse(client.projects)
self.tlm = tlm.TlmResourceWithRawResponse(client.tlm)


class AsyncCodexWithRawResponse:
Expand All @@ -560,7 +555,6 @@ def __init__(self, client: AsyncCodex) -> None:
self.organizations = organizations.AsyncOrganizationsResourceWithRawResponse(client.organizations)
self.users = users.AsyncUsersResourceWithRawResponse(client.users)
self.projects = projects.AsyncProjectsResourceWithRawResponse(client.projects)
self.tlm = tlm.AsyncTlmResourceWithRawResponse(client.tlm)


class CodexWithStreamedResponse:
Expand All @@ -569,7 +563,6 @@ def __init__(self, client: Codex) -> None:
self.organizations = organizations.OrganizationsResourceWithStreamingResponse(client.organizations)
self.users = users.UsersResourceWithStreamingResponse(client.users)
self.projects = projects.ProjectsResourceWithStreamingResponse(client.projects)
self.tlm = tlm.TlmResourceWithStreamingResponse(client.tlm)


class AsyncCodexWithStreamedResponse:
Expand All @@ -578,7 +571,6 @@ def __init__(self, client: AsyncCodex) -> None:
self.organizations = organizations.AsyncOrganizationsResourceWithStreamingResponse(client.organizations)
self.users = users.AsyncUsersResourceWithStreamingResponse(client.users)
self.projects = projects.AsyncProjectsResourceWithStreamingResponse(client.projects)
self.tlm = tlm.AsyncTlmResourceWithStreamingResponse(client.tlm)


Client = Codex
Expand Down
Loading