Skip to content

Commit 54beb02

Browse files
feat(api): api update
1 parent 16ec26b commit 54beb02

13 files changed

+135
-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: b752c79a72b1b72b4b5aea40e27c16c5
2+
openapi_spec_hash: ef5807baa380babd037f9b6271761eae
33
config_hash: 6c3ad84d97bf1d0989ad2ec0cae64078

src/codex/resources/projects/query_logs.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ def list(
118118
List[Literal["hallucination", "search_failure", "unhelpful", "difficult_query", "ungrounded"]]
119119
]
120120
| NotGiven = NOT_GIVEN,
121+
search_text: Optional[str] | NotGiven = NOT_GIVEN,
121122
sort: Optional[str] | NotGiven = NOT_GIVEN,
122123
tool_call_names: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
123124
was_cache_hit: Optional[bool] | NotGiven = NOT_GIVEN,
@@ -150,6 +151,9 @@ def list(
150151
151152
primary_eval_issue: Filter logs that have ANY of these primary evaluation issues (OR operation)
152153
154+
search_text: Case-insensitive search across evaluated_response and question fields
155+
(original_question if available, otherwise question)
156+
153157
sort: Field or score to sort by.
154158
155159
Available fields: 'created_at', 'primary_eval_issue_score'.
@@ -197,6 +201,7 @@ def list(
197201
"order": order,
198202
"passed_evals": passed_evals,
199203
"primary_eval_issue": primary_eval_issue,
204+
"search_text": search_text,
200205
"sort": sort,
201206
"tool_call_names": tool_call_names,
202207
"was_cache_hit": was_cache_hit,
@@ -268,6 +273,7 @@ def list_by_group(
268273
]
269274
| NotGiven = NOT_GIVEN,
270275
remediation_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
276+
search_text: Optional[str] | NotGiven = NOT_GIVEN,
271277
sort: Optional[str] | NotGiven = NOT_GIVEN,
272278
tool_call_names: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
273279
was_cache_hit: Optional[bool] | NotGiven = NOT_GIVEN,
@@ -304,6 +310,9 @@ def list_by_group(
304310
305311
remediation_ids: List of groups to list child logs for
306312
313+
search_text: Case-insensitive search across evaluated_response and question fields
314+
(original_question if available, otherwise question)
315+
307316
sort: Field or score to sort by.
308317
309318
Available fields: 'created_at', 'primary_eval_issue_score'.
@@ -352,6 +361,7 @@ def list_by_group(
352361
"passed_evals": passed_evals,
353362
"primary_eval_issue": primary_eval_issue,
354363
"remediation_ids": remediation_ids,
364+
"search_text": search_text,
355365
"sort": sort,
356366
"tool_call_names": tool_call_names,
357367
"was_cache_hit": was_cache_hit,
@@ -382,6 +392,7 @@ def list_groups(
382392
List[Literal["hallucination", "search_failure", "unhelpful", "difficult_query", "ungrounded"]]
383393
]
384394
| NotGiven = NOT_GIVEN,
395+
search_text: Optional[str] | NotGiven = NOT_GIVEN,
385396
sort: Optional[str] | NotGiven = NOT_GIVEN,
386397
tool_call_names: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
387398
was_cache_hit: Optional[bool] | NotGiven = NOT_GIVEN,
@@ -416,6 +427,9 @@ def list_groups(
416427
417428
primary_eval_issue: Filter logs that have ANY of these primary evaluation issues (OR operation)
418429
430+
search_text: Case-insensitive search across evaluated_response and question fields
431+
(original_question if available, otherwise question)
432+
419433
sort: Field or score to sort by.
420434
421435
Available fields: 'created_at', 'custom_rank', 'impact_score',
@@ -465,6 +479,7 @@ def list_groups(
465479
"order": order,
466480
"passed_evals": passed_evals,
467481
"primary_eval_issue": primary_eval_issue,
482+
"search_text": search_text,
468483
"sort": sort,
469484
"tool_call_names": tool_call_names,
470485
"was_cache_hit": was_cache_hit,
@@ -625,6 +640,7 @@ def list(
625640
List[Literal["hallucination", "search_failure", "unhelpful", "difficult_query", "ungrounded"]]
626641
]
627642
| NotGiven = NOT_GIVEN,
643+
search_text: Optional[str] | NotGiven = NOT_GIVEN,
628644
sort: Optional[str] | NotGiven = NOT_GIVEN,
629645
tool_call_names: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
630646
was_cache_hit: Optional[bool] | NotGiven = NOT_GIVEN,
@@ -657,6 +673,9 @@ def list(
657673
658674
primary_eval_issue: Filter logs that have ANY of these primary evaluation issues (OR operation)
659675
676+
search_text: Case-insensitive search across evaluated_response and question fields
677+
(original_question if available, otherwise question)
678+
660679
sort: Field or score to sort by.
661680
662681
Available fields: 'created_at', 'primary_eval_issue_score'.
@@ -704,6 +723,7 @@ def list(
704723
"order": order,
705724
"passed_evals": passed_evals,
706725
"primary_eval_issue": primary_eval_issue,
726+
"search_text": search_text,
707727
"sort": sort,
708728
"tool_call_names": tool_call_names,
709729
"was_cache_hit": was_cache_hit,
@@ -777,6 +797,7 @@ async def list_by_group(
777797
]
778798
| NotGiven = NOT_GIVEN,
779799
remediation_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
800+
search_text: Optional[str] | NotGiven = NOT_GIVEN,
780801
sort: Optional[str] | NotGiven = NOT_GIVEN,
781802
tool_call_names: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
782803
was_cache_hit: Optional[bool] | NotGiven = NOT_GIVEN,
@@ -813,6 +834,9 @@ async def list_by_group(
813834
814835
remediation_ids: List of groups to list child logs for
815836
837+
search_text: Case-insensitive search across evaluated_response and question fields
838+
(original_question if available, otherwise question)
839+
816840
sort: Field or score to sort by.
817841
818842
Available fields: 'created_at', 'primary_eval_issue_score'.
@@ -861,6 +885,7 @@ async def list_by_group(
861885
"passed_evals": passed_evals,
862886
"primary_eval_issue": primary_eval_issue,
863887
"remediation_ids": remediation_ids,
888+
"search_text": search_text,
864889
"sort": sort,
865890
"tool_call_names": tool_call_names,
866891
"was_cache_hit": was_cache_hit,
@@ -891,6 +916,7 @@ def list_groups(
891916
List[Literal["hallucination", "search_failure", "unhelpful", "difficult_query", "ungrounded"]]
892917
]
893918
| NotGiven = NOT_GIVEN,
919+
search_text: Optional[str] | NotGiven = NOT_GIVEN,
894920
sort: Optional[str] | NotGiven = NOT_GIVEN,
895921
tool_call_names: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
896922
was_cache_hit: Optional[bool] | NotGiven = NOT_GIVEN,
@@ -925,6 +951,9 @@ def list_groups(
925951
926952
primary_eval_issue: Filter logs that have ANY of these primary evaluation issues (OR operation)
927953
954+
search_text: Case-insensitive search across evaluated_response and question fields
955+
(original_question if available, otherwise question)
956+
928957
sort: Field or score to sort by.
929958
930959
Available fields: 'created_at', 'custom_rank', 'impact_score',
@@ -974,6 +1003,7 @@ def list_groups(
9741003
"order": order,
9751004
"passed_evals": passed_evals,
9761005
"primary_eval_issue": primary_eval_issue,
1006+
"search_text": search_text,
9771007
"sort": sort,
9781008
"tool_call_names": tool_call_names,
9791009
"was_cache_hit": was_cache_hit,

src/codex/types/project_create_params.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,10 @@ class Config(TypedDict, total=False):
333333

334334
query_use_llm_matching: bool
335335

336+
question_match_llm_prompt: str
337+
338+
question_match_llm_prompt_with_answer: str
339+
336340
tlm_evals_model: str
337341

338342
upper_llm_match_distance_threshold: float

src/codex/types/project_list_response.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,10 @@ class ProjectConfig(BaseModel):
323323

324324
query_use_llm_matching: Optional[bool] = None
325325

326+
question_match_llm_prompt: Optional[str] = None
327+
328+
question_match_llm_prompt_with_answer: Optional[str] = None
329+
326330
tlm_evals_model: Optional[str] = None
327331

328332
upper_llm_match_distance_threshold: Optional[float] = None

src/codex/types/project_retrieve_response.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,10 @@ class Config(BaseModel):
322322

323323
query_use_llm_matching: Optional[bool] = None
324324

325+
question_match_llm_prompt: Optional[str] = None
326+
327+
question_match_llm_prompt_with_answer: Optional[str] = None
328+
325329
tlm_evals_model: Optional[str] = None
326330

327331
upper_llm_match_distance_threshold: Optional[float] = None

src/codex/types/project_return_schema.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,10 @@ class Config(BaseModel):
322322

323323
query_use_llm_matching: Optional[bool] = None
324324

325+
question_match_llm_prompt: Optional[str] = None
326+
327+
question_match_llm_prompt_with_answer: Optional[str] = None
328+
325329
tlm_evals_model: Optional[str] = None
326330

327331
upper_llm_match_distance_threshold: Optional[float] = None

src/codex/types/project_update_params.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,10 @@ class Config(TypedDict, total=False):
331331

332332
query_use_llm_matching: bool
333333

334+
question_match_llm_prompt: str
335+
336+
question_match_llm_prompt_with_answer: str
337+
334338
tlm_evals_model: str
335339

336340
upper_llm_match_distance_threshold: float

src/codex/types/projects/query_log_list_by_group_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ class QueryLogListByGroupParams(TypedDict, total=False):
5454
remediation_ids: SequenceNotStr[str]
5555
"""List of groups to list child logs for"""
5656

57+
search_text: Optional[str]
58+
"""
59+
Case-insensitive search across evaluated_response and question fields
60+
(original_question if available, otherwise question)
61+
"""
62+
5763
sort: Optional[str]
5864
"""Field or score to sort by.
5965

src/codex/types/projects/query_log_list_by_group_response.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"QueryLogsByGroupQueryLogMessageChatCompletionDeveloperMessageParamContentUnionMember1",
4646
"QueryLogsByGroupQueryLogTool",
4747
"QueryLogsByGroupQueryLogToolFunction",
48+
"Filters",
4849
]
4950

5051

@@ -456,11 +457,62 @@ class QueryLogsByGroup(BaseModel):
456457
total_count: int
457458

458459

460+
class Filters(BaseModel):
461+
custom_metadata_dict: Optional[object] = None
462+
463+
created_at_end: Optional[datetime] = None
464+
"""Filter logs created at or before this timestamp"""
465+
466+
created_at_start: Optional[datetime] = None
467+
"""Filter logs created at or after this timestamp"""
468+
469+
custom_metadata: Optional[str] = None
470+
"""Filter by custom metadata as JSON string: {"key1": "value1", "key2": "value2"}"""
471+
472+
expert_review_status: Optional[Literal["good", "bad"]] = None
473+
"""Filter by expert review status"""
474+
475+
failed_evals: Optional[List[str]] = None
476+
"""Filter by evals that failed"""
477+
478+
guardrailed: Optional[bool] = None
479+
"""Filter by guardrailed status"""
480+
481+
has_tool_calls: Optional[bool] = None
482+
"""Filter by whether the query log has tool calls"""
483+
484+
needs_review: Optional[bool] = None
485+
"""Filter logs that need review"""
486+
487+
passed_evals: Optional[List[str]] = None
488+
"""Filter by evals that passed"""
489+
490+
primary_eval_issue: Optional[
491+
List[Literal["hallucination", "search_failure", "unhelpful", "difficult_query", "ungrounded"]]
492+
] = None
493+
"""Filter logs that have ANY of these primary evaluation issues (OR operation)"""
494+
495+
search_text: Optional[str] = None
496+
"""
497+
Case-insensitive search across evaluated_response and question fields
498+
(original_question if available, otherwise question)
499+
"""
500+
501+
tool_call_names: Optional[List[str]] = None
502+
"""Filter by names of tools called in the assistant response"""
503+
504+
was_cache_hit: Optional[bool] = None
505+
"""Filter by cache hit status"""
506+
507+
459508
class QueryLogListByGroupResponse(BaseModel):
460509
custom_metadata_columns: List[str]
461510
"""Columns of the custom metadata"""
462511

463512
query_logs_by_group: Dict[str, QueryLogsByGroup]
464513

514+
filters: Optional[Filters] = None
515+
"""Applied filters for the query"""
516+
465517
tool_names: Optional[List[str]] = None
466518
"""Names of the tools available in queries"""

src/codex/types/projects/query_log_list_groups_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ class QueryLogListGroupsParams(TypedDict, total=False):
5151
]
5252
"""Filter logs that have ANY of these primary evaluation issues (OR operation)"""
5353

54+
search_text: Optional[str]
55+
"""
56+
Case-insensitive search across evaluated_response and question fields
57+
(original_question if available, otherwise question)
58+
"""
59+
5460
sort: Optional[str]
5561
"""Field or score to sort by.
5662

0 commit comments

Comments
 (0)