mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
312 lines
8.1 KiB
Go
312 lines
8.1 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"
|
|
"fmt"
|
|
)
|
|
|
|
// checks if the EvalRunRequest type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &EvalRunRequest{}
|
|
|
|
// EvalRunRequest struct for EvalRunRequest
|
|
type EvalRunRequest struct {
|
|
// Dataset is the set to score, which must belong to the caller's org and hold at least one ACTIVE example.
|
|
Dataset string `json:"dataset"`
|
|
// Judge is the judge to grade with. Omitted, the model under test grades itself against a default correctness criterion under the score name \"llm-judge\".
|
|
Judge *EvalJudgeSpec `json:"judge,omitempty"`
|
|
// Limit caps how many examples this run scores. It defaults to 20, and anything above 100 falls back to that default.
|
|
Limit *int64 `json:"limit,omitempty"`
|
|
// Model is the model under test.
|
|
Model string `json:"model"`
|
|
// RunName labels the run and is generated from the clock when omitted. It must match ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$.
|
|
RunName *string `json:"runName,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _EvalRunRequest EvalRunRequest
|
|
|
|
// NewEvalRunRequest instantiates a new EvalRunRequest 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 NewEvalRunRequest(dataset string, model string) *EvalRunRequest {
|
|
this := EvalRunRequest{}
|
|
this.Dataset = dataset
|
|
this.Model = model
|
|
return &this
|
|
}
|
|
|
|
// NewEvalRunRequestWithDefaults instantiates a new EvalRunRequest 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 NewEvalRunRequestWithDefaults() *EvalRunRequest {
|
|
this := EvalRunRequest{}
|
|
return &this
|
|
}
|
|
|
|
// GetDataset returns the Dataset field value
|
|
func (o *EvalRunRequest) GetDataset() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Dataset
|
|
}
|
|
|
|
// GetDatasetOk returns a tuple with the Dataset field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EvalRunRequest) GetDatasetOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Dataset, true
|
|
}
|
|
|
|
// SetDataset sets field value
|
|
func (o *EvalRunRequest) SetDataset(v string) {
|
|
o.Dataset = v
|
|
}
|
|
|
|
// GetJudge returns the Judge field value if set, zero value otherwise.
|
|
func (o *EvalRunRequest) GetJudge() EvalJudgeSpec {
|
|
if o == nil || IsNil(o.Judge) {
|
|
var ret EvalJudgeSpec
|
|
return ret
|
|
}
|
|
return *o.Judge
|
|
}
|
|
|
|
// GetJudgeOk returns a tuple with the Judge field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EvalRunRequest) GetJudgeOk() (*EvalJudgeSpec, bool) {
|
|
if o == nil || IsNil(o.Judge) {
|
|
return nil, false
|
|
}
|
|
return o.Judge, true
|
|
}
|
|
|
|
// HasJudge returns a boolean if a field has been set.
|
|
func (o *EvalRunRequest) HasJudge() bool {
|
|
if o != nil && !IsNil(o.Judge) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetJudge gets a reference to the given EvalJudgeSpec and assigns it to the Judge field.
|
|
func (o *EvalRunRequest) SetJudge(v EvalJudgeSpec) {
|
|
o.Judge = &v
|
|
}
|
|
|
|
// GetLimit returns the Limit field value if set, zero value otherwise.
|
|
func (o *EvalRunRequest) GetLimit() int64 {
|
|
if o == nil || IsNil(o.Limit) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Limit
|
|
}
|
|
|
|
// GetLimitOk returns a tuple with the Limit field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EvalRunRequest) GetLimitOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Limit) {
|
|
return nil, false
|
|
}
|
|
return o.Limit, true
|
|
}
|
|
|
|
// HasLimit returns a boolean if a field has been set.
|
|
func (o *EvalRunRequest) HasLimit() bool {
|
|
if o != nil && !IsNil(o.Limit) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLimit gets a reference to the given int64 and assigns it to the Limit field.
|
|
func (o *EvalRunRequest) SetLimit(v int64) {
|
|
o.Limit = &v
|
|
}
|
|
|
|
// GetModel returns the Model field value
|
|
func (o *EvalRunRequest) GetModel() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Model
|
|
}
|
|
|
|
// GetModelOk returns a tuple with the Model field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EvalRunRequest) GetModelOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Model, true
|
|
}
|
|
|
|
// SetModel sets field value
|
|
func (o *EvalRunRequest) SetModel(v string) {
|
|
o.Model = v
|
|
}
|
|
|
|
// GetRunName returns the RunName field value if set, zero value otherwise.
|
|
func (o *EvalRunRequest) 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 *EvalRunRequest) 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 *EvalRunRequest) 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 *EvalRunRequest) SetRunName(v string) {
|
|
o.RunName = &v
|
|
}
|
|
|
|
func (o EvalRunRequest) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o EvalRunRequest) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
toSerialize["dataset"] = o.Dataset
|
|
if !IsNil(o.Judge) {
|
|
toSerialize["judge"] = o.Judge
|
|
}
|
|
if !IsNil(o.Limit) {
|
|
toSerialize["limit"] = o.Limit
|
|
}
|
|
toSerialize["model"] = o.Model
|
|
if !IsNil(o.RunName) {
|
|
toSerialize["runName"] = o.RunName
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *EvalRunRequest) UnmarshalJSON(data []byte) (err error) {
|
|
// This validates that all required properties are included in the JSON object
|
|
// by unmarshalling the object into a generic map with string keys and checking
|
|
// that every required field exists as a key in the generic map.
|
|
requiredProperties := []string{
|
|
"dataset",
|
|
"model",
|
|
}
|
|
|
|
allProperties := make(map[string]interface{})
|
|
|
|
err = json.Unmarshal(data, &allProperties)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
for _, requiredProperty := range requiredProperties {
|
|
if _, exists := allProperties[requiredProperty]; !exists {
|
|
return fmt.Errorf("no value given for required property %v", requiredProperty)
|
|
}
|
|
}
|
|
|
|
varEvalRunRequest := _EvalRunRequest{}
|
|
|
|
err = json.Unmarshal(data, &varEvalRunRequest)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = EvalRunRequest(varEvalRunRequest)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "dataset")
|
|
delete(additionalProperties, "judge")
|
|
delete(additionalProperties, "limit")
|
|
delete(additionalProperties, "model")
|
|
delete(additionalProperties, "runName")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableEvalRunRequest struct {
|
|
value *EvalRunRequest
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableEvalRunRequest) Get() *EvalRunRequest {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableEvalRunRequest) Set(val *EvalRunRequest) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableEvalRunRequest) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableEvalRunRequest) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableEvalRunRequest(val *EvalRunRequest) *NullableEvalRunRequest {
|
|
return &NullableEvalRunRequest{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableEvalRunRequest) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableEvalRunRequest) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|