Files
sdk/model_ai_chat_in.go

269 lines
6.6 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 AiChatIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AiChatIn{}
// AiChatIn struct for AiChatIn
type AiChatIn struct {
// MaxTokens bounds the answer in tokens; 0 leaves it to the model.
MaxTokens *int64 `json:"max_tokens,omitempty"`
// Model is the model to answer, by id (zen5, enso, kai, anthropic/claude-sonnet-4.5 — aiModels lists them). Empty asks the deployment's default Hanzo model.
Model *string `json:"model,omitempty"`
// Prompt is what to ask.
Prompt *string `json:"prompt,omitempty"`
// System is the system message ahead of the prompt, when set.
System *string `json:"system,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AiChatIn AiChatIn
// NewAiChatIn instantiates a new AiChatIn 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 NewAiChatIn() *AiChatIn {
this := AiChatIn{}
return &this
}
// NewAiChatInWithDefaults instantiates a new AiChatIn 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 NewAiChatInWithDefaults() *AiChatIn {
this := AiChatIn{}
return &this
}
// GetMaxTokens returns the MaxTokens field value if set, zero value otherwise.
func (o *AiChatIn) GetMaxTokens() int64 {
if o == nil || IsNil(o.MaxTokens) {
var ret int64
return ret
}
return *o.MaxTokens
}
// GetMaxTokensOk returns a tuple with the MaxTokens field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiChatIn) GetMaxTokensOk() (*int64, bool) {
if o == nil || IsNil(o.MaxTokens) {
return nil, false
}
return o.MaxTokens, true
}
// HasMaxTokens returns a boolean if a field has been set.
func (o *AiChatIn) HasMaxTokens() bool {
if o != nil && !IsNil(o.MaxTokens) {
return true
}
return false
}
// SetMaxTokens gets a reference to the given int64 and assigns it to the MaxTokens field.
func (o *AiChatIn) SetMaxTokens(v int64) {
o.MaxTokens = &v
}
// GetModel returns the Model field value if set, zero value otherwise.
func (o *AiChatIn) 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 *AiChatIn) 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 *AiChatIn) 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 *AiChatIn) SetModel(v string) {
o.Model = &v
}
// GetPrompt returns the Prompt field value if set, zero value otherwise.
func (o *AiChatIn) GetPrompt() string {
if o == nil || IsNil(o.Prompt) {
var ret string
return ret
}
return *o.Prompt
}
// GetPromptOk returns a tuple with the Prompt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiChatIn) GetPromptOk() (*string, bool) {
if o == nil || IsNil(o.Prompt) {
return nil, false
}
return o.Prompt, true
}
// HasPrompt returns a boolean if a field has been set.
func (o *AiChatIn) HasPrompt() bool {
if o != nil && !IsNil(o.Prompt) {
return true
}
return false
}
// SetPrompt gets a reference to the given string and assigns it to the Prompt field.
func (o *AiChatIn) SetPrompt(v string) {
o.Prompt = &v
}
// GetSystem returns the System field value if set, zero value otherwise.
func (o *AiChatIn) GetSystem() string {
if o == nil || IsNil(o.System) {
var ret string
return ret
}
return *o.System
}
// GetSystemOk returns a tuple with the System field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiChatIn) GetSystemOk() (*string, bool) {
if o == nil || IsNil(o.System) {
return nil, false
}
return o.System, true
}
// HasSystem returns a boolean if a field has been set.
func (o *AiChatIn) HasSystem() bool {
if o != nil && !IsNil(o.System) {
return true
}
return false
}
// SetSystem gets a reference to the given string and assigns it to the System field.
func (o *AiChatIn) SetSystem(v string) {
o.System = &v
}
func (o AiChatIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AiChatIn) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.MaxTokens) {
toSerialize["max_tokens"] = o.MaxTokens
}
if !IsNil(o.Model) {
toSerialize["model"] = o.Model
}
if !IsNil(o.Prompt) {
toSerialize["prompt"] = o.Prompt
}
if !IsNil(o.System) {
toSerialize["system"] = o.System
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AiChatIn) UnmarshalJSON(data []byte) (err error) {
varAiChatIn := _AiChatIn{}
err = json.Unmarshal(data, &varAiChatIn)
if err != nil {
return err
}
*o = AiChatIn(varAiChatIn)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "max_tokens")
delete(additionalProperties, "model")
delete(additionalProperties, "prompt")
delete(additionalProperties, "system")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAiChatIn struct {
value *AiChatIn
isSet bool
}
func (v NullableAiChatIn) Get() *AiChatIn {
return v.value
}
func (v *NullableAiChatIn) Set(val *AiChatIn) {
v.value = val
v.isSet = true
}
func (v NullableAiChatIn) IsSet() bool {
return v.isSet
}
func (v *NullableAiChatIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAiChatIn(val *AiChatIn) *NullableAiChatIn {
return &NullableAiChatIn{value: val, isSet: true}
}
func (v NullableAiChatIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAiChatIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}