chore: replace all cn comments to en version by volc api (#313)

This commit is contained in:
tecvan
2025-07-31 15:18:11 +08:00
committed by GitHub
parent 91d6cdb430
commit 5abc63fba6
254 changed files with 5899 additions and 5844 deletions

View File

@@ -30,10 +30,10 @@ type ListKnowledgeRequest struct {
IDs []int64
SpaceID *int64
AppID *int64
Name *string // 完全匹配
Name *string // Exact match
Status []int32
UserID *int64
Query *string // 模糊匹配
Query *string // fuzzy match
Page *int
PageSize *int
Order *Order
@@ -58,10 +58,10 @@ const (
type DocumentType int64
const (
DocumentTypeText DocumentType = 0 // 文本
DocumentTypeTable DocumentType = 1 // 表格
DocumentTypeImage DocumentType = 2 // 图片
DocumentTypeUnknown DocumentType = 9 // 未知
DocumentTypeText DocumentType = 0 // Text
DocumentTypeTable DocumentType = 1 // table
DocumentTypeImage DocumentType = 2 // image
DocumentTypeUnknown DocumentType = 9 // unknown
)
type ListKnowledgeResponse struct {
@@ -102,14 +102,14 @@ type RetrieveRequest struct {
Query string
ChatHistory []*schema.Message
// 从指定的知识库和文档中召回
// Recall from the specified knowledge base and documentation
KnowledgeIDs []int64
DocumentIDs []int64 // todo: 确认下这个场景
DocumentIDs []int64 // TODO: Confirm the scene
// 召回策略
// recall strategy
Strategy *RetrievalStrategy
// 用于 nl2sql message to query 的 chat model config
// Chat model config for nl2sql and message to query
ChatModelProtocol *chatmodel.Protocol
ChatModelConfig *chatmodel.Config
}
@@ -119,8 +119,8 @@ type RetrievalStrategy struct {
MinScore *float64 // 0.01-0.99 default 0.5
MaxTokens *int64
SelectType SelectType // 调用方式
SearchType SearchType // 搜索策略
SelectType SelectType // call method
SearchType SearchType // search strategy
EnableQueryRewrite bool
EnableRerank bool
EnableNL2SQL bool
@@ -129,16 +129,16 @@ type RetrievalStrategy struct {
type SelectType int64
const (
SelectTypeAuto = 0 // 自动调用
SelectTypeOnDemand = 1 // 按需调用
SelectTypeAuto = 0 // automatic call
SelectTypeOnDemand = 1 // call on demand
)
type SearchType int64
const (
SearchTypeSemantic SearchType = 0 // 语义
SearchTypeFullText SearchType = 1 // 全文
SearchTypeHybrid SearchType = 2 // 混合
SearchTypeSemantic SearchType = 0 // semantics
SearchTypeFullText SearchType = 1 // full text
SearchTypeHybrid SearchType = 2 // mix
)
type RetrieveResponse struct {
@@ -158,10 +158,10 @@ type Slice struct {
DocumentName string
RawContent []*SliceContent
SliceStatus SliceStatus
ByteCount int64 // 切片 bytes
CharCount int64 // 切片字符数
Sequence int64 // 切片位置序号
Hit int64 // 命中次数
ByteCount int64 // Sliced bytes
CharCount int64 // number of sliced characters
Sequence int64 // Slicing position serial number
Hit int64 // hit count
Extra map[string]string
}
@@ -215,9 +215,9 @@ type SliceContent struct {
type SliceStatus int64
const (
SliceStatusInit SliceStatus = 0 // 初始化
SliceStatusFinishStore SliceStatus = 1 // searchStore存储完成
SliceStatusFailed SliceStatus = 9 // 失败
SliceStatusInit SliceStatus = 0 // initialization
SliceStatusFinishStore SliceStatus = 1 // searchStore storage complete
SliceStatusFailed SliceStatus = 9 // fail
)
type SliceContentType int64
@@ -231,11 +231,11 @@ const (
type SliceImage struct {
Base64 []byte
URI string
OCR bool // 是否使用 ocr 提取了文本
OCR bool // Is the text extracted using OCR?
OCRText *string
}
type SliceTable struct { // table slice 为一行数据
type SliceTable struct { // Table sliced into one row
Columns []*document.ColumnData
}

View File

@@ -261,7 +261,7 @@ func (op *Openapi3Operation) ToEinoSchemaParameterInfo(ctx context.Context) (map
result[paramName] = paramInfo
}
break // 只取一种 MIME
break // Take only one MIME.
}
return result, nil
@@ -375,8 +375,8 @@ func validateOpenapi3Responses(responses openapi3.Responses) (err error) {
return nil
}
// default status 不处理
// 只处理 '200' status
// Default status not processed
// Only process' 200 'status
if len(responses) != 1 {
if len(responses) != 2 {
return errorx.New(errno.ErrPluginInvalidOpenapi3Doc, errorx.KV(errno.PluginMsgKey,

View File

@@ -341,7 +341,7 @@ type AuthV2 struct {
}
func (au *AuthV2) UnmarshalJSON(data []byte) error {
auth := &Auth{} // 兼容老数据
auth := &Auth{} // Compatible with old data
err := json.Unmarshal(data, auth)
if err != nil {
return errorx.WrapByCode(err, errno.ErrPluginInvalidManifest, errorx.KV(errno.PluginMsgKey,
@@ -381,7 +381,7 @@ func (au *AuthV2) UnmarshalJSON(data []byte) error {
}
func (au *AuthV2) unmarshalService(auth *Auth) (err error) {
if au.SubType == "" && au.Payload == "" { // 兼容老数据
if au.SubType == "" && au.Payload == "" { // Compatible with old data
au.SubType = AuthzSubTypeOfServiceAPIToken
}
@@ -421,7 +421,7 @@ func (au *AuthV2) unmarshalService(auth *Auth) (err error) {
}
func (au *AuthV2) unmarshalOAuth(auth *Auth) (err error) {
if au.SubType == "" { // 兼容老数据
if au.SubType == "" { // Compatible with old data
au.SubType = AuthzSubTypeOfOAuthAuthorizationCode
}

View File

@@ -232,7 +232,7 @@ func (t ToolInfo) ToReqAPIParameter() ([]*common.APIParameter, error) {
params = append(params, apiParam)
}
break // 只取一种 MIME
break // Take only one MIME.
}
return params, nil
@@ -257,7 +257,7 @@ func toAPIParameter(paramMeta paramMetaInfo, sc *openapi3.Schema) (*common.APIPa
Name: paramMeta.name,
Desc: paramMeta.desc,
Type: apiType,
Location: location, // 使用父节点的值
Location: location, // Using the value of the parent node
IsRequired: paramMeta.required,
SubParameters: []*common.APIParameter{},
}
@@ -453,7 +453,7 @@ func (t ToolInfo) ToPluginParameters() ([]*common.PluginParameter, error) {
}
}
break // 只取一种 MIME
break // Take only one MIME.
}
return params, nil

View File

@@ -50,7 +50,7 @@ func (r *ResourceDocument) GetOwnerID() int64 {
return 0
}
// GetUpdateTime 获取更新时间
// GetUpdateTime Get the update time
func (r *ResourceDocument) GetUpdateTime() int64 {
if r.UpdateTimeMS != nil {
return *r.UpdateTimeMS