mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
453 lines
12 KiB
Go
453 lines
12 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 AiAnthropicRequest type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &AiAnthropicRequest{}
|
|
|
|
// AiAnthropicRequest struct for AiAnthropicRequest
|
|
type AiAnthropicRequest struct {
|
|
MaxTokens *int32 `json:"max_tokens,omitempty"`
|
|
Messages []AiAnthropicMessage `json:"messages,omitempty"`
|
|
Model *string `json:"model,omitempty"`
|
|
Stream *bool `json:"stream,omitempty"`
|
|
System interface{} `json:"system,omitempty"`
|
|
Temperature *float32 `json:"temperature,omitempty"`
|
|
Thinking interface{} `json:"thinking,omitempty"`
|
|
ToolChoice interface{} `json:"tool_choice,omitempty"`
|
|
Tools []AiAnthropicTool `json:"tools,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _AiAnthropicRequest AiAnthropicRequest
|
|
|
|
// NewAiAnthropicRequest instantiates a new AiAnthropicRequest 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 NewAiAnthropicRequest() *AiAnthropicRequest {
|
|
this := AiAnthropicRequest{}
|
|
return &this
|
|
}
|
|
|
|
// NewAiAnthropicRequestWithDefaults instantiates a new AiAnthropicRequest 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 NewAiAnthropicRequestWithDefaults() *AiAnthropicRequest {
|
|
this := AiAnthropicRequest{}
|
|
return &this
|
|
}
|
|
|
|
// GetMaxTokens returns the MaxTokens field value if set, zero value otherwise.
|
|
func (o *AiAnthropicRequest) GetMaxTokens() int32 {
|
|
if o == nil || IsNil(o.MaxTokens) {
|
|
var ret int32
|
|
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 *AiAnthropicRequest) GetMaxTokensOk() (*int32, 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 *AiAnthropicRequest) HasMaxTokens() bool {
|
|
if o != nil && !IsNil(o.MaxTokens) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMaxTokens gets a reference to the given int32 and assigns it to the MaxTokens field.
|
|
func (o *AiAnthropicRequest) SetMaxTokens(v int32) {
|
|
o.MaxTokens = &v
|
|
}
|
|
|
|
// GetMessages returns the Messages field value if set, zero value otherwise.
|
|
func (o *AiAnthropicRequest) GetMessages() []AiAnthropicMessage {
|
|
if o == nil || IsNil(o.Messages) {
|
|
var ret []AiAnthropicMessage
|
|
return ret
|
|
}
|
|
return o.Messages
|
|
}
|
|
|
|
// GetMessagesOk returns a tuple with the Messages field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiAnthropicRequest) GetMessagesOk() ([]AiAnthropicMessage, bool) {
|
|
if o == nil || IsNil(o.Messages) {
|
|
return nil, false
|
|
}
|
|
return o.Messages, true
|
|
}
|
|
|
|
// HasMessages returns a boolean if a field has been set.
|
|
func (o *AiAnthropicRequest) HasMessages() bool {
|
|
if o != nil && !IsNil(o.Messages) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMessages gets a reference to the given []AiAnthropicMessage and assigns it to the Messages field.
|
|
func (o *AiAnthropicRequest) SetMessages(v []AiAnthropicMessage) {
|
|
o.Messages = v
|
|
}
|
|
|
|
// GetModel returns the Model field value if set, zero value otherwise.
|
|
func (o *AiAnthropicRequest) 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 *AiAnthropicRequest) 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 *AiAnthropicRequest) 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 *AiAnthropicRequest) SetModel(v string) {
|
|
o.Model = &v
|
|
}
|
|
|
|
// GetStream returns the Stream field value if set, zero value otherwise.
|
|
func (o *AiAnthropicRequest) GetStream() bool {
|
|
if o == nil || IsNil(o.Stream) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Stream
|
|
}
|
|
|
|
// GetStreamOk returns a tuple with the Stream field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiAnthropicRequest) GetStreamOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Stream) {
|
|
return nil, false
|
|
}
|
|
return o.Stream, true
|
|
}
|
|
|
|
// HasStream returns a boolean if a field has been set.
|
|
func (o *AiAnthropicRequest) HasStream() bool {
|
|
if o != nil && !IsNil(o.Stream) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStream gets a reference to the given bool and assigns it to the Stream field.
|
|
func (o *AiAnthropicRequest) SetStream(v bool) {
|
|
o.Stream = &v
|
|
}
|
|
|
|
// GetSystem returns the System field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *AiAnthropicRequest) GetSystem() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
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.
|
|
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
|
func (o *AiAnthropicRequest) GetSystemOk() (*interface{}, 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 *AiAnthropicRequest) HasSystem() bool {
|
|
if o != nil && !IsNil(o.System) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSystem gets a reference to the given interface{} and assigns it to the System field.
|
|
func (o *AiAnthropicRequest) SetSystem(v interface{}) {
|
|
o.System = v
|
|
}
|
|
|
|
// GetTemperature returns the Temperature field value if set, zero value otherwise.
|
|
func (o *AiAnthropicRequest) GetTemperature() float32 {
|
|
if o == nil || IsNil(o.Temperature) {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
return *o.Temperature
|
|
}
|
|
|
|
// GetTemperatureOk returns a tuple with the Temperature field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiAnthropicRequest) GetTemperatureOk() (*float32, bool) {
|
|
if o == nil || IsNil(o.Temperature) {
|
|
return nil, false
|
|
}
|
|
return o.Temperature, true
|
|
}
|
|
|
|
// HasTemperature returns a boolean if a field has been set.
|
|
func (o *AiAnthropicRequest) HasTemperature() bool {
|
|
if o != nil && !IsNil(o.Temperature) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTemperature gets a reference to the given float32 and assigns it to the Temperature field.
|
|
func (o *AiAnthropicRequest) SetTemperature(v float32) {
|
|
o.Temperature = &v
|
|
}
|
|
|
|
// GetThinking returns the Thinking field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *AiAnthropicRequest) GetThinking() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
return ret
|
|
}
|
|
return o.Thinking
|
|
}
|
|
|
|
// GetThinkingOk returns a tuple with the Thinking field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
|
func (o *AiAnthropicRequest) GetThinkingOk() (*interface{}, bool) {
|
|
if o == nil || IsNil(o.Thinking) {
|
|
return nil, false
|
|
}
|
|
return &o.Thinking, true
|
|
}
|
|
|
|
// HasThinking returns a boolean if a field has been set.
|
|
func (o *AiAnthropicRequest) HasThinking() bool {
|
|
if o != nil && !IsNil(o.Thinking) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetThinking gets a reference to the given interface{} and assigns it to the Thinking field.
|
|
func (o *AiAnthropicRequest) SetThinking(v interface{}) {
|
|
o.Thinking = v
|
|
}
|
|
|
|
// GetToolChoice returns the ToolChoice field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *AiAnthropicRequest) GetToolChoice() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
return ret
|
|
}
|
|
return o.ToolChoice
|
|
}
|
|
|
|
// GetToolChoiceOk returns a tuple with the ToolChoice field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
|
func (o *AiAnthropicRequest) GetToolChoiceOk() (*interface{}, bool) {
|
|
if o == nil || IsNil(o.ToolChoice) {
|
|
return nil, false
|
|
}
|
|
return &o.ToolChoice, true
|
|
}
|
|
|
|
// HasToolChoice returns a boolean if a field has been set.
|
|
func (o *AiAnthropicRequest) HasToolChoice() bool {
|
|
if o != nil && !IsNil(o.ToolChoice) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetToolChoice gets a reference to the given interface{} and assigns it to the ToolChoice field.
|
|
func (o *AiAnthropicRequest) SetToolChoice(v interface{}) {
|
|
o.ToolChoice = v
|
|
}
|
|
|
|
// GetTools returns the Tools field value if set, zero value otherwise.
|
|
func (o *AiAnthropicRequest) GetTools() []AiAnthropicTool {
|
|
if o == nil || IsNil(o.Tools) {
|
|
var ret []AiAnthropicTool
|
|
return ret
|
|
}
|
|
return o.Tools
|
|
}
|
|
|
|
// GetToolsOk returns a tuple with the Tools field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiAnthropicRequest) GetToolsOk() ([]AiAnthropicTool, bool) {
|
|
if o == nil || IsNil(o.Tools) {
|
|
return nil, false
|
|
}
|
|
return o.Tools, true
|
|
}
|
|
|
|
// HasTools returns a boolean if a field has been set.
|
|
func (o *AiAnthropicRequest) HasTools() bool {
|
|
if o != nil && !IsNil(o.Tools) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTools gets a reference to the given []AiAnthropicTool and assigns it to the Tools field.
|
|
func (o *AiAnthropicRequest) SetTools(v []AiAnthropicTool) {
|
|
o.Tools = v
|
|
}
|
|
|
|
func (o AiAnthropicRequest) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o AiAnthropicRequest) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.MaxTokens) {
|
|
toSerialize["max_tokens"] = o.MaxTokens
|
|
}
|
|
if !IsNil(o.Messages) {
|
|
toSerialize["messages"] = o.Messages
|
|
}
|
|
if !IsNil(o.Model) {
|
|
toSerialize["model"] = o.Model
|
|
}
|
|
if !IsNil(o.Stream) {
|
|
toSerialize["stream"] = o.Stream
|
|
}
|
|
if o.System != nil {
|
|
toSerialize["system"] = o.System
|
|
}
|
|
if !IsNil(o.Temperature) {
|
|
toSerialize["temperature"] = o.Temperature
|
|
}
|
|
if o.Thinking != nil {
|
|
toSerialize["thinking"] = o.Thinking
|
|
}
|
|
if o.ToolChoice != nil {
|
|
toSerialize["tool_choice"] = o.ToolChoice
|
|
}
|
|
if !IsNil(o.Tools) {
|
|
toSerialize["tools"] = o.Tools
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *AiAnthropicRequest) UnmarshalJSON(data []byte) (err error) {
|
|
varAiAnthropicRequest := _AiAnthropicRequest{}
|
|
|
|
err = json.Unmarshal(data, &varAiAnthropicRequest)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = AiAnthropicRequest(varAiAnthropicRequest)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "max_tokens")
|
|
delete(additionalProperties, "messages")
|
|
delete(additionalProperties, "model")
|
|
delete(additionalProperties, "stream")
|
|
delete(additionalProperties, "system")
|
|
delete(additionalProperties, "temperature")
|
|
delete(additionalProperties, "thinking")
|
|
delete(additionalProperties, "tool_choice")
|
|
delete(additionalProperties, "tools")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableAiAnthropicRequest struct {
|
|
value *AiAnthropicRequest
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableAiAnthropicRequest) Get() *AiAnthropicRequest {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableAiAnthropicRequest) Set(val *AiAnthropicRequest) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableAiAnthropicRequest) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableAiAnthropicRequest) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableAiAnthropicRequest(val *AiAnthropicRequest) *NullableAiAnthropicRequest {
|
|
return &NullableAiAnthropicRequest{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableAiAnthropicRequest) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableAiAnthropicRequest) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|