models

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AiFamily

type AiFamily string
const (
	OpenAI AiFamily = "openai"
)

type AiModels

type AiModels struct {
	Base      `gorm:"embedded"`
	Family    AiFamily `faker:"aifamily" sql:"family;not null;type:enum('openai')"`
	ModelType string   `faker:"oneof: LLM,imagegen" gorm:"model_type;not null"`
	Model     string   `faker:"oneof: gpt3.5,gpt4" gorm:"model;not null"`
	Encoding  string   `faker:"oneof: SHA,MD5" gorm:"encoding;not null"`
	Size      string   `faker:"oneof: small,medium,large" gorm:"size;"`
	Quality   string   `faker:"oneof: low,medium,high" gorm:"quality;"`
	Status    Status   `faker:"status" sql:"status;not null;type:enum('active', 'inactive', 'archived');default:'active'"`
}

type ApiKeys

type ApiKeys struct {
	Base      `gorm:"embedded"`
	ProductID uuid.UUID `gorm:"product_id;not null"`
	ApiKey    string    `faker:"uuid_hyphenated" gorm:"api_key;not null;uniqueIndex;index:idx_api_keys_status,unique"`
	Status    Status    `faker:"status" sql:"status;not null;index:idx_api_keys_status,unique;type:enum('active', 'inactive', 'archived')"`
	Tags      string    `faker:"tags" gorm:"tags;<-:false"`
	CreatedBy string    `faker:"uuid_hyphenated" gorm:"created_by;not null"`
}

type AuditLogs

type AuditLogs struct {
	Id          uuid.UUID       `gorm:"id;<-:create;type:uuid;default:gen_random_uuid();primaryKey;not null"`
	RequestId   string          `gorm:"request_id;<-:create;not null;"`
	CreatedAt   time.Time       `gorm:"created_at;<-:create;default:now();not null"`
	UpdatedAt   time.Time       `gorm:"updated_at;<-:create;default:now();not null"`
	DeletedAt   *gorm.DeletedAt `gorm:"deleted_at;index"`
	ApiKeyID    uuid.UUID       `gorm:"api_key_id;type:uuid;<-:create;not null"`
	IPAddress   string          `faker:"ipv4" gorm:"ip_address;<-:create;not null"`
	Message     string          `gorm:"message;<-:create;not null"`
	MessageType string          `gorm:"message_type;<-:create;not null"`
	Type        string          `gorm:"log_type;<-:create;not null"`
	Metadata    string          `gorm:"metadata;<-:create;not null"`
	ProductID   uuid.UUID       `gorm:"product_id;type:uuid; not null"`
}

type Base

type Base struct {
	Id        uuid.UUID       `gorm:"id;type:uuid;default:gen_random_uuid();primaryKey;not null"`
	CreatedAt time.Time       `gorm:"created_at;default:now();not null"`
	UpdatedAt time.Time       `gorm:"updated_at;default:now();not null"`
	DeletedAt *gorm.DeletedAt `gorm:"deleted_at;index;<-:false"`
}

type FinishReason

type FinishReason string
const (
	Stop          FinishReason = "stop"
	Length        FinishReason = "length"
	Null          FinishReason = "null"
	FunctionCall  FinishReason = "function_call"
	ContentFilter FinishReason = "content_filter"
)

type Products

type Products struct {
	Base        Base      `gorm:"embedded"`
	Status      Status    `faker:"status" sql:"status;not null;type:enum('active', 'inactive', 'archived');default:'active';default:'active'"`
	Name        string    `gorm:"name;not null"`
	WorkspaceID uuid.UUID `gorm:"workspace_id;type:uuid;not null"`
	Tags        string    `faker:"tags" gorm:"tags;<-:false"`
	CreatedBy   string    `faker:"uuid_hyphenated" gorm:"created_by;not null"`
}

type Status

type Status string
const (
	Active   Status = "active"
	Inactive Status = "inactive"
	Archived Status = "archived"
)

type Tags

type Tags struct {
	Base      Base   `gorm:"embedded"`
	Status    Status `faker:"status" sql:"status;not null;type:enum('active', 'inactive', 'archived');default:'active'"`
	Name      string `gorm:"name;not null"`
	CreatedBy string `faker:"uuid_hyphenated" gorm:"created_by;not null"`
}

type Usage

type Usage struct {
	Base                 `gorm:"embedded"`
	ModelID              uuid.UUID    `gorm:"model_id;<-:create;not null"`
	PredictedTokensCount int          `gorm:"predicted_tokens_count;<-:create"`
	PromptTokensCount    int          `gorm:"prompt_tokens_count;<-:create;not null"`
	CompletionTokens     int          `gorm:"completion_tokens;<-:create;not null"`
	TotalTokens          int          `gorm:"total_tokens;<-:create;not null"`
	FinishReason         FinishReason `faker:"finishreason" gorm:"finish_reason;<-:create;not null"`
	RequestType          string       `gorm:"request_type;<-:create;not null"`
	ProductID            uuid.UUID    `gorm:"product_id;type:uuid; not null"`
	AuditLogID           uuid.UUID    `gorm:"type:uuid;not null"`
}

type Workspaces

type Workspaces struct {
	Base      Base   `gorm:"embedded"`
	Status    Status `faker:"status" sql:"status;not null;type:enum('active', 'inactive', 'archived');default:'active'"`
	Name      string `gorm:"name;not null"`
	Tags      string `faker:"tags" gorm:"tags;<-:false"`
	CreatedBy string `faker:"uuid_hyphenated" gorm:"created_by;not null"`
}

Jump to

Keyboard shortcuts

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