Skip to content

Commit f5c1cee

Browse files
feat(api): api update
1 parent 9326b60 commit f5c1cee

File tree

6 files changed

+20
-4
lines changed

6 files changed

+20
-4
lines changed

.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

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,

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"]]

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

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"""

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",

0 commit comments

Comments
 (0)