openai-types 0.1.3

Typed OpenAI API models — zero dependencies beyond serde
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
// AUTO-GENERATED by py2rust — do not edit.
// Re-generate: python3 scripts/py2rust.py sync <python_dir> <rust_dir>
// Domain: evals

use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct SourceFileContentContent {
    pub item: std::collections::HashMap<String, serde_json::Value>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub sample: Option<std::collections::HashMap<String, serde_json::Value>>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct SourceFileContent {
    /// The content of the jsonl file.
    pub content: Vec<SourceFileContentContent>,
    /// The type of jsonl source. Always `file_content`.
    #[serde(rename = "type")]
    pub type_: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct SourceFileID {
    /// The identifier of the file.
    pub id: String,
    /// The type of jsonl source. Always `file_id`.
    #[serde(rename = "type")]
    pub type_: String,
}

/// A StoredCompletionsRunDataSource configuration describing a set of filters
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct SourceStoredCompletions {
    /// The type of source. Always `stored_completions`.
    #[serde(rename = "type")]
    pub type_: String,
    /// An optional Unix timestamp to filter items created after this time.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub created_after: Option<i64>,
    /// An optional Unix timestamp to filter items created before this time.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub created_before: Option<i64>,
    /// An optional maximum number of items to return.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub limit: Option<i64>,
    /// Set of 16 key-value pairs that can be attached to an object.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub metadata: Option<serde_json::Value>,
    /// An optional model to filter by (e.g., 'gpt-4o').
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub model: Option<String>,
}

pub type Source = serde_json::Value;

/// A text output from the model.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct InputMessagesTemplateTemplateEvalItemContentOutputText {
    /// The text output from the model.
    pub text: String,
    /// The type of the output text. Always `output_text`.
    #[serde(rename = "type")]
    pub type_: String,
}

/// An image input block used within EvalItem content arrays.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct InputMessagesTemplateTemplateEvalItemContentInputImage {
    /// The URL of the image input.
    pub image_url: String,
    /// The type of the image input. Always `input_image`.
    #[serde(rename = "type")]
    pub type_: String,
    /// The detail level of the image to be sent to the model.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub detail: Option<String>,
}

pub type InputMessagesTemplateTemplateEvalItemContent = serde_json::Value;

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
#[non_exhaustive]
pub enum InputMessagesTemplateTemplateEvalItemRole {
    #[serde(rename = "user")]
    User,
    #[serde(rename = "assistant")]
    Assistant,
    #[serde(rename = "system")]
    System,
    #[serde(rename = "developer")]
    Developer,
}

/// A message input to the model with a role indicating instruction following
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct InputMessagesTemplateTemplateEvalItem {
    /// Inputs to the model - can contain template strings.
    pub content: InputMessagesTemplateTemplateEvalItemContent,
    /// The role of the message input.
    pub role: InputMessagesTemplateTemplateEvalItemRole,
    /// The type of the message input. Always `message`.
    #[serde(rename = "type", skip_serializing_if = "Option::is_none", default)]
    pub type_: Option<String>,
}

pub type InputMessagesTemplateTemplate = serde_json::Value;

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct InputMessagesTemplate {
    /// A list of chat messages forming the prompt or context.
    pub template: Vec<InputMessagesTemplateTemplate>,
    /// The type of input messages. Always `template`.
    #[serde(rename = "type")]
    pub type_: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct InputMessagesItemReference {
    /// A reference to a variable in the `item` namespace. Ie, "item.input_trajectory"
    pub item_reference: String,
    /// The type of input messages. Always `item_reference`.
    #[serde(rename = "type")]
    pub type_: String,
}

pub type InputMessages = serde_json::Value;

pub type SamplingParamsResponseFormat = serde_json::Value;

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct SamplingParams {
    /// The maximum number of tokens in the generated output.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub max_completion_tokens: Option<i64>,
    /// Constrains effort on reasoning for
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub reasoning_effort: Option<serde_json::Value>,
    /// An object specifying the format that the model must output.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub response_format: Option<SamplingParamsResponseFormat>,
    /// A seed value to initialize the randomness, during sampling.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub seed: Option<i64>,
    /// A higher temperature increases randomness in the outputs.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub temperature: Option<f64>,
    /// A list of tools the model may call.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub tools: Option<Vec<serde_json::Value>>,
    /// An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub top_p: Option<f64>,
}

/// A CompletionsRunDataSource object describing a model sampling configuration.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct CreateEvalCompletionsRunDataSource {
    /// Determines what populates the `item` namespace in this run's data source.
    pub source: Source,
    /// The type of run data source. Always `completions`.
    #[serde(rename = "type")]
    pub type_: String,
    /// Used when sampling from a model.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub input_messages: Option<InputMessages>,
    /// The name of the model to use for generating completions (e.g. "o3-mini").
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub model: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub sampling_params: Option<SamplingParams>,
}

