chore: replace all cn comments to en version by volc api (#313)
This commit is contained in:
@@ -34,52 +34,52 @@ type Config struct {
|
||||
// ParsingStrategy for document parse before indexing
|
||||
type ParsingStrategy struct {
|
||||
// Doc
|
||||
ExtractImage bool `json:"extract_image"` // 提取图片元素
|
||||
ExtractTable bool `json:"extract_table"` // 提取表格元素
|
||||
ImageOCR bool `json:"image_ocr"` // 图片 ocr
|
||||
FilterPages []int `json:"filter_pages"` // 页过滤, 第一页=1
|
||||
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"` // Page filter, first page = 1
|
||||
|
||||
// Sheet
|
||||
SheetID *int `json:"sheet_id"` // xlsx sheet id
|
||||
HeaderLine int `json:"header_line"` // 表头行
|
||||
DataStartLine int `json:"data_start_line"` // 数据起始行
|
||||
RowsCount int `json:"rows_count"` // 读取数据行数
|
||||
IsAppend bool `json:"-"` // 行插入
|
||||
Columns []*document.Column `json:"-"` // sheet 对齐表头
|
||||
IgnoreColumnTypeErr bool `json:"-"` // true 时忽略 column type 与 value 未对齐的问题,此时 value 为空
|
||||
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
|
||||
IsAppend bool `json:"-"` // row insertion
|
||||
Columns []*document.Column `json:"-"` // Sheet Alignment Header
|
||||
IgnoreColumnTypeErr bool `json:"-"` // Ignore the problem that the column type and value are not aligned when true, when the value is empty
|
||||
|
||||
// Image
|
||||
ImageAnnotationType ImageAnnotationType `json:"image_annotation_type"` // 图片内容标注类型
|
||||
ImageAnnotationType ImageAnnotationType `json:"image_annotation_type"` // Image content labeling type
|
||||
}
|
||||
|
||||
type ChunkingStrategy struct {
|
||||
ChunkType ChunkType `json:"chunk_type"`
|
||||
|
||||
// custom 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 ratio
|
||||
TrimSpace bool `json:"trim_space"`
|
||||
TrimURLAndEmail bool `json:"trim_url_and_email"`
|
||||
|
||||
// leveled config
|
||||
MaxDepth int64 `json:"max_depth"` // 按层级分段时的最大层级
|
||||
SaveTitle bool `json:"save_title"` // 保留层级标题
|
||||
MaxDepth int64 `json:"max_depth"` // Maximum level when segmented by level
|
||||
SaveTitle bool `json:"save_title"` // Preserve Hierarchical Titles
|
||||
}
|
||||
|
||||
type ChunkType int64
|
||||
|
||||
const (
|
||||
ChunkTypeDefault ChunkType = 0 // 自动分片
|
||||
ChunkTypeCustom ChunkType = 1 // 自定义规则分片
|
||||
ChunkTypeLeveled ChunkType = 2 // 层级分片
|
||||
ChunkTypeDefault ChunkType = 0 // Automatic sharding
|
||||
ChunkTypeCustom ChunkType = 1 // Custom rule sharding
|
||||
ChunkTypeLeveled ChunkType = 2 // Hierarchical sharding
|
||||
)
|
||||
|
||||
type ImageAnnotationType int64
|
||||
|
||||
const (
|
||||
ImageAnnotationTypeModel ImageAnnotationType = 0 // 模型自动标注
|
||||
ImageAnnotationTypeManual ImageAnnotationType = 1 // 人工标注
|
||||
ImageAnnotationTypeModel ImageAnnotationType = 0 // automatic model annotation
|
||||
ImageAnnotationTypeManual ImageAnnotationType = 1 // manual annotation
|
||||
)
|
||||
|
||||
type FileExtension string
|
||||
|
||||
@@ -33,7 +33,7 @@ type Request struct {
|
||||
}
|
||||
|
||||
type Response struct {
|
||||
SortedData []*Data // 高分在前
|
||||
SortedData []*Data // High score
|
||||
TokenUsage *int64
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ const (
|
||||
|
||||
type FieldName = string
|
||||
|
||||
// 内置 field name
|
||||
// Built-in field name
|
||||
const (
|
||||
FieldID FieldName = "id" // int64
|
||||
FieldCreatorID FieldName = "creator_id" // int64
|
||||
|
||||
@@ -25,15 +25,15 @@ import (
|
||||
|
||||
type IndexerOptions struct {
|
||||
PartitionKey *string
|
||||
Partition *string // 存储分片映射
|
||||
Partition *string // Storage sharding map
|
||||
IndexingFields []string
|
||||
ProgressBar progressbar.ProgressBar
|
||||
}
|
||||
|
||||
type RetrieverOptions struct {
|
||||
MultiMatch *MultiMatch // 多 field 查询
|
||||
MultiMatch *MultiMatch // Multi-field query
|
||||
PartitionKey *string
|
||||
Partitions []string // 查询分片映射
|
||||
Partitions []string // Query sharding map
|
||||
}
|
||||
|
||||
type MultiMatch struct {
|
||||
|
||||
@@ -36,7 +36,7 @@ type Column struct {
|
||||
Description string
|
||||
Nullable bool
|
||||
IsPrimary bool
|
||||
Sequence int // 排序编号
|
||||
Sequence int // sort number
|
||||
}
|
||||
|
||||
type TableColumnType int
|
||||
|
||||
@@ -41,9 +41,9 @@ type SecurityToken struct {
|
||||
}
|
||||
|
||||
type ResourceURL struct {
|
||||
// REQUIRED; 结果图访问精简地址,与默认地址相比缺少 Bucket 部分。
|
||||
// REQUIRED; The resulting graph accesses the thin address, missing the bucket part compared to the default address.
|
||||
CompactURL string `json:"CompactURL"`
|
||||
// REQUIRED; 结果图访问默认地址。
|
||||
// REQUIRED; Result graph access default address.
|
||||
URL string `json:"URL"`
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ type UploadResult struct {
|
||||
|
||||
type Result struct {
|
||||
Uri string `json:"Uri"`
|
||||
UriStatus int `json:"UriStatus"` // 2000表示上传成功
|
||||
UriStatus int `json:"UriStatus"` // 2000 means the upload was successful.
|
||||
}
|
||||
|
||||
type FileInfo struct {
|
||||
|
||||
@@ -47,7 +47,7 @@ const (
|
||||
)
|
||||
|
||||
// Deprecated
|
||||
type Scenario int64 // 模型实体使用场景
|
||||
type Scenario int64 // Model entity usage scenarios
|
||||
|
||||
type Modal string
|
||||
|
||||
@@ -62,10 +62,10 @@ const (
|
||||
type ModelStatus int64
|
||||
|
||||
const (
|
||||
StatusDefault ModelStatus = 0 // 未配置时的默认状态,表现等同 StatusInUse
|
||||
StatusInUse ModelStatus = 1 // 应用中,可使用可新建
|
||||
StatusPending ModelStatus = 5 // 待下线,可使用不可新建
|
||||
StatusDeleted ModelStatus = 10 // 已下线,不可使用不可新建
|
||||
StatusDefault ModelStatus = 0 // Default state when not configured, equivalent to StatusInUse
|
||||
StatusInUse ModelStatus = 1 // In the application, it can be used to create new
|
||||
StatusPending ModelStatus = 5 // To be offline, it can be used and cannot be created.
|
||||
StatusDeleted ModelStatus = 10 // It is offline, unusable, and cannot be created.
|
||||
)
|
||||
|
||||
type Widget string
|
||||
|
||||
@@ -123,10 +123,10 @@ func (p *Parameter) GetString(tp DefaultType) (string, error) {
|
||||
}
|
||||
|
||||
type ModelMeta struct {
|
||||
Protocol chatmodel.Protocol `yaml:"protocol"` // 模型通信协议
|
||||
Capability *Capability `yaml:"capability"` // 模型能力
|
||||
ConnConfig *chatmodel.Config `yaml:"conn_config"` // 模型连接配置
|
||||
Status ModelStatus `yaml:"status"` // 模型状态
|
||||
Protocol chatmodel.Protocol `yaml:"protocol"` // Model Communication Protocol
|
||||
Capability *Capability `yaml:"capability"` // model capability
|
||||
ConnConfig *chatmodel.Config `yaml:"conn_config"` // model connection configuration
|
||||
Status ModelStatus `yaml:"status"` // model state
|
||||
}
|
||||
|
||||
type DefaultValue map[DefaultType]string
|
||||
|
||||
@@ -38,7 +38,7 @@ const (
|
||||
NormalKey IndexType = "KEY"
|
||||
)
|
||||
|
||||
// AlterTableAction 定义修改表的动作类型
|
||||
// AlterTableAction defines the type of action to modify a table
|
||||
type AlterTableAction string
|
||||
|
||||
const (
|
||||
@@ -79,8 +79,8 @@ const (
|
||||
type SortDirection string
|
||||
|
||||
const (
|
||||
SortDirectionAsc SortDirection = "ASC" // 升序
|
||||
SortDirectionDesc SortDirection = "DESC" // 降序
|
||||
SortDirectionAsc SortDirection = "ASC" // ascending order
|
||||
SortDirectionDesc SortDirection = "DESC" // descending order
|
||||
)
|
||||
|
||||
type SQLType int32
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
package entity
|
||||
|
||||
type Column struct {
|
||||
Name string // 保证唯一性
|
||||
Name string // guaranteed uniqueness
|
||||
DataType DataType
|
||||
Length *int
|
||||
NotNull bool
|
||||
DefaultValue *string
|
||||
AutoIncrement bool // 表示该列是否为自动递增
|
||||
AutoIncrement bool // Indicates whether the column is automatically incremented
|
||||
Comment *string
|
||||
}
|
||||
|
||||
@@ -34,12 +34,12 @@ type Index struct {
|
||||
|
||||
type TableOption struct {
|
||||
Collate *string
|
||||
AutoIncrement *int64 // 设置表的自动递增初始值
|
||||
AutoIncrement *int64 // Set the auto-increment initial value of the table
|
||||
Comment *string
|
||||
}
|
||||
|
||||
type Table struct {
|
||||
Name string // 保证唯一性
|
||||
Name string // guaranteed uniqueness
|
||||
Columns []*Column
|
||||
Indexes []*Index
|
||||
Options *TableOption
|
||||
|
||||
@@ -38,17 +38,17 @@ type RDB interface {
|
||||
ExecuteSQL(ctx context.Context, req *ExecuteSQLRequest) (*ExecuteSQLResponse, error)
|
||||
}
|
||||
|
||||
// CreateTableRequest 创建表请求
|
||||
// CreateTableRequest Create table request
|
||||
type CreateTableRequest struct {
|
||||
Table *entity.Table
|
||||
}
|
||||
|
||||
// CreateTableResponse 创建表响应
|
||||
// CreateTableResponse Create table response
|
||||
type CreateTableResponse struct {
|
||||
Table *entity.Table
|
||||
}
|
||||
|
||||
// AlterTableOperation 修改表操作
|
||||
// AlterTableOperation Modify table operation
|
||||
type AlterTableOperation struct {
|
||||
Action entity.AlterTableAction
|
||||
Column *entity.Column
|
||||
@@ -58,64 +58,64 @@ type AlterTableOperation struct {
|
||||
NewTableName *string
|
||||
}
|
||||
|
||||
// AlterTableRequest 修改表请求
|
||||
// AlterTableRequest Modify table request
|
||||
type AlterTableRequest struct {
|
||||
TableName string
|
||||
Operations []*AlterTableOperation
|
||||
}
|
||||
|
||||
// AlterTableResponse 修改表响应
|
||||
// AlterTableResponse Modify table response
|
||||
type AlterTableResponse struct {
|
||||
Table *entity.Table
|
||||
}
|
||||
|
||||
// DropTableRequest 删除表请求
|
||||
// DropTableRequest drop table request
|
||||
type DropTableRequest struct {
|
||||
TableName string
|
||||
IfExists bool
|
||||
}
|
||||
|
||||
// DropTableResponse 删除表响应
|
||||
// DropTableResponse Delete table response
|
||||
type DropTableResponse struct {
|
||||
Success bool
|
||||
}
|
||||
|
||||
// GetTableRequest 获取表信息请求
|
||||
// GetTableRequest Get table information request
|
||||
type GetTableRequest struct {
|
||||
TableName string
|
||||
}
|
||||
|
||||
// GetTableResponse 获取表信息响应
|
||||
// GetTableResponse Get table information response
|
||||
type GetTableResponse struct {
|
||||
Table *entity.Table
|
||||
}
|
||||
|
||||
// InsertDataRequest 插入数据请求
|
||||
// InsertDataRequest insert data request
|
||||
type InsertDataRequest struct {
|
||||
TableName string
|
||||
Data []map[string]interface{}
|
||||
}
|
||||
|
||||
// InsertDataResponse 插入数据响应
|
||||
// InsertDataResponse
|
||||
type InsertDataResponse struct {
|
||||
AffectedRows int64
|
||||
}
|
||||
|
||||
// Condition 定义查询条件
|
||||
// Condition defines query conditions
|
||||
type Condition struct {
|
||||
Field string
|
||||
Operator entity.Operator
|
||||
Value interface{}
|
||||
}
|
||||
|
||||
// ComplexCondition 复杂条件
|
||||
// ComplexCondition
|
||||
type ComplexCondition struct {
|
||||
Conditions []*Condition
|
||||
NestedConditions []*ComplexCondition // 与 Conditions互斥 example: WHERE (age >= 18 AND status = 'active') OR (age >= 21 AND status = 'pending')
|
||||
NestedConditions []*ComplexCondition // Conditions mutual exclusion example: WHERE (age > = 18 AND status = 'active') OR (age > = 21 AND status = 'pending')
|
||||
Operator entity.LogicalOperator
|
||||
}
|
||||
|
||||
// UpdateDataRequest 更新数据请求
|
||||
// UpdateDataRequest
|
||||
type UpdateDataRequest struct {
|
||||
TableName string
|
||||
Data map[string]interface{}
|
||||
@@ -123,67 +123,67 @@ type UpdateDataRequest struct {
|
||||
Limit *int
|
||||
}
|
||||
|
||||
// UpdateDataResponse 更新数据响应
|
||||
// UpdateDataResponse
|
||||
type UpdateDataResponse struct {
|
||||
AffectedRows int64
|
||||
}
|
||||
|
||||
// DeleteDataRequest 删除数据请求
|
||||
// DeleteDataRequest Delete data request
|
||||
type DeleteDataRequest struct {
|
||||
TableName string
|
||||
Where *ComplexCondition
|
||||
Limit *int
|
||||
}
|
||||
|
||||
// DeleteDataResponse 删除数据响应
|
||||
// DeleteDataResponse
|
||||
type DeleteDataResponse struct {
|
||||
AffectedRows int64
|
||||
}
|
||||
|
||||
type OrderBy struct {
|
||||
Field string // 排序字段
|
||||
Direction entity.SortDirection // 排序方向
|
||||
Field string // sort field
|
||||
Direction entity.SortDirection // sort direction
|
||||
}
|
||||
|
||||
// SelectDataRequest 查询数据请求
|
||||
// SelectDataRequest query data request
|
||||
type SelectDataRequest struct {
|
||||
TableName string
|
||||
Fields []string // 要查询的字段,如果为空则查询所有字段
|
||||
Fields []string // The field to query, if empty, query all fields
|
||||
Where *ComplexCondition
|
||||
OrderBy []*OrderBy // 排序条件
|
||||
Limit *int // 限制返回行数
|
||||
Offset *int // 偏移量
|
||||
OrderBy []*OrderBy // sort condition
|
||||
Limit *int // Limit the number of rows returned
|
||||
Offset *int // Offset
|
||||
}
|
||||
|
||||
// SelectDataResponse 查询数据响应
|
||||
// SelectDataResponse
|
||||
type SelectDataResponse struct {
|
||||
ResultSet *entity.ResultSet
|
||||
Total int64 // 符合条件的总记录数(不考虑分页)
|
||||
Total int64 // Total number of eligible records (excluding paging)
|
||||
}
|
||||
|
||||
type UpsertDataRequest struct {
|
||||
TableName string
|
||||
Data []map[string]interface{} // 要更新或插入的数据
|
||||
Keys []string // 用于标识唯一记录的列名,为空的话默认使用主键
|
||||
Data []map[string]interface{} // Data to be updated or inserted
|
||||
Keys []string // The column name used to identify a unique record, if empty, the primary key is used by default
|
||||
}
|
||||
|
||||
type UpsertDataResponse struct {
|
||||
AffectedRows int64 // 受影响的行数
|
||||
InsertedRows int64 // 新插入的行数
|
||||
UpdatedRows int64 // 更新的行数
|
||||
UnchangedRows int64 // 不变的行数(没有插入或更新的行数)
|
||||
AffectedRows int64 // Number of rows affected
|
||||
InsertedRows int64 // Number of newly inserted rows
|
||||
UpdatedRows int64 // updated rows
|
||||
UnchangedRows int64 // Constant number of rows (no rows inserted or updated)
|
||||
}
|
||||
|
||||
// ExecuteSQLRequest 执行SQL请求
|
||||
// ExecuteSQLRequest Execute SQL request
|
||||
type ExecuteSQLRequest struct {
|
||||
SQL string
|
||||
Params []interface{} // 用于参数化查询
|
||||
Params []interface{} // For parameterized queries
|
||||
|
||||
// SQLType indicates the type of SQL: parameterized or raw SQL. It takes effect if OperateType is 0.
|
||||
SQLType entity.SQLType
|
||||
}
|
||||
|
||||
// ExecuteSQLResponse 执行SQL响应
|
||||
// ExecuteSQLResponse
|
||||
type ExecuteSQLResponse struct {
|
||||
ResultSet *entity.ResultSet
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user