Documentation ¶
Overview ¶
openaimodel defines the data structures used for OpenAI interactions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatCompletionRequest ¶
type ChatCompletionRequest struct { Model string `json:"model"` Messages []Message `json:"messages"` Temperature float64 `json:"temperature"` TopP float64 `json:"top_p"` FrequencyPenalty float64 `json:"frequency_penalty"` PresencePenalty float64 `json:"presence_penalty"` MaxTokens int `json:"max_tokens"` N int `json:"n"` }
type ChatCompletionResponse ¶
type ChatCompletionResponse struct { Choices []struct { Message struct { Content string `json:"content"` } `json:"message"` } `json:"choices"` }
type OpenAITransaction ¶
type OpenAITransaction struct { ID uuid.UUID `gorm:"primaryKey;type:uuid;default:uuid_generate_v4()"` UserID uuid.UUID `gorm:"type:uuid"` ThreadID uuid.UUID `gorm:"type:uuid;index"` MessageID uuid.UUID `gorm:"type:uuid"` Model string `gorm:"type:varchar(255)"` Role string `gorm:"type:varchar(50);not null"` MessageLength int `gorm:"type:int"` // Tracks the length of the user's message ProcessTime time.Time `gorm:"default:now()"` }
OpenAITransaction represents a record of an interaction with the OpenAI API.
func (OpenAITransaction) TableName ¶
func (OpenAITransaction) TableName() string
TableName overrides the table name used by OpenAITransaction.
Click to show internal directories.
Click to hide internal directories.