Files
sdk/model_eval_judge_spec.go

231 lines
6.0 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 EvalJudgeSpec type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EvalJudgeSpec{}
// EvalJudgeSpec struct for EvalJudgeSpec
type EvalJudgeSpec struct {
// Criteria is the standard the judge applies, defaulting to a correctness criterion.
Criteria *string `json:"criteria,omitempty"`
// Model is the model that grades. It defaults to the model under test, so a run with no judge named has the model grade itself.
Model *string `json:"model,omitempty"`
// Name is the score name the judge's grades are filed under, \"llm-judge\" by default. A name that is not a legal handle falls back to that default rather than being stored as sent.
Name *string `json:"name,omitempty"`
AdditionalProperties map[string]interface{}
}
type _EvalJudgeSpec EvalJudgeSpec
// NewEvalJudgeSpec instantiates a new EvalJudgeSpec 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 NewEvalJudgeSpec() *EvalJudgeSpec {
this := EvalJudgeSpec{}
return &this
}
// NewEvalJudgeSpecWithDefaults instantiates a new EvalJudgeSpec 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 NewEvalJudgeSpecWithDefaults() *EvalJudgeSpec {
this := EvalJudgeSpec{}
return &this
}
// GetCriteria returns the Criteria field value if set, zero value otherwise.
func (o *EvalJudgeSpec) GetCriteria() string {
if o == nil || IsNil(o.Criteria) {
var ret string
return ret
}
return *o.Criteria
}
// GetCriteriaOk returns a tuple with the Criteria field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalJudgeSpec) GetCriteriaOk() (*string, bool) {
if o == nil || IsNil(o.Criteria) {
return nil, false
}
return o.Criteria, true
}
// HasCriteria returns a boolean if a field has been set.
func (o *EvalJudgeSpec) HasCriteria() bool {
if o != nil && !IsNil(o.Criteria) {
return true
}
return false
}
// SetCriteria gets a reference to the given string and assigns it to the Criteria field.
func (o *EvalJudgeSpec) SetCriteria(v string) {
o.Criteria = &v
}
// GetModel returns the Model field value if set, zero value otherwise.
func (o *EvalJudgeSpec) 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 *EvalJudgeSpec) 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 *EvalJudgeSpec) 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 *EvalJudgeSpec) SetModel(v string) {
o.Model = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *EvalJudgeSpec) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EvalJudgeSpec) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *EvalJudgeSpec) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *EvalJudgeSpec) SetName(v string) {
o.Name = &v
}
func (o EvalJudgeSpec) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EvalJudgeSpec) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Criteria) {
toSerialize["criteria"] = o.Criteria
}
if !IsNil(o.Model) {
toSerialize["model"] = o.Model
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *EvalJudgeSpec) UnmarshalJSON(data []byte) (err error) {
varEvalJudgeSpec := _EvalJudgeSpec{}
err = json.Unmarshal(data, &varEvalJudgeSpec)
if err != nil {
return err
}
*o = EvalJudgeSpec(varEvalJudgeSpec)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "criteria")
delete(additionalProperties, "model")
delete(additionalProperties, "name")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableEvalJudgeSpec struct {
value *EvalJudgeSpec
isSet bool
}
func (v NullableEvalJudgeSpec) Get() *EvalJudgeSpec {
return v.value
}
func (v *NullableEvalJudgeSpec) Set(val *EvalJudgeSpec) {
v.value = val
v.isSet = true
}
func (v NullableEvalJudgeSpec) IsSet() bool {
return v.isSet
}
func (v *NullableEvalJudgeSpec) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEvalJudgeSpec(val *EvalJudgeSpec) *NullableEvalJudgeSpec {
return &NullableEvalJudgeSpec{value: val, isSet: true}
}
func (v NullableEvalJudgeSpec) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEvalJudgeSpec) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}