model

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2025 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DocWaitingForUpload = -2 //文档待上传
	DocInit             = 0  //文档待处理
	DocProcessing       = 3  //文档处理中
	DocFail             = 5  //文档待处理
)
View Source
const (
	KnowledgeImportAnalyze = 1 //知识库任务解析中
	KnowledgeImportSubmit  = 2 //知识库任务已提交
	KnowledgeImportFinish  = 3 //知识库任务导入完成
	KnowledgeImportError   = 4 //知识库任务导入失败
	FileImportType         = 0 //文件上传
	UrlImportType          = 1 //url上传
	UrlFileImportType      = 2 //2.批量url上传
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DocAnalyzer

type DocAnalyzer struct {
	AnalyzerList []string `json:"analyzerList"` //文档解析方式,ocr等
}

type DocImportInfo

type DocImportInfo struct {
	DocInfoList []*DocInfo `json:"docInfoList"`
}

type DocInfo

type DocInfo struct {
	DocId   string `json:"docId"`   //文档id
	DocName string `json:"docName"` //文档名称
	DocUrl  string `json:"docUrl"`  //文档url
	DocType string `json:"docType"` // 文档类型
	DocSize int64  `json:"docSie"`  // 文档大小
}

type KnowledgeBase

type KnowledgeBase struct {
	Id             uint32 `gorm:"column:id;primary_key;type:bigint(20) auto_increment;not null;comment:'id';" json:"id"`       // Primary Key
	KnowledgeId    string `gorm:"uniqueIndex:idx_unique_knowledge_id;column:knowledge_id;type:varchar(64)" json:"knowledgeId"` // Business Primary Key
	Name           string `gorm:"column:name;index:idx_user_id_name,priority:2;type:varchar(256);not null;default:''" json:"name"`
	Description    string `gorm:"column:description;type:text;comment:'知识库描述';" json:"description"`
	DocCount       int    `gorm:"column:doc_count;type:int(11);not null;default:0;comment:'文档数量';" json:"docCount"`
	DocSize        int64  `gorm:"column:doc_size;type:bigint(20);not null;default:0;comment:'文档大小单位:字节';" json:"docSize"`
	EmbeddingModel string `gorm:"column:embedding_model;type:longtext;not null;comment:'embedding模型信息';" json:"embeddingModel"`
	CreatedAt      int64  `gorm:"column:create_at;type:bigint(20);not null;" json:"createAt"` // Create Time
	UpdatedAt      int64  `gorm:"column:update_at;type:bigint(20);not null;" json:"updateAt"` // Update Time
	UserId         string `gorm:"column:user_id;index:idx_user_id_name,priority:1;type:varchar(64);not null;default:'';" json:"userId"`
	OrgId          string `gorm:"column:org_id;type:varchar(64);not null;default:'';" json:"orgId"`
	Deleted        int    `gorm:"column:deleted;type:tinyint(1);not null;default:0;comment:'是否逻辑删除';" json:"deleted"`
}

func (KnowledgeBase) TableName

func (KnowledgeBase) TableName() string

type KnowledgeDoc

type KnowledgeDoc struct {
	Id           uint32 `json:"id" gorm:"primary_key;type:bigint(20) auto_increment;not null;comment:'id';"` // Primary Key
	DocId        string `gorm:"uniqueIndex:idx_unique_doc_id;column:doc_id;type:varchar(64)" json:"docId"`   // Business Primary Key
	ImportTaskId string `gorm:"column:batch_id;type:varchar(64);not null;default:'';comment:'导入的任务id'" json:"importTaskId"`
	KnowledgeId  string `` /* 129-byte string literal not displayed */
	FilePathMd5  string `gorm:"column:file_path_md5;type:varchar(64);not null;default:'';comment:'文件的md5值'" json:"filePathMd5"`
	FilePath     string `gorm:"column:file_path;type:text;not null" json:"filePath"`
	Name         string `gorm:"column:name;index:idx_user_id_knowledge_id_name,priority:3;type:varchar(256);not null;default:''" json:"name"`
	FileType     string `gorm:"column:file_type;type:varchar(20);not null;default:''" json:"fileType"`
	FileSize     int64  `gorm:"column:file_size;type:bigint(20);COMMENT:'文件大小,单位byte'" json:"fileSize"`
	Status       int    `` /* 211-byte string literal not displayed */
	ErrorMsg     string `gorm:"column:error_msg;type:longtext;not null;comment:'解析的错误信息'" json:"errorMsg"`
	CreatedAt    int64  `gorm:"column:create_at;type:bigint(20);not null;" json:"createAt"` // Create Time
	UpdatedAt    int64  `gorm:"column:update_at;type:bigint(20);not null;" json:"updateAt"` // Update Time
	UserId       string `gorm:"column:user_id;index:idx_user_id_knowledge_id_name,priority:1;type:varchar(64);not null;default:'';" json:"userId"`
	OrgId        string `gorm:"column:org_id;type:varchar(64);not null;default:''" json:"orgId"`
	Deleted      int    `gorm:"column:deleted;type:tinyint(1);not null;default:0;comment:'是否逻辑删除';" json:"deleted"`
}

func (KnowledgeDoc) TableName

func (KnowledgeDoc) TableName() string

type KnowledgeImportTask

type KnowledgeImportTask struct {
	Id            uint32 `gorm:"column:id;primary_key;type:bigint(20) auto_increment;not null;comment:'id';" json:"id"`
	ImportId      string `gorm:"uniqueIndex:idx_unique_import_id;column:import_id;type:varchar(64)" json:"importId"` // Business Primary Key
	KnowledgeId   string `gorm:"column:knowledge_id;type:varchar(64);not null;index:idx_knowledge_id" json:"knowledgeId"`
	ImportType    int    `gorm:"column:import_type;type:tinyint(1);not null;" json:"importType"`
	Status        int    `` /* 170-byte string literal not displayed */
	ErrorMsg      string `gorm:"column:error_msg;type:longtext;not null;comment:'解析的错误信息'" json:"errorMsg"`
	DocInfo       string `gorm:"column:doc_info;type:longtext;not null;comment:'文件信息'" json:"docInfo"`
	SegmentConfig string `gorm:"column:segment_config;type:text;not null;comment:'分段配置信息'" json:"segmentConfig"`
	DocAnalyzer   string `gorm:"column:doc_analyzer;type:text;not null;comment:'文档解析配置'" json:"docAnalyzer"`
	CreatedAt     int64  `gorm:"column:create_at;type:bigint(20);not null;" json:"createAt"` // Create Time
	UpdatedAt     int64  `gorm:"column:update_at;type:bigint(20);not null;" json:"updateAt"` // Update Time
	UserId        string `gorm:"column:user_id;type:varchar(64);not null;default:'';" json:"userId"`
	OrgId         string `gorm:"column:org_id;type:varchar(64);not null;default:''" json:"orgId"`
}

func (KnowledgeImportTask) TableName

func (KnowledgeImportTask) TableName() string

type SegmentConfig

type SegmentConfig struct {
	SegmentType string   `json:"segmentType" validate:"required"` //分段方式 0:自定分段;1:自定义分段
	Splitter    []string `json:"splitter"`                        // 分隔符(只有自定义分段必填)
	MaxSplitter int      `json:"maxSplitter"`                     // 可分隔最大值(只有自定义分段必填)
	Overlap     float32  `json:"overlap"`                         // 可重叠值(只有自定义分段必填)
}

Jump to

Keyboard shortcuts

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