Files
twurscandLydiaCai1203 cc28479493 Feat models add field (#643)
* feat: 模型配置支持配置多模态

* feat: models add is_hidden field

---------

Co-authored-by: LydiaCai1203 <1125862926@qq.com>
2026-06-02 19:59:51 +08:00

561 lines
22 KiB
Go

// Code generated by ent, DO NOT EDIT.
package model
import (
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
)
const (
// Label holds the string label denoting the model type in the database.
Label = "model"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldDeletedAt holds the string denoting the deleted_at field in the database.
FieldDeletedAt = "deleted_at"
// FieldUserID holds the string denoting the user_id field in the database.
FieldUserID = "user_id"
// FieldProvider holds the string denoting the provider field in the database.
FieldProvider = "provider"
// FieldAPIKey holds the string denoting the api_key field in the database.
FieldAPIKey = "api_key"
// FieldBaseURL holds the string denoting the base_url field in the database.
FieldBaseURL = "base_url"
// FieldModel holds the string denoting the model field in the database.
FieldModel = "model"
// FieldRemark holds the string denoting the remark field in the database.
FieldRemark = "remark"
// FieldTemperature holds the string denoting the temperature field in the database.
FieldTemperature = "temperature"
// FieldInterfaceType holds the string denoting the interface_type field in the database.
FieldInterfaceType = "interface_type"
// FieldWeight holds the string denoting the weight field in the database.
FieldWeight = "weight"
// FieldThinkingEnabled holds the string denoting the thinking_enabled field in the database.
FieldThinkingEnabled = "thinking_enabled"
// FieldSupportImage holds the string denoting the support_image field in the database.
FieldSupportImage = "support_image"
// FieldIsHidden holds the string denoting the is_hidden field in the database.
FieldIsHidden = "is_hidden"
// FieldContextLimit holds the string denoting the context_limit field in the database.
FieldContextLimit = "context_limit"
// FieldOutputLimit holds the string denoting the output_limit field in the database.
FieldOutputLimit = "output_limit"
// FieldLastCheckAt holds the string denoting the last_check_at field in the database.
FieldLastCheckAt = "last_check_at"
// FieldLastCheckSuccess holds the string denoting the last_check_success field in the database.
FieldLastCheckSuccess = "last_check_success"
// FieldLastCheckError holds the string denoting the last_check_error field in the database.
FieldLastCheckError = "last_check_error"
// FieldCreatedAt holds the string denoting the created_at field in the database.
FieldCreatedAt = "created_at"
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
FieldUpdatedAt = "updated_at"
// EdgeUser holds the string denoting the user edge name in mutations.
EdgeUser = "user"
// EdgeTeams holds the string denoting the teams edge name in mutations.
EdgeTeams = "teams"
// EdgeGroups holds the string denoting the groups edge name in mutations.
EdgeGroups = "groups"
// EdgeVms holds the string denoting the vms edge name in mutations.
EdgeVms = "vms"
// EdgeProjectTasks holds the string denoting the project_tasks edge name in mutations.
EdgeProjectTasks = "project_tasks"
// EdgePricing holds the string denoting the pricing edge name in mutations.
EdgePricing = "pricing"
// EdgeApikeys holds the string denoting the apikeys edge name in mutations.
EdgeApikeys = "apikeys"
// EdgeSwitchesFrom holds the string denoting the switches_from edge name in mutations.
EdgeSwitchesFrom = "switches_from"
// EdgeSwitchesTo holds the string denoting the switches_to edge name in mutations.
EdgeSwitchesTo = "switches_to"
// EdgeTeamModels holds the string denoting the team_models edge name in mutations.
EdgeTeamModels = "team_models"
// EdgeTeamGroupModels holds the string denoting the team_group_models edge name in mutations.
EdgeTeamGroupModels = "team_group_models"
// Table holds the table name of the model in the database.
Table = "models"
// UserTable is the table that holds the user relation/edge.
UserTable = "models"
// UserInverseTable is the table name for the User entity.
// It exists in this package in order to avoid circular dependency with the "user" package.
UserInverseTable = "users"
// UserColumn is the table column denoting the user relation/edge.
UserColumn = "user_id"
// TeamsTable is the table that holds the teams relation/edge. The primary key declared below.
TeamsTable = "team_models"
// TeamsInverseTable is the table name for the Team entity.
// It exists in this package in order to avoid circular dependency with the "team" package.
TeamsInverseTable = "teams"
// GroupsTable is the table that holds the groups relation/edge. The primary key declared below.
GroupsTable = "team_group_models"
// GroupsInverseTable is the table name for the TeamGroup entity.
// It exists in this package in order to avoid circular dependency with the "teamgroup" package.
GroupsInverseTable = "team_groups"
// VmsTable is the table that holds the vms relation/edge.
VmsTable = "virtualmachines"
// VmsInverseTable is the table name for the VirtualMachine entity.
// It exists in this package in order to avoid circular dependency with the "virtualmachine" package.
VmsInverseTable = "virtualmachines"
// VmsColumn is the table column denoting the vms relation/edge.
VmsColumn = "model_id"
// ProjectTasksTable is the table that holds the project_tasks relation/edge.
ProjectTasksTable = "project_tasks"
// ProjectTasksInverseTable is the table name for the ProjectTask entity.
// It exists in this package in order to avoid circular dependency with the "projecttask" package.
ProjectTasksInverseTable = "project_tasks"
// ProjectTasksColumn is the table column denoting the project_tasks relation/edge.
ProjectTasksColumn = "model_id"
// PricingTable is the table that holds the pricing relation/edge.
PricingTable = "model_pricings"
// PricingInverseTable is the table name for the ModelPricing entity.
// It exists in this package in order to avoid circular dependency with the "modelpricing" package.
PricingInverseTable = "model_pricings"
// PricingColumn is the table column denoting the pricing relation/edge.
PricingColumn = "model_id"
// ApikeysTable is the table that holds the apikeys relation/edge.
ApikeysTable = "model_api_keys"
// ApikeysInverseTable is the table name for the ModelApiKey entity.
// It exists in this package in order to avoid circular dependency with the "modelapikey" package.
ApikeysInverseTable = "model_api_keys"
// ApikeysColumn is the table column denoting the apikeys relation/edge.
ApikeysColumn = "model_id"
// SwitchesFromTable is the table that holds the switches_from relation/edge.
SwitchesFromTable = "task_model_switches"
// SwitchesFromInverseTable is the table name for the TaskModelSwitch entity.
// It exists in this package in order to avoid circular dependency with the "taskmodelswitch" package.
SwitchesFromInverseTable = "task_model_switches"
// SwitchesFromColumn is the table column denoting the switches_from relation/edge.
SwitchesFromColumn = "from_model_id"
// SwitchesToTable is the table that holds the switches_to relation/edge.
SwitchesToTable = "task_model_switches"
// SwitchesToInverseTable is the table name for the TaskModelSwitch entity.
// It exists in this package in order to avoid circular dependency with the "taskmodelswitch" package.
SwitchesToInverseTable = "task_model_switches"
// SwitchesToColumn is the table column denoting the switches_to relation/edge.
SwitchesToColumn = "to_model_id"
// TeamModelsTable is the table that holds the team_models relation/edge.
TeamModelsTable = "team_models"
// TeamModelsInverseTable is the table name for the TeamModel entity.
// It exists in this package in order to avoid circular dependency with the "teammodel" package.
TeamModelsInverseTable = "team_models"
// TeamModelsColumn is the table column denoting the team_models relation/edge.
TeamModelsColumn = "model_id"
// TeamGroupModelsTable is the table that holds the team_group_models relation/edge.
TeamGroupModelsTable = "team_group_models"
// TeamGroupModelsInverseTable is the table name for the TeamGroupModel entity.
// It exists in this package in order to avoid circular dependency with the "teamgroupmodel" package.
TeamGroupModelsInverseTable = "team_group_models"
// TeamGroupModelsColumn is the table column denoting the team_group_models relation/edge.
TeamGroupModelsColumn = "model_id"
)
// Columns holds all SQL columns for model fields.
var Columns = []string{
FieldID,
FieldDeletedAt,
FieldUserID,
FieldProvider,
FieldAPIKey,
FieldBaseURL,
FieldModel,
FieldRemark,
FieldTemperature,
FieldInterfaceType,
FieldWeight,
FieldThinkingEnabled,
FieldSupportImage,
FieldIsHidden,
FieldContextLimit,
FieldOutputLimit,
FieldLastCheckAt,
FieldLastCheckSuccess,
FieldLastCheckError,
FieldCreatedAt,
FieldUpdatedAt,
}
var (
// TeamsPrimaryKey and TeamsColumn2 are the table columns denoting the
// primary key for the teams relation (M2M).
TeamsPrimaryKey = []string{"team_id", "model_id"}
// GroupsPrimaryKey and GroupsColumn2 are the table columns denoting the
// primary key for the groups relation (M2M).
GroupsPrimaryKey = []string{"group_id", "model_id"}
)
// ValidColumn reports if the column name is valid (part of the table columns).
func ValidColumn(column string) bool {
for i := range Columns {
if column == Columns[i] {
return true
}
}
return false
}
// Note that the variables below are initialized by the runtime
// package on the initialization of the application. Therefore,
// it should be imported in the main as follows:
//
// import _ "github.com/chaitin/MonkeyCode/backend/db/runtime"
var (
Hooks [1]ent.Hook
Interceptors [1]ent.Interceptor
// ProviderValidator is a validator for the "provider" field. It is called by the builders before save.
ProviderValidator func(string) error
// APIKeyValidator is a validator for the "api_key" field. It is called by the builders before save.
APIKeyValidator func(string) error
// BaseURLValidator is a validator for the "base_url" field. It is called by the builders before save.
BaseURLValidator func(string) error
// ModelValidator is a validator for the "model" field. It is called by the builders before save.
ModelValidator func(string) error
// DefaultWeight holds the default value on creation for the "weight" field.
DefaultWeight int
// DefaultThinkingEnabled holds the default value on creation for the "thinking_enabled" field.
DefaultThinkingEnabled bool
// DefaultSupportImage holds the default value on creation for the "support_image" field.
DefaultSupportImage bool
// DefaultIsHidden holds the default value on creation for the "is_hidden" field.
DefaultIsHidden bool
// DefaultContextLimit holds the default value on creation for the "context_limit" field.
DefaultContextLimit int
// DefaultOutputLimit holds the default value on creation for the "output_limit" field.
DefaultOutputLimit int
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
DefaultCreatedAt func() time.Time
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
DefaultUpdatedAt func() time.Time
// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
UpdateDefaultUpdatedAt func() time.Time
)
// OrderOption defines the ordering options for the Model queries.
type OrderOption func(*sql.Selector)
// ByID orders the results by the id field.
func ByID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldID, opts...).ToFunc()
}
// ByDeletedAt orders the results by the deleted_at field.
func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
}
// ByUserID orders the results by the user_id field.
func ByUserID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUserID, opts...).ToFunc()
}
// ByProvider orders the results by the provider field.
func ByProvider(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldProvider, opts...).ToFunc()
}
// ByAPIKey orders the results by the api_key field.
func ByAPIKey(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldAPIKey, opts...).ToFunc()
}
// ByBaseURL orders the results by the base_url field.
func ByBaseURL(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldBaseURL, opts...).ToFunc()
}
// ByModel orders the results by the model field.
func ByModel(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldModel, opts...).ToFunc()
}
// ByRemark orders the results by the remark field.
func ByRemark(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRemark, opts...).ToFunc()
}
// ByTemperature orders the results by the temperature field.
func ByTemperature(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTemperature, opts...).ToFunc()
}
// ByInterfaceType orders the results by the interface_type field.
func ByInterfaceType(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldInterfaceType, opts...).ToFunc()
}
// ByWeight orders the results by the weight field.
func ByWeight(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldWeight, opts...).ToFunc()
}
// ByThinkingEnabled orders the results by the thinking_enabled field.
func ByThinkingEnabled(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldThinkingEnabled, opts...).ToFunc()
}
// BySupportImage orders the results by the support_image field.
func BySupportImage(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldSupportImage, opts...).ToFunc()
}
// ByIsHidden orders the results by the is_hidden field.
func ByIsHidden(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldIsHidden, opts...).ToFunc()
}
// ByContextLimit orders the results by the context_limit field.
func ByContextLimit(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldContextLimit, opts...).ToFunc()
}
// ByOutputLimit orders the results by the output_limit field.
func ByOutputLimit(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOutputLimit, opts...).ToFunc()
}
// ByLastCheckAt orders the results by the last_check_at field.
func ByLastCheckAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldLastCheckAt, opts...).ToFunc()
}
// ByLastCheckSuccess orders the results by the last_check_success field.
func ByLastCheckSuccess(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldLastCheckSuccess, opts...).ToFunc()
}
// ByLastCheckError orders the results by the last_check_error field.
func ByLastCheckError(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldLastCheckError, opts...).ToFunc()
}
// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}
// ByUpdatedAt orders the results by the updated_at field.
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
}
// ByUserField orders the results by user field.
func ByUserField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newUserStep(), sql.OrderByField(field, opts...))
}
}
// ByTeamsCount orders the results by teams count.
func ByTeamsCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newTeamsStep(), opts...)
}
}
// ByTeams orders the results by teams terms.
func ByTeams(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newTeamsStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByGroupsCount orders the results by groups count.
func ByGroupsCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newGroupsStep(), opts...)
}
}
// ByGroups orders the results by groups terms.
func ByGroups(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newGroupsStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByVmsCount orders the results by vms count.
func ByVmsCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newVmsStep(), opts...)
}
}
// ByVms orders the results by vms terms.
func ByVms(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newVmsStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByProjectTasksCount orders the results by project_tasks count.
func ByProjectTasksCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newProjectTasksStep(), opts...)
}
}
// ByProjectTasks orders the results by project_tasks terms.
func ByProjectTasks(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newProjectTasksStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByPricingField orders the results by pricing field.
func ByPricingField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newPricingStep(), sql.OrderByField(field, opts...))
}
}
// ByApikeysCount orders the results by apikeys count.
func ByApikeysCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newApikeysStep(), opts...)
}
}
// ByApikeys orders the results by apikeys terms.
func ByApikeys(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newApikeysStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// BySwitchesFromCount orders the results by switches_from count.
func BySwitchesFromCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newSwitchesFromStep(), opts...)
}
}
// BySwitchesFrom orders the results by switches_from terms.
func BySwitchesFrom(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newSwitchesFromStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// BySwitchesToCount orders the results by switches_to count.
func BySwitchesToCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newSwitchesToStep(), opts...)
}
}
// BySwitchesTo orders the results by switches_to terms.
func BySwitchesTo(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newSwitchesToStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByTeamModelsCount orders the results by team_models count.
func ByTeamModelsCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newTeamModelsStep(), opts...)
}
}
// ByTeamModels orders the results by team_models terms.
func ByTeamModels(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newTeamModelsStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByTeamGroupModelsCount orders the results by team_group_models count.
func ByTeamGroupModelsCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newTeamGroupModelsStep(), opts...)
}
}
// ByTeamGroupModels orders the results by team_group_models terms.
func ByTeamGroupModels(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newTeamGroupModelsStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
func newUserStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(UserInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, UserTable, UserColumn),
)
}
func newTeamsStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(TeamsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2M, true, TeamsTable, TeamsPrimaryKey...),
)
}
func newGroupsStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(GroupsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2M, true, GroupsTable, GroupsPrimaryKey...),
)
}
func newVmsStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(VmsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, VmsTable, VmsColumn),
)
}
func newProjectTasksStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(ProjectTasksInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, ProjectTasksTable, ProjectTasksColumn),
)
}
func newPricingStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(PricingInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2O, false, PricingTable, PricingColumn),
)
}
func newApikeysStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(ApikeysInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, ApikeysTable, ApikeysColumn),
)
}
func newSwitchesFromStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(SwitchesFromInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, SwitchesFromTable, SwitchesFromColumn),
)
}
func newSwitchesToStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(SwitchesToInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, SwitchesToTable, SwitchesToColumn),
)
}
func newTeamModelsStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(TeamModelsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, true, TeamModelsTable, TeamModelsColumn),
)
}
func newTeamGroupModelsStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(TeamGroupModelsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, true, TeamGroupModelsTable, TeamGroupModelsColumn),
)
}