Files
sdk/model_openai_chat_completion_message.go

450 lines
13 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 OpenaiChatCompletionMessage type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &OpenaiChatCompletionMessage{}
// OpenaiChatCompletionMessage struct for OpenaiChatCompletionMessage
type OpenaiChatCompletionMessage struct {
MultiContent []OpenaiChatMessagePart `json:"MultiContent,omitempty"`
Content *string `json:"content,omitempty"`
FunctionCall *OpenaiFunctionCall `json:"function_call,omitempty"`
Name *string `json:"name,omitempty"`
ReasoningContent *string `json:"reasoning_content,omitempty"`
Refusal *string `json:"refusal,omitempty"`
Role *string `json:"role,omitempty"`
ToolCallId *string `json:"tool_call_id,omitempty"`
ToolCalls []OpenaiToolCall `json:"tool_calls,omitempty"`
AdditionalProperties map[string]interface{}
}
type _OpenaiChatCompletionMessage OpenaiChatCompletionMessage
// NewOpenaiChatCompletionMessage instantiates a new OpenaiChatCompletionMessage 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 NewOpenaiChatCompletionMessage() *OpenaiChatCompletionMessage {
this := OpenaiChatCompletionMessage{}
return &this
}
// NewOpenaiChatCompletionMessageWithDefaults instantiates a new OpenaiChatCompletionMessage 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 NewOpenaiChatCompletionMessageWithDefaults() *OpenaiChatCompletionMessage {
this := OpenaiChatCompletionMessage{}
return &this
}
// GetMultiContent returns the MultiContent field value if set, zero value otherwise.
func (o *OpenaiChatCompletionMessage) GetMultiContent() []OpenaiChatMessagePart {
if o == nil || IsNil(o.MultiContent) {
var ret []OpenaiChatMessagePart
return ret
}
return o.MultiContent
}
// GetMultiContentOk returns a tuple with the MultiContent field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiChatCompletionMessage) GetMultiContentOk() ([]OpenaiChatMessagePart, bool) {
if o == nil || IsNil(o.MultiContent) {
return nil, false
}
return o.MultiContent, true
}
// HasMultiContent returns a boolean if a field has been set.
func (o *OpenaiChatCompletionMessage) HasMultiContent() bool {
if o != nil && !IsNil(o.MultiContent) {
return true
}
return false
}
// SetMultiContent gets a reference to the given []OpenaiChatMessagePart and assigns it to the MultiContent field.
func (o *OpenaiChatCompletionMessage) SetMultiContent(v []OpenaiChatMessagePart) {
o.MultiContent = v
}
// GetContent returns the Content field value if set, zero value otherwise.
func (o *OpenaiChatCompletionMessage) GetContent() string {
if o == nil || IsNil(o.Content) {
var ret string
return ret
}
return *o.Content
}
// GetContentOk returns a tuple with the Content field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiChatCompletionMessage) GetContentOk() (*string, bool) {
if o == nil || IsNil(o.Content) {
return nil, false
}
return o.Content, true
}
// HasContent returns a boolean if a field has been set.
func (o *OpenaiChatCompletionMessage) HasContent() bool {
if o != nil && !IsNil(o.Content) {
return true
}
return false
}
// SetContent gets a reference to the given string and assigns it to the Content field.
func (o *OpenaiChatCompletionMessage) SetContent(v string) {
o.Content = &v
}
// GetFunctionCall returns the FunctionCall field value if set, zero value otherwise.
func (o *OpenaiChatCompletionMessage) GetFunctionCall() OpenaiFunctionCall {
if o == nil || IsNil(o.FunctionCall) {
var ret OpenaiFunctionCall
return ret
}
return *o.FunctionCall
}
// GetFunctionCallOk returns a tuple with the FunctionCall field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiChatCompletionMessage) GetFunctionCallOk() (*OpenaiFunctionCall, bool) {
if o == nil || IsNil(o.FunctionCall) {
return nil, false
}
return o.FunctionCall, true
}
// HasFunctionCall returns a boolean if a field has been set.
func (o *OpenaiChatCompletionMessage) HasFunctionCall() bool {
if o != nil && !IsNil(o.FunctionCall) {
return true
}
return false
}
// SetFunctionCall gets a reference to the given OpenaiFunctionCall and assigns it to the FunctionCall field.
func (o *OpenaiChatCompletionMessage) SetFunctionCall(v OpenaiFunctionCall) {
o.FunctionCall = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *OpenaiChatCompletionMessage) 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 *OpenaiChatCompletionMessage) 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 *OpenaiChatCompletionMessage) 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 *OpenaiChatCompletionMessage) SetName(v string) {
o.Name = &v
}
// GetReasoningContent returns the ReasoningContent field value if set, zero value otherwise.
func (o *OpenaiChatCompletionMessage) GetReasoningContent() string {
if o == nil || IsNil(o.ReasoningContent) {
var ret string
return ret
}
return *o.ReasoningContent
}
// GetReasoningContentOk returns a tuple with the ReasoningContent field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiChatCompletionMessage) GetReasoningContentOk() (*string, bool) {
if o == nil || IsNil(o.ReasoningContent) {
return nil, false
}
return o.ReasoningContent, true
}
// HasReasoningContent returns a boolean if a field has been set.
func (o *OpenaiChatCompletionMessage) HasReasoningContent() bool {
if o != nil && !IsNil(o.ReasoningContent) {
return true
}
return false
}
// SetReasoningContent gets a reference to the given string and assigns it to the ReasoningContent field.
func (o *OpenaiChatCompletionMessage) SetReasoningContent(v string) {
o.ReasoningContent = &v
}
// GetRefusal returns the Refusal field value if set, zero value otherwise.
func (o *OpenaiChatCompletionMessage) GetRefusal() string {
if o == nil || IsNil(o.Refusal) {
var ret string
return ret
}
return *o.Refusal
}
// GetRefusalOk returns a tuple with the Refusal field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiChatCompletionMessage) GetRefusalOk() (*string, bool) {
if o == nil || IsNil(o.Refusal) {
return nil, false
}
return o.Refusal, true
}
// HasRefusal returns a boolean if a field has been set.
func (o *OpenaiChatCompletionMessage) HasRefusal() bool {
if o != nil && !IsNil(o.Refusal) {
return true
}
return false
}
// SetRefusal gets a reference to the given string and assigns it to the Refusal field.
func (o *OpenaiChatCompletionMessage) SetRefusal(v string) {
o.Refusal = &v
}
// GetRole returns the Role field value if set, zero value otherwise.
func (o *OpenaiChatCompletionMessage) GetRole() string {
if o == nil || IsNil(o.Role) {
var ret string
return ret
}
return *o.Role
}
// GetRoleOk returns a tuple with the Role field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiChatCompletionMessage) GetRoleOk() (*string, bool) {
if o == nil || IsNil(o.Role) {
return nil, false
}
return o.Role, true
}
// HasRole returns a boolean if a field has been set.
func (o *OpenaiChatCompletionMessage) HasRole() bool {
if o != nil && !IsNil(o.Role) {
return true
}
return false
}
// SetRole gets a reference to the given string and assigns it to the Role field.
func (o *OpenaiChatCompletionMessage) SetRole(v string) {
o.Role = &v
}
// GetToolCallId returns the ToolCallId field value if set, zero value otherwise.
func (o *OpenaiChatCompletionMessage) GetToolCallId() string {
if o == nil || IsNil(o.ToolCallId) {
var ret string
return ret
}
return *o.ToolCallId
}
// GetToolCallIdOk returns a tuple with the ToolCallId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiChatCompletionMessage) GetToolCallIdOk() (*string, bool) {
if o == nil || IsNil(o.ToolCallId) {
return nil, false
}
return o.ToolCallId, true
}
// HasToolCallId returns a boolean if a field has been set.
func (o *OpenaiChatCompletionMessage) HasToolCallId() bool {
if o != nil && !IsNil(o.ToolCallId) {
return true
}
return false
}
// SetToolCallId gets a reference to the given string and assigns it to the ToolCallId field.
func (o *OpenaiChatCompletionMessage) SetToolCallId(v string) {
o.ToolCallId = &v
}
// GetToolCalls returns the ToolCalls field value if set, zero value otherwise.
func (o *OpenaiChatCompletionMessage) GetToolCalls() []OpenaiToolCall {
if o == nil || IsNil(o.ToolCalls) {
var ret []OpenaiToolCall
return ret
}
return o.ToolCalls
}
// GetToolCallsOk returns a tuple with the ToolCalls field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiChatCompletionMessage) GetToolCallsOk() ([]OpenaiToolCall, bool) {
if o == nil || IsNil(o.ToolCalls) {
return nil, false
}
return o.ToolCalls, true
}
// HasToolCalls returns a boolean if a field has been set.
func (o *OpenaiChatCompletionMessage) HasToolCalls() bool {
if o != nil && !IsNil(o.ToolCalls) {
return true
}
return false
}
// SetToolCalls gets a reference to the given []OpenaiToolCall and assigns it to the ToolCalls field.
func (o *OpenaiChatCompletionMessage) SetToolCalls(v []OpenaiToolCall) {
o.ToolCalls = v
}
func (o OpenaiChatCompletionMessage) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o OpenaiChatCompletionMessage) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.MultiContent) {
toSerialize["MultiContent"] = o.MultiContent
}
if !IsNil(o.Content) {
toSerialize["content"] = o.Content
}
if !IsNil(o.FunctionCall) {
toSerialize["function_call"] = o.FunctionCall
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.ReasoningContent) {
toSerialize["reasoning_content"] = o.ReasoningContent
}
if !IsNil(o.Refusal) {
toSerialize["refusal"] = o.Refusal
}
if !IsNil(o.Role) {
toSerialize["role"] = o.Role
}
if !IsNil(o.ToolCallId) {
toSerialize["tool_call_id"] = o.ToolCallId
}
if !IsNil(o.ToolCalls) {
toSerialize["tool_calls"] = o.ToolCalls
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *OpenaiChatCompletionMessage) UnmarshalJSON(data []byte) (err error) {
varOpenaiChatCompletionMessage := _OpenaiChatCompletionMessage{}
err = json.Unmarshal(data, &varOpenaiChatCompletionMessage)
if err != nil {
return err
}
*o = OpenaiChatCompletionMessage(varOpenaiChatCompletionMessage)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "MultiContent")
delete(additionalProperties, "content")
delete(additionalProperties, "function_call")
delete(additionalProperties, "name")
delete(additionalProperties, "reasoning_content")
delete(additionalProperties, "refusal")
delete(additionalProperties, "role")
delete(additionalProperties, "tool_call_id")
delete(additionalProperties, "tool_calls")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableOpenaiChatCompletionMessage struct {
value *OpenaiChatCompletionMessage
isSet bool
}
func (v NullableOpenaiChatCompletionMessage) Get() *OpenaiChatCompletionMessage {
return v.value
}
func (v *NullableOpenaiChatCompletionMessage) Set(val *OpenaiChatCompletionMessage) {
v.value = val
v.isSet = true
}
func (v NullableOpenaiChatCompletionMessage) IsSet() bool {
return v.isSet
}
func (v *NullableOpenaiChatCompletionMessage) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableOpenaiChatCompletionMessage(val *OpenaiChatCompletionMessage) *NullableOpenaiChatCompletionMessage {
return &NullableOpenaiChatCompletionMessage{value: val, isSet: true}
}
func (v NullableOpenaiChatCompletionMessage) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableOpenaiChatCompletionMessage) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}