Files
sdk/model_ai_model.go

611 lines
16 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 AiModel type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AiModel{}
// AiModel struct for AiModel
type AiModel struct {
// Capabilities are tools, vision and reasoning, those the model supports.
Capabilities []string `json:"capabilities,omitempty"`
// Class is premium, ours or free.
Class *string `json:"class,omitempty"`
// ContextWindow is the most tokens the model reads at once, absent when the catalog does not say.
ContextWindow *int64 `json:"context_window,omitempty"`
// Expires is the day the model's vendor stops serving it (2006-01-02), absent when it states none.
Expires *string `json:"expires,omitempty"`
// Family is the Hanzo family (enso, zen, kai, zoo), absent for a third-party model.
Family *string `json:"family,omitempty"`
// Free is whether a call bills nothing.
Free *bool `json:"free,omitempty"`
// ID is the model's id, the one a completion or a decision names.
Id *string `json:"id,omitempty"`
// Inputs are the modalities the model reads.
Inputs []string `json:"inputs,omitempty"`
// MaxOutputTokens is the most one answer may hold, absent when the catalog does not say.
MaxOutputTokens *int64 `json:"max_output_tokens,omitempty"`
// Name is the model's display name.
Name *string `json:"name,omitempty"`
// Outputs are the modalities the model writes.
Outputs []string `json:"outputs,omitempty"`
// Pricing is the model's list price.
Pricing *AiPrice `json:"pricing,omitempty"`
// ZDR is whether the model is eligible for Zero Data Retention (non-free, non-data-shared commercial route).
Zdr *bool `json:"zdr,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AiModel AiModel
// NewAiModel instantiates a new AiModel 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 NewAiModel() *AiModel {
this := AiModel{}
return &this
}
// NewAiModelWithDefaults instantiates a new AiModel 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 NewAiModelWithDefaults() *AiModel {
this := AiModel{}
return &this
}
// GetCapabilities returns the Capabilities field value if set, zero value otherwise.
func (o *AiModel) GetCapabilities() []string {
if o == nil || IsNil(o.Capabilities) {
var ret []string
return ret
}
return o.Capabilities
}
// GetCapabilitiesOk returns a tuple with the Capabilities field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiModel) GetCapabilitiesOk() ([]string, bool) {
if o == nil || IsNil(o.Capabilities) {
return nil, false
}
return o.Capabilities, true
}
// HasCapabilities returns a boolean if a field has been set.
func (o *AiModel) HasCapabilities() bool {
if o != nil && !IsNil(o.Capabilities) {
return true
}
return false
}
// SetCapabilities gets a reference to the given []string and assigns it to the Capabilities field.
func (o *AiModel) SetCapabilities(v []string) {
o.Capabilities = v
}
// GetClass returns the Class field value if set, zero value otherwise.
func (o *AiModel) GetClass() string {
if o == nil || IsNil(o.Class) {
var ret string
return ret
}
return *o.Class
}
// GetClassOk returns a tuple with the Class field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiModel) GetClassOk() (*string, bool) {
if o == nil || IsNil(o.Class) {
return nil, false
}
return o.Class, true
}
// HasClass returns a boolean if a field has been set.
func (o *AiModel) HasClass() bool {
if o != nil && !IsNil(o.Class) {
return true
}
return false
}
// SetClass gets a reference to the given string and assigns it to the Class field.
func (o *AiModel) SetClass(v string) {
o.Class = &v
}
// GetContextWindow returns the ContextWindow field value if set, zero value otherwise.
func (o *AiModel) GetContextWindow() int64 {
if o == nil || IsNil(o.ContextWindow) {
var ret int64
return ret
}
return *o.ContextWindow
}
// GetContextWindowOk returns a tuple with the ContextWindow field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiModel) GetContextWindowOk() (*int64, bool) {
if o == nil || IsNil(o.ContextWindow) {
return nil, false
}
return o.ContextWindow, true
}
// HasContextWindow returns a boolean if a field has been set.
func (o *AiModel) HasContextWindow() bool {
if o != nil && !IsNil(o.ContextWindow) {
return true
}
return false
}
// SetContextWindow gets a reference to the given int64 and assigns it to the ContextWindow field.
func (o *AiModel) SetContextWindow(v int64) {
o.ContextWindow = &v
}
// GetExpires returns the Expires field value if set, zero value otherwise.
func (o *AiModel) GetExpires() string {
if o == nil || IsNil(o.Expires) {
var ret string
return ret
}
return *o.Expires
}
// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiModel) GetExpiresOk() (*string, bool) {
if o == nil || IsNil(o.Expires) {
return nil, false
}
return o.Expires, true
}
// HasExpires returns a boolean if a field has been set.
func (o *AiModel) HasExpires() bool {
if o != nil && !IsNil(o.Expires) {
return true
}
return false
}
// SetExpires gets a reference to the given string and assigns it to the Expires field.
func (o *AiModel) SetExpires(v string) {
o.Expires = &v
}
// GetFamily returns the Family field value if set, zero value otherwise.
func (o *AiModel) GetFamily() string {
if o == nil || IsNil(o.Family) {
var ret string
return ret
}
return *o.Family
}
// GetFamilyOk returns a tuple with the Family field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiModel) GetFamilyOk() (*string, bool) {
if o == nil || IsNil(o.Family) {
return nil, false
}
return o.Family, true
}
// HasFamily returns a boolean if a field has been set.
func (o *AiModel) HasFamily() bool {
if o != nil && !IsNil(o.Family) {
return true
}
return false
}
// SetFamily gets a reference to the given string and assigns it to the Family field.
func (o *AiModel) SetFamily(v string) {
o.Family = &v
}
// GetFree returns the Free field value if set, zero value otherwise.
func (o *AiModel) GetFree() bool {
if o == nil || IsNil(o.Free) {
var ret bool
return ret
}
return *o.Free
}
// GetFreeOk returns a tuple with the Free field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiModel) GetFreeOk() (*bool, bool) {
if o == nil || IsNil(o.Free) {
return nil, false
}
return o.Free, true
}
// HasFree returns a boolean if a field has been set.
func (o *AiModel) HasFree() bool {
if o != nil && !IsNil(o.Free) {
return true
}
return false
}
// SetFree gets a reference to the given bool and assigns it to the Free field.
func (o *AiModel) SetFree(v bool) {
o.Free = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *AiModel) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiModel) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *AiModel) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *AiModel) SetId(v string) {
o.Id = &v
}
// GetInputs returns the Inputs field value if set, zero value otherwise.
func (o *AiModel) GetInputs() []string {
if o == nil || IsNil(o.Inputs) {
var ret []string
return ret
}
return o.Inputs
}
// GetInputsOk returns a tuple with the Inputs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiModel) GetInputsOk() ([]string, bool) {
if o == nil || IsNil(o.Inputs) {
return nil, false
}
return o.Inputs, true
}
// HasInputs returns a boolean if a field has been set.
func (o *AiModel) HasInputs() bool {
if o != nil && !IsNil(o.Inputs) {
return true
}
return false
}
// SetInputs gets a reference to the given []string and assigns it to the Inputs field.
func (o *AiModel) SetInputs(v []string) {
o.Inputs = v
}
// GetMaxOutputTokens returns the MaxOutputTokens field value if set, zero value otherwise.
func (o *AiModel) GetMaxOutputTokens() int64 {
if o == nil || IsNil(o.MaxOutputTokens) {
var ret int64
return ret
}
return *o.MaxOutputTokens
}
// GetMaxOutputTokensOk returns a tuple with the MaxOutputTokens field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiModel) GetMaxOutputTokensOk() (*int64, bool) {
if o == nil || IsNil(o.MaxOutputTokens) {
return nil, false
}
return o.MaxOutputTokens, true
}
// HasMaxOutputTokens returns a boolean if a field has been set.
func (o *AiModel) HasMaxOutputTokens() bool {
if o != nil && !IsNil(o.MaxOutputTokens) {
return true
}
return false
}
// SetMaxOutputTokens gets a reference to the given int64 and assigns it to the MaxOutputTokens field.
func (o *AiModel) SetMaxOutputTokens(v int64) {
o.MaxOutputTokens = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *AiModel) 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 *AiModel) 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 *AiModel) 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 *AiModel) SetName(v string) {
o.Name = &v
}
// GetOutputs returns the Outputs field value if set, zero value otherwise.
func (o *AiModel) GetOutputs() []string {
if o == nil || IsNil(o.Outputs) {
var ret []string
return ret
}
return o.Outputs
}
// GetOutputsOk returns a tuple with the Outputs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiModel) GetOutputsOk() ([]string, bool) {
if o == nil || IsNil(o.Outputs) {
return nil, false
}
return o.Outputs, true
}
// HasOutputs returns a boolean if a field has been set.
func (o *AiModel) HasOutputs() bool {
if o != nil && !IsNil(o.Outputs) {
return true
}
return false
}
// SetOutputs gets a reference to the given []string and assigns it to the Outputs field.
func (o *AiModel) SetOutputs(v []string) {
o.Outputs = v
}
// GetPricing returns the Pricing field value if set, zero value otherwise.
func (o *AiModel) GetPricing() AiPrice {
if o == nil || IsNil(o.Pricing) {
var ret AiPrice
return ret
}
return *o.Pricing
}
// GetPricingOk returns a tuple with the Pricing field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiModel) GetPricingOk() (*AiPrice, bool) {
if o == nil || IsNil(o.Pricing) {
return nil, false
}
return o.Pricing, true
}
// HasPricing returns a boolean if a field has been set.
func (o *AiModel) HasPricing() bool {
if o != nil && !IsNil(o.Pricing) {
return true
}
return false
}
// SetPricing gets a reference to the given AiPrice and assigns it to the Pricing field.
func (o *AiModel) SetPricing(v AiPrice) {
o.Pricing = &v
}
// GetZdr returns the Zdr field value if set, zero value otherwise.
func (o *AiModel) GetZdr() bool {
if o == nil || IsNil(o.Zdr) {
var ret bool
return ret
}
return *o.Zdr
}
// GetZdrOk returns a tuple with the Zdr field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiModel) GetZdrOk() (*bool, bool) {
if o == nil || IsNil(o.Zdr) {
return nil, false
}
return o.Zdr, true
}
// HasZdr returns a boolean if a field has been set.
func (o *AiModel) HasZdr() bool {
if o != nil && !IsNil(o.Zdr) {
return true
}
return false
}
// SetZdr gets a reference to the given bool and assigns it to the Zdr field.
func (o *AiModel) SetZdr(v bool) {
o.Zdr = &v
}
func (o AiModel) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AiModel) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Capabilities) {
toSerialize["capabilities"] = o.Capabilities
}
if !IsNil(o.Class) {
toSerialize["class"] = o.Class
}
if !IsNil(o.ContextWindow) {
toSerialize["context_window"] = o.ContextWindow
}
if !IsNil(o.Expires) {
toSerialize["expires"] = o.Expires
}
if !IsNil(o.Family) {
toSerialize["family"] = o.Family
}
if !IsNil(o.Free) {
toSerialize["free"] = o.Free
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Inputs) {
toSerialize["inputs"] = o.Inputs
}
if !IsNil(o.MaxOutputTokens) {
toSerialize["max_output_tokens"] = o.MaxOutputTokens
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Outputs) {
toSerialize["outputs"] = o.Outputs
}
if !IsNil(o.Pricing) {
toSerialize["pricing"] = o.Pricing
}
if !IsNil(o.Zdr) {
toSerialize["zdr"] = o.Zdr
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AiModel) UnmarshalJSON(data []byte) (err error) {
varAiModel := _AiModel{}
err = json.Unmarshal(data, &varAiModel)
if err != nil {
return err
}
*o = AiModel(varAiModel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "capabilities")
delete(additionalProperties, "class")
delete(additionalProperties, "context_window")
delete(additionalProperties, "expires")
delete(additionalProperties, "family")
delete(additionalProperties, "free")
delete(additionalProperties, "id")
delete(additionalProperties, "inputs")
delete(additionalProperties, "max_output_tokens")
delete(additionalProperties, "name")
delete(additionalProperties, "outputs")
delete(additionalProperties, "pricing")
delete(additionalProperties, "zdr")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAiModel struct {
value *AiModel
isSet bool
}
func (v NullableAiModel) Get() *AiModel {
return v.value
}
func (v *NullableAiModel) Set(val *AiModel) {
v.value = val
v.isSet = true
}
func (v NullableAiModel) IsSet() bool {
return v.isSet
}
func (v *NullableAiModel) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAiModel(val *AiModel) *NullableAiModel {
return &NullableAiModel{value: val, isSet: true}
}
func (v NullableAiModel) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAiModel) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}