Documentation ¶
Index ¶
- Variables
- func InitDB(config *config.Config, db *gorm.DB)
- func OpenDB(opts config.Config) (*gorm.DB, error)
- func ParseDSN(opts config.Config) (dsn string, err error)
- type APIType
- type Datasource
- type Favorite
- type File
- type LLMConfig
- type LLMJob
- type ModelVersion
- type SchemaSnapshot
- type Sketch
- type Stats
- type TaskEffect
- type TaskInfo
- type Vector
Constants ¶
This section is empty.
Variables ¶
View Source
var CtxDB *gorm.DB
Functions ¶
Types ¶
type Datasource ¶
type Datasource struct { ID int `gorm:"column:id;primaryKey;autoIncrement"` BID string `gorm:"column:b_id;not null;type:char(32);uniqueIndex;comment:datasource id"` Name string `gorm:"column:name;type:varchar(128);not null"` Type string `gorm:"column:type;type:varchar(128);not null"` Platform string `gorm:"column:platform;type:varchar(128);not null"` Config string `gorm:"column:config;type:text;not null"` Secret string `gorm:"column:secret;type:varchar(128);not null"` Host string `gorm:"column:host;type:varchar(128);not null"` Username string `gorm:"column:username;type:varchar(128);not null"` CreateTime time.Time `gorm:"column:create_time;type:datetime;autoCreateTime"` DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index;type:datetime"` }
type Favorite ¶
type Favorite struct { ID int `gorm:"column:id;primaryKey;autoIncrement"` BID string `gorm:"column:b_id;not null;type:char(32);uniqueIndex;comment:favorite id"` Content string `gorm:"column:content;type:varchar(255);not null"` Host string `gorm:"column:host;type:varchar(128);not null"` Username string `gorm:"column:username;type:varchar(128);not null"` CreateTime time.Time `gorm:"column:create_time;type:datetime;autoCreateTime"` DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index;type:datetime"` }
type File ¶
type File struct { ID int `gorm:"column:id;primaryKey;autoIncrement"` BID string `gorm:"column:b_id;not null;type:char(32);uniqueIndex;comment:file id"` Name string `gorm:"column:name;type:varchar(128);unique"` WithHeader bool `gorm:"column:with_header;type:boolean;default:false;"` Delimiter string `gorm:"column:delimiter;default:',';"` Host string `gorm:"column:host;type:varchar(128);not null"` Username string `gorm:"column:username;type:varchar(128);not null"` CreateTime time.Time `gorm:"column:create_time;type:datetime;autoCreateTime"` UpdateTime time.Time `gorm:"column:update_time;type:datetime;autoUpdateTime"` }
type LLMJob ¶
type LLMJob struct { ID int `json:"id" gorm:"primaryKey;autoIncrement"` UserName string `json:"user_name" gorm:"index:"` Host string `json:"host" gorm:"index"` JobID string `json:"job_id" gorm:"index:,unique"` Space string `json:"space"` File string `json:"file"` JobType string `json:"job_type"` Status base.LLMStatus `json:"status"` UserPrompt string `json:"user_prompt"` Process datatypes.JSON `json:"process"` CreateTime time.Time `json:"create_time" gorm:"column:create_time;type:datetime;autoCreateTime"` UpdateTime time.Time `json:"update_ime" gorm:"column:update_time;type:datetime;autoUpdateTime"` }
type ModelVersion ¶
type ModelVersion string
const LLM3Dot5Turbo ModelVersion = "llm3.5-turbo"
const LLM4 ModelVersion = "llm4"
type SchemaSnapshot ¶
type SchemaSnapshot struct { ID int `gorm:"column:id;primaryKey;autoIncrement"` BID string `gorm:"column:b_id;not null;type:char(32);uniqueIndex;comment:schema snapshot id"` Space string `gorm:"column:space;type:varchar(255);not null"` Snapshot string `gorm:"column:snapshot;type:text;not null"` Host string `gorm:"column:host;type:varchar(256);not null"` Username string `gorm:"column:username;type:varchar(128);not null"` CreateTime time.Time `gorm:"column:create_time;type:datetime;autoCreateTime"` UpdateTime time.Time `gorm:"column:update_time;type:datetime;autoUpdateTime"` DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index;type:datetime"` }
type Sketch ¶
type Sketch struct { ID int `gorm:"column:id;primaryKey;autoIncrement"` BID string `gorm:"column:b_id;not null;type:char(32);uniqueIndex;comment:sketch id"` Name string `gorm:"column:name;type:varchar(255);not null"` Schema string `gorm:"column:schema;type:mediumtext;"` Snapshot string `gorm:"column:snapshot;type:mediumtext;"` Host string `gorm:"column:host;type:varchar(256);not null"` Username string `gorm:"column:username;type:varchar(128);not null"` CreateTime time.Time `gorm:"column:create_time;type:datetime;autoCreateTime"` UpdateTime time.Time `gorm:"column:update_time;type:datetime;autoUpdateTime"` DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index;type:datetime"` }
type Stats ¶
type Stats struct { ProcessedBytes int64 `gorm:"column:processed_bytes;"` TotalBytes int64 `gorm:"column:total_bytes;"` FailedRecords int64 `gorm:"column:failed_records;"` TotalRecords int64 `gorm:"column:total_records;"` FailedRequest int64 `gorm:"column:failed_request;"` TotalRequest int64 `gorm:"column:total_request;"` TotalLatency time.Duration `gorm:"column:total_latency;"` TotalRespTime time.Duration `gorm:"column:total_resp_time;"` FailedProcessed int64 `gorm:"column:failed_processed;"` TotalProcessed int64 `gorm:"column:total_processed;"` }
type TaskEffect ¶
type TaskEffect struct { ID int `gorm:"column:id;primaryKey;autoIncrement;"` BID string `gorm:"column:task_id;not null;type:char(32);uniqueIndex;comment:task id"` Log string `gorm:"column:log;type:mediumtext;comment:partial task log"` Config string `gorm:"column:config;type:mediumtext;comment:task config.yaml"` CreateTime time.Time `gorm:"column:create_time;type:datetime;autoCreateTime"` }
storage for task yaml config and partial task log
type TaskInfo ¶
type TaskInfo struct { ID int `gorm:"column:id;primaryKey;autoIncrement;"` BID string `gorm:"column:b_id;not null;type:char(32);uniqueIndex;comment:task id"` Address string `gorm:"column:address;type:varchar(255);"` LLMJobID int `gorm:"column:llm_job_id;"` LLMJob LLMJob `gorm:"foreignKey:LLMJobID;"` Name string `gorm:"column:name;type:varchar(255);"` Space string `gorm:"column:space;type:varchar(255);"` ImportAddress string `gorm:"column:import_address;"` User string `gorm:"column:user;"` TaskStatus string `gorm:"column:task_status;"` TaskMessage string `gorm:"column:task_message;"` Stats Stats `gorm:"embedded"` RawConfig string `gorm:"column:raw_config;type:mediumtext;"` CreateTime time.Time `gorm:"column:create_time;type:datetime;autoCreateTime"` UpdateTime time.Time `gorm:"column:update_time;type:datetime;autoUpdateTime"` }
Click to show internal directories.
Click to hide internal directories.