/// A JsonlRunDataSource object with that specifies a JSONL file that matches the eval
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct CreateEvalJSONLRunDataSource {
    /// Determines what populates the `item` namespace in the data source.
    pub source: Source,
    /// The type of data source. Always `jsonl`.
    #[serde(rename = "type")]
    pub type_: String,
}

/// An object representing an error response from the Eval API.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct EvalAPIError {
    /// The error code.
    pub code: String,
    /// The error message.
    pub message: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceResponsesSourceFileContentContent {
    pub item: std::collections::HashMap<String, serde_json::Value>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub sample: Option<std::collections::HashMap<String, serde_json::Value>>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceResponsesSourceFileContent {
    /// The content of the jsonl file.
    pub content: Vec<DataSourceResponsesSourceFileContentContent>,
    /// The type of jsonl source. Always `file_content`.
    #[serde(rename = "type")]
    pub type_: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceResponsesSourceFileID {
    /// The identifier of the file.
    pub id: String,
    /// The type of jsonl source. Always `file_id`.
    #[serde(rename = "type")]
    pub type_: String,
}

/// A EvalResponsesSource object describing a run data source configuration.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceResponsesSourceResponses {
    /// The type of run data source. Always `responses`.
    #[serde(rename = "type")]
    pub type_: String,
    /// Only include items created after this timestamp (inclusive).
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub created_after: Option<i64>,
    /// Only include items created before this timestamp (inclusive).
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub created_before: Option<i64>,
    /// Optional string to search the 'instructions' field.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub instructions_search: Option<String>,
    /// Metadata filter for the responses.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub metadata: Option<serde_json::Value>,
    /// The name of the model to find responses for.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub model: Option<String>,
    /// Constrains effort on reasoning for
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub reasoning_effort: Option<serde_json::Value>,
    /// Sampling temperature. This is a query parameter used to select responses.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub temperature: Option<f64>,
    /// List of tool names. This is a query parameter used to select responses.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub tools: Option<Vec<String>>,
    /// Nucleus sampling parameter. This is a query parameter used to select responses.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub top_p: Option<f64>,
    /// List of user identifiers. This is a query parameter used to select responses.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub users: Option<Vec<String>>,
}

pub type DataSourceResponsesSource = serde_json::Value;

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceResponsesInputMessagesTemplateTemplateChatMessage {
    /// The content of the message.
    pub content: String,
    /// The role of the message (e.g. "system", "assistant", "user").
    pub role: String,
}

/// A text output from the model.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceResponsesInputMessagesTemplateTemplateEvalItemContentOutputText {
    /// The text output from the model.
    pub text: String,
    /// The type of the output text. Always `output_text`.
    #[serde(rename = "type")]
    pub type_: String,
}

/// An image input block used within EvalItem content arrays.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceResponsesInputMessagesTemplateTemplateEvalItemContentInputImage {
    /// The URL of the image input.
    pub image_url: String,
    /// The type of the image input. Always `input_image`.
    #[serde(rename = "type")]
    pub type_: String,
    /// The detail level of the image to be sent to the model.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub detail: Option<String>,
}

