Documentation
¶
Index ¶
- type Balance
- type IBalanceStore
- type IKeyStore
- type ILocalModelCacheStore
- type ILocalModelInstallStateStore
- type ILocalModelPackageStore
- type ILocalModelStore
- type ILogMetricsStore
- type IProviderModelStore
- type IProviderStore
- type Key
- type LocalModel
- type LocalModelCache
- type LocalModelInstallState
- type LocalModelPackage
- type LogMetrics
- type Provider
- type ProviderModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Balance ¶
type Balance struct {
Id int64 `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"`
Uuid string `gorm:"type:varchar(36);not null;column:uuid;uniqueIndex:uuid;comment:UUID;"`
Provider string `gorm:"type:varchar(100);not null;column:provider;comment:供应商ID;uniqueIndex:provider_model" aovalue:"provider`
ProviderName string `gorm:"type:varchar(100);not null;column:provider_name;comment:供应商名称"`
Model string `gorm:"type:varchar(100);not null;column:model;comment:模型ID;uniqueIndex:provider_model"`
ModelName string `gorm:"type:varchar(100);not null;column:model_name;comment:模型名称"`
Type int `gorm:"type:tinyint(1);not null;column:type;comment:类型,0:online,1:local"`
State int `gorm:"type:tinyint(1);not null;column:state;comment:状态,0:异常,1:正常;default:1"`
Priority int `gorm:"type:int;not null;column:priority;comment:优先级,数字越小优先级越大"`
Creator string `gorm:"size:36;not null;column:creator;comment:创建人;index:creator" aovalue:"creator"` // 创建人
Updater string `gorm:"size:36;not null;column:updater;comment:更新人;index:updater" aovalue:"updater"` // 更新人
CreateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:create_at;comment:创建时间"`
UpdateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:update_at;comment:更新时间"`
}
type IBalanceStore ¶
type IBalanceStore interface {
store.ISearchStore[Balance]
}
type IKeyStore ¶
type IKeyStore interface {
store.ISearchStore[Key]
}
type ILocalModelCacheStore ¶
type ILocalModelCacheStore interface {
store.IBaseStore[LocalModelCache]
}
type ILocalModelInstallStateStore ¶
type ILocalModelInstallStateStore interface {
store.ISearchStore[LocalModelInstallState]
}
type ILocalModelPackageStore ¶
type ILocalModelPackageStore interface {
store.ISearchStore[LocalModelPackage]
}
type ILocalModelStore ¶
type ILocalModelStore interface {
store.ISearchStore[LocalModel]
}
type ILogMetricsStore ¶
type ILogMetricsStore interface {
store.ISearchStore[LogMetrics]
}
type IProviderModelStore ¶
type IProviderModelStore interface {
store.ISearchStore[ProviderModel]
}
type IProviderStore ¶
type IProviderStore interface {
store.ISearchStore[Provider]
}
type Key ¶
type Key struct {
Id int64 `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"`
Uuid string `gorm:"type:varchar(36);not null;column:uuid;uniqueIndex:uuid;comment:UUID;"`
Name string `gorm:"type:varchar(100);not null;column:name;comment:名称"`
Config string `gorm:"type:text;not null;column:config;comment:配置"`
Provider string `gorm:"type:varchar(36);not null;column:provider;comment:供应商ID"`
Status int `gorm:"type:tinyint(1);not null;column:status;comment:状态,0:停用;1:启用,2:错误;3:超额;4:过期"`
ExpireTime int `gorm:"type:int;not null;column:expire_time;comment:过期时间"`
UseToken int `gorm:"type:int;not null;column:use_token;comment:使用token数"`
Sort int `gorm:"type:int;not null;column:sort;comment:排序"`
Creator string `gorm:"size:36;not null;column:creator;comment:创建人;index:creator" aovalue:"creator"` // 创建人
Updater string `gorm:"size:36;not null;column:updater;comment:更新人;index:updater" aovalue:"updater"` // 更新人
CreateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:create_at;comment:创建时间"`
UpdateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:update_at;comment:更新时间"`
Default bool `gorm:"type:tinyint(1);not null;column:default;comment:是否默认"`
}
type LocalModel ¶
type LocalModel struct {
Id int64 `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"`
Uuid string `gorm:"type:varchar(36);not null;column:uuid;uniqueIndex:uuid;comment:UUID;"`
Name string `gorm:"type:varchar(100);not null;column:name;comment:名称"`
Provider string `gorm:"type:varchar(100);not null;column:provider;comment:供应商ID"`
State int `gorm:"type:tinyint(1);not null;column:state;comment:状态,0:关闭,1:正常;default:1"`
Creator string `gorm:"size:36;not null;column:creator;comment:创建人;index:creator" aovalue:"creator"` // 创建人
Updater string `gorm:"size:36;not null;column:updater;comment:更新人;index:updater" aovalue:"updater"` // 更新人
CreateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:create_at;comment:创建时间"`
UpdateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:update_at;comment:更新时间"`
}
func (*LocalModel) IdValue ¶
func (i *LocalModel) IdValue() int64
func (*LocalModel) TableName ¶
func (i *LocalModel) TableName() string
type LocalModelCache ¶
type LocalModelCache struct {
Id int64 `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"`
Model string `gorm:"type:varchar(100);not null;column:model;comment:模型ID"`
Target string `gorm:"type:varchar(100);not null;column:target;comment:目标"`
Type int `gorm:"type:tinyint(1);not null;column:type;comment:类型,0: 服务"`
}
func (*LocalModelCache) IdValue ¶
func (i *LocalModelCache) IdValue() int64
func (*LocalModelCache) TableName ¶
func (i *LocalModelCache) TableName() string
type LocalModelInstallState ¶
type LocalModelInstallState struct {
Id int64 `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"`
Uuid string `gorm:"type:varchar(36);not null;column:uuid;uniqueIndex:uuid;comment:UUID;"`
Complete int64 `gorm:"type:BIGINT(20);not null;column:complete;comment:已下载大小"`
Total int64 `gorm:"type:BIGINT(20);not null;column:total;comment:总大小"`
State int `gorm:"type:tinyint(1);not null;column:state;comment:状态"`
LastMsg string `gorm:"type:text;not null;column:last_msg;comment:最后一次消息"`
UpdateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:update_at;comment:更新时间"`
}
func (*LocalModelInstallState) IdValue ¶
func (i *LocalModelInstallState) IdValue() int64
func (*LocalModelInstallState) TableName ¶
func (i *LocalModelInstallState) TableName() string
type LocalModelPackage ¶
type LocalModelPackage struct {
Id int64 `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"`
Uuid string `gorm:"type:varchar(100);not null;column:uuid;uniqueIndex:uuid;comment:UUID;"`
Name string `gorm:"type:varchar(100);not null;column:name;comment:名称"`
Size string `gorm:"type:varchar(100);not null;column:size;comment:模型大小"`
Hash string `gorm:"type:varchar(100);not null;column:hash;comment:模型hash"`
Description string `gorm:"type:varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;not null;column:description;comment:描述"`
Text string `gorm:"type:varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;not null;column:text;comment:描述"`
Version string `gorm:"type:varchar(100);not null;column:version;comment:版本"`
IsPopular bool `gorm:"type:tinyint(1);not null;column:is_popular;comment:是否热门"`
}
func (*LocalModelPackage) IdValue ¶
func (i *LocalModelPackage) IdValue() int64
func (*LocalModelPackage) TableName ¶
func (i *LocalModelPackage) TableName() string
type LogMetrics ¶
type LogMetrics struct {
Id int64 `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"`
UUID string `gorm:"type:varchar(36);not null;column:uuid;uniqueIndex:uuid;comment:UUID;"`
Provider string `gorm:"type:varchar(36);not null;column:provider;comment:供应商ID"`
Model string `gorm:"type:varchar(36);not null;column:model;comment:模型ID"`
InputToken int `gorm:"type:int;not null;column:input_token;comment:输入token"`
OutputToken int `gorm:"type:int;not null;column:output_token;comment:输出token"`
TotalToken int `gorm:"type:int;not null;column:total_token;comment:总token"`
Cost float64 `gorm:"type:int;not null;column:cost;comment:费用"`
Per float64 `gorm:"type:int;not null;column:per;comment:每个token的价格"`
}
func (*LogMetrics) IdValue ¶
func (i *LogMetrics) IdValue() int64
func (*LogMetrics) TableName ¶
func (i *LogMetrics) TableName() string
type Provider ¶
type Provider struct {
Id int64 `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"`
UUID string `gorm:"type:varchar(36);not null;column:uuid;uniqueIndex:uuid;comment:UUID;"`
Name string `gorm:"type:varchar(100);not null;column:name;comment:name"`
DefaultLLM string `gorm:"type:varchar(255);not null;column:default_llm;comment:默认模型ID"`
Config string `gorm:"type:text;not null;column:config;comment:配置信息"`
Status int `gorm:"type:tinyint(1);not null;column:status;comment:状态,0:停用;1:启用,2:异常;default:1"`
Priority int `gorm:"type:int;not null;column:priority;comment:优先级,值越小优先级越高"`
Type int `gorm:"type:tinyint(1);not null;column:type;comment:type 0:default 1:customize"`
Creator string `gorm:"size:36;not null;column:creator;comment:创建人;index:creator" aovalue:"creator"` // 创建人
Updater string `gorm:"size:36;not null;column:updater;comment:更新人;index:updater" aovalue:"updater"` // 更新人
CreateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:create_at;comment:创建时间"`
UpdateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:update_at;comment:更新时间"`
}
type ProviderModel ¶
type ProviderModel struct {
Id int64 `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:PRIMARY ID;"`
UUID string `gorm:"type:varchar(36);not null;column:uuid;uniqueIndex:uuid;comment:UUID;"`
Name string `gorm:"type:varchar(100);not null;column:name;comment:name;index:name"`
Type string `gorm:"type:varchar(100);not null;column:type;comment:type:chat"`
AccessConfiguration string `gorm:"type:text;not null;column:access_configuration;comment:access_configuration json"`
ModelParameters string `gorm:"type:text;not null;column:model_parameters;comment:model_parameters json"`
Provider string `gorm:"type:varchar(36);not null;column:provider;comment:ai_provider:uuid;index:provider"`
Creator string `gorm:"size:36;not null;column:creator;comment:creator;index:creator" aovalue:"creator"`
Updater string `gorm:"size:36;not null;column:updater;comment:updater;index:updater" aovalue:"updater"`
CreateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:create_at;comment:create_at"`
UpdateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:update_at;comment:update_at"`
}
func (*ProviderModel) IdValue ¶
func (i *ProviderModel) IdValue() int64
func (*ProviderModel) TableName ¶
func (i *ProviderModel) TableName() string
Click to show internal directories.
Click to hide internal directories.