Skip to content

Commit d5f2767

Browse files
release: 0.1.0-alpha.16 (#110)
* chore(internal): version bump * feat(api): api update * chore(internal): bump pyright version * chore(internal): base client updates * release: 0.1.0-alpha.16 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent df82e7e commit d5f2767

16 files changed

+73
-14
lines changed

Diff for: .release-please-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0-alpha.15"
2+
".": "0.1.0-alpha.16"
33
}

Diff for: .stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
configured_endpoints: 36
2-
openapi_spec_hash: 2e10455457751c9efb36adc4399c684d
2+
openapi_spec_hash: 6311021a3aba7ac56cc3b474762945c0
33
config_hash: adbedb6317fca6f566f54564cc341846

Diff for: CHANGELOG.md

+15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Changelog
22

3+
## 0.1.0-alpha.16 (2025-04-18)
4+
5+
Full Changelog: [v0.1.0-alpha.15...v0.1.0-alpha.16](https://github.com/cleanlab/codex-python/compare/v0.1.0-alpha.15...v0.1.0-alpha.16)
6+
7+
### Features
8+
9+
* **api:** api update ([f5c1cee](https://github.com/cleanlab/codex-python/commit/f5c1cee46c42ab67bc09befff130fe88b35f06ac))
10+
11+
12+
### Chores
13+
14+
* **internal:** base client updates ([e7d165b](https://github.com/cleanlab/codex-python/commit/e7d165b98c7536415b74fe92c558a50ee8c5861d))
15+
* **internal:** bump pyright version ([5eac17b](https://github.com/cleanlab/codex-python/commit/5eac17b4e3ef210077d2bed75a7d7b4954d73086))
16+
* **internal:** version bump ([9326b60](https://github.com/cleanlab/codex-python/commit/9326b60bf403d4a5c981b613e715ea80ef29ad8e))
17+
318
## 0.1.0-alpha.15 (2025-04-15)
419

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

Diff for: pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "codex-sdk"
3-
version = "0.1.0-alpha.15"
3+
version = "0.1.0-alpha.16"
44
description = "Internal SDK used within cleanlab-codex package. Refer to https://pypi.org/project/cleanlab-codex/ instead."
55
dynamic = ["readme"]
66
license = "MIT"
@@ -42,7 +42,7 @@ Repository = "https://github.com/cleanlab/codex-python"
4242
managed = true
4343
# version pins are in requirements-dev.lock
4444
dev-dependencies = [
45-
"pyright>=1.1.359",
45+
"pyright==1.1.399",
4646
"mypy",
4747
"respx",
4848
"pytest",

Diff for: requirements-dev.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pydantic-core==2.27.1
6969
# via pydantic
7070
pygments==2.18.0
7171
# via rich
72-
pyright==1.1.392.post0
72+
pyright==1.1.399
7373
pytest==8.3.3
7474
# via pytest-asyncio
7575
pytest-asyncio==0.24.0

Diff for: src/codex/_base_client.py

+30-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@
9898
_AsyncStreamT = TypeVar("_AsyncStreamT", bound=AsyncStream[Any])
9999

100100
if TYPE_CHECKING:
101-
from httpx._config import DEFAULT_TIMEOUT_CONFIG as HTTPX_DEFAULT_TIMEOUT
101+
from httpx._config import (
102+
DEFAULT_TIMEOUT_CONFIG, # pyright: ignore[reportPrivateImportUsage]
103+
)
104+
105+
HTTPX_DEFAULT_TIMEOUT = DEFAULT_TIMEOUT_CONFIG
102106
else:
103107
try:
104108
from httpx._config import DEFAULT_TIMEOUT_CONFIG as HTTPX_DEFAULT_TIMEOUT
@@ -115,6 +119,7 @@ class PageInfo:
115119

116120
url: URL | NotGiven
117121
params: Query | NotGiven
122+
json: Body | NotGiven
118123

119124
@overload
120125
def __init__(
@@ -130,19 +135,30 @@ def __init__(
130135
params: Query,
131136
) -> None: ...
132137

138+
@overload
139+
def __init__(
140+
self,
141+
*,
142+
json: Body,
143+
) -> None: ...
144+
133145
def __init__(
134146
self,
135147
*,
136148
url: URL | NotGiven = NOT_GIVEN,
149+
json: Body | NotGiven = NOT_GIVEN,
137150
params: Query | NotGiven = NOT_GIVEN,
138151
) -> None:
139152
self.url = url
153+
self.json = json
140154
self.params = params
141155

142156
@override
143157
def __repr__(self) -> str:
144158
if self.url:
145159
return f"{self.__class__.__name__}(url={self.url})"
160+
if self.json:
161+
return f"{self.__class__.__name__}(json={self.json})"
146162
return f"{self.__class__.__name__}(params={self.params})"
147163

148164

@@ -191,6 +207,19 @@ def _info_to_options(self, info: PageInfo) -> FinalRequestOptions:
191207
options.url = str(url)
192208
return options
193209

210+
if not isinstance(info.json, NotGiven):
211+
if not is_mapping(info.json):
212+
raise TypeError("Pagination is only supported with mappings")
213+
214+
if not options.json_data:
215+
options.json_data = {**info.json}
216+
else:
217+
if not is_mapping(options.json_data):
218+
raise TypeError("Pagination is only supported with mappings")
219+
220+
options.json_data = {**options.json_data, **info.json}
221+
return options
222+
194223
raise ValueError("Unexpected PageInfo state")
195224

196225

Diff for: src/codex/_models.py

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
)
2020

2121
import pydantic
22-
import pydantic.generics
2322
from pydantic.fields import FieldInfo
2423

2524
from ._types import (

Diff for: src/codex/_utils/_typing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class MyResponse(Foo[_T]):
110110
```
111111
"""
112112
cls = cast(object, get_origin(typ) or typ)
113-
if cls in generic_bases:
113+
if cls in generic_bases: # pyright: ignore[reportUnnecessaryContains]
114114
# we're given the class directly
115115
return extract_type_arg(typ, index)
116116

Diff for: src/codex/_version.py

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

Diff for: src/codex/resources/projects/clusters.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,11 @@ def list(
5050
self,
5151
project_id: str,
5252
*,
53+
eval_issue_types: List[Literal["hallucination", "search_failure", "unhelpful"]] | NotGiven = NOT_GIVEN,
5354
limit: int | NotGiven = NOT_GIVEN,
5455
offset: int | NotGiven = NOT_GIVEN,
5556
order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
56-
sort: Optional[Literal["created_at", "answered_at", "cluster_frequency_count", "custom_rank"]]
57+
sort: Optional[Literal["created_at", "answered_at", "cluster_frequency_count", "custom_rank", "eval_score"]]
5758
| NotGiven = NOT_GIVEN,
5859
states: List[Literal["unanswered", "draft", "published", "published_with_draft"]] | NotGiven = NOT_GIVEN,
5960
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -87,6 +88,7 @@ def list(
8788
timeout=timeout,
8889
query=maybe_transform(
8990
{
91+
"eval_issue_types": eval_issue_types,
9092
"limit": limit,
9193
"offset": offset,
9294
"order": order,
@@ -162,10 +164,11 @@ def list(
162164
self,
163165
project_id: str,
164166
*,
167+
eval_issue_types: List[Literal["hallucination", "search_failure", "unhelpful"]] | NotGiven = NOT_GIVEN,
165168
limit: int | NotGiven = NOT_GIVEN,
166169
offset: int | NotGiven = NOT_GIVEN,
167170
order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
168-
sort: Optional[Literal["created_at", "answered_at", "cluster_frequency_count", "custom_rank"]]
171+
sort: Optional[Literal["created_at", "answered_at", "cluster_frequency_count", "custom_rank", "eval_score"]]
169172
| NotGiven = NOT_GIVEN,
170173
states: List[Literal["unanswered", "draft", "published", "published_with_draft"]] | NotGiven = NOT_GIVEN,
171174
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -199,6 +202,7 @@ def list(
199202
timeout=timeout,
200203
query=maybe_transform(
201204
{
205+
"eval_issue_types": eval_issue_types,
202206
"limit": limit,
203207
"offset": offset,
204208
"order": order,

Diff for: src/codex/types/projects/cluster_list_params.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@
99

1010

1111
class ClusterListParams(TypedDict, total=False):
12+
eval_issue_types: List[Literal["hallucination", "search_failure", "unhelpful"]]
13+
1214
limit: int
1315

1416
offset: int
1517

1618
order: Literal["asc", "desc"]
1719

18-
sort: Optional[Literal["created_at", "answered_at", "cluster_frequency_count", "custom_rank"]]
20+
sort: Optional[Literal["created_at", "answered_at", "cluster_frequency_count", "custom_rank", "eval_score"]]
1921

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

Diff for: src/codex/types/projects/cluster_list_response.py

+4
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ class ClusterListResponse(BaseModel):
140140

141141
draft_answer_last_edited: Optional[datetime] = None
142142

143+
eval_issue_type: Optional[str] = None
144+
145+
eval_score: Optional[float] = None
146+
143147
frequency_count: Optional[int] = None
144148
"""number of times the entry matched for a /query request"""
145149

Diff for: src/codex/types/projects/entry.py

+4
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,9 @@ class Entry(BaseModel):
138138

139139
draft_answer_last_edited: Optional[datetime] = None
140140

141+
eval_issue_type: Optional[str] = None
142+
143+
eval_score: Optional[float] = None
144+
141145
frequency_count: Optional[int] = None
142146
"""number of times the entry matched for a /query request"""

Diff for: tests/api_resources/projects/test_clusters.py

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def test_method_list(self, client: Codex) -> None:
3131
def test_method_list_with_all_params(self, client: Codex) -> None:
3232
cluster = client.projects.clusters.list(
3333
project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
34+
eval_issue_types=["hallucination"],
3435
limit=1,
3536
offset=0,
3637
order="asc",
@@ -144,6 +145,7 @@ async def test_method_list(self, async_client: AsyncCodex) -> None:
144145
async def test_method_list_with_all_params(self, async_client: AsyncCodex) -> None:
145146
cluster = await async_client.projects.clusters.list(
146147
project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
148+
eval_issue_types=["hallucination"],
147149
limit=1,
148150
offset=0,
149151
order="asc",

Diff for: tests/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from codex import Codex, AsyncCodex
1111

1212
if TYPE_CHECKING:
13-
from _pytest.fixtures import FixtureRequest
13+
from _pytest.fixtures import FixtureRequest # pyright: ignore[reportPrivateImportUsage]
1414

1515
pytest.register_assert_rewrite("tests.utils")
1616

Diff for: tests/test_models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ class B(BaseModel):
832832

833833
@pytest.mark.skipif(not PYDANTIC_V2, reason="TypeAliasType is not supported in Pydantic v1")
834834
def test_type_alias_type() -> None:
835-
Alias = TypeAliasType("Alias", str)
835+
Alias = TypeAliasType("Alias", str) # pyright: ignore
836836

837837
class Model(BaseModel):
838838
alias: Alias

0 commit comments

Comments
 (0)