pub type DataSourceResponsesInputMessagesTemplateTemplateEvalItemContent = serde_json::Value;

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
#[non_exhaustive]
pub enum DataSourceResponsesInputMessagesTemplateTemplateEvalItemRole {
    #[serde(rename = "user")]
    User,
    #[serde(rename = "assistant")]
    Assistant,
    #[serde(rename = "system")]
    System,
    #[serde(rename = "developer")]
    Developer,
}

/// A message input to the model with a role indicating instruction following
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceResponsesInputMessagesTemplateTemplateEvalItem {
    /// Inputs to the model - can contain template strings.
    pub content: DataSourceResponsesInputMessagesTemplateTemplateEvalItemContent,
    /// The role of the message input.
    pub role: DataSourceResponsesInputMessagesTemplateTemplateEvalItemRole,
    /// The type of the message input. Always `message`.
    #[serde(rename = "type", skip_serializing_if = "Option::is_none", default)]
    pub type_: Option<String>,
}

pub type DataSourceResponsesInputMessagesTemplateTemplate = serde_json::Value;

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceResponsesInputMessagesTemplate {
    /// A list of chat messages forming the prompt or context.
    pub template: Vec<DataSourceResponsesInputMessagesTemplateTemplate>,
    /// The type of input messages. Always `template`.
    #[serde(rename = "type")]
    pub type_: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceResponsesInputMessagesItemReference {
    /// A reference to a variable in the `item` namespace. Ie, "item.name"
    pub item_reference: String,
    /// The type of input messages. Always `item_reference`.
    #[serde(rename = "type")]
    pub type_: String,
}

pub type DataSourceResponsesInputMessages = serde_json::Value;

/// Configuration options for a text response from the model.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceResponsesSamplingParamsText {
    /// An object specifying the format that the model must output.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub format: Option<serde_json::Value>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceResponsesSamplingParams {
    /// The maximum number of tokens in the generated output.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub max_completion_tokens: Option<i64>,
    /// Constrains effort on reasoning for
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub reasoning_effort: Option<serde_json::Value>,
    /// A seed value to initialize the randomness, during sampling.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub seed: Option<i64>,
    /// A higher temperature increases randomness in the outputs.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub temperature: Option<f64>,
    /// Configuration options for a text response from the model.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub text: Option<DataSourceResponsesSamplingParamsText>,
    /// An array of tools the model may call while generating a response.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub tools: Option<Vec<serde_json::Value>>,
    /// An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub top_p: Option<f64>,
}

/// A ResponsesRunDataSource object describing a model sampling configuration.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceResponses {
    /// Determines what populates the `item` namespace in this run's data source.
    pub source: DataSourceResponsesSource,
    /// The type of run data source. Always `responses`.
    #[serde(rename = "type")]
    pub type_: String,
    /// Used when sampling from a model.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub input_messages: Option<DataSourceResponsesInputMessages>,
    /// The name of the model to use for generating completions (e.g. "o3-mini").
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub model: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub sampling_params: Option<DataSourceResponsesSamplingParams>,
}

pub type DataSource = serde_json::Value;

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct PerModelUsage {
    /// The number of tokens retrieved from cache.
    pub cached_tokens: i64,
    /// The number of completion tokens generated.
    pub completion_tokens: i64,
    /// The number of invocations.
    pub invocation_count: i64,
    /// The name of the model.
    #[serde(rename = "model_name")]
    pub run_model_name: String,
    /// The number of prompt tokens used.
    pub prompt_tokens: i64,
    /// The total number of tokens used.
    pub total_tokens: i64,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct PerTestingCriteriaResult {
    /// Number of tests failed for this criteria.
    pub failed: i64,
    /// Number of tests passed for this criteria.
    pub passed: i64,
    /// A description of the testing criteria.
    pub testing_criteria: String,
}

/// Counters summarizing the outcomes of the evaluation run.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct ResultCounts {
    /// Number of output items that resulted in an error.
    pub errored: i64,
    /// Number of output items that failed to pass the evaluation.
    pub failed: i64,
    /// Number of output items that passed the evaluation.
    pub passed: i64,
    /// Total number of executed output items.
    pub total: i64,
}

