mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
1082 lines
33 KiB
Go
1082 lines
33 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 OpenaiChatCompletionRequest type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &OpenaiChatCompletionRequest{}
|
|
|
|
// OpenaiChatCompletionRequest struct for OpenaiChatCompletionRequest
|
|
type OpenaiChatCompletionRequest struct {
|
|
FrequencyPenalty *float32 `json:"frequency_penalty,omitempty"`
|
|
FunctionCall interface{} `json:"function_call,omitempty"`
|
|
Functions []OpenaiFunctionDefinition `json:"functions,omitempty"`
|
|
LogitBias map[string]int32 `json:"logit_bias,omitempty"`
|
|
Logprobs *bool `json:"logprobs,omitempty"`
|
|
MaxCompletionTokens *int32 `json:"max_completion_tokens,omitempty"`
|
|
MaxTokens *int32 `json:"max_tokens,omitempty"`
|
|
Messages []OpenaiChatCompletionMessage `json:"messages,omitempty"`
|
|
Metadata map[string]string `json:"metadata,omitempty"`
|
|
Model *string `json:"model,omitempty"`
|
|
N *int32 `json:"n,omitempty"`
|
|
ParallelToolCalls interface{} `json:"parallel_tool_calls,omitempty"`
|
|
PresencePenalty *float32 `json:"presence_penalty,omitempty"`
|
|
ReasoningEffort *string `json:"reasoning_effort,omitempty"`
|
|
ResponseFormat *OpenaiChatCompletionResponseFormat `json:"response_format,omitempty"`
|
|
Seed *int32 `json:"seed,omitempty"`
|
|
Stop []string `json:"stop,omitempty"`
|
|
Store *bool `json:"store,omitempty"`
|
|
Stream *bool `json:"stream,omitempty"`
|
|
StreamOptions *OpenaiStreamOptions `json:"stream_options,omitempty"`
|
|
Temperature *float32 `json:"temperature,omitempty"`
|
|
ToolChoice interface{} `json:"tool_choice,omitempty"`
|
|
Tools []OpenaiTool `json:"tools,omitempty"`
|
|
TopLogprobs *int32 `json:"top_logprobs,omitempty"`
|
|
TopP *float32 `json:"top_p,omitempty"`
|
|
User *string `json:"user,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _OpenaiChatCompletionRequest OpenaiChatCompletionRequest
|
|
|
|
// NewOpenaiChatCompletionRequest instantiates a new OpenaiChatCompletionRequest 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 NewOpenaiChatCompletionRequest() *OpenaiChatCompletionRequest {
|
|
this := OpenaiChatCompletionRequest{}
|
|
return &this
|
|
}
|
|
|
|
// NewOpenaiChatCompletionRequestWithDefaults instantiates a new OpenaiChatCompletionRequest 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 NewOpenaiChatCompletionRequestWithDefaults() *OpenaiChatCompletionRequest {
|
|
this := OpenaiChatCompletionRequest{}
|
|
return &this
|
|
}
|
|
|
|
// GetFrequencyPenalty returns the FrequencyPenalty field value if set, zero value otherwise.
|
|
func (o *OpenaiChatCompletionRequest) GetFrequencyPenalty() float32 {
|
|
if o == nil || IsNil(o.FrequencyPenalty) {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
return *o.FrequencyPenalty
|
|
}
|
|
|
|
// GetFrequencyPenaltyOk returns a tuple with the FrequencyPenalty field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *OpenaiChatCompletionRequest) GetFrequencyPenaltyOk() (*float32, bool) {
|
|
if o == nil || IsNil(o.FrequencyPenalty) {
|
|
return nil, false
|
|
}
|
|
return o.FrequencyPenalty, true
|
|
}
|
|
|
|
// HasFrequencyPenalty returns a boolean if a field has been set.
|
|
func (o *OpenaiChatCompletionRequest) HasFrequencyPenalty() bool {
|
|
if o != nil && !IsNil(o.FrequencyPenalty) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetFrequencyPenalty gets a reference to the given float32 and assigns it to the FrequencyPenalty field.
|
|
func (o *OpenaiChatCompletionRequest) SetFrequencyPenalty(v float32) {
|
|
o.FrequencyPenalty = &v
|
|
}
|
|
|
|
// GetFunctionCall returns the FunctionCall field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *OpenaiChatCompletionRequest) GetFunctionCall() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
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.
|
|
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
|
func (o *OpenaiChatCompletionRequest) GetFunctionCallOk() (*interface{}, 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 *OpenaiChatCompletionRequest) HasFunctionCall() bool {
|
|
if o != nil && !IsNil(o.FunctionCall) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetFunctionCall gets a reference to the given interface{} and assigns it to the FunctionCall field.
|
|
func (o *OpenaiChatCompletionRequest) SetFunctionCall(v interface{}) {
|
|
o.FunctionCall = v
|
|
}
|
|
|
|
// GetFunctions returns the Functions field value if set, zero value otherwise.
|
|
func (o *OpenaiChatCompletionRequest) GetFunctions() []OpenaiFunctionDefinition {
|
|
if o == nil || IsNil(o.Functions) {
|
|
var ret []OpenaiFunctionDefinition
|
|
return ret
|
|
}
|
|
return o.Functions
|
|
}
|
|
|
|
// GetFunctionsOk returns a tuple with the Functions field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *OpenaiChatCompletionRequest) GetFunctionsOk() ([]OpenaiFunctionDefinition, bool) {
|
|
if o == nil || IsNil(o.Functions) {
|
|
return nil, false
|
|
}
|
|
return o.Functions, true
|
|
}
|
|
|
|
// HasFunctions returns a boolean if a field has been set.
|
|
func (o *OpenaiChatCompletionRequest) HasFunctions() bool {
|
|
if o != nil && !IsNil(o.Functions) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetFunctions gets a reference to the given []OpenaiFunctionDefinition and assigns it to the Functions field.
|
|
func (o *OpenaiChatCompletionRequest) SetFunctions(v []OpenaiFunctionDefinition) {
|
|
o.Functions = v
|
|
}
|
|
|
|
// GetLogitBias returns the LogitBias field value if set, zero value otherwise.
|
|
func (o *OpenaiChatCompletionRequest) GetLogitBias() map[string]int32 {
|
|
if o == nil || IsNil(o.LogitBias) {
|
|
var ret map[string]int32
|
|
return ret
|
|
}
|
|
return o.LogitBias
|
|
}
|
|
|
|
// GetLogitBiasOk returns a tuple with the LogitBias field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *OpenaiChatCompletionRequest) GetLogitBiasOk() (map[string]int32, bool) {
|
|
if o == nil || IsNil(o.LogitBias) {
|
|
return map[string]int32{}, false
|
|
}
|
|
return o.LogitBias, true
|
|
}
|
|
|
|
// HasLogitBias returns a boolean if a field has been set.
|
|
func (o *OpenaiChatCompletionRequest) HasLogitBias() bool {
|
|
if o != nil && !IsNil(o.LogitBias) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLogitBias gets a reference to the given map[string]int32 and assigns it to the LogitBias field.
|
|
func (o *OpenaiChatCompletionRequest) SetLogitBias(v map[string]int32) {
|
|
o.LogitBias = v
|
|
}
|
|
|
|
// GetLogprobs returns the Logprobs field value if set, zero value otherwise.
|
|
func (o *OpenaiChatCompletionRequest) GetLogprobs() bool {
|
|
if o == nil || IsNil(o.Logprobs) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Logprobs
|
|
}
|
|
|
|
// GetLogprobsOk returns a tuple with the Logprobs field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *OpenaiChatCompletionRequest) GetLogprobsOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Logprobs) {
|
|
return nil, false
|
|
}
|
|
return o.Logprobs, true
|
|
}
|
|
|
|
// HasLogprobs returns a boolean if a field has been set.
|
|
func (o *OpenaiChatCompletionRequest) HasLogprobs() bool {
|
|
if o != nil && !IsNil(o.Logprobs) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLogprobs gets a reference to the given bool and assigns it to the Logprobs field.
|
|
func (o *OpenaiChatCompletionRequest) SetLogprobs(v bool) {
|
|
o.Logprobs = &v
|
|
}
|
|
|
|
// GetMaxCompletionTokens returns the MaxCompletionTokens field value if set, zero value otherwise.
|
|
func (o *OpenaiChatCompletionRequest) GetMaxCompletionTokens() int32 {
|
|
if o == nil || IsNil(o.MaxCompletionTokens) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.MaxCompletionTokens
|
|
}
|
|
|
|
// GetMaxCompletionTokensOk returns a tuple with the MaxCompletionTokens field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *OpenaiChatCompletionRequest) GetMaxCompletionTokensOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.MaxCompletionTokens) {
|
|
return nil, false
|
|
}
|
|
return o.MaxCompletionTokens, true
|
|
}
|
|
|
|
// HasMaxCompletionTokens returns a boolean if a field has been set.
|
|
func (o *OpenaiChatCompletionRequest) HasMaxCompletionTokens() bool {
|
|
if o != nil && !IsNil(o.MaxCompletionTokens) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMaxCompletionTokens gets a reference to the given int32 and assigns it to the MaxCompletionTokens field.
|
|
func (o *OpenaiChatCompletionRequest) SetMaxCompletionTokens(v int32) {
|
|
o.MaxCompletionTokens = &v
|
|
}
|
|
|
|
// GetMaxTokens returns the MaxTokens field value if set, zero value otherwise.
|
|
func (o *OpenaiChatCompletionRequest) 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 *OpenaiChatCompletionRequest) 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 *OpenaiChatCompletionRequest) 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 *OpenaiChatCompletionRequest) SetMaxTokens(v int32) {
|
|
o.MaxTokens = &v
|
|
}
|
|
|
|
// GetMessages returns the Messages field value if set, zero value otherwise.
|
|
func (o *OpenaiChatCompletionRequest) GetMessages() []OpenaiChatCompletionMessage {
|
|
if o == nil || IsNil(o.Messages) {
|
|
var ret []OpenaiChatCompletionMessage
|
|
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 *OpenaiChatCompletionRequest) GetMessagesOk() ([]OpenaiChatCompletionMessage, 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 *OpenaiChatCompletionRequest) HasMessages() bool {
|
|
if o != nil && !IsNil(o.Messages) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMessages gets a reference to the given []OpenaiChatCompletionMessage and assigns it to the Messages field.
|
|
func (o *OpenaiChatCompletionRequest) SetMessages(v []OpenaiChatCompletionMessage) {
|
|
o.Messages = v
|
|
}
|
|
|
|
// GetMetadata returns the Metadata field value if set, zero value otherwise.
|
|
func (o *OpenaiChatCompletionRequest) GetMetadata() map[string]string {
|
|
if o == nil || IsNil(o.Metadata) {
|
|
var ret map[string]string
|
|
return ret
|
|
}
|
|
return o.Metadata
|
|
}
|
|
|
|
// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *OpenaiChatCompletionRequest) GetMetadataOk() (map[string]string, bool) {
|
|
if o == nil || IsNil(o.Metadata) {
|
|
return map[string]string{}, false
|
|
}
|
|
return o.Metadata, true
|
|
}
|
|
|
|
// HasMetadata returns a boolean if a field has been set.
|
|
func (o *OpenaiChatCompletionRequest) HasMetadata() bool {
|
|
if o != nil && !IsNil(o.Metadata) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field.
|
|
func (o *OpenaiChatCompletionRequest) SetMetadata(v map[string]string) {
|
|
o.Metadata = v
|
|
}
|
|
|
|
// GetModel returns the Model field value if set, zero value otherwise.
|
|
func (o *OpenaiChatCompletionRequest) 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 *OpenaiChatCompletionRequest) 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 *OpenaiChatCompletionRequest) 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 *OpenaiChatCompletionRequest) SetModel(v string) {
|
|
o.Model = &v
|
|
}
|
|
|
|
// GetN returns the N field value if set, zero value otherwise.
|
|
func (o *OpenaiChatCompletionRequest) GetN() int32 {
|
|
if o == nil || IsNil(o.N) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.N
|
|
}
|
|
|
|
// GetNOk returns a tuple with the N field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *OpenaiChatCompletionRequest) GetNOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.N) {
|
|
return nil, false
|
|
}
|
|
return o.N, true
|
|
}
|
|
|
|
// HasN returns a boolean if a field has been set.
|
|
func (o *OpenaiChatCompletionRequest) HasN() bool {
|
|
if o != nil && !IsNil(o.N) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetN gets a reference to the given int32 and assigns it to the N field.
|
|
func (o *OpenaiChatCompletionRequest) SetN(v int32) {
|
|
o.N = &v
|
|
}
|
|
|
|
// GetParallelToolCalls returns the ParallelToolCalls field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *OpenaiChatCompletionRequest) GetParallelToolCalls() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
return ret
|
|
}
|
|
return o.ParallelToolCalls
|
|
}
|
|
|
|
// GetParallelToolCallsOk returns a tuple with the ParallelToolCalls 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 *OpenaiChatCompletionRequest) GetParallelToolCallsOk() (*interface{}, bool) {
|
|
if o == nil || IsNil(o.ParallelToolCalls) {
|
|
return nil, false
|
|
}
|
|
return &o.ParallelToolCalls, true
|
|
}
|
|
|
|
// HasParallelToolCalls returns a boolean if a field has been set.
|
|
func (o *OpenaiChatCompletionRequest) HasParallelToolCalls() bool {
|
|
if o != nil && !IsNil(o.ParallelToolCalls) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetParallelToolCalls gets a reference to the given interface{} and assigns it to the ParallelToolCalls field.
|
|
func (o *OpenaiChatCompletionRequest) SetParallelToolCalls(v interface{}) {
|
|
o.ParallelToolCalls = v
|
|
}
|
|
|
|
// GetPresencePenalty returns the PresencePenalty field value if set, zero value otherwise.
|
|
func (o *OpenaiChatCompletionRequest) GetPresencePenalty() float32 {
|
|
if o == nil || IsNil(o.PresencePenalty) {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
return *o.PresencePenalty
|
|
}
|
|
|
|
// GetPresencePenaltyOk returns a tuple with the PresencePenalty field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *OpenaiChatCompletionRequest) GetPresencePenaltyOk() (*float32, bool) {
|
|
if o == nil || IsNil(o.PresencePenalty) {
|
|
return nil, false
|
|
}
|
|
return o.PresencePenalty, true
|
|
}
|
|
|
|
// HasPresencePenalty returns a boolean if a field has been set.
|
|
func (o *OpenaiChatCompletionRequest) HasPresencePenalty() bool {
|
|
if o != nil && !IsNil(o.PresencePenalty) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPresencePenalty gets a reference to the given float32 and assigns it to the PresencePenalty field.
|
|
func (o *OpenaiChatCompletionRequest) SetPresencePenalty(v float32) {
|
|
o.PresencePenalty = &v
|
|
}
|
|
|
|
// GetReasoningEffort returns the ReasoningEffort field value if set, zero value otherwise.
|
|
func (o *OpenaiChatCompletionRequest) GetReasoningEffort() string {
|
|
if o == nil || IsNil(o.ReasoningEffort) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.ReasoningEffort
|
|
}
|
|
|
|
// GetReasoningEffortOk returns a tuple with the ReasoningEffort field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *OpenaiChatCompletionRequest) GetReasoningEffortOk() (*string, bool) {
|
|
if o == nil || IsNil(o.ReasoningEffort) {
|
|
return nil, false
|
|
}
|
|
return o.ReasoningEffort, true
|
|
}
|
|
|
|
// HasReasoningEffort returns a boolean if a field has been set.
|
|
func (o *OpenaiChatCompletionRequest) HasReasoningEffort() bool {
|
|
if o != nil && !IsNil(o.ReasoningEffort) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetReasoningEffort gets a reference to the given string and assigns it to the ReasoningEffort field.
|
|
func (o *OpenaiChatCompletionRequest) SetReasoningEffort(v string) {
|
|
o.ReasoningEffort = &v
|
|
}
|
|
|
|
// GetResponseFormat returns the ResponseFormat field value if set, zero value otherwise.
|
|
func (o *OpenaiChatCompletionRequest) GetResponseFormat() OpenaiChatCompletionResponseFormat {
|
|
if o == nil || IsNil(o.ResponseFormat) {
|
|
var ret OpenaiChatCompletionResponseFormat
|
|
return ret
|
|
}
|
|
return *o.ResponseFormat
|
|
}
|
|
|
|
// GetResponseFormatOk returns a tuple with the ResponseFormat field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *OpenaiChatCompletionRequest) GetResponseFormatOk() (*OpenaiChatCompletionResponseFormat, bool) {
|
|
if o == nil || IsNil(o.ResponseFormat) {
|
|
return nil, false
|
|
}
|
|
return o.ResponseFormat, true
|
|
}
|
|
|
|
// HasResponseFormat returns a boolean if a field has been set.
|
|
func (o *OpenaiChatCompletionRequest) HasResponseFormat() bool {
|
|
if o != nil && !IsNil(o.ResponseFormat) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetResponseFormat gets a reference to the given OpenaiChatCompletionResponseFormat and assigns it to the ResponseFormat field.
|
|
func (o *OpenaiChatCompletionRequest) SetResponseFormat(v OpenaiChatCompletionResponseFormat) {
|
|
o.ResponseFormat = &v
|
|
}
|
|
|
|
// GetSeed returns the Seed field value if set, zero value otherwise.
|
|
func (o *OpenaiChatCompletionRequest) GetSeed() int32 {
|
|
if o == nil || IsNil(o.Seed) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.Seed
|
|
}
|
|
|
|
// GetSeedOk returns a tuple with the Seed field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *OpenaiChatCompletionRequest) GetSeedOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.Seed) {
|
|
return nil, false
|
|
}
|
|
return o.Seed, true
|
|
}
|
|
|
|
// HasSeed returns a boolean if a field has been set.
|
|
func (o *OpenaiChatCompletionRequest) HasSeed() bool {
|
|
if o != nil && !IsNil(o.Seed) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSeed gets a reference to the given int32 and assigns it to the Seed field.
|
|
func (o *OpenaiChatCompletionRequest) SetSeed(v int32) {
|
|
o.Seed = &v
|
|
}
|
|
|
|
// GetStop returns the Stop field value if set, zero value otherwise.
|
|
func (o *OpenaiChatCompletionRequest) GetStop() []string {
|
|
if o == nil || IsNil(o.Stop) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.Stop
|
|
}
|
|
|
|
// GetStopOk returns a tuple with the Stop field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *OpenaiChatCompletionRequest) GetStopOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.Stop) {
|
|
return nil, false
|
|
}
|
|
return o.Stop, true
|
|
}
|
|
|
|
// HasStop returns a boolean if a field has been set.
|
|
func (o *OpenaiChatCompletionRequest) HasStop() bool {
|
|
if o != nil && !IsNil(o.Stop) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStop gets a reference to the given []string and assigns it to the Stop field.
|
|
func (o *OpenaiChatCompletionRequest) SetStop(v []string) {
|
|
o.Stop = v
|
|
}
|
|
|
|
// GetStore returns the Store field value if set, zero value otherwise.
|
|
func (o *OpenaiChatCompletionRequest) GetStore() bool {
|
|
if o == nil || IsNil(o.Store) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Store
|
|
}
|
|
|
|
// GetStoreOk returns a tuple with the Store field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *OpenaiChatCompletionRequest) GetStoreOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Store) {
|
|
return nil, false
|
|
}
|
|
return o.Store, true
|
|
}
|
|
|
|
// HasStore returns a boolean if a field has been set.
|
|
func (o *OpenaiChatCompletionRequest) HasStore() bool {
|
|
if o != nil && !IsNil(o.Store) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStore gets a reference to the given bool and assigns it to the Store field.
|
|
func (o *OpenaiChatCompletionRequest) SetStore(v bool) {
|
|
o.Store = &v
|
|
}
|
|
|
|
// GetStream returns the Stream field value if set, zero value otherwise.
|
|
func (o *OpenaiChatCompletionRequest) 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 *OpenaiChatCompletionRequest) 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 *OpenaiChatCompletionRequest) 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 *OpenaiChatCompletionRequest) SetStream(v bool) {
|
|
o.Stream = &v
|
|
}
|
|
|
|
// GetStreamOptions returns the StreamOptions field value if set, zero value otherwise.
|
|
func (o *OpenaiChatCompletionRequest) GetStreamOptions() OpenaiStreamOptions {
|
|
if o == nil || IsNil(o.StreamOptions) {
|
|
var ret OpenaiStreamOptions
|
|
return ret
|
|
}
|
|
return *o.StreamOptions
|
|
}
|
|
|
|
// GetStreamOptionsOk returns a tuple with the StreamOptions field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *OpenaiChatCompletionRequest) GetStreamOptionsOk() (*OpenaiStreamOptions, bool) {
|
|
if o == nil || IsNil(o.StreamOptions) {
|
|
return nil, false
|
|
}
|
|
return o.StreamOptions, true
|
|
}
|
|
|
|
// HasStreamOptions returns a boolean if a field has been set.
|
|
func (o *OpenaiChatCompletionRequest) HasStreamOptions() bool {
|
|
if o != nil && !IsNil(o.StreamOptions) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStreamOptions gets a reference to the given OpenaiStreamOptions and assigns it to the StreamOptions field.
|
|
func (o *OpenaiChatCompletionRequest) SetStreamOptions(v OpenaiStreamOptions) {
|
|
o.StreamOptions = &v
|
|
}
|
|
|
|
// GetTemperature returns the Temperature field value if set, zero value otherwise.
|
|
func (o *OpenaiChatCompletionRequest) 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 *OpenaiChatCompletionRequest) 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 *OpenaiChatCompletionRequest) 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 *OpenaiChatCompletionRequest) SetTemperature(v float32) {
|
|
o.Temperature = &v
|
|
}
|
|
|
|
// GetToolChoice returns the ToolChoice field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *OpenaiChatCompletionRequest) 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 *OpenaiChatCompletionRequest) 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 *OpenaiChatCompletionRequest) 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 *OpenaiChatCompletionRequest) SetToolChoice(v interface{}) {
|
|
o.ToolChoice = v
|
|
}
|
|
|
|
// GetTools returns the Tools field value if set, zero value otherwise.
|
|
func (o *OpenaiChatCompletionRequest) GetTools() []OpenaiTool {
|
|
if o == nil || IsNil(o.Tools) {
|
|
var ret []OpenaiTool
|
|
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 *OpenaiChatCompletionRequest) GetToolsOk() ([]OpenaiTool, 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 *OpenaiChatCompletionRequest) HasTools() bool {
|
|
if o != nil && !IsNil(o.Tools) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTools gets a reference to the given []OpenaiTool and assigns it to the Tools field.
|
|
func (o *OpenaiChatCompletionRequest) SetTools(v []OpenaiTool) {
|
|
o.Tools = v
|
|
}
|
|
|
|
// GetTopLogprobs returns the TopLogprobs field value if set, zero value otherwise.
|
|
func (o *OpenaiChatCompletionRequest) GetTopLogprobs() int32 {
|
|
if o == nil || IsNil(o.TopLogprobs) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.TopLogprobs
|
|
}
|
|
|
|
// GetTopLogprobsOk returns a tuple with the TopLogprobs field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *OpenaiChatCompletionRequest) GetTopLogprobsOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.TopLogprobs) {
|
|
return nil, false
|
|
}
|
|
return o.TopLogprobs, true
|
|
}
|
|
|
|
// HasTopLogprobs returns a boolean if a field has been set.
|
|
func (o *OpenaiChatCompletionRequest) HasTopLogprobs() bool {
|
|
if o != nil && !IsNil(o.TopLogprobs) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTopLogprobs gets a reference to the given int32 and assigns it to the TopLogprobs field.
|
|
func (o *OpenaiChatCompletionRequest) SetTopLogprobs(v int32) {
|
|
o.TopLogprobs = &v
|
|
}
|
|
|
|
// GetTopP returns the TopP field value if set, zero value otherwise.
|
|
func (o *OpenaiChatCompletionRequest) GetTopP() float32 {
|
|
if o == nil || IsNil(o.TopP) {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
return *o.TopP
|
|
}
|
|
|
|
// GetTopPOk returns a tuple with the TopP field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *OpenaiChatCompletionRequest) GetTopPOk() (*float32, bool) {
|
|
if o == nil || IsNil(o.TopP) {
|
|
return nil, false
|
|
}
|
|
return o.TopP, true
|
|
}
|
|
|
|
// HasTopP returns a boolean if a field has been set.
|
|
func (o *OpenaiChatCompletionRequest) HasTopP() bool {
|
|
if o != nil && !IsNil(o.TopP) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTopP gets a reference to the given float32 and assigns it to the TopP field.
|
|
func (o *OpenaiChatCompletionRequest) SetTopP(v float32) {
|
|
o.TopP = &v
|
|
}
|
|
|
|
// GetUser returns the User field value if set, zero value otherwise.
|
|
func (o *OpenaiChatCompletionRequest) GetUser() string {
|
|
if o == nil || IsNil(o.User) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.User
|
|
}
|
|
|
|
// GetUserOk returns a tuple with the User field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *OpenaiChatCompletionRequest) GetUserOk() (*string, bool) {
|
|
if o == nil || IsNil(o.User) {
|
|
return nil, false
|
|
}
|
|
return o.User, true
|
|
}
|
|
|
|
// HasUser returns a boolean if a field has been set.
|
|
func (o *OpenaiChatCompletionRequest) HasUser() bool {
|
|
if o != nil && !IsNil(o.User) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUser gets a reference to the given string and assigns it to the User field.
|
|
func (o *OpenaiChatCompletionRequest) SetUser(v string) {
|
|
o.User = &v
|
|
}
|
|
|
|
func (o OpenaiChatCompletionRequest) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o OpenaiChatCompletionRequest) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.FrequencyPenalty) {
|
|
toSerialize["frequency_penalty"] = o.FrequencyPenalty
|
|
}
|
|
if o.FunctionCall != nil {
|
|
toSerialize["function_call"] = o.FunctionCall
|
|
}
|
|
if !IsNil(o.Functions) {
|
|
toSerialize["functions"] = o.Functions
|
|
}
|
|
if !IsNil(o.LogitBias) {
|
|
toSerialize["logit_bias"] = o.LogitBias
|
|
}
|
|
if !IsNil(o.Logprobs) {
|
|
toSerialize["logprobs"] = o.Logprobs
|
|
}
|
|
if !IsNil(o.MaxCompletionTokens) {
|
|
toSerialize["max_completion_tokens"] = o.MaxCompletionTokens
|
|
}
|
|
if !IsNil(o.MaxTokens) {
|
|
toSerialize["max_tokens"] = o.MaxTokens
|
|
}
|
|
if !IsNil(o.Messages) {
|
|
toSerialize["messages"] = o.Messages
|
|
}
|
|
if !IsNil(o.Metadata) {
|
|
toSerialize["metadata"] = o.Metadata
|
|
}
|
|
if !IsNil(o.Model) {
|
|
toSerialize["model"] = o.Model
|
|
}
|
|
if !IsNil(o.N) {
|
|
toSerialize["n"] = o.N
|
|
}
|
|
if o.ParallelToolCalls != nil {
|
|
toSerialize["parallel_tool_calls"] = o.ParallelToolCalls
|
|
}
|
|
if !IsNil(o.PresencePenalty) {
|
|
toSerialize["presence_penalty"] = o.PresencePenalty
|
|
}
|
|
if !IsNil(o.ReasoningEffort) {
|
|
toSerialize["reasoning_effort"] = o.ReasoningEffort
|
|
}
|
|
if !IsNil(o.ResponseFormat) {
|
|
toSerialize["response_format"] = o.ResponseFormat
|
|
}
|
|
if !IsNil(o.Seed) {
|
|
toSerialize["seed"] = o.Seed
|
|
}
|
|
if !IsNil(o.Stop) {
|
|
toSerialize["stop"] = o.Stop
|
|
}
|
|
if !IsNil(o.Store) {
|
|
toSerialize["store"] = o.Store
|
|
}
|
|
if !IsNil(o.Stream) {
|
|
toSerialize["stream"] = o.Stream
|
|
}
|
|
if !IsNil(o.StreamOptions) {
|
|
toSerialize["stream_options"] = o.StreamOptions
|
|
}
|
|
if !IsNil(o.Temperature) {
|
|
toSerialize["temperature"] = o.Temperature
|
|
}
|
|
if o.ToolChoice != nil {
|
|
toSerialize["tool_choice"] = o.ToolChoice
|
|
}
|
|
if !IsNil(o.Tools) {
|
|
toSerialize["tools"] = o.Tools
|
|
}
|
|
if !IsNil(o.TopLogprobs) {
|
|
toSerialize["top_logprobs"] = o.TopLogprobs
|
|
}
|
|
if !IsNil(o.TopP) {
|
|
toSerialize["top_p"] = o.TopP
|
|
}
|
|
if !IsNil(o.User) {
|
|
toSerialize["user"] = o.User
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *OpenaiChatCompletionRequest) UnmarshalJSON(data []byte) (err error) {
|
|
varOpenaiChatCompletionRequest := _OpenaiChatCompletionRequest{}
|
|
|
|
err = json.Unmarshal(data, &varOpenaiChatCompletionRequest)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = OpenaiChatCompletionRequest(varOpenaiChatCompletionRequest)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "frequency_penalty")
|
|
delete(additionalProperties, "function_call")
|
|
delete(additionalProperties, "functions")
|
|
delete(additionalProperties, "logit_bias")
|
|
delete(additionalProperties, "logprobs")
|
|
delete(additionalProperties, "max_completion_tokens")
|
|
delete(additionalProperties, "max_tokens")
|
|
delete(additionalProperties, "messages")
|
|
delete(additionalProperties, "metadata")
|
|
delete(additionalProperties, "model")
|
|
delete(additionalProperties, "n")
|
|
delete(additionalProperties, "parallel_tool_calls")
|
|
delete(additionalProperties, "presence_penalty")
|
|
delete(additionalProperties, "reasoning_effort")
|
|
delete(additionalProperties, "response_format")
|
|
delete(additionalProperties, "seed")
|
|
delete(additionalProperties, "stop")
|
|
delete(additionalProperties, "store")
|
|
delete(additionalProperties, "stream")
|
|
delete(additionalProperties, "stream_options")
|
|
delete(additionalProperties, "temperature")
|
|
delete(additionalProperties, "tool_choice")
|
|
delete(additionalProperties, "tools")
|
|
delete(additionalProperties, "top_logprobs")
|
|
delete(additionalProperties, "top_p")
|
|
delete(additionalProperties, "user")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableOpenaiChatCompletionRequest struct {
|
|
value *OpenaiChatCompletionRequest
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableOpenaiChatCompletionRequest) Get() *OpenaiChatCompletionRequest {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableOpenaiChatCompletionRequest) Set(val *OpenaiChatCompletionRequest) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableOpenaiChatCompletionRequest) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableOpenaiChatCompletionRequest) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableOpenaiChatCompletionRequest(val *OpenaiChatCompletionRequest) *NullableOpenaiChatCompletionRequest {
|
|
return &NullableOpenaiChatCompletionRequest{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableOpenaiChatCompletionRequest) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableOpenaiChatCompletionRequest) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|