repo

package
v0.0.0-...-c20d9b3 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByStatusOrder

func ByStatusOrder() func(s *sql.Selector)

func NewModelRepo

func NewModelRepo(db *db.Client) domain.ModelRepo

Types

type DailyUsage

type DailyUsage struct {
	Date         time.Time `json:"date"`          // 时间戳
	InputTokens  int64     `json:"input_tokens"`  // 输入token数
	OutputTokens int64     `json:"output_tokens"` // 输出token数
}

type ModelRepo

type ModelRepo struct {
	// contains filtered or unexported fields
}

func (*ModelRepo) Create

func (r *ModelRepo) Create(ctx context.Context, m *domain.CreateModelReq) (*db.Model, error)

func (*ModelRepo) Delete

func (r *ModelRepo) Delete(ctx context.Context, id string) error

func (*ModelRepo) GetTokenUsage

func (r *ModelRepo) GetTokenUsage(ctx context.Context, modelType consts.ModelType) (*domain.ModelTokenUsageResp, error)

func (*ModelRepo) GetWithCache

func (r *ModelRepo) GetWithCache(ctx context.Context, modelType consts.ModelType) ([]*db.Model, error)

func (*ModelRepo) InitModel

func (r *ModelRepo) InitModel(ctx context.Context, modelName, modelKey, modelURL string) error

func (*ModelRepo) List

func (r *ModelRepo) List(ctx context.Context) (*domain.AllModelResp, error)

func (*ModelRepo) ModelUsage

func (r *ModelRepo) ModelUsage(ctx context.Context, ids []uuid.UUID) (map[uuid.UUID]domain.ModelUsage, error)

func (*ModelRepo) MyModelList

func (r *ModelRepo) MyModelList(ctx context.Context, req *domain.MyModelListReq) ([]*db.Model, error)

func (*ModelRepo) Update

func (r *ModelRepo) Update(ctx context.Context, id string, fn func(tx *db.Tx, old *db.Model, up *db.ModelUpdateOne) error) (*db.Model, error)

type TokenUsage

type TokenUsage struct {
	Input  int64 `json:"input"`  // 输入token数
	Output int64 `json:"output"` // 输出token数
}

Jump to

Keyboard shortcuts

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