/// A schema representing an evaluation run.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct RunCancelResponse {
    /// Unique identifier for the evaluation run.
    pub id: String,
    /// Unix timestamp (in seconds) when the evaluation run was created.
    pub created_at: i64,
    /// Information about the run's data source.
    pub data_source: DataSource,
    /// An object representing an error response from the Eval API.
    pub error: EvalAPIError,
    /// The identifier of the associated evaluation.
    pub eval_id: String,
    /// Set of 16 key-value pairs that can be attached to an object.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub metadata: Option<serde_json::Value>,
    /// The model that is evaluated, if applicable.
    pub model: String,
    /// The name of the evaluation run.
    pub name: String,
    /// The type of the object. Always "eval.run".
    pub object: String,
    /// Usage statistics for each model during the evaluation run.
    pub per_model_usage: Vec<PerModelUsage>,
    /// Results per testing criteria applied during the evaluation run.
    pub per_testing_criteria_results: Vec<PerTestingCriteriaResult>,
    /// The URL to the rendered evaluation run report on the UI dashboard.
    pub report_url: String,
    /// Counters summarizing the outcomes of the evaluation run.
    pub result_counts: ResultCounts,
    /// The status of the evaluation run.
    pub status: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct RunCreateParams {
    /// Details about the run's data source.
    pub data_source: DataSource,
    /// Set of 16 key-value pairs that can be attached to an object.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub metadata: Option<serde_json::Value>,
    /// The name of the run.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub name: Option<String>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceCreateEvalResponsesRunDataSourceSourceFileContentContent {
    pub item: std::collections::HashMap<String, serde_json::Value>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub sample: Option<std::collections::HashMap<String, serde_json::Value>>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceCreateEvalResponsesRunDataSourceSourceFileContent {
    /// The content of the jsonl file.
    pub content: Vec<DataSourceCreateEvalResponsesRunDataSourceSourceFileContentContent>,
    /// The type of jsonl source. Always `file_content`.
    #[serde(rename = "type")]
    pub type_: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceCreateEvalResponsesRunDataSourceSourceFileID {
    /// The identifier of the file.
    pub id: String,
    /// The type of jsonl source. Always `file_id`.
    #[serde(rename = "type")]
    pub type_: String,
}

/// A EvalResponsesSource object describing a run data source configuration.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceCreateEvalResponsesRunDataSourceSourceResponses {
    /// The type of run data source. Always `responses`.
    #[serde(rename = "type")]
    pub type_: String,
    /// Only include items created after this timestamp (inclusive).
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub created_after: Option<i64>,
    /// Only include items created before this timestamp (inclusive).
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub created_before: Option<i64>,
    /// Optional string to search the 'instructions' field.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub instructions_search: Option<String>,
    /// Metadata filter for the responses.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub metadata: Option<serde_json::Value>,
    /// The name of the model to find responses for.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub model: Option<String>,
    /// Constrains effort on reasoning for
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub reasoning_effort: Option<serde_json::Value>,
    /// Sampling temperature. This is a query parameter used to select responses.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub temperature: Option<f64>,
    /// List of tool names. This is a query parameter used to select responses.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub tools: Option<serde_json::Value>,
    /// Nucleus sampling parameter. This is a query parameter used to select responses.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub top_p: Option<f64>,
    /// List of user identifiers. This is a query parameter used to select responses.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub users: Option<serde_json::Value>,
}

pub type DataSourceCreateEvalResponsesRunDataSourceSource = serde_json::Value;

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplateChatMessage {
    /// The content of the message.
    pub content: String,
    /// The role of the message (e.g. "system", "assistant", "user").
    pub role: String,
}

/// A text output from the model.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplateEvalItemContentOutputText {
    /// The text output from the model.
    pub text: String,
    /// The type of the output text. Always `output_text`.
    #[serde(rename = "type")]
    pub type_: String,
}

/// An image input block used within EvalItem content arrays.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplateEvalItemContentInputImage {
    /// The URL of the image input.
    pub image_url: String,
    /// The type of the image input. Always `input_image`.
    #[serde(rename = "type")]
    pub type_: String,
    /// The detail level of the image to be sent to the model.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub detail: Option<String>,
}

