Skip to content

Commit 16ec26b

Browse files
feat(api): api update
1 parent 9a65cae commit 16ec26b

12 files changed

+118
-1
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
configured_endpoints: 56
2-
openapi_spec_hash: 50e871c310076ede174715f6e76f673c
2+
openapi_spec_hash: b752c79a72b1b72b4b5aea40e27c16c5
33
config_hash: 6c3ad84d97bf1d0989ad2ec0cae64078

src/codex/resources/projects/query_logs.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def list(
106106
created_at_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
107107
created_at_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
108108
custom_metadata: Optional[str] | NotGiven = NOT_GIVEN,
109+
expert_review_status: Optional[Literal["good", "bad"]] | NotGiven = NOT_GIVEN,
109110
failed_evals: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
110111
guardrailed: Optional[bool] | NotGiven = NOT_GIVEN,
111112
has_tool_calls: Optional[bool] | NotGiven = NOT_GIVEN,
@@ -137,6 +138,8 @@ def list(
137138
138139
custom_metadata: Filter by custom metadata as JSON string: {"key1": "value1", "key2": "value2"}
139140
141+
expert_review_status: Filter by expert review status
142+
140143
failed_evals: Filter by evals that failed
141144
142145
guardrailed: Filter by guardrailed status
@@ -185,6 +188,7 @@ def list(
185188
"created_at_end": created_at_end,
186189
"created_at_start": created_at_start,
187190
"custom_metadata": custom_metadata,
191+
"expert_review_status": expert_review_status,
188192
"failed_evals": failed_evals,
189193
"guardrailed": guardrailed,
190194
"has_tool_calls": has_tool_calls,
@@ -250,6 +254,7 @@ def list_by_group(
250254
created_at_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
251255
created_at_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
252256
custom_metadata: Optional[str] | NotGiven = NOT_GIVEN,
257+
expert_review_status: Optional[Literal["good", "bad"]] | NotGiven = NOT_GIVEN,
253258
failed_evals: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
254259
guardrailed: Optional[bool] | NotGiven = NOT_GIVEN,
255260
has_tool_calls: Optional[bool] | NotGiven = NOT_GIVEN,
@@ -283,6 +288,8 @@ def list_by_group(
283288
284289
custom_metadata: Filter by custom metadata as JSON string: {"key1": "value1", "key2": "value2"}
285290
291+
expert_review_status: Filter by expert review status
292+
286293
failed_evals: Filter by evals that failed
287294
288295
guardrailed: Filter by guardrailed status
@@ -334,6 +341,7 @@ def list_by_group(
334341
"created_at_end": created_at_end,
335342
"created_at_start": created_at_start,
336343
"custom_metadata": custom_metadata,
344+
"expert_review_status": expert_review_status,
337345
"failed_evals": failed_evals,
338346
"guardrailed": guardrailed,
339347
"has_tool_calls": has_tool_calls,
@@ -361,6 +369,7 @@ def list_groups(
361369
created_at_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
362370
created_at_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
363371
custom_metadata: Optional[str] | NotGiven = NOT_GIVEN,
372+
expert_review_status: Optional[Literal["good", "bad"]] | NotGiven = NOT_GIVEN,
364373
failed_evals: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
365374
guardrailed: Optional[bool] | NotGiven = NOT_GIVEN,
366375
has_tool_calls: Optional[bool] | NotGiven = NOT_GIVEN,
@@ -393,6 +402,8 @@ def list_groups(
393402
394403
custom_metadata: Filter by custom metadata as JSON string: {"key1": "value1", "key2": "value2"}
395404
405+
expert_review_status: Filter by expert review status
406+
396407
failed_evals: Filter by evals that failed
397408
398409
guardrailed: Filter by guardrailed status
@@ -444,6 +455,7 @@ def list_groups(
444455
"created_at_end": created_at_end,
445456
"created_at_start": created_at_start,
446457
"custom_metadata": custom_metadata,
458+
"expert_review_status": expert_review_status,
447459
"failed_evals": failed_evals,
448460
"guardrailed": guardrailed,
449461
"has_tool_calls": has_tool_calls,
@@ -601,6 +613,7 @@ def list(
601613
created_at_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
602614
created_at_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
603615
custom_metadata: Optional[str] | NotGiven = NOT_GIVEN,
616+
expert_review_status: Optional[Literal["good", "bad"]] | NotGiven = NOT_GIVEN,
604617
failed_evals: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
605618
guardrailed: Optional[bool] | NotGiven = NOT_GIVEN,
606619
has_tool_calls: Optional[bool] | NotGiven = NOT_GIVEN,
@@ -632,6 +645,8 @@ def list(
632645
633646
custom_metadata: Filter by custom metadata as JSON string: {"key1": "value1", "key2": "value2"}
634647
648+
expert_review_status: Filter by expert review status
649+
635650
failed_evals: Filter by evals that failed
636651
637652
guardrailed: Filter by guardrailed status
@@ -680,6 +695,7 @@ def list(
680695
"created_at_end": created_at_end,
681696
"created_at_start": created_at_start,
682697
"custom_metadata": custom_metadata,
698+
"expert_review_status": expert_review_status,
683699
"failed_evals": failed_evals,
684700
"guardrailed": guardrailed,
685701
"has_tool_calls": has_tool_calls,
@@ -747,6 +763,7 @@ async def list_by_group(
747763
created_at_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
748764
created_at_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
749765
custom_metadata: Optional[str] | NotGiven = NOT_GIVEN,
766+
expert_review_status: Optional[Literal["good", "bad"]] | NotGiven = NOT_GIVEN,
750767
failed_evals: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
751768
guardrailed: Optional[bool] | NotGiven = NOT_GIVEN,
752769
has_tool_calls: Optional[bool] | NotGiven = NOT_GIVEN,
@@ -780,6 +797,8 @@ async def list_by_group(
780797
781798
custom_metadata: Filter by custom metadata as JSON string: {"key1": "value1", "key2": "value2"}
782799
800+
expert_review_status: Filter by expert review status
801+
783802
failed_evals: Filter by evals that failed
784803
785804
guardrailed: Filter by guardrailed status
@@ -831,6 +850,7 @@ async def list_by_group(
831850
"created_at_end": created_at_end,
832851
"created_at_start": created_at_start,
833852
"custom_metadata": custom_metadata,
853+
"expert_review_status": expert_review_status,
834854
"failed_evals": failed_evals,
835855
"guardrailed": guardrailed,
836856
"has_tool_calls": has_tool_calls,
@@ -858,6 +878,7 @@ def list_groups(
858878
created_at_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
859879
created_at_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
860880
custom_metadata: Optional[str] | NotGiven = NOT_GIVEN,
881+
expert_review_status: Optional[Literal["good", "bad"]] | NotGiven = NOT_GIVEN,
861882
failed_evals: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
862883
guardrailed: Optional[bool] | NotGiven = NOT_GIVEN,
863884
has_tool_calls: Optional[bool] | NotGiven = NOT_GIVEN,
@@ -890,6 +911,8 @@ def list_groups(
890911
891912
custom_metadata: Filter by custom metadata as JSON string: {"key1": "value1", "key2": "value2"}
892913
914+
expert_review_status: Filter by expert review status
915+
893916
failed_evals: Filter by evals that failed
894917
895918
guardrailed: Filter by guardrailed status
@@ -941,6 +964,7 @@ def list_groups(
941964
"created_at_end": created_at_end,
942965
"created_at_start": created_at_start,
943966
"custom_metadata": custom_metadata,
967+
"expert_review_status": expert_review_status,
944968
"failed_evals": failed_evals,
945969
"guardrailed": guardrailed,
946970
"has_tool_calls": has_tool_calls,

src/codex/types/project_validate_response.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ class ProjectValidateResponse(BaseModel):
5252
Codex Project, or None otherwise.
5353
"""
5454

55+
expert_review_guardrail_explanation: Optional[str] = None
56+
"""Explanation from a similar bad query log that caused this to be guardrailed"""
57+
5558
is_bad_response: bool
5659
"""True if the response is flagged as potentially bad, False otherwise.
5760

src/codex/types/projects/query_log_list_by_group_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class QueryLogListByGroupParams(TypedDict, total=False):
2222
custom_metadata: Optional[str]
2323
"""Filter by custom metadata as JSON string: {"key1": "value1", "key2": "value2"}"""
2424

25+
expert_review_status: Optional[Literal["good", "bad"]]
26+
"""Filter by expert review status"""
27+
2528
failed_evals: Optional[SequenceNotStr[str]]
2629
"""Filter by evals that failed"""
2730

src/codex/types/projects/query_log_list_by_group_response.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,18 @@ class QueryLogsByGroupQueryLog(BaseModel):
399399
Used to log tool calls in the query log.
400400
"""
401401

402+
expert_review_created_at: Optional[datetime] = None
403+
"""When the expert review was created"""
404+
405+
expert_review_created_by_user_id: Optional[str] = None
406+
"""ID of the user who created the expert review"""
407+
408+
expert_review_explanation: Optional[str] = None
409+
"""Expert explanation when marked as bad"""
410+
411+
expert_review_status: Optional[Literal["good", "bad"]] = None
412+
"""Expert review status: 'good' or 'bad'"""
413+
402414
guardrail_evals: Optional[List[str]] = None
403415
"""Evals that should trigger guardrail"""
404416

@@ -428,6 +440,9 @@ class QueryLogsByGroupQueryLog(BaseModel):
428440
primary_eval_issue_score: Optional[float] = None
429441
"""Score of the primary eval issue"""
430442

443+
similar_query_log_guardrail_explanation: Optional[str] = None
444+
"""Explanation from a similar bad query log that caused this to be guardrailed"""
445+
431446
tools: Optional[List[QueryLogsByGroupQueryLogTool]] = None
432447
"""Tools to use for the LLM call.
433448

src/codex/types/projects/query_log_list_groups_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class QueryLogListGroupsParams(TypedDict, total=False):
2222
custom_metadata: Optional[str]
2323
"""Filter by custom metadata as JSON string: {"key1": "value1", "key2": "value2"}"""
2424

25+
expert_review_status: Optional[Literal["good", "bad"]]
26+
"""Filter by expert review status"""
27+
2528
failed_evals: Optional[SequenceNotStr[str]]
2629
"""Filter by evals that failed"""
2730

src/codex/types/projects/query_log_list_groups_response.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,18 @@ class QueryLogListGroupsResponse(BaseModel):
395395
Used to log tool calls in the query log.
396396
"""
397397

398+
expert_review_created_at: Optional[datetime] = None
399+
"""When the expert review was created"""
400+
401+
expert_review_created_by_user_id: Optional[str] = None
402+
"""ID of the user who created the expert review"""
403+
404+
expert_review_explanation: Optional[str] = None
405+
"""Expert explanation when marked as bad"""
406+
407+
expert_review_status: Optional[Literal["good", "bad"]] = None
408+
"""Expert review status: 'good' or 'bad'"""
409+
398410
guardrail_evals: Optional[List[str]] = None
399411
"""Evals that should trigger guardrail"""
400412

@@ -424,6 +436,9 @@ class QueryLogListGroupsResponse(BaseModel):
424436
primary_eval_issue_score: Optional[float] = None
425437
"""Score of the primary eval issue"""
426438

439+
similar_query_log_guardrail_explanation: Optional[str] = None
440+
"""Explanation from a similar bad query log that caused this to be guardrailed"""
441+
427442
tools: Optional[List[Tool]] = None
428443
"""Tools to use for the LLM call.
429444

src/codex/types/projects/query_log_list_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class QueryLogListParams(TypedDict, total=False):
2222
custom_metadata: Optional[str]
2323
"""Filter by custom metadata as JSON string: {"key1": "value1", "key2": "value2"}"""
2424

25+
expert_review_status: Optional[Literal["good", "bad"]]
26+
"""Filter by expert review status"""
27+
2528
failed_evals: Optional[SequenceNotStr[str]]
2629
"""Filter by evals that failed"""
2730

src/codex/types/projects/query_log_list_response.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,18 @@ class QueryLogListResponse(BaseModel):
383383
Used to log tool calls in the query log.
384384
"""
385385

386+
expert_review_created_at: Optional[datetime] = None
387+
"""When the expert review was created"""
388+
389+
expert_review_created_by_user_id: Optional[str] = None
390+
"""ID of the user who created the expert review"""
391+
392+
expert_review_explanation: Optional[str] = None
393+
"""Expert explanation when marked as bad"""
394+
395+
expert_review_status: Optional[Literal["good", "bad"]] = None
396+
"""Expert review status: 'good' or 'bad'"""
397+
386398
guardrail_evals: Optional[List[str]] = None
387399
"""Evals that should trigger guardrail"""
388400

@@ -409,6 +421,9 @@ class QueryLogListResponse(BaseModel):
409421
primary_eval_issue_score: Optional[float] = None
410422
"""Score of the primary eval issue"""
411423

424+
similar_query_log_guardrail_explanation: Optional[str] = None
425+
"""Explanation from a similar bad query log that caused this to be guardrailed"""
426+
412427
tools: Optional[List[Tool]] = None
413428
"""Tools to use for the LLM call.
414429

src/codex/types/projects/query_log_retrieve_response.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,18 @@ class QueryLogRetrieveResponse(BaseModel):
387387
Used to log tool calls in the query log.
388388
"""
389389

390+
expert_review_created_at: Optional[datetime] = None
391+
"""When the expert review was created"""
392+
393+
expert_review_created_by_user_id: Optional[str] = None
394+
"""ID of the user who created the expert review"""
395+
396+
expert_review_explanation: Optional[str] = None
397+
"""Expert explanation when marked as bad"""
398+
399+
expert_review_status: Optional[Literal["good", "bad"]] = None
400+
"""Expert review status: 'good' or 'bad'"""
401+
390402
guardrail_evals: Optional[List[str]] = None
391403
"""Evals that should trigger guardrail"""
392404

@@ -416,6 +428,9 @@ class QueryLogRetrieveResponse(BaseModel):
416428
primary_eval_issue_score: Optional[float] = None
417429
"""Score of the primary eval issue"""
418430

431+
similar_query_log_guardrail_explanation: Optional[str] = None
432+
"""Explanation from a similar bad query log that caused this to be guardrailed"""
433+
419434
tools: Optional[List[Tool]] = None
420435
"""Tools to use for the LLM call.
421436

0 commit comments

Comments
 (0)