models

package
v0.0.0-...-68f0fd0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKey

type APIKey struct {
	BaseModel
	UserId uint   `json:"user_id" gorm:"index"`
	Name   string `json:"name"`
	Key    string `json:"key" gorm:"uniqueIndex"`
}

type BaseModel

type BaseModel struct {
	ID        uint       `json:"id" gorm:"primarykey"`
	CreatedAt time.Time  `json:"created_at" gorm:"index"`
	UpdatedAt time.Time  `json:"updated_at"`
	DeletedAt *time.Time `json:"deleted_at" gorm:"index"`
}

type Model

type Model struct {
	BaseModel
	UserId            uint   `json:"user_id"`
	ModelName         string `json:"model_name"`
	InternalModelName string `json:"-"`
	APIUrl            string `json:"-"`
	APIKey            string `json:"-"`
	Format            string `json:"format"`
}

type QueryRecord

type QueryRecord struct {
	BaseModel
	APIKey             string   `json:"api_key" gorm:"index"`
	Request            string   `json:"request"`
	Response           string   `json:"response"`
	RequestedModel     string   `json:"requested_model"`
	MaxTokens          int      `json:"max_tokens"`
	InputTokens        int      `json:"input_tokens"`
	OutputTokens       int      `json:"output_tokens"`
	Temperature        float32  `json:"temperature"`
	TopP               float32  `json:"top_p"`
	PresencePenalty    float32  `json:"presence_penalty"`
	FrequencyPenalty   float32  `json:"frequency_penalty"`
	Stream             bool     `json:"stream"`
	Tags               []string `json:"tags" gorm:"serializer:json"`
	RequestTimeSeconds float32  `json:"request_time_seconds"`
}

type User

type User struct {
	BaseModel
	Email          string `json:"email" gorm:"uniqueIndex"`
	HashedPassword string `json:"-"`
	Password       string `json:"-" gorm:"-"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL