Skip to content

Commit 3216627

Browse files
feat(api): api update
1 parent 10350c1 commit 3216627

File tree

4 files changed

+315
-42
lines changed

4 files changed

+315
-42
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: 55
2-
openapi_spec_hash: f17890d85522687a4c68702da9ad2efb
2+
openapi_spec_hash: 922886934580d0b2addcb6e26ada0e09
33
config_hash: 8f6e5c3b064cbb77569a6bf654954a56

src/codex/resources/projects/projects.py

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -488,17 +488,18 @@ def validate(
488488
project_id: str,
489489
*,
490490
context: str,
491-
prompt: str,
492491
query: str,
493-
response: str,
492+
response: project_validate_params.Response,
494493
use_llm_matching: bool | NotGiven = NOT_GIVEN,
495494
constrain_outputs: Optional[List[str]] | NotGiven = NOT_GIVEN,
496495
custom_eval_thresholds: Optional[Dict[str, float]] | NotGiven = NOT_GIVEN,
497496
custom_metadata: Optional[object] | NotGiven = NOT_GIVEN,
498497
eval_scores: Optional[Dict[str, float]] | NotGiven = NOT_GIVEN,
499-
messages: Optional[Iterable[project_validate_params.Message]] | NotGiven = NOT_GIVEN,
498+
messages: Iterable[project_validate_params.Message] | NotGiven = NOT_GIVEN,
500499
options: Optional[project_validate_params.Options] | NotGiven = NOT_GIVEN,
500+
prompt: Optional[str] | NotGiven = NOT_GIVEN,
501501
quality_preset: Literal["best", "high", "medium", "low", "base"] | NotGiven = NOT_GIVEN,
502+
rewritten_question: Optional[str] | NotGiven = NOT_GIVEN,
502503
task: Optional[str] | NotGiven = NOT_GIVEN,
503504
x_client_library_version: str | NotGiven = NOT_GIVEN,
504505
x_integration_type: str | NotGiven = NOT_GIVEN,
@@ -526,9 +527,8 @@ def validate(
526527
eval_scores: Scores assessing different aspects of the RAG system. If not provided, TLM will
527528
be used to generate scores.
528529
529-
messages: Optional message history to provide conversation context for the query. Used to
530-
rewrite query into a self-contained version of itself. If not provided, the
531-
query will be treated as self-contained.
530+
messages: Message history to provide conversation context for the query. Messages contain
531+
up to and including the latest user prompt to the LLM.
532532
533533
options: Typed dict of advanced configuration options for the Trustworthy Language Model.
534534
Many of these configurations are determined by the quality preset selected
@@ -615,8 +615,14 @@ def validate(
615615
- name: Name of the evaluation criteria.
616616
- criteria: Instructions specifying the evaluation criteria.
617617
618+
prompt: The prompt to use for the TLM call. If not provided, the prompt will be
619+
generated from the messages.
620+
618621
quality_preset: The quality preset to use for the TLM or Trustworthy RAG API.
619622
623+
rewritten_question: The re-written query if it was provided by the client to Codex from a user to be
624+
used instead of the original query.
625+
620626
extra_headers: Send extra headers
621627
622628
extra_query: Add additional query parameters to the request
@@ -643,7 +649,6 @@ def validate(
643649
body=maybe_transform(
644650
{
645651
"context": context,
646-
"prompt": prompt,
647652
"query": query,
648653
"response": response,
649654
"constrain_outputs": constrain_outputs,
@@ -652,7 +657,9 @@ def validate(
652657
"eval_scores": eval_scores,
653658
"messages": messages,
654659
"options": options,
660+
"prompt": prompt,
655661
"quality_preset": quality_preset,
662+
"rewritten_question": rewritten_question,
656663
"task": task,
657664
},
658665
project_validate_params.ProjectValidateParams,
@@ -1090,17 +1097,18 @@ async def validate(
10901097
project_id: str,
10911098
*,
10921099
context: str,
1093-
prompt: str,
10941100
query: str,
1095-
response: str,
1101+
response: project_validate_params.Response,
10961102
use_llm_matching: bool | NotGiven = NOT_GIVEN,
10971103
constrain_outputs: Optional[List[str]] | NotGiven = NOT_GIVEN,
10981104
custom_eval_thresholds: Optional[Dict[str, float]] | NotGiven = NOT_GIVEN,
10991105
custom_metadata: Optional[object] | NotGiven = NOT_GIVEN,
11001106
eval_scores: Optional[Dict[str, float]] | NotGiven = NOT_GIVEN,
1101-
messages: Optional[Iterable[project_validate_params.Message]] | NotGiven = NOT_GIVEN,
1107+
messages: Iterable[project_validate_params.Message] | NotGiven = NOT_GIVEN,
11021108
options: Optional[project_validate_params.Options] | NotGiven = NOT_GIVEN,
1109+
prompt: Optional[str] | NotGiven = NOT_GIVEN,
11031110
quality_preset: Literal["best", "high", "medium", "low", "base"] | NotGiven = NOT_GIVEN,
1111+
rewritten_question: Optional[str] | NotGiven = NOT_GIVEN,
11041112
task: Optional[str] | NotGiven = NOT_GIVEN,
11051113
x_client_library_version: str | NotGiven = NOT_GIVEN,
11061114
x_integration_type: str | NotGiven = NOT_GIVEN,
@@ -1128,9 +1136,8 @@ async def validate(
11281136
eval_scores: Scores assessing different aspects of the RAG system. If not provided, TLM will
11291137
be used to generate scores.
11301138
1131-
messages: Optional message history to provide conversation context for the query. Used to
1132-
rewrite query into a self-contained version of itself. If not provided, the
1133-
query will be treated as self-contained.
1139+
messages: Message history to provide conversation context for the query. Messages contain
1140+
up to and including the latest user prompt to the LLM.
11341141
11351142
options: Typed dict of advanced configuration options for the Trustworthy Language Model.
11361143
Many of these configurations are determined by the quality preset selected
@@ -1217,8 +1224,14 @@ async def validate(
12171224
- name: Name of the evaluation criteria.
12181225
- criteria: Instructions specifying the evaluation criteria.
12191226
1227+
prompt: The prompt to use for the TLM call. If not provided, the prompt will be
1228+
generated from the messages.
1229+
12201230
quality_preset: The quality preset to use for the TLM or Trustworthy RAG API.
12211231
1232+
rewritten_question: The re-written query if it was provided by the client to Codex from a user to be
1233+
used instead of the original query.
1234+
12221235
extra_headers: Send extra headers
12231236
12241237
extra_query: Add additional query parameters to the request
@@ -1245,7 +1258,6 @@ async def validate(
12451258
body=await async_maybe_transform(
12461259
{
12471260
"context": context,
1248-
"prompt": prompt,
12491261
"query": query,
12501262
"response": response,
12511263
"constrain_outputs": constrain_outputs,
@@ -1254,7 +1266,9 @@ async def validate(
12541266
"eval_scores": eval_scores,
12551267
"messages": messages,
12561268
"options": options,
1269+
"prompt": prompt,
12571270
"quality_preset": quality_preset,
1271+
"rewritten_question": rewritten_question,
12581272
"task": task,
12591273
},
12601274
project_validate_params.ProjectValidateParams,

0 commit comments

Comments
 (0)