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{
593    /// The text output from the model.
594    pub text: String,
595    /// The type of the output text. Always `output_text`.
596    #[serde(rename = "type")]
597    pub type_: String,
598}
599
600/// An image input block used within EvalItem content arrays.
601#[derive(Debug, Clone, Serialize, Deserialize)]
602#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
603pub struct DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplateEvalItemContentInputImage
604{
605    /// The URL of the image input.
606    pub image_url: String,
607    /// The type of the image input. Always `input_image`.
608    #[serde(rename = "type")]
609    pub type_: String,
610    /// The detail level of the image to be sent to the model.
611    #[serde(skip_serializing_if = "Option::is_none", default)]
612    pub detail: Option<String>,
613}
614
615pub type DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplateEvalItemContent =
616    serde_json::Value;
617
618#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
619#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
620#[non_exhaustive]
621pub enum DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplateEvalItemRole {
622    #[serde(rename = "user")]
623    User,
624    #[serde(rename = "assistant")]
625    Assistant,
626    #[serde(rename = "system")]
627    System,
628    #[serde(rename = "developer")]
629    Developer,
630}
631
632/// A message input to the model with a role indicating instruction following
633#[derive(Debug, Clone, Serialize, Deserialize)]
634#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
635pub struct DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplateEvalItem {
636    /// Inputs to the model - can contain template strings.
637    pub content:
638        DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplateEvalItemContent,
639    /// The role of the message input.
640    pub role: DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplateEvalItemRole,
641    /// The type of the message input. Always `message`.
642    #[serde(rename = "type", skip_serializing_if = "Option::is_none", default)]
643    pub type_: Option<String>,
644}
645
646pub type DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplate =
647    serde_json::Value;
648
649#[derive(Debug, Clone, Serialize, Deserialize)]
650#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
651pub struct DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplate {
652    /// A list of chat messages forming the prompt or context.
653    pub template: Vec<DataSourceCreateEvalResponsesRunDataSourceInputMessagesTemplateTemplate>,
654    /// The type of input messages. Always `template`.
655    #[serde(rename = "type")]
656    pub type_: String,
657}
658
659#[derive(Debug, Clone, Serialize, Deserialize)]
660#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
661pub struct DataSourceCreateEvalResponsesRunDataSourceInputMessagesItemReference {
662    /// A reference to a variable in the `item` namespace. Ie, "item.name"
663    pub item_reference: String,
664    /// The type of input messages. Always `item_reference`.
665    #[serde(rename = "type")]
666    pub type_: String,
667}
668
669pub type DataSourceCreateEvalResponsesRunDataSourceInputMessages = serde_json::Value;
670
671/// Configuration options for a text response from the model.
672#[derive(Debug, Clone, Serialize, Deserialize)]
673#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
674pub struct DataSourceCreateEvalResponsesRunDataSourceSamplingParamsText {
675    /// An object specifying the format that the model must output.
676    #[serde(skip_serializing_if = "Option::is_none", default)]
677    pub format: Option<serde_json::Value>,
678}
679
680#[derive(Debug, Clone, Serialize, Deserialize)]
681#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
682pub struct DataSourceCreateEvalResponsesRunDataSourceSamplingParams {
683    /// The maximum number of tokens in the generated output.
684    #[serde(skip_serializing_if = "Option::is_none", default)]
685    pub max_completion_tokens: Option<i64>,
686    /// Constrains effort on reasoning for
687    #[serde(skip_serializing_if = "Option::is_none", default)]
688    pub reasoning_effort: Option<serde_json::Value>,
689    /// A seed value to initialize the randomness, during sampling.
690    #[serde(skip_serializing_if = "Option::is_none", default)]
691    pub seed: Option<i64>,
692    /// A higher temperature increases randomness in the outputs.
693    #[serde(skip_serializing_if = "Option::is_none", default)]
694    pub temperature: Option<f64>,
695    /// Configuration options for a text response from the model.
696    #[serde(skip_serializing_if = "Option::is_none", default)]
697    pub text: Option<DataSourceCreateEvalResponsesRunDataSourceSamplingParamsText>,
698    /// An array of tools the model may call while generating a response.
699    #[serde(skip_serializing_if = "Option::is_none", default)]
700    pub tools: Option<Vec<serde_json::Value>>,
701    /// An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
702    #[serde(skip_serializing_if = "Option::is_none", default)]
703    pub top_p: Option<f64>,
704}
705
706/// A ResponsesRunDataSource object describing a model sampling configuration.
707#[derive(Debug, Clone, Serialize, Deserialize)]
708#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
709pub struct DataSourceCreateEvalResponsesRunDataSource {
710    /// Determines what populates the `item` namespace in this run's data source.
711    pub source: DataSourceCreateEvalResponsesRunDataSourceSource,
712    /// The type of run data source. Always `responses`.
713    #[serde(rename = "type")]
714    pub type_: String,
715    /// Used when sampling from a model.
716    #[serde(skip_serializing_if = "Option::is_none", default)]
717    pub input_messages: Option<DataSourceCreateEvalResponsesRunDataSourceInputMessages>,
718    /// The name of the model to use for generating completions (e.g. "o3-mini").
719    #[serde(skip_serializing_if = "Option::is_none", default)]
720    pub model: Option<String>,
721    #[serde(skip_serializing_if = "Option::is_none", default)]
722    pub sampling_params: Option<DataSourceCreateEvalResponsesRunDataSourceSamplingParams>,
723}
724
725/// A schema representing an evaluation run.
726#[derive(Debug, Clone, Serialize, Deserialize)]
727#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
728pub struct RunCreateResponse {
729    /// Unique identifier for the evaluation run.
730    pub id: String,
731    /// Unix timestamp (in seconds) when the evaluation run was created.
732    pub created_at: i64,
733    /// Information about the run's data source.
734    pub data_source: DataSource,
735    /// An object representing an error response from the Eval API.
736    pub error: EvalAPIError,
737    /// The identifier of the associated evaluation.
738    pub eval_id: String,
739    /// Set of 16 key-value pairs that can be attached to an object.
740    #[serde(skip_serializing_if = "Option::is_none", default)]
741    pub metadata: Option<serde_json::Value>,
742    /// The model that is evaluated, if applicable.
743    pub model: String,
744    /// The name of the evaluation run.
745    pub name: String,
746    /// The type of the object. Always "eval.run".
747    pub object: String,
748    /// Usage statistics for each model during the evaluation run.
749    pub per_model_usage: Vec<PerModelUsage>,
750    /// Results per testing criteria applied during the evaluation run.
751    pub per_testing_criteria_results: Vec<PerTestingCriteriaResult>,
752    /// The URL to the rendered evaluation run report on the UI dashboard.
753    pub report_url: String,
754    /// Counters summarizing the outcomes of the evaluation run.
755    pub result_counts: ResultCounts,
756    /// The status of the evaluation run.
757    pub status: String,
758}
759
760#[derive(Debug, Clone, Serialize, Deserialize)]
761#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
762pub struct RunDeleteResponse {
763    #[serde(skip_serializing_if = "Option::is_none", default)]
764    pub deleted: Option<bool>,
765    #[serde(skip_serializing_if = "Option::is_none", default)]
766    pub object: Option<String>,
767    #[serde(skip_serializing_if = "Option::is_none", default)]
768    pub run_id: Option<String>,
769}
770
771#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
772#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
773#[non_exhaustive]
774pub enum RunListParamsOrder {
775    #[serde(rename = "asc")]
776    Asc,
777    #[serde(rename = "desc")]
778    Desc,
779}
780
781#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
782#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
783#[non_exhaustive]
784pub enum RunListParamsStatus {
785    #[serde(rename = "queued")]
786    Queued,
787    #[serde(rename = "in_progress")]
788    InProgress,
789    #[serde(rename = "completed")]
790    Completed,
791    #[serde(rename = "canceled")]
792    Canceled,
793    #[serde(rename = "failed")]
794    Failed,
795}
796
797#[derive(Debug, Clone, Serialize, Deserialize)]
798#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
799pub struct RunListParams {
800    /// Identifier for the last run from the previous pagination request.
801    #[serde(skip_serializing_if = "Option::is_none", default)]
802    pub after: Option<String>,
803    /// Number of runs to retrieve.
804    #[serde(skip_serializing_if = "Option::is_none", default)]
805    pub limit: Option<i64>,
806    /// Sort order for runs by timestamp.
807    #[serde(skip_serializing_if = "Option::is_none", default)]
808    pub order: Option<RunListParamsOrder>,
809    /// Filter runs by status.
810    #[serde(skip_serializing_if = "Option::is_none", default)]
811    pub status: Option<RunListParamsStatus>,
812}
813
814/// A schema representing an evaluation run.
815#[derive(Debug, Clone, Serialize, Deserialize)]
816#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
817pub struct RunListResponse {
818    /// Unique identifier for the evaluation run.
819    pub id: String,
820    /// Unix timestamp (in seconds) when the evaluation run was created.
821    pub created_at: i64,
822    /// Information about the run's data source.
823    pub data_source: DataSource,
824    /// An object representing an error response from the Eval API.
825    pub error: EvalAPIError,
826    /// The identifier of the associated evaluation.
827    pub eval_id: String,
828    /// Set of 16 key-value pairs that can be attached to an object.
829    #[serde(skip_serializing_if = "Option::is_none", default)]
830    pub metadata: Option<serde_json::Value>,
831    /// The model that is evaluated, if applicable.
832    pub model: String,
833    /// The name of the evaluation run.
834    pub name: String,
835    /// The type of the object. Always "eval.run".
836    pub object: String,
837    /// Usage statistics for each model during the evaluation run.
838    pub per_model_usage: Vec<PerModelUsage>,
839    /// Results per testing criteria applied during the evaluation run.
840    pub per_testing_criteria_results: Vec<PerTestingCriteriaResult>,
841    /// The URL to the rendered evaluation run report on the UI dashboard.
842    pub report_url: String,
843    /// Counters summarizing the outcomes of the evaluation run.
844    pub result_counts: ResultCounts,
845    /// The status of the evaluation run.
846    pub status: String,
847}
848
849/// A schema representing an evaluation run.
850#[derive(Debug, Clone, Serialize, Deserialize)]
851#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
852pub struct RunRetrieveResponse {
853    /// Unique identifier for the evaluation run.
854    pub id: String,
855    /// Unix timestamp (in seconds) when the evaluation run was created.
856    pub created_at: i64,
857    /// Information about the run's data source.
858    pub data_source: DataSource,
859    /// An object representing an error response from the Eval API.
860    pub error: EvalAPIError,
861    /// The identifier of the associated evaluation.
862    pub eval_id: String,
863    /// Set of 16 key-value pairs that can be attached to an object.
864    #[serde(skip_serializing_if = "Option::is_none", default)]
865    pub metadata: Option<serde_json::Value>,
866    /// The model that is evaluated, if applicable.
867    pub model: String,
868    /// The name of the evaluation run.
869    pub name: String,
870    /// The type of the object. Always "eval.run".
871    pub object: String,
872    /// Usage statistics for each model during the evaluation run.
873    pub per_model_usage: Vec<PerModelUsage>,
874    /// Results per testing criteria applied during the evaluation run.
875    pub per_testing_criteria_results: Vec<PerTestingCriteriaResult>,
876    /// The URL to the rendered evaluation run report on the UI dashboard.
877    pub report_url: String,
878    /// Counters summarizing the outcomes of the evaluation run.
879    pub result_counts: ResultCounts,
880    /// The status of the evaluation run.
881    pub status: String,
882}
883
884#[derive(Debug, Clone, Serialize, Deserialize)]
885#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
886pub struct EvalCreateParams {
887    /// The configuration for the data source used for the evaluation runs.
888    pub data_source_config: DataSourceConfig,
889    /// A list of graders for all eval runs in this group.
890    pub testing_criteria: Vec<TestingCriterion>,
891    /// Set of 16 key-value pairs that can be attached to an object.
892    #[serde(skip_serializing_if = "Option::is_none", default)]
893    pub metadata: Option<serde_json::Value>,
894    /// The name of the evaluation.
895    #[serde(skip_serializing_if = "Option::is_none", default)]
896    pub name: Option<String>,
897}
898
899/// A CustomDataSourceConfig object that defines the schema for the data source used for the evaluation runs.
900#[derive(Debug, Clone, Serialize, Deserialize)]
901#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
902pub struct DataSourceConfigCustom {
903    /// The json schema for each row in the data source.
904    pub item_schema: std::collections::HashMap<String, serde_json::Value>,
905    /// The type of data source. Always `custom`.
906    #[serde(rename = "type")]
907    pub type_: String,
908    /// Whether the eval should expect you to populate the sample namespace (ie, by
909    #[serde(skip_serializing_if = "Option::is_none", default)]
910    pub include_sample_schema: Option<bool>,
911}
912
913/// A data source config which specifies the metadata property of your logs query.
914#[derive(Debug, Clone, Serialize, Deserialize)]
915#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
916pub struct DataSourceConfigLogs {
917    /// The type of data source. Always `logs`.
918    #[serde(rename = "type")]
919    pub type_: String,
920    /// Metadata filters for the logs data source.
921    #[serde(skip_serializing_if = "Option::is_none", default)]
922    pub metadata: Option<std::collections::HashMap<String, serde_json::Value>>,
923}
924
925/// Deprecated in favor of LogsDataSourceConfig.
926#[derive(Debug, Clone, Serialize, Deserialize)]
927#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
928pub struct DataSourceConfigStoredCompletions {
929    /// The type of data source. Always `stored_completions`.
930    #[serde(rename = "type")]
931    pub type_: String,
932    /// Metadata filters for the stored completions data source.
933    #[serde(skip_serializing_if = "Option::is_none", default)]
934    pub metadata: Option<std::collections::HashMap<String, serde_json::Value>>,
935}
936
937pub type DataSourceConfig = serde_json::Value;
938
939#[derive(Debug, Clone, Serialize, Deserialize)]
940#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
941pub struct TestingCriterionLabelModelInputSimpleInputMessage {
942    /// The content of the message.
943    pub content: String,
944    /// The role of the message (e.g. "system", "assistant", "user").
945    pub role: String,
946}
947
948/// A text output from the model.
949#[derive(Debug, Clone, Serialize, Deserialize)]
950#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
951pub struct TestingCriterionLabelModelInputEvalItemContentOutputText {
952    /// The text output from the model.
953    pub text: String,
954    /// The type of the output text. Always `output_text`.
955    #[serde(rename = "type")]
956    pub type_: String,
957}
958
959/// An image input block used within EvalItem content arrays.
960#[derive(Debug, Clone, Serialize, Deserialize)]
961#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
962pub struct TestingCriterionLabelModelInputEvalItemContentInputImage {
963    /// The URL of the image input.
964    pub image_url: String,
965    /// The type of the image input. Always `input_image`.
966    #[serde(rename = "type")]
967    pub type_: String,
968    /// The detail level of the image to be sent to the model.
969    #[serde(skip_serializing_if = "Option::is_none", default)]
970    pub detail: Option<String>,
971}
972
973pub type TestingCriterionLabelModelInputEvalItemContent = serde_json::Value;
974
975#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
976#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
977#[non_exhaustive]
978pub enum TestingCriterionLabelModelInputEvalItemRole {
979    #[serde(rename = "user")]
980    User,
981    #[serde(rename = "assistant")]
982    Assistant,
983    #[serde(rename = "system")]
984    System,
985    #[serde(rename = "developer")]
986    Developer,
987}
988
989/// A message input to the model with a role indicating instruction following
990#[derive(Debug, Clone, Serialize, Deserialize)]
991#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
992pub struct TestingCriterionLabelModelInputEvalItem {
993    /// Inputs to the model - can contain template strings.
994    pub content: TestingCriterionLabelModelInputEvalItemContent,
995    /// The role of the message input.
996    pub role: TestingCriterionLabelModelInputEvalItemRole,
997    /// The type of the message input. Always `message`.
998    #[serde(rename = "type", skip_serializing_if = "Option::is_none", default)]
999    pub type_: Option<String>,
1000}
1001
1002pub type TestingCriterionLabelModelInput = serde_json::Value;
1003
1004/// A LabelModelGrader object which uses a model to assign labels to each item
1005#[derive(Debug, Clone, Serialize, Deserialize)]
1006#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
1007pub struct TestingCriterionLabelModel {
1008    /// A list of chat messages forming the prompt or context.
1009    pub input: Vec<TestingCriterionLabelModelInput>,
1010    /// The labels to classify to each item in the evaluation.
1011    pub labels: serde_json::Value,
1012    /// The model to use for the evaluation. Must support structured outputs.
1013    pub model: String,
1014    /// The name of the grader.
1015    pub name: String,
1016    /// The labels that indicate a passing result. Must be a subset of labels.
1017    pub passing_labels: serde_json::Value,
1018    /// The object type, which is always `label_model`.
1019    #[serde(rename = "type")]
1020    pub type_: String,
1021}
1022
1023pub type TestingCriterion = serde_json::Value;
1024
1025/// An Eval object with a data source config and testing criteria.
1026#[derive(Debug, Clone, Serialize, Deserialize)]
1027#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
1028pub struct EvalCreateResponse {
1029    /// Unique identifier for the evaluation.
1030    pub id: String,
1031    /// The Unix timestamp (in seconds) for when the eval was created.
1032    pub created_at: i64,
1033    /// Configuration of data sources used in runs of the evaluation.
1034    pub data_source_config: DataSourceConfig,
1035    /// Set of 16 key-value pairs that can be attached to an object.
1036    #[serde(skip_serializing_if = "Option::is_none", default)]
1037    pub metadata: Option<serde_json::Value>,
1038    /// The name of the evaluation.
1039    pub name: String,
1040    /// The object type.
1041    pub object: String,
1042    /// A list of testing criteria.
1043    pub testing_criteria: Vec<TestingCriterion>,
1044}
1045
1046/// A CustomDataSourceConfig which specifies the schema of your `item` and optionally `sample` namespaces.
1047#[derive(Debug, Clone, Serialize, Deserialize)]
1048#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
1049pub struct EvalCustomDataSourceConfig {
1050    /// The json schema for the run data source items. Learn how to build JSON schemas
1051    #[serde(rename = "schema")]
1052    pub schema_: std::collections::HashMap<String, serde_json::Value>,
1053    /// The type of data source. Always `custom`.
1054    #[serde(rename = "type")]
1055    pub type_: String,
1056}
1057
1058#[derive(Debug, Clone, Serialize, Deserialize)]
1059#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
1060pub struct EvalDeleteResponse {
1061    pub deleted: bool,
1062    pub eval_id: String,
1063    pub object: String,
1064}
1065
1066#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
1067#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
1068#[non_exhaustive]
1069pub enum EvalListParamsOrder {
1070    #[serde(rename = "asc")]
1071    Asc,
1072    #[serde(rename = "desc")]
1073    Desc,
1074}
1075
1076#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
1077#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
1078#[non_exhaustive]
1079pub enum EvalListParamsOrderBy {
1080    #[serde(rename = "created_at")]
1081    CreatedAt,
1082    #[serde(rename = "updated_at")]
1083    UpdatedAt,
1084}
1085
1086#[derive(Debug, Clone, Serialize, Deserialize)]
1087#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
1088pub struct EvalListParams {
1089    /// Identifier for the last eval from the previous pagination request.
1090    #[serde(skip_serializing_if = "Option::is_none", default)]
1091    pub after: Option<String>,
1092    /// Number of evals to retrieve.
1093    #[serde(skip_serializing_if = "Option::is_none", default)]
1094    pub limit: Option<i64>,
1095    /// Sort order for evals by timestamp.
1096    #[serde(skip_serializing_if = "Option::is_none", default)]
1097    pub order: Option<EvalListParamsOrder>,
1098    /// Evals can be ordered by creation time or last updated time.
1099    #[serde(skip_serializing_if = "Option::is_none", default)]
1100    pub order_by: Option<EvalListParamsOrderBy>,
1101}
1102
1103/// An Eval object with a data source config and testing criteria.
1104#[derive(Debug, Clone, Serialize, Deserialize)]
1105#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
1106pub struct EvalListResponse {
1107    /// Unique identifier for the evaluation.
1108    pub id: String,
1109    /// The Unix timestamp (in seconds) for when the eval was created.
1110    pub created_at: i64,
1111    /// Configuration of data sources used in runs of the evaluation.
1112    pub data_source_config: DataSourceConfig,
1113    /// Set of 16 key-value pairs that can be attached to an object.
1114    #[serde(skip_serializing_if = "Option::is_none", default)]
1115    pub metadata: Option<serde_json::Value>,
1116    /// The name of the evaluation.
1117    pub name: String,
1118    /// The object type.
1119    pub object: String,
1120    /// A list of testing criteria.
1121    pub testing_criteria: Vec<TestingCriterion>,
1122}
1123
1124/// An Eval object with a data source config and testing criteria.
1125#[derive(Debug, Clone, Serialize, Deserialize)]
1126#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
1127pub struct EvalRetrieveResponse {
1128    /// Unique identifier for the evaluation.
1129    pub id: String,
1130    /// The Unix timestamp (in seconds) for when the eval was created.
1131    pub created_at: i64,
1132    /// Configuration of data sources used in runs of the evaluation.
1133    pub data_source_config: DataSourceConfig,
1134    /// Set of 16 key-value pairs that can be attached to an object.
1135    #[serde(skip_serializing_if = "Option::is_none", default)]
1136    pub metadata: Option<serde_json::Value>,
1137    /// The name of the evaluation.
1138    pub name: String,
1139    /// The object type.
1140    pub object: String,
1141    /// A list of testing criteria.
1142    pub testing_criteria: Vec<TestingCriterion>,
1143}
1144
1145/// Deprecated in favor of LogsDataSourceConfig.
1146#[derive(Debug, Clone, Serialize, Deserialize)]
1147#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
1148pub struct EvalStoredCompletionsDataSourceConfig {
1149    /// The json schema for the run data source items. Learn how to build JSON schemas
1150    #[serde(rename = "schema")]
1151    pub schema_: std::collections::HashMap<String, serde_json::Value>,
1152    /// The type of data source. Always `stored_completions`.
1153    #[serde(rename = "type")]
1154    pub type_: String,
1155    /// Set of 16 key-value pairs that can be attached to an object.
1156    #[serde(skip_serializing_if = "Option::is_none", default)]
1157    pub metadata: Option<serde_json::Value>,
1158}
1159
1160#[derive(Debug, Clone, Serialize, Deserialize)]
1161#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
1162pub struct EvalUpdateParams {
1163    /// Set of 16 key-value pairs that can be attached to an object.
1164    #[serde(skip_serializing_if = "Option::is_none", default)]
1165    pub metadata: Option<serde_json::Value>,
1166    /// Rename the evaluation.
1167    #[serde(skip_serializing_if = "Option::is_none", default)]
1168    pub name: Option<String>,
1169}
1170
1171/// An Eval object with a data source config and testing criteria.
1172#[derive(Debug, Clone, Serialize, Deserialize)]
1173#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
1174pub struct EvalUpdateResponse {
1175    /// Unique identifier for the evaluation.
1176    pub id: String,
1177    /// The Unix timestamp (in seconds) for when the eval was created.
1178    pub created_at: i64,
1179    /// Configuration of data sources used in runs of the evaluation.
1180    pub data_source_config: DataSourceConfig,
1181    /// Set of 16 key-value pairs that can be attached to an object.
1182    #[serde(skip_serializing_if = "Option::is_none", default)]
1183    pub metadata: Option<serde_json::Value>,
1184    /// The name of the evaluation.
1185    pub name: String,
1186    /// The object type.
1187    pub object: String,
1188    /// A list of testing criteria.
1189    pub testing_criteria: Vec<TestingCriterion>,
1190}