pub type DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplateEvalItemContent = serde_json::Value;

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
#[non_exhaustive]
pub enum DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplateEvalItemRole {
    #[serde(rename = "user")]
    User,
    #[serde(rename = "assistant")]
    Assistant,
    #[serde(rename = "system")]
    System,
    #[serde(rename = "developer")]
    Developer,
}

/// A message input to the model with a role indicating instruction following
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplateEvalItem {
    /// Inputs to the model - can contain template strings.
    pub content: DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplateEvalItemContent,
    /// The role of the message input.
    pub role: DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplateEvalItemRole,
    /// The type of the message input. Always `message`.
    #[serde(rename = "type", skip_serializing_if = "Option::is_none", default)]
    pub type_: Option<String>,
}

pub type DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplate = serde_json::Value;

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplate {
    /// A list of chat messages forming the prompt or context.
    pub template: Vec<DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplate>,
    /// The type of input messages. Always `template`.
    #[serde(rename = "type")]
    pub type_: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceCreateEvalResponsesRunDataSourceInputMessagesItemReference {
    /// A reference to a variable in the `item` namespace. Ie, "item.name"
    pub item_reference: String,
    /// The type of input messages. Always `item_reference`.
    #[serde(rename = "type")]
    pub type_: String,
}

pub type DataSourceCreateEvalResponsesRunDataSourceInputMessages = serde_json::Value;

/// Configuration options for a text response from the model.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceCreateEvalResponsesRunDataSourceSamplingParamsText {
    /// An object specifying the format that the model must output.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub format: Option<serde_json::Value>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceCreateEvalResponsesRunDataSourceSamplingParams {
    /// The maximum number of tokens in the generated output.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub max_completion_tokens: Option<i64>,
    /// Constrains effort on reasoning for
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub reasoning_effort: Option<serde_json::Value>,
    /// A seed value to initialize the randomness, during sampling.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub seed: Option<i64>,
    /// A higher temperature increases randomness in the outputs.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub temperature: Option<f64>,
    /// Configuration options for a text response from the model.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub text: Option<DataSourceCreateEvalResponsesRunDataSourceSamplingParamsText>,
    /// An array of tools the model may call while generating a response.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub tools: Option<Vec<serde_json::Value>>,
    /// An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub top_p: Option<f64>,
}

/// A ResponsesRunDataSource object describing a model sampling configuration.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceCreateEvalResponsesRunDataSource {
    /// Determines what populates the `item` namespace in this run's data source.
    pub source: DataSourceCreateEvalResponsesRunDataSourceSource,
    /// The type of run data source. Always `responses`.
    #[serde(rename = "type")]
    pub type_: String,
    /// Used when sampling from a model.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub input_messages: Option<DataSourceCreateEvalResponsesRunDataSourceInputMessages>,
    /// The name of the model to use for generating completions (e.g. "o3-mini").
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub model: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub sampling_params: Option<DataSourceCreateEvalResponsesRunDataSourceSamplingParams>,
}

