Documentation
¶
Index ¶
Constants ¶
View Source
const ( ContentTypeText = "text" ContentTypeImageURL = "image_url" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorWithStatusCode ¶
type GeneralOpenAIRequest ¶
type GeneralOpenAIRequest struct { Messages []Message `json:"messages,omitempty"` Model string `json:"model,omitempty"` FrequencyPenalty float64 `json:"frequency_penalty,omitempty"` MaxTokens int `json:"max_tokens,omitempty"` N int `json:"n,omitempty"` PresencePenalty float64 `json:"presence_penalty,omitempty"` ResponseFormat *ResponseFormat `json:"response_format,omitempty"` Seed float64 `json:"seed,omitempty"` Stream bool `json:"stream,omitempty"` Temperature float64 `json:"temperature,omitempty"` TopP float64 `json:"top_p,omitempty"` TopK int `json:"top_k,omitempty"` Tools []Tool `json:"tools,omitempty"` ToolChoice any `json:"tool_choice,omitempty"` FunctionCall any `json:"function_call,omitempty"` Functions any `json:"functions,omitempty"` User string `json:"user,omitempty"` Prompt any `json:"prompt,omitempty"` Input any `json:"input,omitempty"` EncodingFormat string `json:"encoding_format,omitempty"` Dimensions int `json:"dimensions,omitempty"` Instruction string `json:"instruction,omitempty"` Size string `json:"size,omitempty"` }
func (GeneralOpenAIRequest) ParseInput ¶
func (r GeneralOpenAIRequest) ParseInput() []string
type ImageRequest ¶
type ImageRequest struct { Model string `json:"model"` Prompt string `json:"prompt" binding:"required"` N int `json:"n,omitempty"` Size string `json:"size,omitempty"` Quality string `json:"quality,omitempty"` ResponseFormat string `json:"response_format,omitempty"` Style string `json:"style,omitempty"` User string `json:"user,omitempty"` }
type Message ¶
type Message struct { Role string `json:"role,omitempty"` Content any `json:"content,omitempty"` Name *string `json:"name,omitempty"` ToolCalls []Tool `json:"tool_calls,omitempty"` ToolCallId string `json:"tool_call_id,omitempty"` }
func (Message) IsStringContent ¶
func (Message) ParseContent ¶
func (m Message) ParseContent() []MessageContent
func (Message) StringContent ¶
type MessageContent ¶
type ResponseFormat ¶
type ResponseFormat struct {
Type string `json:"type,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.