@@ -488,18 +488,17 @@ def validate(
488
488
project_id : str ,
489
489
* ,
490
490
context : str ,
491
+ prompt : str ,
491
492
query : str ,
492
- response : project_validate_params . Response ,
493
+ response : str ,
493
494
use_llm_matching : bool | NotGiven = NOT_GIVEN ,
494
495
constrain_outputs : Optional [List [str ]] | NotGiven = NOT_GIVEN ,
495
496
custom_eval_thresholds : Optional [Dict [str , float ]] | NotGiven = NOT_GIVEN ,
496
497
custom_metadata : Optional [object ] | NotGiven = NOT_GIVEN ,
497
498
eval_scores : Optional [Dict [str , float ]] | NotGiven = NOT_GIVEN ,
498
- messages : Iterable [project_validate_params .Message ] | NotGiven = NOT_GIVEN ,
499
+ messages : Optional [ Iterable [project_validate_params .Message ] ] | NotGiven = NOT_GIVEN ,
499
500
options : Optional [project_validate_params .Options ] | NotGiven = NOT_GIVEN ,
500
- prompt : Optional [str ] | NotGiven = NOT_GIVEN ,
501
501
quality_preset : Literal ["best" , "high" , "medium" , "low" , "base" ] | NotGiven = NOT_GIVEN ,
502
- rewritten_question : Optional [str ] | NotGiven = NOT_GIVEN ,
503
502
task : Optional [str ] | NotGiven = NOT_GIVEN ,
504
503
x_client_library_version : str | NotGiven = NOT_GIVEN ,
505
504
x_integration_type : str | NotGiven = NOT_GIVEN ,
@@ -527,8 +526,9 @@ def validate(
527
526
eval_scores: Scores assessing different aspects of the RAG system. If not provided, TLM will
528
527
be used to generate scores.
529
528
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.
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.
532
532
533
533
options: Typed dict of advanced configuration options for the Trustworthy Language Model.
534
534
Many of these configurations are determined by the quality preset selected
@@ -615,14 +615,8 @@ def validate(
615
615
- name: Name of the evaluation criteria.
616
616
- criteria: Instructions specifying the evaluation criteria.
617
617
618
- prompt: The prompt to use for the TLM call. If not provided, the prompt will be
619
- generated from the messages.
620
-
621
618
quality_preset: The quality preset to use for the TLM or Trustworthy RAG API.
622
619
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
-
626
620
extra_headers: Send extra headers
627
621
628
622
extra_query: Add additional query parameters to the request
@@ -649,6 +643,7 @@ def validate(
649
643
body = maybe_transform (
650
644
{
651
645
"context" : context ,
646
+ "prompt" : prompt ,
652
647
"query" : query ,
653
648
"response" : response ,
654
649
"constrain_outputs" : constrain_outputs ,
@@ -657,9 +652,7 @@ def validate(
657
652
"eval_scores" : eval_scores ,
658
653
"messages" : messages ,
659
654
"options" : options ,
660
- "prompt" : prompt ,
661
655
"quality_preset" : quality_preset ,
662
- "rewritten_question" : rewritten_question ,
663
656
"task" : task ,
664
657
},
665
658
project_validate_params .ProjectValidateParams ,
@@ -1097,18 +1090,17 @@ async def validate(
1097
1090
project_id : str ,
1098
1091
* ,
1099
1092
context : str ,
1093
+ prompt : str ,
1100
1094
query : str ,
1101
- response : project_validate_params . Response ,
1095
+ response : str ,
1102
1096
use_llm_matching : bool | NotGiven = NOT_GIVEN ,
1103
1097
constrain_outputs : Optional [List [str ]] | NotGiven = NOT_GIVEN ,
1104
1098
custom_eval_thresholds : Optional [Dict [str , float ]] | NotGiven = NOT_GIVEN ,
1105
1099
custom_metadata : Optional [object ] | NotGiven = NOT_GIVEN ,
1106
1100
eval_scores : Optional [Dict [str , float ]] | NotGiven = NOT_GIVEN ,
1107
- messages : Iterable [project_validate_params .Message ] | NotGiven = NOT_GIVEN ,
1101
+ messages : Optional [ Iterable [project_validate_params .Message ] ] | NotGiven = NOT_GIVEN ,
1108
1102
options : Optional [project_validate_params .Options ] | NotGiven = NOT_GIVEN ,
1109
- prompt : Optional [str ] | NotGiven = NOT_GIVEN ,
1110
1103
quality_preset : Literal ["best" , "high" , "medium" , "low" , "base" ] | NotGiven = NOT_GIVEN ,
1111
- rewritten_question : Optional [str ] | NotGiven = NOT_GIVEN ,
1112
1104
task : Optional [str ] | NotGiven = NOT_GIVEN ,
1113
1105
x_client_library_version : str | NotGiven = NOT_GIVEN ,
1114
1106
x_integration_type : str | NotGiven = NOT_GIVEN ,
@@ -1136,8 +1128,9 @@ async def validate(
1136
1128
eval_scores: Scores assessing different aspects of the RAG system. If not provided, TLM will
1137
1129
be used to generate scores.
1138
1130
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.
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.
1141
1134
1142
1135
options: Typed dict of advanced configuration options for the Trustworthy Language Model.
1143
1136
Many of these configurations are determined by the quality preset selected
@@ -1224,14 +1217,8 @@ async def validate(
1224
1217
- name: Name of the evaluation criteria.
1225
1218
- criteria: Instructions specifying the evaluation criteria.
1226
1219
1227
- prompt: The prompt to use for the TLM call. If not provided, the prompt will be
1228
- generated from the messages.
1229
-
1230
1220
quality_preset: The quality preset to use for the TLM or Trustworthy RAG API.
1231
1221
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
-
1235
1222
extra_headers: Send extra headers
1236
1223
1237
1224
extra_query: Add additional query parameters to the request
@@ -1258,6 +1245,7 @@ async def validate(
1258
1245
body = await async_maybe_transform (
1259
1246
{
1260
1247
"context" : context ,
1248
+ "prompt" : prompt ,
1261
1249
"query" : query ,
1262
1250
"response" : response ,
1263
1251
"constrain_outputs" : constrain_outputs ,
@@ -1266,9 +1254,7 @@ async def validate(
1266
1254
"eval_scores" : eval_scores ,
1267
1255
"messages" : messages ,
1268
1256
"options" : options ,
1269
- "prompt" : prompt ,
1270
1257
"quality_preset" : quality_preset ,
1271
- "rewritten_question" : rewritten_question ,
1272
1258
"task" : task ,
1273
1259
},
1274
1260
project_validate_params .ProjectValidateParams ,
0 commit comments