Skip to main content

openai_types/evals/
_gen.rs

1// AUTO-GENERATED by py2rust — do not edit.
2// Re-generate: python3 scripts/py2rust.py sync <python_dir> <rust_dir>
3// Domain: evals
4
5use serde::{Deserialize, Serialize};
6
7#[derive(Debug, Clone, Serialize, Deserialize)]
8#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
9pub struct SourceFileContentContent {
10    pub item: std::collections::HashMap<String, serde_json::Value>,
11    #[serde(skip_serializing_if = "Option::is_none", default)]
12    pub sample: Option<std::collections::HashMap<String, serde_json::Value>>,
13}
14
15#[derive(Debug, Clone, Serialize, Deserialize)]
16#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
17pub struct SourceFileContent {
18    /// The content of the jsonl file.
19    pub content: Vec<SourceFileContentContent>,
20    /// The type of jsonl source. Always `file_content`.
21    #[serde(rename = "type")]
22    pub type_: String,
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize)]
26#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
27pub struct SourceFileID {
28    /// The identifier of the file.
29    pub id: String,
30    /// The type of jsonl source. Always `file_id`.
31    #[serde(rename = "type")]
32    pub type_: String,
33}
34
35/// A StoredCompletionsRunDataSource configuration describing a set of filters
36#[derive(Debug, Clone, Serialize, Deserialize)]
37#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
38pub struct SourceStoredCompletions {
39    /// The type of source. Always `stored_completions`.
40    #[serde(rename = "type")]
41    pub type_: String,
42    /// An optional Unix timestamp to filter items created after this time.
43    #[serde(skip_serializing_if = "Option::is_none", default)]
44    pub created_after: Option<i64>,
45    /// An optional Unix timestamp to filter items created before this time.
46    #[serde(skip_serializing_if = "Option::is_none", default)]
47    pub created_before: Option<i64>,
48    /// An optional maximum number of items to return.
49    #[serde(skip_serializing_if = "Option::is_none", default)]
50    pub limit: Option<i64>,
51    /// Set of 16 key-value pairs that can be attached to an object.
52    #[serde(skip_serializing_if = "Option::is_none", default)]
53    pub metadata: Option<serde_json::Value>,
54    /// An optional model to filter by (e.g., 'gpt-4o').
55    #[serde(skip_serializing_if = "Option::is_none", default)]
56    pub model: Option<String>,
57}
58
59pub type Source = serde_json::Value;
60
61/// A text output from the model.
62#[derive(Debug, Clone, Serialize, Deserialize)]
63#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
64pub struct InputMessagesTemplateTemplateEvalItemContentOutputText {
65    /// The text output from the model.
66    pub text: String,
67    /// The type of the output text. Always `output_text`.
68    #[serde(rename = "type")]
69    pub type_: String,
70}
71
72/// An image input block used within EvalItem content arrays.
73#[derive(Debug, Clone, Serialize, Deserialize)]
74#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
75pub struct InputMessagesTemplateTemplateEvalItemContentInputImage {
76    /// The URL of the image input.
77    pub image_url: String,
78    /// The type of the image input. Always `input_image`.
79    #[serde(rename = "type")]
80    pub type_: String,
81    /// The detail level of the image to be sent to the model.
82    #[serde(skip_serializing_if = "Option::is_none", default)]
83    pub detail: Option<String>,
84}
85
86pub type InputMessagesTemplateTemplateEvalItemContent = serde_json::Value;
87
88#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
89#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
90#[non_exhaustive]
91pub enum InputMessagesTemplateTemplateEvalItemRole {
92    #[serde(rename = "user")]
93    User,
94    #[serde(rename = "assistant")]
95    Assistant,
96    #[serde(rename = "system")]
97    System,
98    #[serde(rename = "developer")]
99    Developer,
100}
101
102/// A message input to the model with a role indicating instruction following
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
105pub struct InputMessagesTemplateTemplateEvalItem {
106    /// Inputs to the model - can contain template strings.
107    pub content: InputMessagesTemplateTemplateEvalItemContent,
108    /// The role of the message input.
109    pub role: InputMessagesTemplateTemplateEvalItemRole,
110    /// The type of the message input. Always `message`.
111    #[serde(rename = "type", skip_serializing_if = "Option::is_none", default)]
112    pub type_: Option<String>,
113}
114
115pub type InputMessagesTemplateTemplate = serde_json::Value;
116
117#[derive(Debug, Clone, Serialize, Deserialize)]
118#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
119pub struct InputMessagesTemplate {
120    /// A list of chat messages forming the prompt or context.
121    pub template: Vec<InputMessagesTemplateTemplate>,
122    /// The type of input messages. Always `template`.
123    #[serde(rename = "type")]
124    pub type_: String,
125}
126
127#[derive(Debug, Clone, Serialize, Deserialize)]
128#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
129pub struct InputMessagesItemReference {
130    /// A reference to a variable in the `item` namespace. Ie, "item.input_trajectory"
131    pub item_reference: String,
132    /// The type of input messages. Always `item_reference`.
133    #[serde(rename = "type")]
134    pub type_: String,
135}
136
137pub type InputMessages = serde_json::Value;
138
139pub type SamplingParamsResponseFormat = serde_json::Value;
140
141#[derive(Debug, Clone, Serialize, Deserialize)]
142#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
143pub struct SamplingParams {
144    /// The maximum number of tokens in the generated output.
145    #[serde(skip_serializing_if = "Option::is_none", default)]
146    pub max_completion_tokens: Option<i64>,
147    /// Constrains effort on reasoning for
148    #[serde(skip_serializing_if = "Option::is_none", default)]
149    pub reasoning_effort: Option<serde_json::Value>,
150    /// An object specifying the format that the model must output.
151    #[serde(skip_serializing_if = "Option::is_none", default)]
152    pub response_format: Option<SamplingParamsResponseFormat>,
153    /// A seed value to initialize the randomness, during sampling.
154    #[serde(skip_serializing_if = "Option::is_none", default)]
155    pub seed: Option<i64>,
156    /// A higher temperature increases randomness in the outputs.
157    #[serde(skip_serializing_if = "Option::is_none", default)]
158    pub temperature: Option<f64>,
159    /// A list of tools the model may call.
160    #[serde(skip_serializing_if = "Option::is_none", default)]
161    pub tools: Option<Vec<serde_json::Value>>,
162    /// An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
163    #[serde(skip_serializing_if = "Option::is_none", default)]
164    pub top_p: Option<f64>,
165}
166
167/// A CompletionsRunDataSource object describing a model sampling configuration.
168#[derive(Debug, Clone, Serialize, Deserialize)]
169#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
170pub struct CreateEvalCompletionsRunDataSource {
171    /// Determines what populates the `item` namespace in this run's data source.
172    pub source: Source,
173    /// The type of run data source. Always `completions`.
174    #[serde(rename = "type")]
175    pub type_: String,
176    /// Used when sampling from a model.
177    #[serde(skip_serializing_if = "Option::is_none", default)]
178    pub input_messages: Option<InputMessages>,
179    /// The name of the model to use for generating completions (e.g. "o3-mini").
180    #[serde(skip_serializing_if = "Option::is_none", default)]
181    pub model: Option<String>,
182    #[serde(skip_serializing_if = "Option::is_none", default)]
183    pub sampling_params: Option<SamplingParams>,
184}
185
186/// A JsonlRunDataSource object with that specifies a JSONL file that matches the eval
187#[derive(Debug, Clone, Serialize, Deserialize)]
188#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
189pub struct CreateEvalJSONLRunDataSource {
190    /// Determines what populates the `item` namespace in the data source.
191    pub source: Source,
192    /// The type of data source. Always `jsonl`.
193    #[serde(rename = "type")]
194    pub type_: String,
195}
196
197/// An object representing an error response from the Eval API.
198#[derive(Debug, Clone, Serialize, Deserialize)]
199#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
200pub struct EvalAPIError {
201    /// The error code.
202    pub code: String,
203    /// The error message.
204    pub message: String,
205}
206
207#[derive(Debug, Clone, Serialize, Deserialize)]
208#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
209pub struct DataSourceResponsesSourceFileContentContent {
210    pub item: std::collections::HashMap<String, serde_json::Value>,
211    #[serde(skip_serializing_if = "Option::is_none", default)]
212    pub sample: Option<std::collections::HashMap<String, serde_json::Value>>,
213}
214
215#[derive(Debug, Clone, Serialize, Deserialize)]
216#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
217pub struct DataSourceResponsesSourceFileContent {
218    /// The content of the jsonl file.
219    pub content: Vec<DataSourceResponsesSourceFileContentContent>,
220    /// The type of jsonl source. Always `file_content`.
221    #[serde(rename = "type")]
222    pub type_: String,
223}
224
225#[derive(Debug, Clone, Serialize, Deserialize)]
226#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
227pub struct DataSourceResponsesSourceFileID {
228    /// The identifier of the file.
229    pub id: String,
230    /// The type of jsonl source. Always `file_id`.
231    #[serde(rename = "type")]
232    pub type_: String,
233}
234
235/// A EvalResponsesSource object describing a run data source configuration.
236#[derive(Debug, Clone, Serialize, Deserialize)]
237#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
238pub struct DataSourceResponsesSourceResponses {
239    /// The type of run data source. Always `responses`.
240    #[serde(rename = "type")]
241    pub type_: String,
242    /// Only include items created after this timestamp (inclusive).
243    #[serde(skip_serializing_if = "Option::is_none", default)]
244    pub created_after: Option<i64>,
245    /// Only include items created before this timestamp (inclusive).
246    #[serde(skip_serializing_if = "Option::is_none", default)]
247    pub created_before: Option<i64>,
248    /// Optional string to search the 'instructions' field.
249    #[serde(skip_serializing_if = "Option::is_none", default)]
250    pub instructions_search: Option<String>,
251    /// Metadata filter for the responses.
252    #[serde(skip_serializing_if = "Option::is_none", default)]
253    pub metadata: Option<serde_json::Value>,
254    /// The name of the model to find responses for.
255    #[serde(skip_serializing_if = "Option::is_none", default)]
256    pub model: Option<String>,
257    /// Constrains effort on reasoning for
258    #[serde(skip_serializing_if = "Option::is_none", default)]
259    pub reasoning_effort: Option<serde_json::Value>,
260    /// Sampling temperature. This is a query parameter used to select responses.
261    #[serde(skip_serializing_if = "Option::is_none", default)]
262    pub temperature: Option<f64>,
263    /// List of tool names. This is a query parameter used to select responses.
264    #[serde(skip_serializing_if = "Option::is_none", default)]
265    pub tools: Option<Vec<String>>,
266    /// Nucleus sampling parameter. This is a query parameter used to select responses.
267    #[serde(skip_serializing_if = "Option::is_none", default)]
268    pub top_p: Option<f64>,
269    /// List of user identifiers. This is a query parameter used to select responses.
270    #[serde(skip_serializing_if = "Option::is_none", default)]
271    pub users: Option<Vec<String>>,
272}
273
274pub type DataSourceResponsesSource = serde_json::Value;
275
276#[derive(Debug, Clone, Serialize, Deserialize)]
277#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
278pub struct DataSourceResponsesInputMessagesTemplateTemplateChatMessage {
279    /// The content of the message.
280    pub content: String,
281    /// The role of the message (e.g. "system", "assistant", "user").
282    pub role: String,
283}
284
285/// A text output from the model.
286#[derive(Debug, Clone, Serialize, Deserialize)]
287#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
288pub struct DataSourceResponsesInputMessagesTemplateTemplateEvalItemContentOutputText {
289    /// The text output from the model.
290    pub text: String,
291    /// The type of the output text. Always `output_text`.
292    #[serde(rename = "type")]
293    pub type_: String,
294}
295
296/// An image input block used within EvalItem content arrays.
297#[derive(Debug, Clone, Serialize, Deserialize)]
298#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
299pub struct DataSourceResponsesInputMessagesTemplateTemplateEvalItemContentInputImage {
300    /// The URL of the image input.
301    pub image_url: String,
302    /// The type of the image input. Always `input_image`.
303    #[serde(rename = "type")]
304    pub type_: String,
305    /// The detail level of the image to be sent to the model.
306    #[serde(skip_serializing_if = "Option::is_none", default)]
307    pub detail: Option<String>,
308}
309
310pub type DataSourceResponsesInputMessagesTemplateTemplateEvalItemContent = serde_json::Value;
311
312#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
313#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
314#[non_exhaustive]
315pub enum DataSourceResponsesInputMessagesTemplateTemplateEvalItemRole {
316    #[serde(rename = "user")]
317    User,
318    #[serde(rename = "assistant")]
319    Assistant,
320    #[serde(rename = "system")]
321    System,
322    #[serde(rename = "developer")]
323    Developer,
324}
325
326/// A message input to the model with a role indicating instruction following
327#[derive(Debug, Clone, Serialize, Deserialize)]
328#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
329pub struct DataSourceResponsesInputMessagesTemplateTemplateEvalItem {
330    /// Inputs to the model - can contain template strings.
331    pub content: DataSourceResponsesInputMessagesTemplateTemplateEvalItemContent,
332    /// The role of the message input.
333    pub role: DataSourceResponsesInputMessagesTemplateTemplateEvalItemRole,
334    /// The type of the message input. Always `message`.
335    #[serde(rename = "type", skip_serializing_if = "Option::is_none", default)]
336    pub type_: Option<String>,
337}
338
339pub type DataSourceResponsesInputMessagesTemplateTemplate = serde_json::Value;
340
341#[derive(Debug, Clone, Serialize, Deserialize)]
342#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
343pub struct DataSourceResponsesInputMessagesTemplate {
344    /// A list of chat messages forming the prompt or context.
345    pub template: Vec<DataSourceResponsesInputMessagesTemplateTemplate>,
346    /// The type of input messages. Always `template`.
347    #[serde(rename = "type")]
348    pub type_: String,
349}
350
351#[derive(Debug, Clone, Serialize, Deserialize)]
352#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
353pub struct DataSourceResponsesInputMessagesItemReference {
354    /// A reference to a variable in the `item` namespace. Ie, "item.name"
355    pub item_reference: String,
356    /// The type of input messages. Always `item_reference`.
357    #[serde(rename = "type")]
358    pub type_: String,
359}
360
361pub type DataSourceResponsesInputMessages = serde_json::Value;
362
363/// Configuration options for a text response from the model.
364#[derive(Debug, Clone, Serialize, Deserialize)]
365#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
366pub struct DataSourceResponsesSamplingParamsText {
367    /// An object specifying the format that the model must output.
368    #[serde(skip_serializing_if = "Option::is_none", default)]
369    pub format: Option<serde_json::Value>,
370}
371
372#[derive(Debug, Clone, Serialize, Deserialize)]
373#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
374pub struct DataSourceResponsesSamplingParams {
375    /// The maximum number of tokens in the generated output.
376    #[serde(skip_serializing_if = "Option::is_none", default)]
377    pub max_completion_tokens: Option<i64>,
378    /// Constrains effort on reasoning for
379    #[serde(skip_serializing_if = "Option::is_none", default)]
380    pub reasoning_effort: Option<serde_json::Value>,
381    /// A seed value to initialize the randomness, during sampling.
382    #[serde(skip_serializing_if = "Option::is_none", default)]
383    pub seed: Option<i64>,
384    /// A higher temperature increases randomness in the outputs.
385    #[serde(skip_serializing_if = "Option::is_none", default)]
386    pub temperature: Option<f64>,
387    /// Configuration options for a text response from the model.
388    #[serde(skip_serializing_if = "Option::is_none", default)]
389    pub text: Option<DataSourceResponsesSamplingParamsText>,
390    /// An array of tools the model may call while generating a response.
391    #[serde(skip_serializing_if = "Option::is_none", default)]
392    pub tools: Option<Vec<serde_json::Value>>,
393    /// An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
394    #[serde(skip_serializing_if = "Option::is_none", default)]
395    pub top_p: Option<f64>,
396}
397
398/// A ResponsesRunDataSource object describing a model sampling configuration.
399#[derive(Debug, Clone, Serialize, Deserialize)]
400#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
401pub struct DataSourceResponses {
402    /// Determines what populates the `item` namespace in this run's data source.
403    pub source: DataSourceResponsesSource,
404    /// The type of run data source. Always `responses`.
405    #[serde(rename = "type")]
406    pub type_: String,
407    /// Used when sampling from a model.
408    #[serde(skip_serializing_if = "Option::is_none", default)]
409    pub input_messages: Option<DataSourceResponsesInputMessages>,
410    /// The name of the model to use for generating completions (e.g. "o3-mini").
411    #[serde(skip_serializing_if = "Option::is_none", default)]
412    pub model: Option<String>,
413    #[serde(skip_serializing_if = "Option::is_none", default)]
414    pub sampling_params: Option<DataSourceResponsesSamplingParams>,
415}
416
417pub type DataSource = serde_json::Value;
418
419#[derive(Debug, Clone, Serialize, Deserialize)]
420#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
421pub struct PerModelUsage {
422    /// The number of tokens retrieved from cache.
423    pub cached_tokens: i64,
424    /// The number of completion tokens generated.
425    pub completion_tokens: i64,
426    /// The number of invocations.
427    pub invocation_count: i64,
428    /// The name of the model.
429    #[serde(rename = "model_name")]
430    pub run_model_name: String,
431    /// The number of prompt tokens used.
432    pub prompt_tokens: i64,
433    /// The total number of tokens used.
434    pub total_tokens: i64,
435}
436
437#[derive(Debug, Clone, Serialize, Deserialize)]
438#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
439pub struct PerTestingCriteriaResult {
440    /// Number of tests failed for this criteria.
441    pub failed: i64,
442    /// Number of tests passed for this criteria.
443    pub passed: i64,
444    /// A description of the testing criteria.
445    pub testing_criteria: String,
446}
447
448/// Counters summarizing the outcomes of the evaluation run.
449#[derive(Debug, Clone, Serialize, Deserialize)]
450#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
451pub struct ResultCounts {
452    /// Number of output items that resulted in an error.
453    pub errored: i64,
454    /// Number of output items that failed to pass the evaluation.
455    pub failed: i64,
456    /// Number of output items that passed the evaluation.
457    pub passed: i64,
458    /// Total number of executed output items.
459    pub total: i64,
460}
461
462/// A schema representing an evaluation run.
463#[derive(Debug, Clone, Serialize, Deserialize)]
464#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
465pub struct RunCancelResponse {
466    /// Unique identifier for the evaluation run.
467    pub id: String,
468    /// Unix timestamp (in seconds) when the evaluation run was created.
469    pub created_at: i64,
470    /// Information about the run's data source.
471    pub data_source: DataSource,
472    /// An object representing an error response from the Eval API.
473    pub error: EvalAPIError,
474    /// The identifier of the associated evaluation.
475    pub eval_id: String,
476    /// Set of 16 key-value pairs that can be attached to an object.
477    #[serde(skip_serializing_if = "Option::is_none", default)]
478    pub metadata: Option<serde_json::Value>,
479    /// The model that is evaluated, if applicable.
480    pub model: String,
481    /// The name of the evaluation run.
482    pub name: String,
483    /// The type of the object. Always "eval.run".
484    pub object: String,
485    /// Usage statistics for each model during the evaluation run.
486    pub per_model_usage: Vec<PerModelUsage>,
487    /// Results per testing criteria applied during the evaluation run.
488    pub per_testing_criteria_results: Vec<PerTestingCriteriaResult>,
489    /// The URL to the rendered evaluation run report on the UI dashboard.
490    pub report_url: String,
491    /// Counters summarizing the outcomes of the evaluation run.
492    pub result_counts: ResultCounts,
493    /// The status of the evaluation run.
494    pub status: String,
495}
496
497#[derive(Debug, Clone, Serialize, Deserialize)]
498#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
499pub struct RunCreateParams {
500    /// Details about the run's data source.
501    pub data_source: DataSource,
502    /// Set of 16 key-value pairs that can be attached to an object.
503    #[serde(skip_serializing_if = "Option::is_none", default)]
504    pub metadata: Option<serde_json::Value>,
505    /// The name of the run.
506    #[serde(skip_serializing_if = "Option::is_none", default)]
507    pub name: Option<String>,
508}
509
510#[derive(Debug, Clone, Serialize, Deserialize)]
511#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
512pub struct DataSourceCreateEvalResponsesRunDataSourceSourceFileContentContent {
513    pub item: std::collections::HashMap<String, serde_json::Value>,
514    #[serde(skip_serializing_if = "Option::is_none", default)]
515    pub sample: Option<std::collections::HashMap<String, serde_json::Value>>,
516}
517
518#[derive(Debug, Clone, Serialize, Deserialize)]
519#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
520pub struct DataSourceCreateEvalResponsesRunDataSourceSourceFileContent {
521    /// The content of the jsonl file.
522    pub content: Vec<DataSourceCreateEvalResponsesRunDataSourceSourceFileContentContent>,
523    /// The type of jsonl source. Always `file_content`.
524    #[serde(rename = "type")]
525    pub type_: String,
526}
527
528#[derive(Debug, Clone, Serialize, Deserialize)]
529#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
530pub struct DataSourceCreateEvalResponsesRunDataSourceSourceFileID {
531    /// The identifier of the file.
532    pub id: String,
533    /// The type of jsonl source. Always `file_id`.
534    #[serde(rename = "type")]
535    pub type_: String,
536}
537
538/// A EvalResponsesSource object describing a run data source configuration.
539#[derive(Debug, Clone, Serialize, Deserialize)]
540#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
541pub struct DataSourceCreateEvalResponsesRunDataSourceSourceResponses {
542    /// The type of run data source. Always `responses`.
543    #[serde(rename = "type")]
544    pub type_: String,
545    /// Only include items created after this timestamp (inclusive).
546    #[serde(skip_serializing_if = "Option::is_none", default)]
547    pub created_after: Option<i64>,
548    /// Only include items created before this timestamp (inclusive).
549    #[serde(skip_serializing_if = "Option::is_none", default)]
550    pub created_before: Option<i64>,
551    /// Optional string to search the 'instructions' field.
552    #[serde(skip_serializing_if = "Option::is_none", default)]
553    pub instructions_search: Option<String>,
554    /// Metadata filter for the responses.
555    #[serde(skip_serializing_if = "Option::is_none", default)]
556    pub metadata: Option<serde_json::Value>,
557    /// The name of the model to find responses for.
558    #[serde(skip_serializing_if = "Option::is_none", default)]
559    pub model: Option<String>,
560    /// Constrains effort on reasoning for
561    #[serde(skip_serializing_if = "Option::is_none", default)]
562    pub reasoning_effort: Option<serde_json::Value>,
563    /// Sampling temperature. This is a query parameter used to select responses.
564    #[serde(skip_serializing_if = "Option::is_none", default)]
565    pub temperature: Option<f64>,
566    /// List of tool names. This is a query parameter used to select responses.
567    #[serde(skip_serializing_if = "Option::is_none", default)]
568    pub tools: Option<serde_json::Value>,
569    /// Nucleus sampling parameter. This is a query parameter used to select responses.
570    #[serde(skip_serializing_if = "Option::is_none", default)]
571    pub top_p: Option<f64>,
572    /// List of user identifiers. This is a query parameter used to select responses.
573    #[serde(skip_serializing_if = "Option::is_none", default)]
574    pub users: Option<serde_json::Value>,
575}
576
577pub type DataSourceCreateEvalResponsesRunDataSourceSource = serde_json::Value;
578
579#[derive(Debug, Clone, Serialize, Deserialize)]
580#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
581pub struct DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplateChatMessage {
582    /// The content of the message.
583    pub content: String,
584    /// The role of the message (e.g. "system", "assistant", "user").
585    pub role: String,
586}
587
588/// A text output from the model.
589#[derive(Debug, Clone, Serialize, Deserialize)]
590#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
591pub struct DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplateEvalItemContentOutputText {
592    /// The text output from the model.
593    pub text: String,
594    /// The type of the output text. Always `output_text`.
595    #[serde(rename = "type")]
596    pub type_: String,
597}
598
599/// An image input block used within EvalItem content arrays.
600#[derive(Debug, Clone, Serialize, Deserialize)]
601#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
602pub struct DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplateEvalItemContentInputImage {
603    /// The URL of the image input.
604    pub image_url: String,
605    /// The type of the image input. Always `input_image`.
606    #[serde(rename = "type")]
607    pub type_: String,
608    /// The detail level of the image to be sent to the model.
609    #[serde(skip_serializing_if = "Option::is_none", default)]
610    pub detail: Option<String>,
611}
612
613pub type DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplateEvalItemContent = serde_json::Value;
614
615#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
616#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
617#[non_exhaustive]
618pub enum DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplateEvalItemRole {
619    #[serde(rename = "user")]
620    User,
621    #[serde(rename = "assistant")]
622    Assistant,
623    #[serde(rename = "system")]
624    System,
625    #[serde(rename = "developer")]
626    Developer,
627}
628
629/// A message input to the model with a role indicating instruction following
630#[derive(Debug, Clone, Serialize, Deserialize)]
631#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
632pub struct DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplateEvalItem {
633    /// Inputs to the model - can contain template strings.
634    pub content: DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplateEvalItemContent,
635    /// The role of the message input.
636    pub role: DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplateEvalItemRole,
637    /// The type of the message input. Always `message`.
638    #[serde(rename = "type", skip_serializing_if = "Option::is_none", default)]
639    pub type_: Option<String>,
640}
641
642pub type DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplate = serde_json::Value;
643
644#[derive(Debug, Clone, Serialize, Deserialize)]
645#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
646pub struct DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplate {
647    /// A list of chat messages forming the prompt or context.
648    pub template: Vec<DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplate>,
649    /// The type of input messages. Always `template`.
650    #[serde(rename = "type")]
651    pub type_: String,
652}
653
654#[derive(Debug, Clone, Serialize, Deserialize)]
655#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
656pub struct DataSourceCreateEvalResponsesRunDataSourceInputMessagesItemReference {
657    /// A reference to a variable in the `item` namespace. Ie, "item.name"
658    pub item_reference: String,
659    /// The type of input messages. Always `item_reference`.
660    #[serde(rename = "type")]
661    pub type_: String,
662}
663
664pub type DataSourceCreateEvalResponsesRunDataSourceInputMessages = serde_json::Value;
665
666/// Configuration options for a text response from the model.
667#[derive(Debug, Clone, Serialize, Deserialize)]
668#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
669pub struct DataSourceCreateEvalResponsesRunDataSourceSamplingParamsText {
670    /// An object specifying the format that the model must output.
671    #[serde(skip_serializing_if = "Option::is_none", default)]
672    pub format: Option<serde_json::Value>,
673}
674
675#[derive(Debug, Clone, Serialize, Deserialize)]
676#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
677pub struct DataSourceCreateEvalResponsesRunDataSourceSamplingParams {
678    /// The maximum number of tokens in the generated output.
679    #[serde(skip_serializing_if = "Option::is_none", default)]
680    pub max_completion_tokens: Option<i64>,
681    /// Constrains effort on reasoning for
682    #[serde(skip_serializing_if = "Option::is_none", default)]
683    pub reasoning_effort: Option<serde_json::Value>,
684    /// A seed value to initialize the randomness, during sampling.
685    #[serde(skip_serializing_if = "Option::is_none", default)]
686    pub seed: Option<i64>,
687    /// A higher temperature increases randomness in the outputs.
688    #[serde(skip_serializing_if = "Option::is_none", default)]
689    pub temperature: Option<f64>,
690    /// Configuration options for a text response from the model.
691    #[serde(skip_serializing_if = "Option::is_none", default)]
692    pub text: Option<DataSourceCreateEvalResponsesRunDataSourceSamplingParamsText>,
693    /// An array of tools the model may call while generating a response.
694    #[serde(skip_serializing_if = "Option::is_none", default)]
695    pub tools: Option<Vec<serde_json::Value>>,
696    /// An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
697    #[serde(skip_serializing_if = "Option::is_none", default)]
698    pub top_p: Option<f64>,
699}
700
701/// A ResponsesRunDataSource object describing a model sampling configuration.
702#[derive(Debug, Clone, Serialize, Deserialize)]
703#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
704pub struct DataSourceCreateEvalResponsesRunDataSource {
705    /// Determines what populates the `item` namespace in this run's data source.
706    pub source: DataSourceCreateEvalResponsesRunDataSourceSource,
707    /// The type of run data source. Always `responses`.
708    #[serde(rename = "type")]
709    pub type_: String,
710    /// Used when sampling from a model.
711    #[serde(skip_serializing_if = "Option::is_none", default)]
712    pub input_messages: Option<DataSourceCreateEvalResponsesRunDataSourceInputMessages>,
713    /// The name of the model to use for generating completions (e.g. "o3-mini").
714    #[serde(skip_serializing_if = "Option::is_none", default)]
715    pub model: Option<String>,
716    #[serde(skip_serializing_if = "Option::is_none", default)]
717    pub sampling_params: Option<DataSourceCreateEvalResponsesRunDataSourceSamplingParams>,
718}
719
720/// A schema representing an evaluation run.
721#[derive(Debug, Clone, Serialize, Deserialize)]
722#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
723pub struct RunCreateResponse {
724    /// Unique identifier for the evaluation run.
725    pub id: String,
726    /// Unix timestamp (in seconds) when the evaluation run was created.
727    pub created_at: i64,
728    /// Information about the run's data source.
729    pub data_source: DataSource,
730    /// An object representing an error response from the Eval API.
731    pub error: EvalAPIError,
732    /// The identifier of the associated evaluation.
733    pub eval_id: String,
734    /// Set of 16 key-value pairs that can be attached to an object.
735    #[serde(skip_serializing_if = "Option::is_none", default)]
736    pub metadata: Option<serde_json::Value>,
737    /// The model that is evaluated, if applicable.
738    pub model: String,
739    /// The name of the evaluation run.
740    pub name: String,
741    /// The type of the object. Always "eval.run".
742    pub object: String,
743    /// Usage statistics for each model during the evaluation run.
744    pub per_model_usage: Vec<PerModelUsage>,
745    /// Results per testing criteria applied during the evaluation run.
746    pub per_testing_criteria_results: Vec<PerTestingCriteriaResult>,
747    /// The URL to the rendered evaluation run report on the UI dashboard.
748    pub report_url: String,
749    /// Counters summarizing the outcomes of the evaluation run.
750    pub result_counts: ResultCounts,
751    /// The status of the evaluation run.
752    pub status: String,
753}
754
755#[derive(Debug, Clone, Serialize, Deserialize)]
756#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
757pub struct RunDeleteResponse {
758    #[serde(skip_serializing_if = "Option::is_none", default)]
759    pub deleted: Option<bool>,
760    #[serde(skip_serializing_if = "Option::is_none", default)]
761    pub object: Option<String>,
762    #[serde(skip_serializing_if = "Option::is_none", default)]
763    pub run_id: Option<String>,
764}
765
766#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
767#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
768#[non_exhaustive]
769pub enum RunListParamsOrder {
770    #[serde(rename = "asc")]
771    Asc,
772    #[serde(rename = "desc")]
773    Desc,
774}
775
776#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
777#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
778#[non_exhaustive]
779pub enum RunListParamsStatus {
780    #[serde(rename = "queued")]
781    Queued,
782    #[serde(rename = "in_progress")]
783    InProgress,
784    #[serde(rename = "completed")]
785    Completed,
786    #[serde(rename = "canceled")]
787    Canceled,
788    #[serde(rename = "failed")]
789    Failed,
790}
791
792#[derive(Debug, Clone, Serialize, Deserialize)]
793#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
794pub struct RunListParams {
795    /// Identifier for the last run from the previous pagination request.
796    #[serde(skip_serializing_if = "Option::is_none", default)]
797    pub after: Option<String>,
798    /// Number of runs to retrieve.
799    #[serde(skip_serializing_if = "Option::is_none", default)]
800    pub limit: Option<i64>,
801    /// Sort order for runs by timestamp.
802    #[serde(skip_serializing_if = "Option::is_none", default)]
803    pub order: Option<RunListParamsOrder>,
804    /// Filter runs by status.
805    #[serde(skip_serializing_if = "Option::is_none", default)]
806    pub status: Option<RunListParamsStatus>,
807}
808
809/// A schema representing an evaluation run.
810#[derive(Debug, Clone, Serialize, Deserialize)]
811#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
812pub struct RunListResponse {
813    /// Unique identifier for the evaluation run.
814    pub id: String,
815    /// Unix timestamp (in seconds) when the evaluation run was created.
816    pub created_at: i64,
817    /// Information about the run's data source.
818    pub data_source: DataSource,
819    /// An object representing an error response from the Eval API.
820    pub error: EvalAPIError,
821    /// The identifier of the associated evaluation.
822    pub eval_id: String,
823    /// Set of 16 key-value pairs that can be attached to an object.
824    #[serde(skip_serializing_if = "Option::is_none", default)]
825    pub metadata: Option<serde_json::Value>,
826    /// The model that is evaluated, if applicable.
827    pub model: String,
828    /// The name of the evaluation run.
829    pub name: String,
830    /// The type of the object. Always "eval.run".
831    pub object: String,
832    /// Usage statistics for each model during the evaluation run.
833    pub per_model_usage: Vec<PerModelUsage>,
834    /// Results per testing criteria applied during the evaluation run.
835    pub per_testing_criteria_results: Vec<PerTestingCriteriaResult>,
836    /// The URL to the rendered evaluation run report on the UI dashboard.
837    pub report_url: String,
838    /// Counters summarizing the outcomes of the evaluation run.
839    pub result_counts: ResultCounts,
840    /// The status of the evaluation run.
841    pub status: String,
842}
843
844/// A schema representing an evaluation run.
845#[derive(Debug, Clone, Serialize, Deserialize)]
846#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
847pub struct RunRetrieveResponse {
848    /// Unique identifier for the evaluation run.
849    pub id: String,
850    /// Unix timestamp (in seconds) when the evaluation run was created.
851    pub created_at: i64,
852    /// Information about the run's data source.
853    pub data_source: DataSource,
854    /// An object representing an error response from the Eval API.
855    pub error: EvalAPIError,
856    /// The identifier of the associated evaluation.
857    pub eval_id: String,
858    /// Set of 16 key-value pairs that can be attached to an object.
859    #[serde(skip_serializing_if = "Option::is_none", default)]
860    pub metadata: Option<serde_json::Value>,
861    /// The model that is evaluated, if applicable.
862    pub model: String,
863    /// The name of the evaluation run.
864    pub name: String,
865    /// The type of the object. Always "eval.run".
866    pub object: String,
867    /// Usage statistics for each model during the evaluation run.
868    pub per_model_usage: Vec<PerModelUsage>,
869    /// Results per testing criteria applied during the evaluation run.
870    pub per_testing_criteria_results: Vec<PerTestingCriteriaResult>,
871    /// The URL to the rendered evaluation run report on the UI dashboard.
872    pub report_url: String,
873    /// Counters summarizing the outcomes of the evaluation run.
874    pub result_counts: ResultCounts,
875    /// The status of the evaluation run.
876    pub status: String,
877}
878
879#[derive(Debug, Clone, Serialize, Deserialize)]
880#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
881pub struct EvalCreateParams {
882    /// The configuration for the data source used for the evaluation runs.
883    pub data_source_config: DataSourceConfig,
884    /// A list of graders for all eval runs in this group.
885    pub testing_criteria: Vec<TestingCriterion>,
886    /// Set of 16 key-value pairs that can be attached to an object.
887    #[serde(skip_serializing_if = "Option::is_none", default)]
888    pub metadata: Option<serde_json::Value>,
889    /// The name of the evaluation.
890    #[serde(skip_serializing_if = "Option::is_none", default)]
891    pub name: Option<String>,
892}
893
894/// A CustomDataSourceConfig object that defines the schema for the data source used for the evaluation runs.
895#[derive(Debug, Clone, Serialize, Deserialize)]
896#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
897pub struct DataSourceConfigCustom {
898    /// The json schema for each row in the data source.
899    pub item_schema: std::collections::HashMap<String, serde_json::Value>,
900    /// The type of data source. Always `custom`.
901    #[serde(rename = "type")]
902    pub type_: String,
903    /// Whether the eval should expect you to populate the sample namespace (ie, by
904    #[serde(skip_serializing_if = "Option::is_none", default)]
905    pub include_sample_schema: Option<bool>,
906}
907
908/// A data source config which specifies the metadata property of your logs query.
909#[derive(Debug, Clone, Serialize, Deserialize)]
910#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
911pub struct DataSourceConfigLogs {
912    /// The type of data source. Always `logs`.
913    #[serde(rename = "type")]
914    pub type_: String,
915    /// Metadata filters for the logs data source.
916    #[serde(skip_serializing_if = "Option::is_none", default)]
917    pub metadata: Option<std::collections::HashMap<String, serde_json::Value>>,
918}
919
920/// Deprecated in favor of LogsDataSourceConfig.
921#[derive(Debug, Clone, Serialize, Deserialize)]
922#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
923pub struct DataSourceConfigStoredCompletions {
924    /// The type of data source. Always `stored_completions`.
925    #[serde(rename = "type")]
926    pub type_: String,
927    /// Metadata filters for the stored completions data source.
928    #[serde(skip_serializing_if = "Option::is_none", default)]
929    pub metadata: Option<std::collections::HashMap<String, serde_json::Value>>,
930}
931
932pub type DataSourceConfig = serde_json::Value;
933
934#[derive(Debug, Clone, Serialize, Deserialize)]
935#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
936pub struct TestingCriterionLabelModelInputSimpleInputMessage {
937    /// The content of the message.
938    pub content: String,
939    /// The role of the message (e.g. "system", "assistant", "user").
940    pub role: String,
941}
942
943/// A text output from the model.
944#[derive(Debug, Clone, Serialize, Deserialize)]
945#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
946pub struct TestingCriterionLabelModelInputEvalItemContentOutputText {
947    /// The text output from the model.
948    pub text: String,
949    /// The type of the output text. Always `output_text`.
950    #[serde(rename = "type")]
951    pub type_: String,
952}
953
954/// An image input block used within EvalItem content arrays.
955#[derive(Debug, Clone, Serialize, Deserialize)]
956#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
957pub struct TestingCriterionLabelModelInputEvalItemContentInputImage {
958    /// The URL of the image input.
959    pub image_url: String,
960    /// The type of the image input. Always `input_image`.
961    #[serde(rename = "type")]
962    pub type_: String,
963    /// The detail level of the image to be sent to the model.
964    #[serde(skip_serializing_if = "Option::is_none", default)]
965    pub detail: Option<String>,
966}
967
968pub type TestingCriterionLabelModelInputEvalItemContent = serde_json::Value;
969
970#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
971#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
972#[non_exhaustive]
973pub enum TestingCriterionLabelModelInputEvalItemRole {
974    #[serde(rename = "user")]
975    User,
976    #[serde(rename = "assistant")]
977    Assistant,
978    #[serde(rename = "system")]
979    System,
980    #[serde(rename = "developer")]
981    Developer,
982}
983
984/// A message input to the model with a role indicating instruction following
985#[derive(Debug, Clone, Serialize, Deserialize)]
986#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
987pub struct TestingCriterionLabelModelInputEvalItem {
988    /// Inputs to the model - can contain template strings.
989    pub content: TestingCriterionLabelModelInputEvalItemContent,
990    /// The role of the message input.
991    pub role: TestingCriterionLabelModelInputEvalItemRole,
992    /// The type of the message input. Always `message`.
993    #[serde(rename = "type", skip_serializing_if = "Option::is_none", default)]
994    pub type_: Option<String>,
995}
996
997pub type TestingCriterionLabelModelInput = serde_json::Value;
998
999/// A LabelModelGrader object which uses a model to assign labels to each item
1000#[derive(Debug, Clone, Serialize, Deserialize)]
1001#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
1002pub struct TestingCriterionLabelModel {
1003    /// A list of chat messages forming the prompt or context.
1004    pub input: Vec<TestingCriterionLabelModelInput>,
1005    /// The labels to classify to each item in the evaluation.
1006    pub labels: serde_json::Value,
1007    /// The model to use for the evaluation. Must support structured outputs.
1008    pub model: String,
1009    /// The name of the grader.
1010    pub name: String,
1011    /// The labels that indicate a passing result. Must be a subset of labels.
1012    pub passing_labels: serde_json::Value,
1013    /// The object type, which is always `label_model`.
1014    #[serde(rename = "type")]
1015    pub type_: String,
1016}
1017
1018pub type TestingCriterion = serde_json::Value;
1019
1020/// An Eval object with a data source config and testing criteria.
1021#[derive(Debug, Clone, Serialize, Deserialize)]
1022#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
1023pub struct EvalCreateResponse {
1024    /// Unique identifier for the evaluation.
1025    pub id: String,
1026    /// The Unix timestamp (in seconds) for when the eval was created.
1027    pub created_at: i64,
1028    /// Configuration of data sources used in runs of the evaluation.
1029    pub data_source_config: DataSourceConfig,
1030    /// Set of 16 key-value pairs that can be attached to an object.
1031    #[serde(skip_serializing_if = "Option::is_none", default)]
1032    pub metadata: Option<serde_json::Value>,
1033    /// The name of the evaluation.
1034    pub name: String,
1035    /// The object type.
1036    pub object: String,
1037    /// A list of testing criteria.
1038    pub testing_criteria: Vec<TestingCriterion>,
1039}
1040
1041/// A CustomDataSourceConfig which specifies the schema of your `item` and optionally `sample` namespaces.
1042#[derive(Debug, Clone, Serialize, Deserialize)]
1043#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
1044pub struct EvalCustomDataSourceConfig {
1045    /// The json schema for the run data source items. Learn how to build JSON schemas
1046    #[serde(rename = "schema")]
1047    pub schema_: std::collections::HashMap<String, serde_json::Value>,
1048    /// The type of data source. Always `custom`.
1049    #[serde(rename = "type")]
1050    pub type_: String,
1051}
1052
1053#[derive(Debug, Clone, Serialize, Deserialize)]
1054#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
1055pub struct EvalDeleteResponse {
1056    pub deleted: bool,
1057    pub eval_id: String,
1058    pub object: String,
1059}
1060
1061#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
1062#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
1063#[non_exhaustive]
1064pub enum EvalListParamsOrder {
1065    #[serde(rename = "asc")]
1066    Asc,
1067    #[serde(rename = "desc")]
1068    Desc,
1069}
1070
1071#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
1072#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
1073#[non_exhaustive]
1074pub enum EvalListParamsOrderBy {
1075    #[serde(rename = "created_at")]
1076    CreatedAt,
1077    #[serde(rename = "updated_at")]
1078    UpdatedAt,
1079}
1080
1081#[derive(Debug, Clone, Serialize, Deserialize)]
1082#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
1083pub struct EvalListParams {
1084    /// Identifier for the last eval from the previous pagination request.
1085    #[serde(skip_serializing_if = "Option::is_none", default)]
1086    pub after: Option<String>,
1087    /// Number of evals to retrieve.
1088    #[serde(skip_serializing_if = "Option::is_none", default)]
1089    pub limit: Option<i64>,
1090    /// Sort order for evals by timestamp.
1091    #[serde(skip_serializing_if = "Option::is_none", default)]
1092    pub order: Option<EvalListParamsOrder>,
1093    /// Evals can be ordered by creation time or last updated time.
1094    #[serde(skip_serializing_if = "Option::is_none", default)]
1095    pub order_by: Option<EvalListParamsOrderBy>,
1096}
1097
1098/// An Eval object with a data source config and testing criteria.
1099#[derive(Debug, Clone, Serialize, Deserialize)]
1100#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
1101pub struct EvalListResponse {
1102    /// Unique identifier for the evaluation.
1103    pub id: String,
1104    /// The Unix timestamp (in seconds) for when the eval was created.
1105    pub created_at: i64,
1106    /// Configuration of data sources used in runs of the evaluation.
1107    pub data_source_config: DataSourceConfig,
1108    /// Set of 16 key-value pairs that can be attached to an object.
1109    #[serde(skip_serializing_if = "Option::is_none", default)]
1110    pub metadata: Option<serde_json::Value>,
1111    /// The name of the evaluation.
1112    pub name: String,
1113    /// The object type.
1114    pub object: String,
1115    /// A list of testing criteria.
1116    pub testing_criteria: Vec<TestingCriterion>,
1117}
1118
1119/// An Eval object with a data source config and testing criteria.
1120#[derive(Debug, Clone, Serialize, Deserialize)]
1121#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
1122pub struct EvalRetrieveResponse {
1123    /// Unique identifier for the evaluation.
1124    pub id: String,
1125    /// The Unix timestamp (in seconds) for when the eval was created.
1126    pub created_at: i64,
1127    /// Configuration of data sources used in runs of the evaluation.
1128    pub data_source_config: DataSourceConfig,
1129    /// Set of 16 key-value pairs that can be attached to an object.
1130    #[serde(skip_serializing_if = "Option::is_none", default)]
1131    pub metadata: Option<serde_json::Value>,
1132    /// The name of the evaluation.
1133    pub name: String,
1134    /// The object type.
1135    pub object: String,
1136    /// A list of testing criteria.
1137    pub testing_criteria: Vec<TestingCriterion>,
1138}
1139
1140/// Deprecated in favor of LogsDataSourceConfig.
1141#[derive(Debug, Clone, Serialize, Deserialize)]
1142#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
1143pub struct EvalStoredCompletionsDataSourceConfig {
1144    /// The json schema for the run data source items. Learn how to build JSON schemas
1145    #[serde(rename = "schema")]
1146    pub schema_: std::collections::HashMap<String, serde_json::Value>,
1147    /// The type of data source. Always `stored_completions`.
1148    #[serde(rename = "type")]
1149    pub type_: String,
1150    /// Set of 16 key-value pairs that can be attached to an object.
1151    #[serde(skip_serializing_if = "Option::is_none", default)]
1152    pub metadata: Option<serde_json::Value>,
1153}
1154
1155#[derive(Debug, Clone, Serialize, Deserialize)]
1156#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
1157pub struct EvalUpdateParams {
1158    /// Set of 16 key-value pairs that can be attached to an object.
1159    #[serde(skip_serializing_if = "Option::is_none", default)]
1160    pub metadata: Option<serde_json::Value>,
1161    /// Rename the evaluation.
1162    #[serde(skip_serializing_if = "Option::is_none", default)]
1163    pub name: Option<String>,
1164}
1165
1166/// An Eval object with a data source config and testing criteria.
1167#[derive(Debug, Clone, Serialize, Deserialize)]
1168#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
1169pub struct EvalUpdateResponse {
1170    /// Unique identifier for the evaluation.
1171    pub id: String,
1172    /// The Unix timestamp (in seconds) for when the eval was created.
1173    pub created_at: i64,
1174    /// Configuration of data sources used in runs of the evaluation.
1175    pub data_source_config: DataSourceConfig,
1176    /// Set of 16 key-value pairs that can be attached to an object.
1177    #[serde(skip_serializing_if = "Option::is_none", default)]
1178    pub metadata: Option<serde_json::Value>,
1179    /// The name of the evaluation.
1180    pub name: String,
1181    /// The object type.
1182    pub object: String,
1183    /// A list of testing criteria.
1184    pub testing_criteria: Vec<TestingCriterion>,
1185}