/// A schema representing an evaluation run.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct RunCreateResponse {
    /// Unique identifier for the evaluation run.
    pub id: String,
    /// Unix timestamp (in seconds) when the evaluation run was created.
    pub created_at: i64,
    /// Information about the run's data source.
    pub data_source: DataSource,
    /// An object representing an error response from the Eval API.
    pub error: EvalAPIError,
    /// The identifier of the associated evaluation.
    pub eval_id: String,
    /// Set of 16 key-value pairs that can be attached to an object.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub metadata: Option<serde_json::Value>,
    /// The model that is evaluated, if applicable.
    pub model: String,
    /// The name of the evaluation run.
    pub name: String,
    /// The type of the object. Always "eval.run".
    pub object: String,
    /// Usage statistics for each model during the evaluation run.
    pub per_model_usage: Vec<PerModelUsage>,
    /// Results per testing criteria applied during the evaluation run.
    pub per_testing_criteria_results: Vec<PerTestingCriteriaResult>,
    /// The URL to the rendered evaluation run report on the UI dashboard.
    pub report_url: String,
    /// Counters summarizing the outcomes of the evaluation run.
    pub result_counts: ResultCounts,
    /// The status of the evaluation run.
    pub status: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct RunDeleteResponse {
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub deleted: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub object: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub run_id: Option<String>,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
#[non_exhaustive]
pub enum RunListParamsOrder {
    #[serde(rename = "asc")]
    Asc,
    #[serde(rename = "desc")]
    Desc,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
#[non_exhaustive]
pub enum RunListParamsStatus {
    #[serde(rename = "queued")]
    Queued,
    #[serde(rename = "in_progress")]
    InProgress,
    #[serde(rename = "completed")]
    Completed,
    #[serde(rename = "canceled")]
    Canceled,
    #[serde(rename = "failed")]
    Failed,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct RunListParams {
    /// Identifier for the last run from the previous pagination request.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub after: Option<String>,
    /// Number of runs to retrieve.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub limit: Option<i64>,
    /// Sort order for runs by timestamp.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub order: Option<RunListParamsOrder>,
    /// Filter runs by status.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub status: Option<RunListParamsStatus>,
}

/// A schema representing an evaluation run.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct RunListResponse {
    /// Unique identifier for the evaluation run.
    pub id: String,
    /// Unix timestamp (in seconds) when the evaluation run was created.
    pub created_at: i64,
    /// Information about the run's data source.
    pub data_source: DataSource,
    /// An object representing an error response from the Eval API.
    pub error: EvalAPIError,
    /// The identifier of the associated evaluation.
    pub eval_id: String,
    /// Set of 16 key-value pairs that can be attached to an object.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub metadata: Option<serde_json::Value>,
    /// The model that is evaluated, if applicable.
    pub model: String,
    /// The name of the evaluation run.
    pub name: String,
    /// The type of the object. Always "eval.run".
    pub object: String,
    /// Usage statistics for each model during the evaluation run.
    pub per_model_usage: Vec<PerModelUsage>,
    /// Results per testing criteria applied during the evaluation run.
    pub per_testing_criteria_results: Vec<PerTestingCriteriaResult>,
    /// The URL to the rendered evaluation run report on the UI dashboard.
    pub report_url: String,
    /// Counters summarizing the outcomes of the evaluation run.
    pub result_counts: ResultCounts,
    /// The status of the evaluation run.
    pub status: String,
}

/// A schema representing an evaluation run.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct RunRetrieveResponse {
    /// Unique identifier for the evaluation run.
    pub id: String,
    /// Unix timestamp (in seconds) when the evaluation run was created.
    pub created_at: i64,
    /// Information about the run's data source.
    pub data_source: DataSource,
    /// An object representing an error response from the Eval API.
    pub error: EvalAPIError,
    /// The identifier of the associated evaluation.
    pub eval_id: String,
    /// Set of 16 key-value pairs that can be attached to an object.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub metadata: Option<serde_json::Value>,
    /// The model that is evaluated, if applicable.
    pub model: String,
    /// The name of the evaluation run.
    pub name: String,
    /// The type of the object. Always "eval.run".
    pub object: String,
    /// Usage statistics for each model during the evaluation run.
    pub per_model_usage: Vec<PerModelUsage>,
    /// Results per testing criteria applied during the evaluation run.
    pub per_testing_criteria_results: Vec<PerTestingCriteriaResult>,
    /// The URL to the rendered evaluation run report on the UI dashboard.
    pub report_url: String,
    /// Counters summarizing the outcomes of the evaluation run.
    pub result_counts: ResultCounts,
    /// The status of the evaluation run.
    pub status: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct EvalCreateParams {
    /// The configuration for the data source used for the evaluation runs.
    pub data_source_config: DataSourceConfig,
    /// A list of graders for all eval runs in this group.
    pub testing_criteria: Vec<TestingCriterion>,
    /// Set of 16 key-value pairs that can be attached to an object.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub metadata: Option<serde_json::Value>,
    /// The name of the evaluation.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub name: Option<String>,
}

/// A CustomDataSourceConfig object that defines the schema for the data source used for the evaluation runs.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceConfigCustom {
    /// The json schema for each row in the data source.
    pub item_schema: std::collections::HashMap<String, serde_json::Value>,
    /// The type of data source. Always `custom`.
    #[serde(rename = "type")]
    pub type_: String,
    /// Whether the eval should expect you to populate the sample namespace (ie, by
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub include_sample_schema: Option<bool>,
}

/// A data source config which specifies the metadata property of your logs query.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceConfigLogs {
    /// The type of data source. Always `logs`.
    #[serde(rename = "type")]
    pub type_: String,
    /// Metadata filters for the logs data source.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub metadata: Option<std::collections::HashMap<String, serde_json::Value>>,
}

