chore: replace all cn comments to en version by volc api (#313)
This commit is contained in:
@@ -19,14 +19,14 @@ package entity
|
||||
type DocumentStatus int64
|
||||
|
||||
const (
|
||||
DocumentStatusInit DocumentStatus = -1 // 初始化
|
||||
DocumentStatusUploading DocumentStatus = 0 // 上传中
|
||||
DocumentStatusEnable DocumentStatus = 1 // 生效
|
||||
DocumentStatusDisable DocumentStatus = 2 // 失效
|
||||
DocumentStatusDeleted DocumentStatus = 3 // 已删除
|
||||
DocumentStatusChunking DocumentStatus = 4 // 切片中
|
||||
// DocumentStatusRefreshing DocumentStatus = 5 // 刷新中
|
||||
DocumentStatusFailed DocumentStatus = 9 // 失败
|
||||
DocumentStatusInit DocumentStatus = -1 // initialization
|
||||
DocumentStatusUploading DocumentStatus = 0 // Uploading
|
||||
DocumentStatusEnable DocumentStatus = 1 // take effect
|
||||
DocumentStatusDisable DocumentStatus = 2 // failure
|
||||
DocumentStatusDeleted DocumentStatus = 3 // deleted
|
||||
DocumentStatusChunking DocumentStatus = 4 // Slicing
|
||||
// DocumentStatusRefreshing DocumentStatus = 5//Refreshing
|
||||
DocumentStatusFailed DocumentStatus = 9 // fail
|
||||
)
|
||||
|
||||
func (s DocumentStatus) String() string {
|
||||
@@ -44,7 +44,7 @@ func (s DocumentStatus) String() string {
|
||||
case DocumentStatusChunking:
|
||||
return "切片中"
|
||||
// case DocumentStatusRefreshing:
|
||||
// return "刷新中"
|
||||
// Returns "Refreshing"
|
||||
case DocumentStatusFailed:
|
||||
return "失败"
|
||||
default:
|
||||
@@ -55,6 +55,6 @@ func (s DocumentStatus) String() string {
|
||||
type DocumentSource int64
|
||||
|
||||
const (
|
||||
DocumentSourceLocal DocumentSource = 0 // 本地文件上传
|
||||
DocumentSourceCustom DocumentSource = 2 // 自定义文本
|
||||
DocumentSourceLocal DocumentSource = 0 // local file upload
|
||||
DocumentSourceCustom DocumentSource = 2 // custom text
|
||||
)
|
||||
|
||||
@@ -27,25 +27,25 @@ type Document struct {
|
||||
|
||||
KnowledgeID int64
|
||||
Type knowledge.DocumentType
|
||||
RawContent string // 用户自定义的原始内容
|
||||
URI string // 文档 uri
|
||||
URL string // 文档 url
|
||||
Size int64 // 文档 bytes
|
||||
SliceCount int64 // slice 数量
|
||||
CharCount int64 // 文档字符数
|
||||
FileExtension parser.FileExtension // 文档后缀, csv/pdf...
|
||||
Status DocumentStatus // 文档状态
|
||||
StatusMsg string // 文档状态详细信息
|
||||
Hits int64 // 命中次数
|
||||
Source DocumentSource // 文档来源
|
||||
ParsingStrategy *ParsingStrategy // 解析策略
|
||||
ChunkingStrategy *ChunkingStrategy // 分段策略
|
||||
RawContent string // User-defined original content
|
||||
URI string // Document URI
|
||||
URL string // Document URL
|
||||
Size int64 // Document bytes
|
||||
SliceCount int64 // Number of slices
|
||||
CharCount int64 // Number of document characters
|
||||
FileExtension parser.FileExtension // Document suffix, csv/pdf...
|
||||
Status DocumentStatus // Document Status
|
||||
StatusMsg string // Document Status Details
|
||||
Hits int64 // hit count
|
||||
Source DocumentSource // document source
|
||||
ParsingStrategy *ParsingStrategy // parsing strategy
|
||||
ChunkingStrategy *ChunkingStrategy // segmentation strategy
|
||||
|
||||
TableInfo TableInfo
|
||||
IsAppend bool // 是否在表格中追加
|
||||
IsAppend bool // Whether to append to the table
|
||||
|
||||
// LevelURI string // 层级分段预览 uri
|
||||
// PreviewURI string // 预览 uri
|
||||
// LevelURI string//Hierarchical segmentation preview uri
|
||||
// PreviewURI string//preview uri
|
||||
}
|
||||
|
||||
type TableInfo struct {
|
||||
@@ -56,18 +56,18 @@ type TableInfo struct {
|
||||
}
|
||||
type TableSheet struct {
|
||||
SheetId int64 // sheet id
|
||||
HeaderLineIdx int64 // 表头行
|
||||
StartLineIdx int64 // 数据起始行
|
||||
SheetName string // sheet的名称
|
||||
TotalRows int64 // 总行数
|
||||
HeaderLineIdx int64 // header row
|
||||
StartLineIdx int64 // Data start row
|
||||
SheetName string // Name of sheet
|
||||
TotalRows int64 // total number of rows
|
||||
}
|
||||
type TableColumn struct {
|
||||
ID int64
|
||||
Name string
|
||||
Type document.TableColumnType
|
||||
Description string
|
||||
Indexing bool // 是否索引
|
||||
Sequence int64 // 表格中的原始序号
|
||||
Indexing bool // whether to index
|
||||
Sequence int64 // The original serial number in the table
|
||||
}
|
||||
|
||||
type WhereDocumentOpt struct {
|
||||
|
||||
@@ -29,20 +29,20 @@ type Event struct {
|
||||
|
||||
type EventType string
|
||||
|
||||
// 文档 event
|
||||
// 切分 + 写入向量库操作事务性由实现自行保证
|
||||
// Document event
|
||||
// Split + write vector library operation transactionality is guaranteed by the implementation itself
|
||||
const (
|
||||
EventTypeIndexDocuments EventType = "index_documents"
|
||||
|
||||
// EventTypeIndexDocument 文档信息已写入 orm,逻辑中需要解析+切分+搜索数据入库
|
||||
// EventTypeIndexDocument document information has been written to orm, the logic needs to parse + split + search data warehousing
|
||||
// Event requires: Event.Document
|
||||
EventTypeIndexDocument EventType = "index_document"
|
||||
|
||||
// EventTypeIndexSlice 切片信息已写入 orm,逻辑中仅写入搜索数据
|
||||
// EventTypeIndexSlice slice information has been written to orm, and only search data is written in the logic
|
||||
// Event requires: Event.Slice
|
||||
EventTypeIndexSlice EventType = "index_slice"
|
||||
|
||||
// EventTypeDeleteKnowledgeData 删除 knowledge
|
||||
// EventTypeDeleteKnowledgeData remove knowledge
|
||||
// Event requires: Event.KnowledgeID, Event.SliceIDs
|
||||
EventTypeDeleteKnowledgeData EventType = "delete_knowledge_data"
|
||||
|
||||
|
||||
@@ -26,10 +26,10 @@ type WhereKnowledgeOption struct {
|
||||
KnowledgeIDs []int64
|
||||
AppID *int64
|
||||
SpaceID *int64
|
||||
Name *string // 完全匹配
|
||||
Name *string // Exact match
|
||||
Status []int32
|
||||
UserID *int64
|
||||
Query *string // 模糊匹配
|
||||
Query *string // fuzzy match
|
||||
Page *int
|
||||
PageSize *int
|
||||
Order *Order
|
||||
|
||||
@@ -25,18 +25,18 @@ type RetrievalStrategy = knowledge.RetrievalStrategy
|
||||
|
||||
// ParsingStrategy for document parse before indexing
|
||||
type ParsingStrategy struct {
|
||||
ParsingType ParsingType `json:"parsing_type"` // 解析类型
|
||||
ParsingType ParsingType `json:"parsing_type"` // parse type
|
||||
// Doc
|
||||
ExtractImage bool `json:"extract_image"` // 提取图片元素
|
||||
ExtractTable bool `json:"extract_table"` // 提取表格元素
|
||||
ImageOCR bool `json:"image_ocr"` // 图片 ocr
|
||||
FilterPages []int `json:"filter_pages"` // 过滤页数
|
||||
ExtractImage bool `json:"extract_image"` // Extract image elements
|
||||
ExtractTable bool `json:"extract_table"` // Extract table elements
|
||||
ImageOCR bool `json:"image_ocr"` // Image ocr
|
||||
FilterPages []int `json:"filter_pages"` // filter pages
|
||||
|
||||
// Sheet
|
||||
SheetID int64 `json:"sheet_id"` // xlsx sheet id
|
||||
HeaderLine int `json:"header_line"` // 表头行
|
||||
DataStartLine int `json:"data_start_line"` // 数据起始行
|
||||
RowsCount int `json:"rows_count"` // 读取数据行数
|
||||
HeaderLine int `json:"header_line"` // header row
|
||||
DataStartLine int `json:"data_start_line"` // Data start row
|
||||
RowsCount int `json:"rows_count"` // number of rows read
|
||||
|
||||
// Image
|
||||
CaptionType *parser.ImageAnnotationType `json:"caption_type"`
|
||||
@@ -52,13 +52,13 @@ const (
|
||||
type ChunkingStrategy struct {
|
||||
ChunkType parser.ChunkType `json:"chunk_type"`
|
||||
// custom chunk config
|
||||
ChunkSize int64 `json:"chunk_size"` // 分段最大长度
|
||||
Separator string `json:"separator"` // 分段标识符
|
||||
Overlap int64 `json:"overlap"` // 分段重叠
|
||||
ChunkSize int64 `json:"chunk_size"` // maximum segmentation length
|
||||
Separator string `json:"separator"` // segmentation identifier
|
||||
Overlap int64 `json:"overlap"` // segmented overlap
|
||||
TrimSpace bool `json:"trim_space"`
|
||||
TrimURLAndEmail bool `json:"trim_url_and_email"`
|
||||
|
||||
// 按层级分段
|
||||
MaxDepth int64 `json:"max_depth"` // 按层级分段时的最大层级
|
||||
SaveTitle bool `json:"save_title"` // 保留层级标题
|
||||
// segmentation by hierarchy
|
||||
MaxDepth int64 `json:"max_depth"` // Maximum level when segmented by level
|
||||
SaveTitle bool `json:"save_title"` // Preserve Hierarchical Titles
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user