Files
sdk/model_eval_run_summary.go

421 lines
11 KiB
Go

/*
Hanzo Cloud API
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/.
API version: v1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hanzoai
import (
"encoding/json"
)
// checks if the EvalRunSummary type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EvalRunSummary{}
// EvalRunSummary struct for EvalRunSummary
type EvalRunSummary struct {
// AvgScore is the mean over the scored examples, 0 when none scored.
AvgScore *float64 `json:"avgScore,omitempty"`
// Dataset is the set that was scored.
Dataset *string `json:"dataset,omitempty"`
// Items is how many examples the run attempted.
Items *int64 `json:"items,omitempty"`
// JudgeModel is the model that graded.
JudgeModel *string `json:"judgeModel,omitempty"`
// Model is the model under test.
Model *string `json:"model,omitempty"`
// Results is one row per attempted example.
Results []EvalItemResult `json:"results,omitempty"`
// RunName is the run's label, which scores and traces are filed under.
RunName *string `json:"runName,omitempty"`
// Scored is how many produced a real score. It counts successes only, so a partial run is honest about what it achieved.
Scored *int64 `json:"scored,omitempty"`
AdditionalProperties map[string]interface{}
}
type _EvalRunSummary EvalRunSummary
// NewEvalRunSummary instantiates a new EvalRunSummary object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewEvalRunSummary() *EvalRunSummary {
this := EvalRunSummary{}
return &this
}
// NewEvalRunSummaryWithDefaults instantiates a new EvalRunSummary object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewEvalRunSummaryWithDefaults() *EvalRunSummary {
this := EvalRunSummary{}
return &this
}
// GetAvgScore returns the AvgScore field value if set, zero value otherwise.
func (o *EvalRunSummary) GetAvgScore() float64 {
if o == nil || IsNil(o.AvgScore) {
var ret float64
return ret
}
return *o.AvgScore
}
// GetAvgScoreOk returns a tuple with the AvgScore field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalRunSummary) GetAvgScoreOk() (*float64, bool) {
if o == nil || IsNil(o.AvgScore) {
return nil, false
}
return o.AvgScore, true
}
// HasAvgScore returns a boolean if a field has been set.
func (o *EvalRunSummary) HasAvgScore() bool {
if o != nil && !IsNil(o.AvgScore) {
return true
}
return false
}
// SetAvgScore gets a reference to the given float64 and assigns it to the AvgScore field.
func (o *EvalRunSummary) SetAvgScore(v float64) {
o.AvgScore = &v
}
// GetDataset returns the Dataset field value if set, zero value otherwise.
func (o *EvalRunSummary) GetDataset() string {
if o == nil || IsNil(o.Dataset) {
var ret string
return ret
}
return *o.Dataset
}
// GetDatasetOk returns a tuple with the Dataset field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalRunSummary) GetDatasetOk() (*string, bool) {
if o == nil || IsNil(o.Dataset) {
return nil, false
}
return o.Dataset, true
}
// HasDataset returns a boolean if a field has been set.
func (o *EvalRunSummary) HasDataset() bool {
if o != nil && !IsNil(o.Dataset) {
return true
}
return false
}
// SetDataset gets a reference to the given string and assigns it to the Dataset field.
func (o *EvalRunSummary) SetDataset(v string) {
o.Dataset = &v
}
// GetItems returns the Items field value if set, zero value otherwise.
func (o *EvalRunSummary) GetItems() int64 {
if o == nil || IsNil(o.Items) {
var ret int64
return ret
}
return *o.Items
}
// GetItemsOk returns a tuple with the Items field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalRunSummary) GetItemsOk() (*int64, bool) {
if o == nil || IsNil(o.Items) {
return nil, false
}
return o.Items, true
}
// HasItems returns a boolean if a field has been set.
func (o *EvalRunSummary) HasItems() bool {
if o != nil && !IsNil(o.Items) {
return true
}
return false
}
// SetItems gets a reference to the given int64 and assigns it to the Items field.
func (o *EvalRunSummary) SetItems(v int64) {
o.Items = &v
}
// GetJudgeModel returns the JudgeModel field value if set, zero value otherwise.
func (o *EvalRunSummary) GetJudgeModel() string {
if o == nil || IsNil(o.JudgeModel) {
var ret string
return ret
}
return *o.JudgeModel
}
// GetJudgeModelOk returns a tuple with the JudgeModel field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalRunSummary) GetJudgeModelOk() (*string, bool) {
if o == nil || IsNil(o.JudgeModel) {
return nil, false
}
return o.JudgeModel, true
}
// HasJudgeModel returns a boolean if a field has been set.
func (o *EvalRunSummary) HasJudgeModel() bool {
if o != nil && !IsNil(o.JudgeModel) {
return true
}
return false
}
// SetJudgeModel gets a reference to the given string and assigns it to the JudgeModel field.
func (o *EvalRunSummary) SetJudgeModel(v string) {
o.JudgeModel = &v
}
// GetModel returns the Model field value if set, zero value otherwise.
func (o *EvalRunSummary) GetModel() string {
if o == nil || IsNil(o.Model) {
var ret string
return ret
}
return *o.Model
}
// GetModelOk returns a tuple with the Model field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalRunSummary) GetModelOk() (*string, bool) {
if o == nil || IsNil(o.Model) {
return nil, false
}
return o.Model, true
}
// HasModel returns a boolean if a field has been set.
func (o *EvalRunSummary) HasModel() bool {
if o != nil && !IsNil(o.Model) {
return true
}
return false
}
// SetModel gets a reference to the given string and assigns it to the Model field.
func (o *EvalRunSummary) SetModel(v string) {
o.Model = &v
}
// GetResults returns the Results field value if set, zero value otherwise.
func (o *EvalRunSummary) GetResults() []EvalItemResult {
if o == nil || IsNil(o.Results) {
var ret []EvalItemResult
return ret
}
return o.Results
}
// GetResultsOk returns a tuple with the Results field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalRunSummary) GetResultsOk() ([]EvalItemResult, bool) {
if o == nil || IsNil(o.Results) {
return nil, false
}
return o.Results, true
}
// HasResults returns a boolean if a field has been set.
func (o *EvalRunSummary) HasResults() bool {
if o != nil && !IsNil(o.Results) {
return true
}
return false
}
// SetResults gets a reference to the given []EvalItemResult and assigns it to the Results field.
func (o *EvalRunSummary) SetResults(v []EvalItemResult) {
o.Results = v
}
// GetRunName returns the RunName field value if set, zero value otherwise.
func (o *EvalRunSummary) GetRunName() string {
if o == nil || IsNil(o.RunName) {
var ret string
return ret
}
return *o.RunName
}
// GetRunNameOk returns a tuple with the RunName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalRunSummary) GetRunNameOk() (*string, bool) {
if o == nil || IsNil(o.RunName) {
return nil, false
}
return o.RunName, true
}
// HasRunName returns a boolean if a field has been set.
func (o *EvalRunSummary) HasRunName() bool {
if o != nil && !IsNil(o.RunName) {
return true
}
return false
}
// SetRunName gets a reference to the given string and assigns it to the RunName field.
func (o *EvalRunSummary) SetRunName(v string) {
o.RunName = &v
}
// GetScored returns the Scored field value if set, zero value otherwise.
func (o *EvalRunSummary) GetScored() int64 {
if o == nil || IsNil(o.Scored) {
var ret int64
return ret
}
return *o.Scored
}
// GetScoredOk returns a tuple with the Scored field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalRunSummary) GetScoredOk() (*int64, bool) {
if o == nil || IsNil(o.Scored) {
return nil, false
}
return o.Scored, true
}
// HasScored returns a boolean if a field has been set.
func (o *EvalRunSummary) HasScored() bool {
if o != nil && !IsNil(o.Scored) {
return true
}
return false
}
// SetScored gets a reference to the given int64 and assigns it to the Scored field.
func (o *EvalRunSummary) SetScored(v int64) {
o.Scored = &v
}
func (o EvalRunSummary) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EvalRunSummary) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.AvgScore) {
toSerialize["avgScore"] = o.AvgScore
}
if !IsNil(o.Dataset) {
toSerialize["dataset"] = o.Dataset
}
if !IsNil(o.Items) {
toSerialize["items"] = o.Items
}
if !IsNil(o.JudgeModel) {
toSerialize["judgeModel"] = o.JudgeModel
}
if !IsNil(o.Model) {
toSerialize["model"] = o.Model
}
if !IsNil(o.Results) {
toSerialize["results"] = o.Results
}
if !IsNil(o.RunName) {
toSerialize["runName"] = o.RunName
}
if !IsNil(o.Scored) {
toSerialize["scored"] = o.Scored
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *EvalRunSummary) UnmarshalJSON(data []byte) (err error) {
varEvalRunSummary := _EvalRunSummary{}
err = json.Unmarshal(data, &varEvalRunSummary)
if err != nil {
return err
}
*o = EvalRunSummary(varEvalRunSummary)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "avgScore")
delete(additionalProperties, "dataset")
delete(additionalProperties, "items")
delete(additionalProperties, "judgeModel")
delete(additionalProperties, "model")
delete(additionalProperties, "results")
delete(additionalProperties, "runName")
delete(additionalProperties, "scored")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableEvalRunSummary struct {
value *EvalRunSummary
isSet bool
}
func (v NullableEvalRunSummary) Get() *EvalRunSummary {
return v.value
}
func (v *NullableEvalRunSummary) Set(val *EvalRunSummary) {
v.value = val
v.isSet = true
}
func (v NullableEvalRunSummary) IsSet() bool {
return v.isSet
}
func (v *NullableEvalRunSummary) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEvalRunSummary(val *EvalRunSummary) *NullableEvalRunSummary {
return &NullableEvalRunSummary{value: val, isSet: true}
}
func (v NullableEvalRunSummary) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEvalRunSummary) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}