/// Deprecated in favor of LogsDataSourceConfig.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DataSourceConfigStoredCompletions {
    /// The type of data source. Always `stored_completions`.
    #[serde(rename = "type")]
    pub type_: String,
    /// Metadata filters for the stored completions data source.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub metadata: Option<std::collections::HashMap<String, serde_json::Value>>,
}

pub type DataSourceConfig = serde_json::Value;

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct TestingCriterionLabelModelInputSimpleInputMessage {
    /// The content of the message.
    pub content: String,
    /// The role of the message (e.g. "system", "assistant", "user").
    pub role: String,
}

/// A text output from the model.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct TestingCriterionLabelModelInputEvalItemContentOutputText {
    /// The text output from the model.
    pub text: String,
    /// The type of the output text. Always `output_text`.
    #[serde(rename = "type")]
    pub type_: String,
}

/// An image input block used within EvalItem content arrays.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct TestingCriterionLabelModelInputEvalItemContentInputImage {
    /// The URL of the image input.
    pub image_url: String,
    /// The type of the image input. Always `input_image`.
    #[serde(rename = "type")]
    pub type_: String,
    /// The detail level of the image to be sent to the model.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub detail: Option<String>,
}

pub type TestingCriterionLabelModelInputEvalItemContent = serde_json::Value;

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
#[non_exhaustive]
pub enum TestingCriterionLabelModelInputEvalItemRole {
    #[serde(rename = "user")]
    User,
    #[serde(rename = "assistant")]
    Assistant,
    #[serde(rename = "system")]
    System,
    #[serde(rename = "developer")]
    Developer,
}

/// A message input to the model with a role indicating instruction following
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct TestingCriterionLabelModelInputEvalItem {
    /// Inputs to the model - can contain template strings.
    pub content: TestingCriterionLabelModelInputEvalItemContent,
    /// The role of the message input.
    pub role: TestingCriterionLabelModelInputEvalItemRole,
    /// The type of the message input. Always `message`.
    #[serde(rename = "type", skip_serializing_if = "Option::is_none", default)]
    pub type_: Option<String>,
}

pub type TestingCriterionLabelModelInput = serde_json::Value;

/// A LabelModelGrader object which uses a model to assign labels to each item
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct TestingCriterionLabelModel {
    /// A list of chat messages forming the prompt or context.
    pub input: Vec<TestingCriterionLabelModelInput>,
    /// The labels to classify to each item in the evaluation.
    pub labels: serde_json::Value,
    /// The model to use for the evaluation. Must support structured outputs.
    pub model: String,
    /// The name of the grader.
    pub name: String,
    /// The labels that indicate a passing result. Must be a subset of labels.
    pub passing_labels: serde_json::Value,
    /// The object type, which is always `label_model`.
    #[serde(rename = "type")]
    pub type_: String,
}

pub type TestingCriterion = serde_json::Value;

/// An Eval object with a data source config and testing criteria.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct EvalCreateResponse {
    /// Unique identifier for the evaluation.
    pub id: String,
    /// The Unix timestamp (in seconds) for when the eval was created.
    pub created_at: i64,
    /// Configuration of data sources used in runs of the evaluation.
    pub data_source_config: DataSourceConfig,
    /// Set of 16 key-value pairs that can be attached to an object.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub metadata: Option<serde_json::Value>,
    /// The name of the evaluation.
    pub name: String,
    /// The object type.
    pub object: String,
    /// A list of testing criteria.
    pub testing_criteria: Vec<TestingCriterion>,
}

