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

@@ -9,17 +9,17 @@ import (
"github.com/apache/thrift/lib/go/thrift"
)
// 类型
// type
type FormatType int64
const (
// 文本
// Text
FormatType_Text FormatType = 0
// 表格
// table
FormatType_Table FormatType = 1
// 图片
// image
FormatType_Image FormatType = 2
// 数据库
// database
FormatType_Database FormatType = 3
)
@@ -158,9 +158,9 @@ func (p *ContentSchema) Value() (driver.Value, error) {
type CaptionType int64
const (
// 智能标注
// intelligent annotation
CaptionType_Auto CaptionType = 0
// 人工标注
// manual annotation
CaptionType_Manual CaptionType = 1
)
@@ -202,19 +202,19 @@ func (p *CaptionType) Value() (driver.Value, error) {
type DocumentStatus int64
const (
// 上传中
// Uploading
DocumentStatus_Processing DocumentStatus = 0
// 生效
// take effect
DocumentStatus_Enable DocumentStatus = 1
// 失效
// failure
DocumentStatus_Disable DocumentStatus = 2
// 删除
// delete
DocumentStatus_Deleted DocumentStatus = 3
// 重新分片中,调用方不感知该状态
// In rescaling, the caller is not aware of the state
DocumentStatus_Resegment DocumentStatus = 4
// 刷新中(刷新成功后会删除)
// Refreshing (will be deleted after successful refresh)
DocumentStatus_Refreshing DocumentStatus = 5
// 失败
// fail
DocumentStatus_Failed DocumentStatus = 9
)
@@ -276,9 +276,9 @@ func (p *DocumentStatus) Value() (driver.Value, error) {
type DocumentSource int64
const (
// 本地文件上传
// local file upload
DocumentSource_Document DocumentSource = 0
// 自定义类型
// custom type
DocumentSource_Custom DocumentSource = 2
)
@@ -320,9 +320,9 @@ func (p *DocumentSource) Value() (driver.Value, error) {
type ParsingType int64
const (
//快速解析
//fast parse
ParsingType_FastParsing ParsingType = 0
//精准解析
//accurate analysis
ParsingType_AccurateParsing ParsingType = 1
)
@@ -361,7 +361,7 @@ func (p *ParsingType) Value() (driver.Value, error) {
return int64(*p), nil
}
// 排序字段
// sort field
type OrderField int64
const (
@@ -404,7 +404,7 @@ func (p *OrderField) Value() (driver.Value, error) {
return int64(*p), nil
}
// 排序规则
// OrderType
type OrderType int64
const (
@@ -450,13 +450,13 @@ func (p *OrderType) Value() (driver.Value, error) {
type ReviewStatus int64
const (
// 处理中
// Processing
ReviewStatus_Processing ReviewStatus = 0
// 已完成
// Completed.
ReviewStatus_Enable ReviewStatus = 1
// 失败
// fail
ReviewStatus_Failed ReviewStatus = 2
// 失败
// fail
ReviewStatus_ForceStop ReviewStatus = 3
)
@@ -504,23 +504,23 @@ func (p *ReviewStatus) Value() (driver.Value, error) {
}
type ChunkStrategy struct {
// 分隔符,如句号
// A separator, such as a period
Separator string `thrift:"separator,1" form:"separator" json:"separator" query:"separator"`
// 分片的最大token数
// Maximum number of tokens for sharding
MaxTokens int64 `thrift:"max_tokens,2" form:"max_tokens" json:"max_tokens" query:"max_tokens"`
// 替换掉连续的空格、换行符和制表符
// Replace consecutive spaces, newlines, and tabs
RemoveExtraSpaces bool `thrift:"remove_extra_spaces,3" form:"remove_extra_spaces" json:"remove_extra_spaces" query:"remove_extra_spaces"`
// 是否去除url和email
// Remove URL and email
RemoveUrlsEmails bool `thrift:"remove_urls_emails,4" form:"remove_urls_emails" json:"remove_urls_emails" query:"remove_urls_emails"`
// 如果为0, 则不使用以上字段的配置
// If 0, the configuration of the above fields is not used
ChunkType ChunkType `thrift:"chunk_type,5" form:"chunk_type" json:"chunk_type" query:"chunk_type"`
// 图片类型,图片描述文字的标注方式
// Image type, image description text annotation method
CaptionType *CaptionType `thrift:"caption_type,7,optional" form:"caption_type" json:"caption_type,omitempty" query:"caption_type"`
//分段重叠度
//segmented overlap
Overlap *int64 `thrift:"overlap,8,optional" form:"overlap" json:"overlap,omitempty" query:"overlap"`
//最大层级数(按层级分段时生效)
//Maximum number of levels (effective when segmented by level)
MaxLevel *int64 `thrift:"max_level,9,optional" form:"max_level" json:"max_level,omitempty" query:"max_level"`
//切片保留层级标题(按层级分段时生效)
//Slice preserves level headers (effective when segmented by level)
SaveTitle *bool `thrift:"save_title,10,optional" form:"save_title" json:"save_title,omitempty" query:"save_title"`
}
@@ -1057,13 +1057,13 @@ func (p *ChunkStrategy) String() string {
}
type ParsingStrategy struct {
//解析类型
//parse type
ParsingType *ParsingType `thrift:"parsing_type,1,optional" form:"parsing_type" json:"parsing_type,omitempty" query:"parsing_type"`
//是否开启图片元素提取(精准解析时生效)
//Whether to enable image element extraction (effective when accurately parsing)
ImageExtraction *bool `thrift:"image_extraction,2,optional" form:"image_extraction" json:"image_extraction,omitempty" query:"image_extraction"`
//是否开启表格元素提取(精准解析时生效)
//Whether to enable table element extraction (effective when accurately parsing)
TableExtraction *bool `thrift:"table_extraction,3,optional" form:"table_extraction" json:"table_extraction,omitempty" query:"table_extraction"`
//是否开启图片OCR精准解析时生效
//Whether to turn on picture OCR (effective when accurate analysis)
ImageOcr *bool `thrift:"image_ocr,4,optional" form:"image_ocr" json:"image_ocr,omitempty" query:"image_ocr"`
}
@@ -1380,13 +1380,13 @@ func (p *ParsingStrategy) String() string {
}
type IndexStrategy struct {
//是否开启向量索引(默认为true
//Whether to enable vector indexing (default is true)
VectorIndexing *bool `thrift:"vector_indexing,1,optional" form:"vector_indexing" json:"vector_indexing,omitempty" query:"vector_indexing"`
//是否开启关键词索引(默认为true
//Whether to enable keyword indexing (default is true)
KeywordIndexing *bool `thrift:"keyword_indexing,2,optional" form:"keyword_indexing" json:"keyword_indexing,omitempty" query:"keyword_indexing"`
//是否开启分层索引
//Whether to enable hierarchical indexing
HierarchicalIndexing *bool `thrift:"hierarchical_indexing,3,optional" form:"hierarchical_indexing" json:"hierarchical_indexing,omitempty" query:"hierarchical_indexing"`
//向量模型
//vector model
Model *string `thrift:"model,4,optional" form:"model" json:"model,omitempty" query:"model"`
}
@@ -1702,7 +1702,7 @@ func (p *IndexStrategy) String() string {
}
type FilterStrategy struct {
//过滤页数
//filter pages
FilterPage []int32 `thrift:"filter_page,1,optional" form:"filter_page" json:"filter_page,omitempty" query:"filter_page"`
}
@@ -1873,7 +1873,7 @@ func (p *FilterStrategy) String() string {
}
type SinkStrategy struct {
// 是否检查索引成功
// Check whether the index was successful
CheckIndex bool `thrift:"check_index,1" form:"check_index" json:"check_index" query:"check_index"`
}

View File

@@ -3,11 +3,11 @@
package dataset
import (
"github.com/coze-dev/coze-studio/backend/api/model/base"
"database/sql"
"database/sql/driver"
"fmt"
"github.com/apache/thrift/lib/go/thrift"
"github.com/coze-dev/coze-studio/backend/api/model/base"
)
type DatasetStatus int64
@@ -15,9 +15,9 @@ type DatasetStatus int64
const (
DatasetStatus_DatasetProcessing DatasetStatus = 0
DatasetStatus_DatasetReady DatasetStatus = 1
// 软删
// soft delete
DatasetStatus_DatasetDeleted DatasetStatus = 2
// 不启用
// Do not enable
DatasetStatus_DatasetForbid DatasetStatus = 3
DatasetStatus_DatasetFailed DatasetStatus = 9
)
@@ -154,18 +154,18 @@ func (p *DatasetSource) Value() (driver.Value, error) {
}
type CreateDatasetRequest struct {
// 知识库名称长度不超过100个字符
// Knowledge base name, no more than 100 characters in length
Name string `thrift:"name,1" form:"name" json:"name" query:"name"`
// 知识库描述
// Knowledge Base Description
Description string `thrift:"description,2" form:"description" json:"description" query:"description"`
// 空间ID
// Space ID
SpaceID int64 `thrift:"space_id,3" form:"space_id" json:"space_id,string" query:"space_id"`
// 知识库头像URI
// Knowledge Base Avatar URI
IconURI string `thrift:"icon_uri,4" form:"icon_uri" json:"icon_uri" query:"icon_uri"`
FormatType FormatType `thrift:"format_type,5" form:"format_type" json:"format_type" query:"format_type"`
// 开放给第三方的业务标识, coze 传 0 或者不传
// Open to third-party business identity, coze pass 0 or no pass
BizID int64 `thrift:"biz_id,6" form:"biz_id" json:"biz_id,string" query:"biz_id"`
//新增project ID
//project ID
ProjectID int64 `thrift:"project_id,7" form:"project_id" json:"project_id,string" query:"project_id"`
Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"`
}
@@ -920,7 +920,7 @@ func (p *CreateDatasetResponse) String() string {
type DatasetDetailRequest struct {
DatasetIDs []string `thrift:"DatasetIDs,1" form:"dataset_ids" json:"dataset_ids"`
//新增project ID
// project ID
ProjectID int64 `thrift:"project_id,3" form:"project_id" json:"project_id,string" query:"project_id"`
SpaceID int64 `thrift:"space_id,2" form:"space_id" json:"space_id,string" query:"space_id"`
Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"`
@@ -1549,44 +1549,44 @@ func (p *DatasetDetailResponse) String() string {
type Dataset struct {
DatasetID int64 `thrift:"dataset_id,1" form:"dataset_id" json:"dataset_id,string" query:"dataset_id"`
// 数据集名称
// Dataset name
Name string `thrift:"name,2" form:"name" json:"name" query:"name"`
// 文件列表
// file list
FileList []string `thrift:"file_list,3" form:"file_list" json:"file_list" query:"file_list"`
// 所有文件大小
// All file sizes
AllFileSize int64 `thrift:"all_file_size,4" form:"all_file_size" json:"all_file_size,string" query:"all_file_size"`
// 使用Bot
// Bot count
BotUsedCount int32 `thrift:"bot_used_count,5" form:"bot_used_count" json:"bot_used_count" query:"bot_used_count"`
Status DatasetStatus `thrift:"status,6" form:"status" json:"status" query:"status"`
// 处理中的文件名称列表,兼容老逻辑
// List of file names in process, compatible with old logic
ProcessingFileList []string `thrift:"processing_file_list,7" form:"processing_file_list" json:"processing_file_list" query:"processing_file_list"`
// 更新时间,秒级时间戳
// Update time, second timestamp
UpdateTime int32 `thrift:"update_time,8" form:"update_time" json:"update_time" query:"update_time"`
IconURL string `thrift:"icon_url,9" form:"icon_url" json:"icon_url" query:"icon_url"`
Description string `thrift:"description,10" form:"description" json:"description" query:"description"`
IconURI string `thrift:"icon_uri,11" form:"icon_uri" json:"icon_uri" query:"icon_uri"`
// 是否可以编辑
// Can it be edited?
CanEdit bool `thrift:"can_edit,12" form:"can_edit" json:"can_edit" query:"can_edit"`
// 创建时间,秒级时间戳
// create_time, second timestamp
CreateTime int32 `thrift:"create_time,13" form:"create_time" json:"create_time" query:"create_time"`
// 创建者ID
// creator ID
CreatorID int64 `thrift:"creator_id,14" form:"creator_id" json:"creator_id,string" query:"creator_id"`
// 空间ID
// Space ID
SpaceID int64 `thrift:"space_id,15" form:"space_id" json:"space_id,string" query:"space_id"`
// 处理失败的文件
// Processing failed files
FailedFileList []string `thrift:"failed_file_list,18" form:"failed_file_list" json:"failed_file_list" query:"failed_file_list"`
FormatType FormatType `thrift:"format_type,19" form:"format_type" json:"format_type" query:"format_type"`
// 分段数量
// number of segments
SliceCount int32 `thrift:"slice_count,20" form:"slice_count" json:"slice_count" query:"slice_count"`
// 命中次数
// hit count
HitCount int32 `thrift:"hit_count,21" form:"hit_count" json:"hit_count" query:"hit_count"`
// 文档数量
// number of documents
DocCount int32 `thrift:"doc_count,22" form:"doc_count" json:"doc_count" query:"doc_count"`
// 切片规则
// slicing rule
ChunkStrategy *ChunkStrategy `thrift:"chunk_strategy,23" form:"chunk_strategy" json:"chunk_strategy" query:"chunk_strategy"`
// 处理中的文件ID列表
// List of file IDs in process
ProcessingFileIDList []string `thrift:"processing_file_id_list,24" form:"processing_file_id_list" json:"processing_file_id_list" query:"processing_file_id_list"`
//新增project ID
//project ID
ProjectID string `thrift:"project_id,25" form:"project_id" json:"project_id" query:"project_id"`
}
@@ -2784,17 +2784,17 @@ type ListDatasetRequest struct {
Page *int32 `thrift:"page,3,optional" form:"page" json:"page,omitempty" query:"page"`
Size *int32 `thrift:"size,4,optional" form:"size" json:"size,omitempty" query:"size"`
SpaceID int64 `thrift:"space_id,5" form:"space_id" json:"space_id,string" query:"space_id"`
// 排序字段
// sort field
OrderField *OrderField `thrift:"order_field,6,optional" form:"order_field" json:"order_field,omitempty" query:"order_field"`
// 排序规则
// order_type
OrderType *OrderType `thrift:"order_type,7,optional" form:"order_type" json:"order_type,omitempty" query:"order_type"`
// 如果传了指定值, 就放开校验
// If the specified value is passed, the verification is released
SpaceAuth *string `thrift:"space_auth,8,optional" form:"space_auth" json:"space_auth,omitempty" query:"space_auth"`
// 开放给第三方的业务标识
// Business identity open to third parties
BizID *int64 `thrift:"biz_id,9,optional" form:"biz_id" json:"biz_id,string,omitempty" query:"biz_id"`
// 是否需要拉取引用bots的数量会增加响应延时
// Whether the number of reference bots needs to be pulled will increase the response delay
NeedRefBots *bool `thrift:"need_ref_bots,10,optional" form:"need_ref_bots" json:"need_ref_bots,omitempty" query:"need_ref_bots"`
//新增project ID
//project ID
ProjectID *string `thrift:"project_id,11,optional" form:"project_id" json:"project_id,omitempty" query:"project_id"`
Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"`
}
@@ -3848,15 +3848,15 @@ func (p *ListDatasetResponse) String() string {
}
type DatasetFilter struct {
// 如果都设置了And 关系
// The following conditions are related to and
Name *string `thrift:"name,1,optional" form:"name" json:"name,omitempty" query:"name"`
// 知识库id列表
// Knowledge id list
DatasetIds []string `thrift:"dataset_ids,2,optional" form:"dataset_ids" json:"dataset_ids,omitempty" query:"dataset_ids"`
// 来源
// source
SourceType *DatasetSource `thrift:"source_type,3,optional" form:"source_type" json:"source_type,omitempty" query:"source_type"`
// 搜索类型
// search type
ScopeType *DatasetScopeType `thrift:"scope_type,4,optional" form:"scope_type" json:"scope_type,omitempty" query:"scope_type"`
// 类型
// type
FormatType *FormatType `thrift:"format_type,5,optional" form:"format_type" json:"format_type,omitempty" query:"format_type"`
}
@@ -4694,13 +4694,13 @@ func (p *DeleteDatasetResponse) String() string {
}
type UpdateDatasetRequest struct {
// 知识库id
// Knowledge ID
DatasetID int64 `thrift:"dataset_id,1" form:"dataset_id" json:"dataset_id,string" query:"dataset_id"`
// 知识库名称,不能为空
// Knowledge base name, cannot be empty
Name string `thrift:"name,2" form:"name" json:"name" query:"name"`
// 知识库icon
// Knowledge base icon
IconURI string `thrift:"icon_uri,3" form:"icon_uri" json:"icon_uri" query:"icon_uri"`
// 知识库描述
// Knowledge Base Description
Description string `thrift:"description,4" form:"description" json:"description" query:"description"`
Status *DatasetStatus `thrift:"status,5,optional" form:"status" json:"status,omitempty" query:"status"`
Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"`

View File

@@ -3,28 +3,28 @@
package dataset
import (
"github.com/coze-dev/coze-studio/backend/api/model/base"
"database/sql"
"database/sql/driver"
"fmt"
"github.com/apache/thrift/lib/go/thrift"
"github.com/coze-dev/coze-studio/backend/api/model/base"
)
type ColumnType int64
const (
ColumnType_Unknown ColumnType = 0
// 文本
// Text
ColumnType_Text ColumnType = 1
// 数字
// number
ColumnType_Number ColumnType = 2
// 时间
// time
ColumnType_Date ColumnType = 3
// float
ColumnType_Float ColumnType = 4
// bool
ColumnType_Boolean ColumnType = 5
// 图片
// picture
ColumnType_Image ColumnType = 6
)
@@ -86,11 +86,11 @@ func (p *ColumnType) Value() (driver.Value, error) {
type TableDataType int64
const (
// schema sheets preview data
// Schema sheets and preview data
TableDataType_AllData TableDataType = 0
// 只需要 schema 结构 & Sheets
// Only need schema structure & Sheets
TableDataType_OnlySchema TableDataType = 1
// 只需要 preview data
// Just preview the data
TableDataType_OnlyPreview TableDataType = 2
)
@@ -138,7 +138,7 @@ type ListDocumentRequest struct {
DocumentIds []string `thrift:"document_ids,2,optional" form:"document_ids" json:"document_ids,omitempty" query:"document_ids"`
Page *int32 `thrift:"page,3,optional" form:"page" json:"page,omitempty" query:"page"`
Size *int32 `thrift:"size,4,optional" form:"size" json:"size,omitempty" query:"size"`
// 根据名称搜索
// Search by name
Keyword *string `thrift:"keyword,5,optional" form:"keyword" json:"keyword,omitempty" query:"keyword"`
Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"`
}
@@ -948,55 +948,55 @@ func (p *ListDocumentResponse) String() string {
type DocumentInfo struct {
Name string `thrift:"name,1" form:"name" json:"name" query:"name"`
DocumentID int64 `thrift:"document_id,2" form:"document_id" json:"document_id,string" query:"document_id"`
// 文件链接
// file link
TosURI *string `thrift:"tos_uri,3,optional" form:"tos_uri" json:"tos_uri,omitempty" query:"tos_uri"`
// 创建时间
// create_time
CreateTime int32 `thrift:"create_time,5" form:"create_time" json:"create_time" query:"create_time"`
// 更新时间
// update time
UpdateTime int32 `thrift:"update_time,6" form:"update_time" json:"update_time" query:"update_time"`
// 创建人
// creator_id
CreatorID *int64 `thrift:"creator_id,7,optional" form:"creator_id" json:"creator_id,string,omitempty"`
// 包含分段数量
// number of segments included
SliceCount int32 `thrift:"slice_count,8" form:"slice_count" json:"slice_count" query:"slice_count"`
// 文件后缀 csv, pdf
// File suffix csv, pdf, etc
Type string `thrift:"type,9" form:"type" json:"type" query:"type"`
// 文件大小 字节数
// File size, number of bytes
Size int32 `thrift:"size,10" form:"size" json:"size" query:"size"`
// 字符数
// character count
CharCount int32 `thrift:"char_count,11" form:"char_count" json:"char_count" query:"char_count"`
// 状态
// status
Status DocumentStatus `thrift:"status,12" form:"status" json:"status" query:"status"`
// 命中次数
// hit count
HitCount int32 `thrift:"hit_count,13" form:"hit_count" json:"hit_count" query:"hit_count"`
// 来源
// source
SourceType DocumentSource `thrift:"source_type,14" form:"source_type" json:"source_type" query:"source_type"`
// 文件类型
// file type
FormatType FormatType `thrift:"format_type,18" form:"format_type" json:"format_type" query:"format_type"`
// 表格类型元数据
// Table type metadata
TableMeta []*TableColumn `thrift:"table_meta,19,optional" form:"table_meta" json:"table_meta,omitempty" query:"table_meta"`
// url 地址
// URL address
WebURL *string `thrift:"web_url,20,optional" form:"web_url" json:"web_url,omitempty" query:"web_url"`
// 状态的详细信息;如果切片失败,返回失败信息
// Details of the status; if the slice fails, return the failure information
StatusDescript *string `thrift:"status_descript,21,optional" form:"status_descript" json:"status_descript,omitempty" query:"status_descript"`
// 空间id
// Space ID
SpaceID *int64 `thrift:"space_id,24,optional" form:"space_id" json:"space_id,string,omitempty" query:"space_id"`
// 以下字段仅针对重构后的表格类型有用,用于前端判断
// The following fields are only useful for the reconstructed table type and are used for front-end judgment
EditableAppendContent *bool `thrift:"editable_append_content,26,optional" form:"editable_append_content" json:"editable_append_content,omitempty" query:"editable_append_content"`
// 切片规则
// slicing rule
ChunkStrategy *ChunkStrategy `thrift:"chunk_strategy,27" form:"chunk_strategy" json:"chunk_strategy" query:"chunk_strategy"`
// imagex 存储的文件链接
// File links stored by ImageX
ImagexURI *string `thrift:"imagex_uri,28,optional" form:"imagex_uri" json:"imagex_uri,omitempty" query:"imagex_uri"`
// 层级分段文档树Json (未使用)
// Hierarchical Segmentation Document Tree Json (unused)
DocOutline *string `thrift:"doc_outline,29,optional" form:"doc_outline" json:"doc_outline,omitempty" query:"doc_outline"`
// 解析策略
// parsing strategy
ParsingStrategy *ParsingStrategy `thrift:"parsing_strategy,30,optional" form:"parsing_strategy" json:"parsing_strategy,omitempty" query:"parsing_strategy"`
// 过滤策略
// filtering strategy
FilterStrategy *FilterStrategy `thrift:"filter_strategy,32,optional" form:"filter_strategy" json:"filter_strategy,omitempty" query:"filter_strategy"`
// 层级分段文档树 tos_url
// Hierarchical segmented document tree tos_url
DocTreeTosURL *string `thrift:"doc_tree_tos_url,33,optional" form:"doc_tree_tos_url" json:"doc_tree_tos_url,omitempty" query:"doc_tree_tos_url"`
// 预览用的原文档 tos_url
// Preview the original document tos_url
PreviewTosURL *string `thrift:"preview_tos_url,34,optional" form:"preview_tos_url" json:"preview_tos_url,omitempty" query:"preview_tos_url"`
// 预览用的原文档 tos_url
// Preview the original document tos_url
ReviewID *int64 `thrift:"review_id,35,optional" form:"review_id" json:"review_id,omitempty" query:"review_id"`
}
@@ -2454,18 +2454,18 @@ func (p *DocumentInfo) String() string {
}
type TableColumn struct {
// 列 id
// Column ID
ID int64 `thrift:"id,1" form:"id" json:"id,string"`
// 列名
// column_name
ColumnName string `thrift:"column_name,2" form:"column_name" json:"column_name" query:"column_name"`
// 是否为语义匹配列
// Is it a semantically matched column?
IsSemantic bool `thrift:"is_semantic,3" form:"is_semantic" json:"is_semantic" query:"is_semantic"`
// 列原本在 excel 的序号
// List the serial number originally in excel
Sequence int64 `thrift:"sequence,4" form:"sequence" json:"sequence,string"`
// 列类型
// column type
ColumnType *ColumnType `thrift:"column_type,5,optional" form:"column_type" json:"column_type,omitempty" query:"column_type"`
ContainsEmptyValue *bool `thrift:"contains_empty_value,6,optional" form:"contains_empty_value" json:"contains_empty_value,omitempty" query:"contains_empty_value"`
// 描述
// describe
Desc *string `thrift:"desc,7,optional" form:"desc" json:"desc,omitempty" query:"desc"`
}
@@ -2903,7 +2903,7 @@ func (p *TableColumn) String() string {
}
type DeleteDocumentRequest struct {
// 要删除的文档ID列表
// List of document IDs to delete
DocumentIds []string `thrift:"document_ids,2" form:"document_ids" json:"document_ids" query:"document_ids"`
Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"`
}
@@ -3374,9 +3374,9 @@ func (p *DeleteDocumentResponse) String() string {
type UpdateDocumentRequest struct {
DocumentID int64 `thrift:"document_id,1" form:"document_id" json:"document_id,string" query:"document_id"`
// 需要更新就传, 更新名称
// If you need to update, please upload it and update the name.
DocumentName *string `thrift:"document_name,3,optional" form:"document_name" json:"document_name,omitempty" query:"document_name"`
// 更新表结构
// Update table structure
TableMeta []*TableColumn `thrift:"table_meta,5,optional" form:"table_meta" json:"table_meta,omitempty" query:"table_meta"`
Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"`
}
@@ -3951,9 +3951,9 @@ func (p *UpdateDocumentResponse) String() string {
}
type UpdatePhotoCaptionRequest struct {
// 文档ID
// Document ID
DocumentID int64 `thrift:"document_id,1,required" form:"document_id,required" json:"document_id,string,required" query:"document_id,required"`
// 要更新的图片描述信息
// Picture description information to be updated
Caption string `thrift:"caption,2,required" form:"caption,required" json:"caption,required" query:"caption,required"`
Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"`
}
@@ -4462,11 +4462,11 @@ func (p *UpdatePhotoCaptionResponse) String() string {
}
type ListPhotoRequest struct {
// 知识库ID
// Knowledge ID
DatasetID int64 `thrift:"dataset_id,1,required" form:"dataset_id,required" json:"dataset_id,string,required" query:"dataset_id,required"`
// 页数,从 1 开始
// Number of pages, starting from 1
Page *int32 `thrift:"page,2,optional" form:"page" json:"page,omitempty" query:"page"`
// 每页大小
// page size
Size *int32 `thrift:"size,3,optional" form:"size" json:"size,omitempty" query:"size"`
Filter *PhotoFilter `thrift:"filter,4,optional" form:"filter" json:"filter,omitempty" query:"filter"`
Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"`
@@ -4830,11 +4830,11 @@ func (p *ListPhotoRequest) String() string {
}
type PhotoFilter struct {
// true 筛选 “已标注” 的图片false 筛选 “未标注” 的图片
// True to filter "marked" images, false to filter "unmarked" images
HasCaption *bool `thrift:"has_caption,1,optional" form:"has_caption" json:"has_caption,omitempty" query:"has_caption"`
// 搜索关键字,对图片名称和图片描述进行搜索
// Search keywords, search for image names and picture descriptions
Keyword *string `thrift:"keyword,2,optional" form:"keyword" json:"keyword,omitempty" query:"keyword"`
// 状态
// status
Status *DocumentStatus `thrift:"status,3,optional" form:"status" json:"status,omitempty" query:"status"`
}
@@ -5463,27 +5463,27 @@ func (p *ListPhotoResponse) String() string {
}
type PhotoInfo struct {
// 图片型知识库一个图片对应一个文档
// Picture Knowledge Base One picture corresponds to one document
Name string `thrift:"name,1" form:"name" json:"name" query:"name"`
// 文档ID
// Document ID
DocumentID int64 `thrift:"document_id,2" form:"document_id" json:"document_id,string" query:"document_id"`
// 图片链接
// image link
URL string `thrift:"url,3" form:"url" json:"url" query:"url"`
// 图片描述信息
// picture description information
Caption string `thrift:"caption,4" form:"caption" json:"caption" query:"caption"`
// 创建时间
// create_time
CreateTime int32 `thrift:"create_time,5" form:"create_time" json:"create_time" query:"create_time"`
// 更新时间
// update time
UpdateTime int32 `thrift:"update_time,6" form:"update_time" json:"update_time" query:"update_time"`
// 创建人
// creator_id
CreatorID int64 `thrift:"creator_id,7" form:"creator_id" json:"creator_id,string"`
// 图片后缀 jpg, png
// Image suffix jpg, png, etc
Type string `thrift:"type,8" form:"type" json:"type" query:"type"`
// 图片大小
// image size
Size int32 `thrift:"size,9" form:"size" json:"size" query:"size"`
// 状态
// status
Status DocumentStatus `thrift:"status,10" form:"status" json:"status" query:"status"`
// 来源
// source
SourceType DocumentSource `thrift:"source_type,11" form:"source_type" json:"source_type" query:"source_type"`
}
@@ -6063,9 +6063,9 @@ func (p *PhotoInfo) String() string {
}
type PhotoDetailRequest struct {
// 文档ID列表
// Document ID List
DocumentIds []string `thrift:"document_ids,1,required" form:"document_ids,required" json:"document_ids,required" query:"document_ids,required"`
// 知识库ID
// Knowledge ID
DatasetID int64 `thrift:"dataset_id,2,required" form:"dataset_id,required" json:"dataset_id,string,required" query:"dataset_id,required"`
Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"`
}
@@ -6337,7 +6337,7 @@ func (p *PhotoDetailRequest) String() string {
}
type PhotoDetailResponse struct {
// 文档ID到图片信息的映射
// Mapping document ID to image information
PhotoInfos map[string]*PhotoInfo `thrift:"photo_infos,1" form:"photo_infos" json:"photo_infos" query:"photo_infos"`
Code int64 `thrift:"code,253,required" form:"code,required" json:"code,required" query:"code,required"`
Msg string `thrift:"msg,254,required" form:"msg,required" json:"msg,required" query:"msg,required"`
@@ -6669,15 +6669,15 @@ func (p *PhotoDetailResponse) String() string {
}
type ResegmentRequest struct {
// 知识库ID
// Knowledge ID
DatasetID int64 `thrift:"dataset_id,1" form:"dataset_id" json:"dataset_id,string" query:"dataset_id"`
// 要重新分段的文档
// Document to be re-segmented
DocumentIds []string `thrift:"document_ids,2" form:"document_ids" json:"document_ids" query:"document_ids"`
// 分段策略
// segmentation strategy
ChunkStrategy *ChunkStrategy `thrift:"chunk_strategy,3" form:"chunk_strategy" json:"chunk_strategy" query:"chunk_strategy"`
// 解析策略
// parsing strategy
ParsingStrategy *ParsingStrategy `thrift:"parsing_strategy,5,optional" form:"parsing_strategy" json:"parsing_strategy,omitempty" query:"parsing_strategy"`
// 过滤策略
// filtering strategy
FilterStrategy *FilterStrategy `thrift:"filter_strategy,7,optional" form:"filter_strategy" json:"filter_strategy,omitempty" query:"filter_strategy"`
Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"`
}
@@ -7088,7 +7088,7 @@ func (p *ResegmentRequest) String() string {
}
type ResegmentResponse struct {
// 老版需要. 仅返回id 和名称即可
// The old version requires. Just return the id and name.
DocumentInfos []*DocumentInfo `thrift:"document_infos,1" form:"document_infos" json:"document_infos" query:"document_infos"`
Code int64 `thrift:"code,253,required" form:"code,required" json:"code,required" query:"code,required"`
Msg string `thrift:"msg,254,required" form:"msg,required" json:"msg,required" query:"msg,required"`
@@ -7406,17 +7406,17 @@ func (p *ResegmentResponse) String() string {
}
type CreateDocumentRequest struct {
// 要插入文档的知识库id
// The knowledge base id of the document to insert.
DatasetID int64 `thrift:"dataset_id,1" form:"dataset_id" json:"dataset_id,string" query:"dataset_id"`
// 知识库的类型,目前支持文本、表格、图片三种知识库
// Types of knowledge bases, currently supporting text, tables, and images
FormatType FormatType `thrift:"format_type,4" form:"format_type" json:"format_type" query:"format_type"`
// 表格类型一次只能创建一个
// Only one table type can be created at a time
DocumentBases []*DocumentBase `thrift:"document_bases,6" form:"document_bases" json:"document_bases" query:"document_bases"`
// 只在知识库中没有文档时需要传递,已有则从知识库获取.切片规则,为空则自动按段落切片
// Only when there is no document in the knowledge base, it needs to be passed, and if there is one, it will be obtained from the knowledge base. Slicing rules, if it is empty, it will be automatically sliced by paragraph
ChunkStrategy *ChunkStrategy `thrift:"chunk_strategy,17,optional" form:"chunk_strategy" json:"chunk_strategy,omitempty" query:"chunk_strategy"`
// 为 true 时向已有的 document 追加内容。text 类型不能使用
// Appends content to an existing document when true. The text type cannot be used
IsAppend *bool `thrift:"is_append,31,optional" form:"is_append" json:"is_append,omitempty" query:"is_append"`
// 解析策略
// parsing strategy
ParsingStrategy *ParsingStrategy `thrift:"parsing_strategy,32,optional" form:"parsing_strategy" json:"parsing_strategy,omitempty" query:"parsing_strategy"`
Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"`
}
@@ -8197,18 +8197,18 @@ func (p *CreateDocumentResponse) String() string {
}
// 用于创建文档的基本信息
// Basic information for creating a document
type DocumentBase struct {
// 文档名称
// Document name
Name string `thrift:"name,1" form:"name" json:"name" query:"name"`
SourceInfo *SourceInfo `thrift:"source_info,2" form:"source_info" json:"source_info" query:"source_info"`
// 以下参数表格类型需要传递
// The following parameter table types need to be passed
TableMeta []*TableColumn `thrift:"table_meta,4,optional" form:"table_meta" json:"table_meta,omitempty" query:"table_meta"`
// 表格解析信息
// Table parsing information
TableSheet *TableSheet `thrift:"table_sheet,5,optional" form:"table_sheet" json:"table_sheet,omitempty" query:"table_sheet"`
// 过滤策略
// filtering strategy
FilterStrategy *FilterStrategy `thrift:"filter_strategy,6,optional" form:"filter_strategy" json:"filter_strategy,omitempty" query:"filter_strategy"`
// 图片类型知识库,人工标注时的图片描述
// Image type knowledge base, picture description when manually annotated
Caption *string `thrift:"caption,7,optional" form:"caption" json:"caption,omitempty" query:"caption"`
}
@@ -8631,18 +8631,18 @@ func (p *DocumentBase) String() string {
}
// 支持多种数据源
// Supports multiple data sources
type SourceInfo struct {
// 本地上传返回的 uri
// Upload the returned URI locally.
TosURI *string `thrift:"tos_uri,1,optional" form:"tos_uri" json:"tos_uri,omitempty"`
DocumentSource *DocumentSource `thrift:"document_source,4,optional" form:"document_source" json:"document_source,omitempty"`
// document_source 自定义原始内容: 表格型知识库需要符合的格式json list<map<string, string>>
// document_source custom raw content: Format required for a tabular knowledge base: json list < map < string, string > >
CustomContent *string `thrift:"custom_content,5,optional" form:"custom_content" json:"custom_content,omitempty"`
// document_source 本地: 如果不传 tos 地址, 则需要传文件 base64, 类型
// document_source local: If you don't send the tos address, you need to send the file base64, type
FileBase64 *string `thrift:"file_base64,7,optional" form:"file_base64" json:"file_base64,omitempty" query:"file_base64"`
// 文件类型, 比如 pdf
// File type, such as PDF
FileType *string `thrift:"file_type,8,optional" form:"file_type" json:"file_type,omitempty" query:"file_type"`
// imagex_uri, tos_uri 二选一, imagex_uri 优先,需要通过 imagex 的方法获取数据和签发 url
// imagex_uri, and tos_uri choose one, imagex_uri priority, need to get data and sign url through imagex method
ImagexURI *string `thrift:"imagex_uri,10,optional" form:"imagex_uri" json:"imagex_uri,omitempty" query:"imagex_uri"`
}
@@ -9069,11 +9069,11 @@ func (p *SourceInfo) String() string {
}
type TableSheet struct {
// 用户选择的 sheet id
// User selected sheet id
SheetID int64 `thrift:"sheet_id,1" form:"sheet_id" json:"sheet_id,string"`
// 用户选择的表头行数,从 0 开始编号
// The number of header rows selected by the user, numbered from 0
HeaderLineIdx int64 `thrift:"header_line_idx,2" form:"header_line_idx" json:"header_line_idx,string"`
// 用户选择的起始行号,从 0 开始编号
// User-selected starting line number, numbered from 0
StartLineIdx int64 `thrift:"start_line_idx,3" form:"start_line_idx" json:"start_line_idx,string"`
}
@@ -9831,13 +9831,13 @@ func (p *GetDocumentProgressResponse) String() string {
type DocumentProgress struct {
DocumentID int64 `thrift:"document_id,1" form:"document_id" json:"document_id,string" query:"document_id"`
// 知识库进度百分比
// Knowledge Base Progress Percentage
Progress int32 `thrift:"progress,2" form:"progress" json:"progress" query:"progress"`
Status DocumentStatus `thrift:"status,3" form:"status" json:"status" query:"status"`
// 状态的详细描述;如果切片失败,返回失败信息
// A detailed description of the status; if the slice fails, a failure message is returned
StatusDescript *string `thrift:"status_descript,4,optional" form:"status_descript" json:"status_descript,omitempty" query:"status_descript"`
DocumentName string `thrift:"document_name,5" form:"document_name" json:"document_name" query:"document_name"`
// 剩余时间单位秒
// Remaining time in seconds
RemainingTime *int64 `thrift:"remaining_time,6,optional" form:"remaining_time" json:"remaining_time,omitempty" query:"remaining_time"`
Size *int64 `thrift:"size,7,optional" form:"size" json:"size,omitempty" query:"size"`
Type *string `thrift:"type,8,optional" form:"type" json:"type,omitempty" query:"type"`
@@ -10386,19 +10386,19 @@ func (p *DocumentProgress) String() string {
}
// 获取 database 上传的表格文件元信息
// Get the table file meta information uploaded by the database
type GetTableSchemaRequest struct {
// 表格解析信息, 默认初始值0,0,1表示第1个表格表头行为第1行数据行从第2行开始
// Table parsing information, the default initial value is 0, 0, 1, which represents the first table, the first row of the table header, and the data row starts from the second row
TableSheet *TableSheet `thrift:"table_sheet,1,optional" form:"table_sheet" json:"table_sheet,omitempty" query:"table_sheet"`
// 不传默认返回所有数据
// All data is returned by default without passing it on.
TableDataType *TableDataType `thrift:"table_data_type,2,optional" form:"table_data_type" json:"table_data_type,omitempty" query:"table_data_type"`
// 兼容重构前的版本:如果需要拉取的是当前 document 的 schema 时传递该值
// Compatible with pre-refactoring versions: pass this value if you need to pull the schema of the current document
DocumentID *int64 `thrift:"document_id,3,optional" form:"document_id" json:"document_id,string,omitempty"`
// source file 的信息,新增 segment / 之前逻辑迁移到这里
// Source file information, add segment/before logic migrate here
SourceFile *SourceInfo `thrift:"source_file,4,optional" form:"source_file" json:"source_file,omitempty" query:"source_file"`
// 表格预览前端需要传递原始的数据表结构
// The table preview front end needs to pass the original data table structure
OriginTableMeta []*TableColumn `thrift:"origin_table_meta,5,optional" form:"origin_table_meta" json:"origin_table_meta,omitempty" query:"origin_table_meta"`
// 表格预览前端需要传递用户编辑之后的数据表结构
// The table preview front end needs to pass the data table structure edited by the user
PreviewTableMeta []*TableColumn `thrift:"preview_table_meta,6,optional" form:"preview_table_meta" json:"preview_table_meta,omitempty" query:"preview_table_meta"`
Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"`
}
@@ -10912,11 +10912,11 @@ func (p *GetTableSchemaRequest) String() string {
}
type DocTableSheet struct {
// sheet 的编号
// Number of sheet
ID int64 `thrift:"id,1" form:"id" json:"id" query:"id"`
// sheet
// Sheet name
SheetName string `thrift:"sheet_name,2" form:"sheet_name" json:"sheet_name" query:"sheet_name"`
// 总行数
// total number of rows
TotalRow int64 `thrift:"total_row,3" form:"total_row" json:"total_row" query:"total_row"`
}
@@ -11147,9 +11147,9 @@ type GetTableSchemaResponse struct {
Code int32 `thrift:"code,1,required" form:"code,required" json:"code,required" query:"code,required"`
Msg string `thrift:"msg,2,required" form:"msg,required" json:"msg,required" query:"msg,required"`
SheetList []*DocTableSheet `thrift:"sheet_list,3" form:"sheet_list" json:"sheet_list" query:"sheet_list"`
// 选中的 sheet 的 schema, 不选择默认返回第一个 sheet
// The schema of the selected sheet, not selected to return the first sheet by default
TableMeta []*TableColumn `thrift:"table_meta,4" form:"table_meta" json:"table_meta" query:"table_meta"`
// knowledge table 场景中会返回
// The knowledge table will return
PreviewData []map[string]string `thrift:"preview_data,5" form:"preview_data" json:"preview_data"`
BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"-" json:"-" query:"-"`
}
@@ -11621,15 +11621,15 @@ func (p *GetTableSchemaResponse) String() string {
}
// 判断用户配置的 schema 是否和对应 document id 的一致
// Determine whether the schema configured by the user is consistent with the corresponding document id
type ValidateTableSchemaRequest struct {
// 空间ID
// Space ID
SpaceID int64 `thrift:"space_id,1" form:"space_id" json:"space_id,string"`
// 要校验的文档ID
// Document ID to verify
DocumentID int64 `thrift:"document_id,2" form:"document_id" json:"document_id,string"`
// source file 的信息
// Information from the source file
SourceInfo *SourceInfo `thrift:"source_info,3" form:"source_file" json:"source_file"`
// 表格解析信息, 默认初始值0,0,1表示第1个表格表头行为第1行数据行从第2行开始
// Table parsing information, the default initial value is 0, 0, 1, which represents the first table, the first row of the table header, and the data row starts from the second row
TableSheet *TableSheet `thrift:"table_sheet,4" form:"table_sheet" json:"table_sheet"`
Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"`
}
@@ -11967,7 +11967,7 @@ func (p *ValidateTableSchemaRequest) String() string {
type ValidateTableSchemaResponse struct {
ColumnValidResult map[string]string `thrift:"ColumnValidResult,1,optional" form:"column_valid_result" json:"column_valid_result,omitempty"`
// 如果失败会返回错误码
// If it fails, an error code will be returned.
Code int64 `thrift:"code,253,required" form:"code,required" json:"code,required" query:"code,required"`
Msg string `thrift:"msg,254,required" form:"msg,required" json:"msg,required" query:"msg,required"`
BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"-" json:"-" query:"-"`
@@ -12504,7 +12504,7 @@ func (p *ExtractPhotoCaptionRequest) String() string {
}
type ExtractPhotoCaptionResponse struct {
// 图片描述
// picture description
Caption string `thrift:"caption,1" form:"caption" json:"caption" query:"caption"`
Code int64 `thrift:"code,253,required" form:"code,required" json:"code,required" query:"code,required"`
Msg string `thrift:"msg,254,required" form:"msg,required" json:"msg,required" query:"msg,required"`

View File

@@ -9,7 +9,7 @@ import (
)
type DatasetService interface {
// 知识库相关
// Knowledge base related
GetIconForDataset(ctx context.Context, req *GetIconRequest) (r *GetIconResponse, err error)
CreateDataset(ctx context.Context, req *CreateDatasetRequest) (r *CreateDatasetResponse, err error)
@@ -21,7 +21,7 @@ type DatasetService interface {
DeleteDataset(ctx context.Context, req *DeleteDatasetRequest) (r *DeleteDatasetResponse, err error)
UpdateDataset(ctx context.Context, req *UpdateDatasetRequest) (r *UpdateDatasetResponse, err error)
// Document相关
// Document related
CreateDocument(ctx context.Context, req *CreateDocumentRequest) (r *CreateDocumentResponse, err error)
ListDocument(ctx context.Context, req *ListDocumentRequest) (r *ListDocumentResponse, err error)
@@ -45,7 +45,7 @@ type DatasetService interface {
GetTableSchema(ctx context.Context, req *GetTableSchemaRequest) (r *GetTableSchemaResponse, err error)
ValidateTableSchema(ctx context.Context, req *ValidateTableSchemaRequest) (r *ValidateTableSchemaResponse, err error)
// slice相关
// Slice related
DeleteSlice(ctx context.Context, req *DeleteSliceRequest) (r *DeleteSliceResponse, err error)
CreateSlice(ctx context.Context, req *CreateSliceRequest) (r *CreateSliceResponse, err error)
@@ -53,7 +53,7 @@ type DatasetService interface {
UpdateSlice(ctx context.Context, req *UpdateSliceRequest) (r *UpdateSliceResponse, err error)
ListSlice(ctx context.Context, req *ListSliceRequest) (r *ListSliceResponse, err error)
/** 预分片相关 **/
/** Pre-sharding related **/
CreateDocumentReview(ctx context.Context, req *CreateDocumentReviewRequest) (r *CreateDocumentReviewResponse, err error)
MGetDocumentReview(ctx context.Context, req *MGetDocumentReviewRequest) (r *MGetDocumentReviewResponse, err error)

View File

@@ -3,9 +3,9 @@
package dataset
import (
"github.com/coze-dev/coze-studio/backend/api/model/base"
"fmt"
"github.com/apache/thrift/lib/go/thrift"
"github.com/coze-dev/coze-studio/backend/api/model/base"
)
type ReviewInput struct {
@@ -298,7 +298,7 @@ type Review struct {
DocumentName string `thrift:"document_name,2" form:"document_name" json:"document_name" query:"document_name"`
DocumentType string `thrift:"document_type,3" form:"document_type" json:"document_type" query:"document_type"`
TosURL string `thrift:"tos_url,4" form:"tos_url" json:"tos_url" query:"tos_url"`
// 状态
// status
Status *ReviewStatus `thrift:"status,5,optional" form:"status" json:"status,omitempty" query:"status"`
DocTreeTosURL *string `thrift:"doc_tree_tos_url,6,optional" form:"doc_tree_tos_url" json:"doc_tree_tos_url,omitempty" query:"doc_tree_tos_url"`
PreviewTosURL *string `thrift:"preview_tos_url,7,optional" form:"preview_tos_url" json:"preview_tos_url,omitempty" query:"preview_tos_url"`

View File

@@ -3,21 +3,21 @@
package dataset
import (
"github.com/coze-dev/coze-studio/backend/api/model/base"
"database/sql"
"database/sql/driver"
"fmt"
"github.com/apache/thrift/lib/go/thrift"
"github.com/coze-dev/coze-studio/backend/api/model/base"
)
type SliceStatus int64
const (
// 未向量化
// unvectorized
SliceStatus_PendingVectoring SliceStatus = 0
// 已向量化
// vectorized
SliceStatus_FinishVectoring SliceStatus = 1
// 禁用
// disable
SliceStatus_Deactive SliceStatus = 9
)
@@ -61,7 +61,7 @@ func (p *SliceStatus) Value() (driver.Value, error) {
}
type DeleteSliceRequest struct {
// 要删除的分片ID列表
// List of sharding IDs to delete
SliceIds []string `thrift:"slice_ids,4,optional" form:"slice_ids" json:"slice_ids,omitempty"`
Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"`
}
@@ -537,11 +537,11 @@ func (p *DeleteSliceResponse) String() string {
}
type CreateSliceRequest struct {
// 新增分片插入的文档ID
// Add sharding inserted document ID
DocumentID int64 `thrift:"document_id,2,required" form:"document_id,required" json:"document_id,string,required" query:"document_id,required"`
// 新增分片的内容
// Add sharding content
RawText *string `thrift:"raw_text,5,optional" form:"raw_text" json:"raw_text,omitempty" query:"raw_text"`
// 分片插入位置1表示文档开头最大值为最后一个分片位置+1
// Sharding insertion position, 1 indicates the beginning of the document, and the maximum value is the last sharding position + 1
Sequence *int64 `thrift:"sequence,6,optional" form:"sequence" json:"sequence,string,omitempty" query:"sequence"`
Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"`
}
@@ -852,7 +852,7 @@ func (p *CreateSliceRequest) String() string {
}
type CreateSliceResponse struct {
// 新增分片ID
// Add sharding ID
SliceID int64 `thrift:"slice_id,1" form:"slice_id" json:"slice_id,string" query:"slice_id"`
Code int64 `thrift:"code,253,required" form:"code,required" json:"code,required" query:"code,required"`
Msg string `thrift:"msg,254,required" form:"msg,required" json:"msg,required" query:"msg,required"`
@@ -1150,9 +1150,9 @@ func (p *CreateSliceResponse) String() string {
}
type UpdateSliceRequest struct {
// 要更新的分片ID
// The sharding ID to update
SliceID int64 `thrift:"slice_id,2,required" form:"slice_id,required" json:"slice_id,string,required" query:"slice_id,required"`
// 要更新的内容
// Content to be updated
RawText *string `thrift:"raw_text,7,optional" form:"raw_text" json:"raw_text,omitempty" query:"raw_text"`
Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"`
}
@@ -1660,15 +1660,15 @@ func (p *UpdateSliceResponse) String() string {
}
type ListSliceRequest struct {
// 要list的分片所属的文档ID
// The document ID of the sharding to list
DocumentID *int64 `thrift:"document_id,2,optional" form:"document_id" json:"document_id,string,omitempty" query:"document_id"`
// 分片序号表示从该序号的分片开始list
// Sharding serial number, indicating that the list starts from the sharding of this serial number
Sequence *int64 `thrift:"sequence,3,optional" form:"sequence" json:"sequence,string,omitempty" query:"sequence"`
// 查询关键字
// query keyword
Keyword *string `thrift:"keyword,4,optional" form:"keyword" json:"keyword,omitempty" query:"keyword"`
// 如果只传 dataset_id,则返回该知识库下的分片
// If only dataset_id, return sharding under that knowledge base
DatasetID *int64 `thrift:"dataset_id,5,optional" form:"dataset_id" json:"dataset_id,string,omitempty" query:"dataset_id"`
// 每页大小
// page size
PageSize int64 `thrift:"page_size,21" form:"page_size" json:"page_size,string" query:"page_size"`
Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"`
}
@@ -2081,11 +2081,11 @@ func (p *ListSliceRequest) String() string {
}
type ListSliceResponse struct {
// 返回的分片列表
// Returned list of shardings
Slices []*SliceInfo `thrift:"slices,1" form:"slices" json:"slices" query:"slices"`
// 总分片数
// Total shardings
Total int64 `thrift:"total,2" form:"total" json:"total,string" query:"total"`
// 是否还有更多分片
// Is there more sharding?
Hasmore bool `thrift:"hasmore,3" form:"hasmore" json:"hasmore" query:"hasmore"`
Code int64 `thrift:"code,253,required" form:"code,required" json:"code,required" query:"code,required"`
Msg string `thrift:"msg,254,required" form:"msg,required" json:"msg,required" query:"msg,required"`
@@ -2491,21 +2491,21 @@ func (p *ListSliceResponse) String() string {
}
type SliceInfo struct {
// 分片ID
// Sharding ID
SliceID int64 `thrift:"slice_id,1" form:"slice_id" json:"slice_id,string" query:"slice_id"`
// 分片内容
// Sharding content
Content string `thrift:"content,2" form:"content" json:"content" query:"content"`
// 分片状态
// Sharding state
Status SliceStatus `thrift:"status,3" form:"status" json:"status" query:"status"`
// 命中次数
// hit count
HitCount int64 `thrift:"hit_count,4" form:"hit_count" json:"hit_count,string" query:"hit_count"`
// 字符数
// character count
CharCount int64 `thrift:"char_count,5" form:"char_count" json:"char_count,string" query:"char_count"`
// 序号
// serial number
Sequence int64 `thrift:"sequence,7" form:"sequence" json:"sequence,string" query:"sequence"`
// 分片所属的文档ID
// The document ID to which sharding belongs
DocumentID int64 `thrift:"document_id,8" form:"document_id" json:"document_id,string" query:"document_id"`
// 分片相关的元信息, 透传 slice 表里的 extra->chunk_info 字段 (json)
// Meta information related to sharding, extra- > chunk_info field in the transparent slice table (json)
ChunkInfo string `thrift:"chunk_info,9" form:"chunk_info" json:"chunk_info" query:"chunk_info"`
}