Skip to content

Commit d8b8e25

Browse files
feat(api): update via SDK Studio
1 parent c3eee55 commit d8b8e25

24 files changed

+405
-389
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2025 Codex
189+
Copyright 2025 Cleanlab Codex
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# Codex Python API library
1+
# Cleanlab Codex Python API library
22

33
[![PyPI version](https://img.shields.io/pypi/v/codex.svg)](https://pypi.org/project/codex/)
44

5-
The Codex Python library provides convenient access to the Codex REST API from any Python 3.8+
5+
The Cleanlab Codex Python library provides convenient access to the Cleanlab Codex REST API from any Python 3.8+
66
application. The library includes type definitions for all request params and response fields,
77
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
88

99
It is generated with [Stainless](https://www.stainlessapi.com/).
1010

1111
## Documentation
1212

13-
The REST API documentation can be found on [docs.codex.com](https://docs.codex.com). The full API of this library can be found in [api.md](api.md).
13+
The REST API documentation can be found on [help.cleanlab.ai](https://help.cleanlab.ai). The full API of this library can be found in [api.md](api.md).
1414

1515
## Installation
1616

@@ -27,9 +27,9 @@ pip install git+ssh://[email protected]/stainless-sdks/codex-python.git
2727
The full API of this library can be found in [api.md](api.md).
2828

2929
```python
30-
from codex import Codex
30+
from codex import CleanlabCodex
3131

32-
client = Codex(
32+
client = CleanlabCodex(
3333
# or 'production' | 'local'; defaults to "production".
3434
environment="staging",
3535
)
@@ -49,13 +49,13 @@ so that your Bearer Token is not stored in source control.
4949

5050
## Async usage
5151

52-
Simply import `AsyncCodex` instead of `Codex` and use `await` with each API call:
52+
Simply import `AsyncCleanlabCodex` instead of `CleanlabCodex` and use `await` with each API call:
5353

5454
```python
5555
import asyncio
56-
from codex import AsyncCodex
56+
from codex import AsyncCleanlabCodex
5757

58-
client = AsyncCodex(
58+
client = AsyncCleanlabCodex(
5959
# or 'production' | 'local'; defaults to "production".
6060
environment="staging",
6161
)
@@ -95,9 +95,9 @@ All errors inherit from `codex.APIError`.
9595

9696
```python
9797
import codex
98-
from codex import Codex
98+
from codex import CleanlabCodex
9999

100-
client = Codex()
100+
client = CleanlabCodex()
101101

102102
try:
103103
client.projects.create(
@@ -138,10 +138,10 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
138138
You can use the `max_retries` option to configure or disable retry settings:
139139

140140
```python
141-
from codex import Codex
141+
from codex import CleanlabCodex
142142

143143
# Configure the default for all requests:
144-
client = Codex(
144+
client = CleanlabCodex(
145145
# default is 2
146146
max_retries=0,
147147
)
@@ -160,16 +160,16 @@ By default requests time out after 1 minute. You can configure this with a `time
160160
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
161161

162162
```python
163-
from codex import Codex
163+
from codex import CleanlabCodex
164164

165165
# Configure the default for all requests:
166-
client = Codex(
166+
client = CleanlabCodex(
167167
# 20 seconds (default is 1 minute)
168168
timeout=20.0,
169169
)
170170

171171
# More granular control:
172-
client = Codex(
172+
client = CleanlabCodex(
173173
timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),
174174
)
175175

@@ -191,10 +191,10 @@ Note that requests that time out are [retried twice by default](#retries).
191191

192192
We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.
193193

194-
You can enable logging by setting the environment variable `CODEX_LOG` to `info`.
194+
You can enable logging by setting the environment variable `CLEANLAB_CODEX_LOG` to `info`.
195195

196196
```shell
197-
$ export CODEX_LOG=info
197+
$ export CLEANLAB_CODEX_LOG=info
198198
```
199199

200200
Or to `debug` for more verbose logging.
@@ -216,9 +216,9 @@ if response.my_field is None:
216216
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
217217

218218
```py
219-
from codex import Codex
219+
from codex import CleanlabCodex
220220

221-
client = Codex()
221+
client = CleanlabCodex()
222222
response = client.projects.with_raw_response.create(
223223
config={},
224224
name="name",
@@ -298,10 +298,10 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
298298

299299
```python
300300
import httpx
301-
from codex import Codex, DefaultHttpxClient
301+
from codex import CleanlabCodex, DefaultHttpxClient
302302

303-
client = Codex(
304-
# Or use the `CODEX_BASE_URL` env var
303+
client = CleanlabCodex(
304+
# Or use the `CLEANLAB_CODEX_BASE_URL` env var
305305
base_url="http://my.test.server.example.com:8083",
306306
http_client=DefaultHttpxClient(
307307
proxy="http://my.test.proxy.example.com",
@@ -321,9 +321,9 @@ client.with_options(http_client=DefaultHttpxClient(...))
321321
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
322322

323323
```py
324-
from codex import Codex
324+
from codex import CleanlabCodex
325325

326-
with Codex() as client:
326+
with CleanlabCodex() as client:
327327
# make requests here
328328
...
329329

SECURITY.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ before making any information public.
1616
## Reporting Non-SDK Related Security Issues
1717

1818
If you encounter security issues that are not directly related to SDKs but pertain to the services
19-
or products provided by Codex please follow the respective company's security reporting guidelines.
19+
or products provided by Cleanlab Codex please follow the respective company's security reporting guidelines.
2020

21-
### Codex Terms and Policies
21+
### Cleanlab Codex Terms and Policies
2222

23-
Please contact [email protected] for any questions or concerns regarding security of our services.
23+
Please contact [email protected] for any questions or concerns regarding security of our services.
2424

2525
---
2626

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[project]
22
name = "codex"
33
version = "0.0.1-alpha.0"
4-
description = "The official Python library for the codex API"
4+
description = "The official Python library for the Cleanlab Codex API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
77
authors = [
8-
{ name = "Codex", email = "[email protected]" },
8+
{ name = "Cleanlab Codex", email = "[email protected]" },
99
]
1010
dependencies = [
1111
"httpx>=0.23.0, <1",

src/codex/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,30 @@
55
from ._utils import file_from_path
66
from ._client import (
77
ENVIRONMENTS,
8-
Codex,
98
Client,
109
Stream,
1110
Timeout,
1211
Transport,
13-
AsyncCodex,
1412
AsyncClient,
1513
AsyncStream,
14+
CleanlabCodex,
1615
RequestOptions,
16+
AsyncCleanlabCodex,
1717
)
1818
from ._models import BaseModel
1919
from ._version import __title__, __version__
2020
from ._response import APIResponse as APIResponse, AsyncAPIResponse as AsyncAPIResponse
2121
from ._constants import DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES, DEFAULT_CONNECTION_LIMITS
2222
from ._exceptions import (
2323
APIError,
24-
CodexError,
2524
ConflictError,
2625
NotFoundError,
2726
APIStatusError,
2827
RateLimitError,
2928
APITimeoutError,
3029
BadRequestError,
3130
APIConnectionError,
31+
CleanlabCodexError,
3232
AuthenticationError,
3333
InternalServerError,
3434
PermissionDeniedError,
@@ -48,7 +48,7 @@
4848
"NotGiven",
4949
"NOT_GIVEN",
5050
"Omit",
51-
"CodexError",
51+
"CleanlabCodexError",
5252
"APIError",
5353
"APIStatusError",
5454
"APITimeoutError",
@@ -68,8 +68,8 @@
6868
"AsyncClient",
6969
"Stream",
7070
"AsyncStream",
71-
"Codex",
72-
"AsyncCodex",
71+
"CleanlabCodex",
72+
"AsyncCleanlabCodex",
7373
"ENVIRONMENTS",
7474
"file_from_path",
7575
"BaseModel",

0 commit comments

Comments
 (0)