/// A CustomDataSourceConfig which specifies the schema of your `item` and optionally `sample` namespaces.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct EvalCustomDataSourceConfig {
    /// The json schema for the run data source items. Learn how to build JSON schemas
    #[serde(rename = "schema")]
    pub schema_: std::collections::HashMap<String, serde_json::Value>,
    /// The type of data source. Always `custom`.
    #[serde(rename = "type")]
    pub type_: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct EvalDeleteResponse {
    pub deleted: bool,
    pub eval_id: String,
    pub object: String,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
#[non_exhaustive]
pub enum EvalListParamsOrder {
    #[serde(rename = "asc")]
    Asc,
    #[serde(rename = "desc")]
    Desc,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
#[non_exhaustive]
pub enum EvalListParamsOrderBy {
    #[serde(rename = "created_at")]
    CreatedAt,
    #[serde(rename = "updated_at")]
    UpdatedAt,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct EvalListParams {
    /// Identifier for the last eval from the previous pagination request.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub after: Option<String>,
    /// Number of evals to retrieve.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub limit: Option<i64>,
    /// Sort order for evals by timestamp.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub order: Option<EvalListParamsOrder>,
    /// Evals can be ordered by creation time or last updated time.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub order_by: Option<EvalListParamsOrderBy>,
}

/// An Eval object with a data source config and testing criteria.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct EvalListResponse {
    /// Unique identifier for the evaluation.
    pub id: String,
    /// The Unix timestamp (in seconds) for when the eval was created.
    pub created_at: i64,
    /// Configuration of data sources used in runs of the evaluation.
    pub data_source_config: DataSourceConfig,
    /// Set of 16 key-value pairs that can be attached to an object.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub metadata: Option<serde_json::Value>,
    /// The name of the evaluation.
    pub name: String,
    /// The object type.
    pub object: String,
    /// A list of testing criteria.
    pub testing_criteria: Vec<TestingCriterion>,
}

/// An Eval object with a data source config and testing criteria.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct EvalRetrieveResponse {
    /// Unique identifier for the evaluation.
    pub id: String,
    /// The Unix timestamp (in seconds) for when the eval was created.
    pub created_at: i64,
    /// Configuration of data sources used in runs of the evaluation.
    pub data_source_config: DataSourceConfig,
    /// Set of 16 key-value pairs that can be attached to an object.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub metadata: Option<serde_json::Value>,
    /// The name of the evaluation.
    pub name: String,
    /// The object type.
    pub object: String,
    /// A list of testing criteria.
    pub testing_criteria: Vec<TestingCriterion>,
}

/// Deprecated in favor of LogsDataSourceConfig.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct EvalStoredCompletionsDataSourceConfig {
    /// The json schema for the run data source items. Learn how to build JSON schemas
    #[serde(rename = "schema")]
    pub schema_: std::collections::HashMap<String, serde_json::Value>,
    /// The type of data source. Always `stored_completions`.
    #[serde(rename = "type")]
    pub type_: String,
    /// Set of 16 key-value pairs that can be attached to an object.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub metadata: Option<serde_json::Value>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct EvalUpdateParams {
    /// Set of 16 key-value pairs that can be attached to an object.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub metadata: Option<serde_json::Value>,
    /// Rename the evaluation.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub name: Option<String>,
}

/// An Eval object with a data source config and testing criteria.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct EvalUpdateResponse {
    /// Unique identifier for the evaluation.
    pub id: String,
    /// The Unix timestamp (in seconds) for when the eval was created.
    pub created_at: i64,
    /// Configuration of data sources used in runs of the evaluation.
    pub data_source_config: DataSourceConfig,
    /// Set of 16 key-value pairs that can be attached to an object.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub metadata: Option<serde_json::Value>,
    /// The name of the evaluation.
    pub name: String,
    /// The object type.
    pub object: String,
    /// A list of testing criteria.
    pub testing_criteria: Vec<TestingCriterion>,
}