Skip to main content

hanzo_client/models/
score_req.rs

1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ScoreReq {
16    /// Comment is the grader's reasoning, truncated at 2000 characters.
17    #[serde(rename = "comment", skip_serializing_if = "Option::is_none")]
18    pub comment: Option<String>,
19    /// DataType is NUMERIC, CATEGORICAL or BOOLEAN. A declared rubric overrides it — a caller cannot claim a type the org's rubric contradicts.
20    #[serde(rename = "dataType", skip_serializing_if = "Option::is_none")]
21    pub data_type: Option<String>,
22    /// ItemID attaches the score to one graded example.
23    #[serde(rename = "datasetItemId", skip_serializing_if = "Option::is_none")]
24    pub dataset_item_id: Option<String>,
25    /// Dataset attaches the score to one dataset.
26    #[serde(rename = "datasetName", skip_serializing_if = "Option::is_none")]
27    pub dataset_name: Option<String>,
28    /// Name is the score name. A rubric of the same name, if the org has declared one, decides this score's type and the values it may take.
29    #[serde(rename = "name")]
30    pub name: String,
31    /// RunName attaches the score to one run.
32    #[serde(rename = "runName", skip_serializing_if = "Option::is_none")]
33    pub run_name: Option<String>,
34    /// StringValue is the label of a CATEGORICAL score, which must be one the rubric allows.
35    #[serde(rename = "stringValue", skip_serializing_if = "Option::is_none")]
36    pub string_value: Option<String>,
37    /// TraceID attaches the score to one model call.
38    #[serde(rename = "traceId", skip_serializing_if = "Option::is_none")]
39    pub trace_id: Option<String>,
40    /// Value is the numeric score, which must be finite: NaN and Inf are refused. A BOOLEAN score takes 0 or 1.
41    #[serde(rename = "value", skip_serializing_if = "Option::is_none")]
42    pub value: Option<f64>,
43}
44
45impl ScoreReq {
46    pub fn new(name: String) -> ScoreReq {
47        ScoreReq {
48            comment: None,
49            data_type: None,
50            dataset_item_id: None,
51            dataset_name: None,
52            name,
53            run_name: None,
54            string_value: None,
55            trace_id: None,
56            value: None,
57        }
58    }
59}
60