Files
sdk/model_eval_item_result.go

307 lines
7.8 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 EvalItemResult type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EvalItemResult{}
// EvalItemResult struct for EvalItemResult
type EvalItemResult struct {
// Error is why this example produced no score — the model, the judge, or the run's deadline. A result carrying one is not counted in Scored.
Error *string `json:"error,omitempty"`
// ItemID is the example that was scored.
ItemId *string `json:"itemId,omitempty"`
// Output is what the model under test answered, truncated at 2000 characters.
Output *string `json:"output,omitempty"`
// Score is the judge's grade.
Score *float64 `json:"score,omitempty"`
// TraceID is the model call this result came from.
TraceId *string `json:"traceId,omitempty"`
AdditionalProperties map[string]interface{}
}
type _EvalItemResult EvalItemResult
// NewEvalItemResult instantiates a new EvalItemResult 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 NewEvalItemResult() *EvalItemResult {
this := EvalItemResult{}
return &this
}
// NewEvalItemResultWithDefaults instantiates a new EvalItemResult 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 NewEvalItemResultWithDefaults() *EvalItemResult {
this := EvalItemResult{}
return &this
}
// GetError returns the Error field value if set, zero value otherwise.
func (o *EvalItemResult) GetError() string {
if o == nil || IsNil(o.Error) {
var ret string
return ret
}
return *o.Error
}
// GetErrorOk returns a tuple with the Error field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalItemResult) GetErrorOk() (*string, bool) {
if o == nil || IsNil(o.Error) {
return nil, false
}
return o.Error, true
}
// HasError returns a boolean if a field has been set.
func (o *EvalItemResult) HasError() bool {
if o != nil && !IsNil(o.Error) {
return true
}
return false
}
// SetError gets a reference to the given string and assigns it to the Error field.
func (o *EvalItemResult) SetError(v string) {
o.Error = &v
}
// GetItemId returns the ItemId field value if set, zero value otherwise.
func (o *EvalItemResult) GetItemId() string {
if o == nil || IsNil(o.ItemId) {
var ret string
return ret
}
return *o.ItemId
}
// GetItemIdOk returns a tuple with the ItemId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalItemResult) GetItemIdOk() (*string, bool) {
if o == nil || IsNil(o.ItemId) {
return nil, false
}
return o.ItemId, true
}
// HasItemId returns a boolean if a field has been set.
func (o *EvalItemResult) HasItemId() bool {
if o != nil && !IsNil(o.ItemId) {
return true
}
return false
}
// SetItemId gets a reference to the given string and assigns it to the ItemId field.
func (o *EvalItemResult) SetItemId(v string) {
o.ItemId = &v
}
// GetOutput returns the Output field value if set, zero value otherwise.
func (o *EvalItemResult) GetOutput() string {
if o == nil || IsNil(o.Output) {
var ret string
return ret
}
return *o.Output
}
// GetOutputOk returns a tuple with the Output field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalItemResult) GetOutputOk() (*string, bool) {
if o == nil || IsNil(o.Output) {
return nil, false
}
return o.Output, true
}
// HasOutput returns a boolean if a field has been set.
func (o *EvalItemResult) HasOutput() bool {
if o != nil && !IsNil(o.Output) {
return true
}
return false
}
// SetOutput gets a reference to the given string and assigns it to the Output field.
func (o *EvalItemResult) SetOutput(v string) {
o.Output = &v
}
// GetScore returns the Score field value if set, zero value otherwise.
func (o *EvalItemResult) GetScore() float64 {
if o == nil || IsNil(o.Score) {
var ret float64
return ret
}
return *o.Score
}
// GetScoreOk returns a tuple with the Score field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalItemResult) GetScoreOk() (*float64, bool) {
if o == nil || IsNil(o.Score) {
return nil, false
}
return o.Score, true
}
// HasScore returns a boolean if a field has been set.
func (o *EvalItemResult) HasScore() bool {
if o != nil && !IsNil(o.Score) {
return true
}
return false
}
// SetScore gets a reference to the given float64 and assigns it to the Score field.
func (o *EvalItemResult) SetScore(v float64) {
o.Score = &v
}
// GetTraceId returns the TraceId field value if set, zero value otherwise.
func (o *EvalItemResult) GetTraceId() string {
if o == nil || IsNil(o.TraceId) {
var ret string
return ret
}
return *o.TraceId
}
// GetTraceIdOk returns a tuple with the TraceId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalItemResult) GetTraceIdOk() (*string, bool) {
if o == nil || IsNil(o.TraceId) {
return nil, false
}
return o.TraceId, true
}
// HasTraceId returns a boolean if a field has been set.
func (o *EvalItemResult) HasTraceId() bool {
if o != nil && !IsNil(o.TraceId) {
return true
}
return false
}
// SetTraceId gets a reference to the given string and assigns it to the TraceId field.
func (o *EvalItemResult) SetTraceId(v string) {
o.TraceId = &v
}
func (o EvalItemResult) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EvalItemResult) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Error) {
toSerialize["error"] = o.Error
}
if !IsNil(o.ItemId) {
toSerialize["itemId"] = o.ItemId
}
if !IsNil(o.Output) {
toSerialize["output"] = o.Output
}
if !IsNil(o.Score) {
toSerialize["score"] = o.Score
}
if !IsNil(o.TraceId) {
toSerialize["traceId"] = o.TraceId
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *EvalItemResult) UnmarshalJSON(data []byte) (err error) {
varEvalItemResult := _EvalItemResult{}
err = json.Unmarshal(data, &varEvalItemResult)
if err != nil {
return err
}
*o = EvalItemResult(varEvalItemResult)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "error")
delete(additionalProperties, "itemId")
delete(additionalProperties, "output")
delete(additionalProperties, "score")
delete(additionalProperties, "traceId")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableEvalItemResult struct {
value *EvalItemResult
isSet bool
}
func (v NullableEvalItemResult) Get() *EvalItemResult {
return v.value
}
func (v *NullableEvalItemResult) Set(val *EvalItemResult) {
v.value = val
v.isSet = true
}
func (v NullableEvalItemResult) IsSet() bool {
return v.isSet
}
func (v *NullableEvalItemResult) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEvalItemResult(val *EvalItemResult) *NullableEvalItemResult {
return &NullableEvalItemResult{value: val, isSet: true}
}
func (v NullableEvalItemResult) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEvalItemResult) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}