From 5abc63fba6b3052981c325ef5285a3f627115b09 Mon Sep 17 00:00:00 2001 From: tecvan <84165678+Tecvan-fe@users.noreply.github.com> Date: Thu, 31 Jul 2025 15:18:11 +0800 Subject: [PATCH] chore: replace all cn comments to en version by volc api (#313) --- .../api/handler/coze/developer_api_service.go | 2 +- .../api/handler/coze/open_apiauth_service.go | 2 +- backend/api/handler/coze/passport_service.go | 6 +- backend/api/model/common/common.go | 28 +- .../conversation/agentrun/agentrun_service.go | 2 +- .../api/model/conversation/common/common.go | 8 +- .../conversation/conversation/conversation.go | 22 +- .../api/model/conversation/message/message.go | 116 ++-- backend/api/model/conversation/run/run.go | 42 +- .../model/crossdomain/knowledge/knowledge.go | 52 +- .../api/model/crossdomain/plugin/openai.go | 6 +- .../crossdomain/plugin/plugin_manifest.go | 6 +- .../api/model/crossdomain/plugin/toolinfo.go | 6 +- .../model/crossdomain/search/resource_doc.go | 2 +- backend/api/model/database/database.go | 4 +- .../model/developer/connector/connector.go | 94 +-- .../model/flow/dataengine/dataset/common.go | 86 +-- .../model/flow/dataengine/dataset/dataset.go | 84 +-- .../model/flow/dataengine/dataset/document.go | 228 +++---- .../dataset/flow_dataengine_dataset.go | 8 +- .../model/flow/dataengine/dataset/review.go | 4 +- .../model/flow/dataengine/dataset/slice.go | 54 +- .../coze/flow.devops.debugger.coze.go | 20 +- .../devops/debugger/domain/infra/infra.go | 58 +- .../debugger/domain/testcase/testcase.go | 8 +- .../marketplace_common/marketplace_common.go | 14 +- .../product_common/product_common.go | 82 +-- .../product_public_api/public_api.go | 296 ++++----- .../intelligence/common/common_struct.go | 26 +- .../common/intelligence_common_struct.go | 6 +- .../api/model/intelligence/intelligence.go | 6 +- backend/api/model/intelligence/search.go | 36 +- .../api/model/knowledge/document/kdocument.go | 16 +- backend/api/model/kvmemory/kvmemory.go | 10 +- .../ocean/cloud/bot_common/bot_common.go | 574 ++++++++--------- .../ocean/cloud/bot_open_api/bot_open_api.go | 2 +- .../cloud/developer_api/developer_api.go | 382 +++++------ .../ocean/cloud/memory/ocean_cloud_memory.go | 6 +- .../ocean/cloud/playground/playground.go | 258 ++++---- .../ocean/cloud/playground/prompt_resource.go | 50 +- .../cloud/playground/shortcut_command.go | 56 +- .../cloud/plugin_develop/plugin_develop.go | 164 ++--- .../cloud/workflow/ocean_cloud_workflow.go | 24 +- .../api/model/ocean/cloud/workflow/trace.go | 96 +-- .../model/ocean/cloud/workflow/workflow.go | 596 ++++++++--------- backend/api/model/passport/passport.go | 12 +- .../permission/openapiauth/openapiauth.go | 22 +- .../plugin_develop_common.go | 178 ++--- backend/api/model/project/project.go | 6 +- .../model/project_memory/project_memory.go | 10 +- backend/api/model/publish/publish.go | 166 ++--- .../model/resource/common/resource_common.go | 148 ++--- backend/api/model/resource/resource.go | 54 +- backend/api/model/table/table.go | 482 +++++++------- backend/api/model/task/task.go | 4 +- backend/api/model/task_struct/task_struct.go | 2 +- backend/application/app/app.go | 2 +- backend/application/conversation/agent_run.go | 2 +- backend/application/knowledge/convertor.go | 2 +- backend/application/memory/database.go | 2 +- backend/application/modelmgr/modelmgr.go | 4 +- backend/application/plugin/plugin.go | 4 +- backend/application/search/resource_search.go | 2 +- backend/application/singleagent/get.go | 2 +- .../application/singleagent/single_agent.go | 6 +- backend/application/upload/icon.go | 16 +- backend/application/user/user.go | 16 +- .../conf/plugin/pluginproduct/lark_sheet.yaml | 2 +- .../contract/crossworkflow/crossworkflow.go | 2 +- .../agentflow/agent_flow_builder_test.go | 6 +- .../agentflow/node_prompt_variables.go | 4 +- .../internal/agentflow/node_tool_knowledge.go | 2 +- .../dal/model/single_agent_draft.gen.go | 2 +- .../dal/model/single_agent_publish.gen.go | 18 +- .../dal/model/single_agent_version.gen.go | 2 +- .../dal/query/single_agent_draft.gen.go | 2 +- .../dal/query/single_agent_publish.gen.go | 18 +- .../dal/query/single_agent_version.gen.go | 2 +- .../internal/dal/single_agent_publish.go | 4 +- .../agent/singleagent/service/publish.go | 2 +- .../singleagent/service/single_agent_impl.go | 4 +- .../internal/dal/model/run_record.gen.go | 34 +- .../internal/dal/query/run_record.gen.go | 24 +- .../agentrun/service/agent_run_impl.go | 2 +- .../agentrun/service/agent_run_test.go | 2 +- .../internal/dal/model/conversation.gen.go | 22 +- .../internal/dal/query/conversation.gen.go | 18 +- .../message/internal/dal/model/message.gen.go | 40 +- .../message/internal/dal/query/message.gen.go | 34 +- backend/domain/datacopy/entity/entity.go | 8 +- .../internal/dal/model/data_copy_task.gen.go | 34 +- .../internal/dal/query/data_copy_task.gen.go | 32 +- backend/domain/datacopy/service/datacopy.go | 2 +- backend/domain/knowledge/entity/const.go | 22 +- backend/domain/knowledge/entity/document.go | 44 +- backend/domain/knowledge/entity/event.go | 10 +- backend/domain/knowledge/entity/knowledge.go | 4 +- backend/domain/knowledge/entity/strategy.go | 28 +- .../internal/dal/dao/knowledge_document.go | 4 +- .../dal/dao/knowledge_document_slice.go | 4 +- .../internal/dal/model/knowledge.gen.go | 26 +- .../dal/model/knowledge_document.gen.go | 40 +- .../model/knowledge_document_review.gen.go | 28 +- .../dal/model/knowledge_document_slice.gen.go | 28 +- .../internal/dal/query/knowledge.gen.go | 22 +- .../dal/query/knowledge_document.gen.go | 36 +- .../query/knowledge_document_review.gen.go | 22 +- .../dal/query/knowledge_document_slice.gen.go | 22 +- .../domain/knowledge/processor/impl/base.go | 10 +- .../knowledge/processor/impl/custom_doc.go | 2 +- .../knowledge/processor/impl/custom_table.go | 12 +- .../knowledge/processor/impl/local_table.go | 2 +- .../domain/knowledge/processor/interface.go | 10 +- backend/domain/knowledge/service/convert.go | 2 +- backend/domain/knowledge/service/datacopy.go | 14 +- .../domain/knowledge/service/event_handle.go | 10 +- backend/domain/knowledge/service/interface.go | 22 +- backend/domain/knowledge/service/knowledge.go | 56 +- .../knowledge/service/knowledge_test.go | 46 +- backend/domain/knowledge/service/rdb.go | 6 +- backend/domain/knowledge/service/retrieve.go | 48 +- backend/domain/knowledge/service/sheet.go | 12 +- .../domain/memory/database/entity/database.go | 14 +- .../database/internal/convertor/types.go | 6 +- .../internal/dal/draft_database_info.go | 14 +- .../internal/dal/online_database_info.go | 24 +- .../internal/physicaltable/physical.go | 20 +- .../memory/database/internal/sheet/sheet.go | 4 +- .../memory/database/service/database_impl.go | 2 +- .../memory/variables/entity/sys_variables.go | 6 +- .../variables/entity/variable_instance.go | 4 +- .../variables/entity/variable_meta_schema.go | 2 +- .../dal/model/variable_instance.gen.go | 22 +- .../internal/dal/model/variables_meta.gen.go | 16 +- .../dal/query/variable_instance.gen.go | 18 +- .../internal/dal/query/variables_meta.gen.go | 12 +- .../variables/internal/dal/variables_meta.go | 4 +- .../variables/service/variables_impl.go | 4 +- .../plugin/internal/dal/agent_tool_version.go | 2 +- .../internal/openapi/convert_protocol.go | 4 +- backend/domain/plugin/service/exec_tool.go | 6 +- backend/domain/plugin/service/plugin_draft.go | 6 +- .../internal/dal/model/prompt_resource.gen.go | 18 +- .../internal/dal/query/prompt_resource.gen.go | 18 +- backend/domain/prompt/service/prompt_impl.go | 4 +- .../domain/search/entity/resources_event.go | 2 +- backend/domain/search/service/search.go | 2 +- .../dal/model/shortcut_command.gen.go | 48 +- .../dal/query/shortcut_command.gen.go | 46 +- backend/domain/user/entity/user.go | 20 +- backend/domain/user/internal/dal/user.go | 6 +- backend/domain/user/service/user_impl.go | 78 +-- .../crossdomain/knowledge/knowledge.go | 6 +- .../workflow/entity/node_type_literal.go | 4 +- backend/domain/workflow/entity/vo/canvas.go | 2 +- .../domain/workflow/entity/vo/node_test.go | 22 +- .../internal/canvas/adaptor/canvas_test.go | 2 +- .../canvas/validate/canvas_validate.go | 4 +- .../httprequester/http_requester_test.go | 6 +- .../internal/nodes/qa/question_answer.go | 4 +- .../nodes/textprocessor/text_processor.go | 2 +- .../repo/dal/model/node_execution.gen.go | 2 +- .../repo/dal/model/workflow_draft.gen.go | 20 +- .../repo/dal/model/workflow_execution.gen.go | 2 +- .../repo/dal/model/workflow_meta.gen.go | 16 +- .../repo/dal/model/workflow_reference.gen.go | 4 +- .../repo/dal/model/workflow_snapshot.gen.go | 14 +- .../repo/dal/model/workflow_version.gen.go | 24 +- .../repo/dal/query/node_execution.gen.go | 2 +- .../repo/dal/query/workflow_draft.gen.go | 16 +- .../repo/dal/query/workflow_execution.gen.go | 2 +- .../repo/dal/query/workflow_meta.gen.go | 16 +- .../repo/dal/query/workflow_reference.gen.go | 4 +- .../repo/dal/query/workflow_snapshot.gen.go | 4 +- .../repo/dal/query/workflow_version.gen.go | 18 +- .../workflow/internal/repo/repository.go | 10 +- .../infra/contract/document/parser/manager.go | 42 +- .../infra/contract/document/rerank/rerank.go | 2 +- .../contract/document/searchstore/manager.go | 2 +- .../contract/document/searchstore/options.go | 6 +- backend/infra/contract/document/table.go | 2 +- backend/infra/contract/imagex/imagex.go | 6 +- backend/infra/contract/modelmgr/const.go | 10 +- backend/infra/contract/modelmgr/desc.go | 8 +- backend/infra/contract/rdb/entity/const.go | 6 +- backend/infra/contract/rdb/entity/rdb.go | 8 +- backend/infra/contract/rdb/rdb.go | 72 +-- backend/infra/impl/cache/redis/redis.go | 18 +- .../impl/document/parser/builtin/convert.go | 4 +- .../document/parser/builtin/parse_iter.go | 2 +- .../document/parser/builtin/parse_json.go | 2 +- .../parser/builtin/py_parser_protocol.go | 2 +- .../impl/document/parser/builtin/util.go | 2 +- .../document/rerank/vikingdb/vikingdb_test.go | 10 +- .../searchstore/milvus/milvus_manager.go | 2 +- .../vikingdb/vikingdb_searchstore.go | 2 +- .../impl/dynconf/static/static_config.go | 20 +- backend/infra/impl/es/es7.go | 6 +- backend/infra/impl/es/es8.go | 2 +- backend/infra/impl/eventbus/kafka/consumer.go | 4 +- backend/infra/impl/eventbus/nsq/consumer.go | 2 +- backend/infra/impl/eventbus/rmq/consumer.go | 2 +- backend/infra/impl/idgen/idgen.go | 8 +- .../infra/impl/imagex/veimagex/veimagex.go | 2 +- backend/infra/impl/rdb/mysql.go | 4 +- backend/infra/impl/storage/tos/tos.go | 16 +- backend/pkg/ctxcache/ctx_cache_test.go | 4 +- backend/pkg/errorx/code/register.go | 6 +- .../migrations/20250730131847_update.sql | 48 ++ docker/atlas/migrations/atlas.sum | 3 +- docker/atlas/opencoze_latest_schema.hcl | 440 ++++++------- docker/volumes/mysql/schema.sql | 56 +- helm/charts/opencoze/files/mysql/schema.sql | 56 +- idl/bot_common/bot_common.thrift | 592 ++++++++--------- .../ocean_cloud_workflow.thrift | 24 +- .../ocean_cloud_workflow/trace.thrift | 94 +-- .../ocean_cloud_workflow/workflow.thrift | 606 +++++++++--------- idl/conversation/common.thrift | 8 +- idl/conversation/conversation.thrift | 18 +- idl/conversation/message.thrift | 114 ++-- idl/conversation/run.thrift | 38 +- idl/data_engine/dataset/common.thrift | 86 +-- idl/data_engine/dataset/dataset.thrift | 84 +-- idl/data_engine/dataset/document.thrift | 238 +++---- .../dataset/flow_dataengine_dataset.thrift | 8 +- idl/data_engine/dataset/review.thrift | 2 +- idl/data_engine/dataset/slice.thrift | 52 +- .../knowledge/common.thrift | 28 +- .../knowledge/kdocument.thrift | 12 +- .../kvmemory/kvmemory.thrift | 6 +- .../kvmemory/project_memory.thrift | 8 +- .../ocean_cloud_memory/table/table.thrift | 480 +++++++------- idl/developer/developer_api.thrift | 382 +++++------ idl/flow/devops/debugger/domain/infra.thrift | 58 +- .../devops/debugger/domain/testcase.thrift | 6 +- .../debugger/flow.devops.debugger.coze.thrift | 16 +- .../product_common.thrift | 82 +-- .../public_api.thrift | 302 ++++----- .../marketplace/marketplace_common.thrift | 14 +- .../common_struct/common_struct.thrift | 26 +- .../intelligence_common_struct.thrift | 6 +- .../common_struct/task_struct.thrift | 2 +- idl/intelligence/project.thrift | 2 +- idl/intelligence/publish.thrift | 162 ++--- idl/intelligence/search.thrift | 32 +- idl/passport/passport.thrift | 12 +- idl/permission/openapiauth.thrift | 22 +- idl/playground/playground.thrift | 254 ++++---- idl/playground/prompt_resource.thrift | 48 +- idl/playground/shortcut_command.thrift | 54 +- idl/plugin/plugin_develop.thrift | 160 ++--- idl/plugin/plugin_develop_common.thrift | 178 ++--- idl/resource/resource.thrift | 50 +- idl/resource/resource_common.thrift | 148 ++--- 254 files changed, 5899 insertions(+), 5844 deletions(-) create mode 100644 docker/atlas/migrations/20250730131847_update.sql diff --git a/backend/api/handler/coze/developer_api_service.go b/backend/api/handler/coze/developer_api_service.go index 91d9a9f1..8a80a94f 100644 --- a/backend/api/handler/coze/developer_api_service.go +++ b/backend/api/handler/coze/developer_api_service.go @@ -267,7 +267,7 @@ func GetUploadAuthToken(ctx context.Context, c *app.RequestContext) { func createSecret(uid int64, fileType string) string { num := 10 input := fmt.Sprintf("upload_%d_Ma*9)fhi_%d_gou_%s_rand_%d", uid, time.Now().Unix(), fileType, rand.Intn(100000)) - // 做md5,取前20个,// mapIntToBase62 把数字映射到 Base62 + // Do md5, take the first 20,//mapIntToBase62 map the number to Base62 hash := sha256.Sum256([]byte(fmt.Sprintf("%s", input))) hashString := base64.StdEncoding.EncodeToString(hash[:]) if len(hashString) > num { diff --git a/backend/api/handler/coze/open_apiauth_service.go b/backend/api/handler/coze/open_apiauth_service.go index 47732bdd..3cce000e 100644 --- a/backend/api/handler/coze/open_apiauth_service.go +++ b/backend/api/handler/coze/open_apiauth_service.go @@ -138,7 +138,7 @@ func CreatePersonalAccessTokenAndPermission(ctx context.Context, c *app.RequestC c.JSON(consts.StatusOK, resp) } -// checkCPATParams 检查创建个人访问令牌的参数 +// checkCPATParams Check parameters for creating personal access tokens func checkCPATParams(ctx context.Context, req *openapiauth.CreatePersonalAccessTokenAndPermissionRequest) error { if req.Name == "" { diff --git a/backend/api/handler/coze/passport_service.go b/backend/api/handler/coze/passport_service.go index 810b9a0b..57e77c02 100644 --- a/backend/api/handler/coze/passport_service.go +++ b/backend/api/handler/coze/passport_service.go @@ -159,7 +159,7 @@ func UserUpdateAvatar(ctx context.Context, c *app.RequestContext) { var err error var req passport.UserUpdateAvatarRequest - // 获取上传的文件 + // Get the uploaded file file, err := c.FormFile("avatar") if err != nil { logs.CtxErrorf(ctx, "Get Avatar Fail failed, err=%v", err) @@ -167,13 +167,13 @@ func UserUpdateAvatar(ctx context.Context, c *app.RequestContext) { return } - // 检查文件类型 + // Check file type if !strings.HasPrefix(file.Header.Get("Content-Type"), "image/") { invalidParamRequestResponse(c, "invalid file type, only image allowed") return } - // 读取文件内容 + // Read file content src, err := file.Open() if err != nil { internalServerErrorResponse(ctx, c, err) diff --git a/backend/api/model/common/common.go b/backend/api/model/common/common.go index 205d809d..c4925e0b 100644 --- a/backend/api/model/common/common.go +++ b/backend/api/model/common/common.go @@ -13,17 +13,17 @@ 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 ) @@ -83,11 +83,11 @@ func (p *ColumnType) Value() (driver.Value, error) { } 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"` } @@ -314,20 +314,20 @@ func (p *DocTableSheet) String() string { } -// 表格的列信息 +// Table column information type DocTableColumn 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"` } diff --git a/backend/api/model/conversation/agentrun/agentrun_service.go b/backend/api/model/conversation/agentrun/agentrun_service.go index 469626a6..1355f406 100644 --- a/backend/api/model/conversation/agentrun/agentrun_service.go +++ b/backend/api/model/conversation/agentrun/agentrun_service.go @@ -3,10 +3,10 @@ package agentrun import ( - "github.com/coze-dev/coze-studio/backend/api/model/conversation/run" "context" "fmt" "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-studio/backend/api/model/conversation/run" ) type AgentRunService interface { diff --git a/backend/api/model/conversation/common/common.go b/backend/api/model/conversation/common/common.go index 4f9ba35d..4e4e362b 100644 --- a/backend/api/model/conversation/common/common.go +++ b/backend/api/model/conversation/common/common.go @@ -15,14 +15,14 @@ const ( Scene_Explore Scene = 1 Scene_BotStore Scene = 2 Scene_CozeHome Scene = 3 - //调试 + //debugging Scene_Playground Scene = 4 - // 评测平台 + // evaluation platform Scene_Evaluation Scene = 5 Scene_AgentAPP Scene = 6 - //prompt优化 + //Prompt optimization Scene_PromptOptimize Scene = 7 - // createbot的nl2bot功能 + // Createbot's nl2bot features Scene_GenerateAgentInfo Scene = 8 //openapi Scene_SceneOpenApi Scene = 9 diff --git a/backend/api/model/conversation/conversation/conversation.go b/backend/api/model/conversation/conversation/conversation.go index de1b8db9..e2aae59a 100644 --- a/backend/api/model/conversation/conversation/conversation.go +++ b/backend/api/model/conversation/conversation/conversation.go @@ -3,10 +3,10 @@ package conversation import ( - "github.com/coze-dev/coze-studio/backend/api/model/base" - "github.com/coze-dev/coze-studio/backend/api/model/conversation/common" "fmt" "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-studio/backend/api/model/base" + "github.com/coze-dev/coze-studio/backend/api/model/conversation/common" ) type ClearConversationHistoryRequest struct { @@ -509,7 +509,7 @@ func (p *ClearConversationHistoryResponse) String() string { type ClearConversationCtxRequest struct { ConversationID int64 `thrift:"conversation_id,1,required" form:"conversation_id,required" json:"conversation_id,string,required" query:"conversation_id,required"` Scene *common.Scene `thrift:"scene,2,optional" form:"scene" json:"scene,omitempty" query:"scene"` - // 存在需要插入聊天的情况 + // There is a situation that needs to be inserted into the chat. InsertHistoryMessageList []string `thrift:"insert_history_message_list,3,optional" form:"insert_history_message_list" json:"insert_history_message_list,omitempty" query:"insert_history_message_list"` } @@ -1507,7 +1507,7 @@ func (p *ConversationData) String() string { } type CreateConversationRequest struct { - //自定义透传字段 + //custom passthrough field MetaData map[string]string `thrift:"MetaData,1,optional" form:"meta_data" json:"meta_data,omitempty"` BotId *int64 `thrift:"BotId,3,optional" form:"bot_id" json:"bot_id,string,omitempty"` ConnectorId *int64 `thrift:"ConnectorId,4,optional" form:"connector_id" json:"connector_id,string,omitempty"` @@ -2418,11 +2418,11 @@ func (p *Section) String() string { } type ClearConversationApiResponse struct { - // 错误code + // Error code Code int64 `thrift:"code,1" form:"code" json:"code"` - // 错误消息 + // error message Msg string `thrift:"msg,2" form:"msg" json:"msg"` - // section 信息 + // Section information Data *Section `thrift:"data,3" form:"data" json:"data"` BaseResp *base.BaseResp `thrift:"BaseResp,255" form:"BaseResp" json:"BaseResp" query:"BaseResp"` } @@ -2709,9 +2709,9 @@ func (p *ClearConversationApiResponse) String() string { type ListConversationsApiRequest struct { PageNum int64 `thrift:"page_num,1" json:"page_num" query:"page_num"` PageSize int64 `thrift:"page_size,2" json:"page_size" query:"page_size"` - // 可选值:ASC、DESC + // Optional values: ASC, DESC SortOrder string `thrift:"sort_order,3" json:"sort_order" query:"sort_order"` - // 可选值:created_at创建时间 + // Optional value: such as created_at SortField string `thrift:"sort_field,4" json:"sort_field" query:"sort_field"` BotID int64 `thrift:"bot_id,5,required" json:"bot_id,string,required" query:"bot_id,required"` ConnectorID *int64 `thrift:"connector_id,6,optional" json:"connector_id,string,omitempty" query:"connector_id"` @@ -3143,9 +3143,9 @@ func (p *ListConversationsApiRequest) String() string { } type ListConversationsApiResponse struct { - // 错误code + // Error code Code int64 `thrift:"code,1" form:"code" json:"code"` - // 错误消息 + // error message Msg string `thrift:"msg,2" form:"msg" json:"msg"` Data *ListConversationData `thrift:"data,3" form:"data" json:"data"` BaseResp *base.BaseResp `thrift:"BaseResp,255" form:"BaseResp" json:"BaseResp" query:"BaseResp"` diff --git a/backend/api/model/conversation/message/message.go b/backend/api/model/conversation/message/message.go index 4a55e10a..163b8b59 100644 --- a/backend/api/model/conversation/message/message.go +++ b/backend/api/model/conversation/message/message.go @@ -3,12 +3,12 @@ package message import ( - "github.com/coze-dev/coze-studio/backend/api/model/base" - "github.com/coze-dev/coze-studio/backend/api/model/conversation/common" "database/sql" "database/sql/driver" "fmt" "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-studio/backend/api/model/base" + "github.com/coze-dev/coze-studio/backend/api/model/conversation/common" ) const ( @@ -106,21 +106,21 @@ func (p *MsgParticipantType) Value() (driver.Value, error) { return int64(*p), nil } -// follow copilot 定义的枚举 +// Enumeration following copilot definition type ChatMessageMetaType int64 const ( // Compatible value ChatMessageMetaType_Default_0 ChatMessageMetaType = 0 - // 端侧直接替换 + // End-to-side direct replacement ChatMessageMetaType_Replaceable ChatMessageMetaType = 1 - // 插入引用 + // insert reference ChatMessageMetaType_Insertable ChatMessageMetaType = 2 - // 文档引用 + // document citation ChatMessageMetaType_DocumentRef ChatMessageMetaType = 3 - // 知识库引用卡片 + // Knowledge Base Reference Card ChatMessageMetaType_KnowledgeCard ChatMessageMetaType = 4 - // 嵌入的多媒体信息,只是alice给端上用的,因为全链路复用这一个字段,所以在这儿改了 + // The embedded multimedia information is only used by Alice for the end. Because full link multiplexing uses this field, it has been changed here. ChatMessageMetaType_EmbeddedMultimedia ChatMessageMetaType = 100 ) @@ -196,9 +196,9 @@ type ExtraInfo struct { NewSectionID string `thrift:"new_section_id,17" form:"new_section_id" json:"new_section_id" query:"new_section_id"` RemoveQueryID string `thrift:"remove_query_id,18" form:"remove_query_id" json:"remove_query_id" query:"remove_query_id"` ExecuteDisplayName string `thrift:"execute_display_name,19" form:"execute_display_name" json:"execute_display_name" query:"execute_display_name"` - // 对应定时任务task_type,1-预设任务,2-用户任务,3-Plugin后台任务 + // Corresponding to timed task task_type, 1-preset task, 2-user task, 3-Plugin background task TaskType string `thrift:"task_type,20" form:"task_type" json:"task_type" query:"task_type"` - //agent app使用引用格式 + //Agent app uses reference format ReferFormat string `thrift:"refer_format,21" form:"refer_format" json:"refer_format" query:"refer_format"` CallID string `thrift:"call_id,22" form:"call_id" json:"call_id" query:"call_id"` } @@ -1273,9 +1273,9 @@ type MsgParticipantInfo struct { UserName string `thrift:"user_name,8" form:"user_name" json:"user_name" query:"user_name"` AllowMention bool `thrift:"allow_mention,9" form:"allow_mention" json:"allow_mention" query:"allow_mention"` AccessPath string `thrift:"access_path,10" form:"access_path" json:"access_path" query:"access_path"` - // 是否被收藏 + // Is collected IsFav bool `thrift:"is_fav,11" form:"is_fav" json:"is_fav" query:"is_fav"` - // 12: shortcut_command.ShortcutStruct shortcuts //快捷指令 + // 12: shortcut_command ShortcutStruct shortcuts//Shortcuts AllowShare bool `thrift:"allow_share,13" form:"allow_share" json:"allow_share" query:"allow_share"` } @@ -2251,7 +2251,7 @@ func (p *SubmitToolOutputs) String() string { } -// 和 bot_connector_platform保持同步 +// Keep up with bot_connector_platform type RequiredAction struct { Type string `thrift:"type,1" form:"type" json:"type" query:"type"` SubmitToolOutputs *SubmitToolOutputs `thrift:"submit_tool_outputs,2" form:"submit_tool_outputs" json:"submit_tool_outputs" query:"submit_tool_outputs"` @@ -2635,25 +2635,25 @@ type ChatMessage struct { ReplyID string `thrift:"reply_id,6" form:"reply_id" json:"reply_id" query:"reply_id"` SectionID string `thrift:"section_id,7" form:"section_id" json:"section_id" query:"section_id"` ExtraInfo *ExtraInfo `thrift:"extra_info,8" form:"extra_info" json:"extra_info" query:"extra_info"` - // 正常、打断状态 拉消息列表时使用,chat运行时没有这个字段 + // Normal, interrupted state, used when pulling the message list, this field is not available when chat is running. Status string `thrift:"status,9" form:"status" json:"status" query:"status"` - // 打断位置 + // interrupt position BrokenPos *int32 `thrift:"broken_pos,10,optional" form:"broken_pos" json:"broken_pos,omitempty" query:"broken_pos"` SenderID *string `thrift:"sender_id,11,optional" form:"sender_id" json:"sender_id,omitempty" query:"sender_id"` MentionList []*MsgParticipantInfo `thrift:"mention_list,12,optional" form:"mention_list" json:"mention_list,omitempty" query:"mention_list"` ContentTime int64 `thrift:"content_time,13" form:"content_time" json:"content_time" query:"content_time"` MessageIndex int64 `thrift:"message_index,14" json:"message_index,string" form:"message_index" query:"message_index"` - // 消息来源,0 普通聊天消息,1 定时任务,2 通知,3 异步结果 + // Sources, 0 normal chat messages, 1 scheduled task, 2 notifications, 3 asynchronous results Source int32 `thrift:"source,15" form:"source" json:"source" query:"source"` - // 对应回复的query 找不到后端加一个兜底的 + // Corresponding to the replied query, the backend cannot be found, and a backend is added. ReplyMessage *ChatMessage `thrift:"reply_message,16,optional" form:"reply_message" json:"reply_message,omitempty" query:"reply_message"` - // 打断信息 + // interrupt message RequiredAction *RequiredAction `thrift:"required_action,17,optional" form:"required_action" json:"required_action,omitempty" query:"required_action"` - // 引用、高亮等文本标记 + // Text markup such as quoting, highlighting, etc MetaInfos []*ChatMessageMetaInfo `thrift:"meta_infos,18,optional" form:"meta_infos" json:"meta_infos,omitempty" query:"meta_infos"` - // 卡片状态 + // Card Status CardStatus map[string]string `thrift:"card_status,19,optional" form:"card_status" json:"card_status,omitempty" query:"card_status"` - //模型思维链 + //Model Thinking Chain ReasoningContent *string `thrift:"reasoning_content,20,optional" form:"reasoning_content" json:"reasoning_content,omitempty" query:"reasoning_content"` } @@ -3787,22 +3787,22 @@ func (p *ChatMessage) String() string { type GetMessageListRequest struct { ConversationID string `thrift:"conversation_id,1" form:"conversation_id" json:"conversation_id" query:"conversation_id"` - // 首次传0/-1,0-最后一页,-1-未读第一页 + // First pass 0/-1, 0 - last page, -1 - unread first page Cursor string `thrift:"cursor,2,required" form:"cursor,required" json:"cursor,required" query:"cursor,required"` Count int32 `thrift:"count,3,required" form:"count,required" json:"count,required" query:"count,required"` BotID string `thrift:"bot_id,4" form:"bot_id" json:"bot_id" query:"bot_id"` DraftMode *bool `thrift:"draft_mode,5,optional" form:"draft_mode" json:"draft_mode,omitempty" query:"draft_mode"` - // 使用的bot模版 + // The bot template used PresetBot *string `thrift:"preset_bot,6,optional" form:"preset_bot" json:"preset_bot,omitempty" query:"preset_bot"` Scene *common.Scene `thrift:"scene,7,optional" form:"scene" json:"scene,omitempty" query:"scene"` - // 同一个bot和uid下面的不同业务情况 + // Different business situations under the same bot and uid BizKind *string `thrift:"biz_kind,8,optional" form:"biz_kind" json:"biz_kind,omitempty" query:"biz_kind"` - // 存在创建聊天记录前需要插入聊天的情况 + // There are situations where you need to insert a chat before creating a chat history InsertHistoryMessageList []string `thrift:"insert_history_message_list,9,optional" form:"insert_history_message_list" json:"insert_history_message_list,omitempty" query:"insert_history_message_list"` LoadDirection *LoadDirection `thrift:"load_direction,10,optional" form:"load_direction" json:"load_direction,omitempty" query:"load_direction"` - // 在已有conversation情况下,是否强制append message + // Whether to force an appended message in an existing conversation MustAppend *bool `thrift:"must_append,11,optional" form:"must_append" json:"must_append,omitempty" query:"must_append"` - // 分享ID + // Share ID ShareID *int64 `thrift:"share_id,12,optional" json:"share_id,string" form:"share_id" query:"share_id"` } @@ -4552,22 +4552,22 @@ func (p *GetMessageListRequest) String() string { type GetMessageListResponse struct { MessageList []*ChatMessage `thrift:"message_list,1,required" form:"message_list,required" json:"message_list,required" query:"message_list,required"` - // 下一刷存在时的位置(向上翻页),与next_cursor翻页方向相反。兼容旧逻辑,不加prev前缀 + // The position when the next brush exists (page up), opposite to the next_cursor page turning direction. Compatible with old logic, no prev prefix Cursor string `thrift:"cursor,2,required" form:"cursor,required" json:"cursor,required" query:"cursor,required"` - // 下一刷是否存在(向上翻页),与next_has_more翻页方向相反。兼容旧逻辑,不加prev前缀 + // Whether the next swipe exists (page up), the opposite direction to the next_has_more page turning. Compatible with old logic, without prev prefix Hasmore bool `thrift:"hasmore,3,required" form:"hasmore,required" json:"hasmore,required" query:"hasmore,required"` ConversationID string `thrift:"conversation_id,4,required" form:"conversation_id,required" json:"conversation_id,required" query:"conversation_id,required"` - // 会话最新的section_id 只有第一刷返回 + // Session Latest section_id Only First Brush Back LastSectionID *string `thrift:"last_section_id,5,optional" form:"last_section_id" json:"last_section_id,omitempty" query:"last_section_id"` Code int64 `thrift:"code,6" form:"code" json:"code" query:"code"` Msg string `thrift:"msg,7" form:"msg" json:"msg" query:"msg"` ParticipantInfoMap map[string]*MsgParticipantInfo `thrift:"participant_info_map,8,optional" form:"participant_info_map" json:"participant_info_map,omitempty" query:"participant_info_map"` - // 下一刷存在时的位置(向下翻页), + // The position when the next swipe exists (page down), NextCursor string `thrift:"next_cursor,9" form:"next_cursor" json:"next_cursor" query:"next_cursor"` - // 下一刷是否存在(向下翻页) + // Does the next swipe exist (page down) NextHasMore bool `thrift:"next_has_more,10" form:"next_has_more" json:"next_has_more" query:"next_has_more"` ReadMessageIndex int64 `thrift:"read_message_index,11" json:"read_message_index,string" form:"read_message_index" query:"read_message_index"` - //botconnector对应的id + //ID for botconnector ConnectorConversationID string `thrift:"connector_conversation_id,12" form:"connector_conversation_id" json:"connector_conversation_id" query:"connector_conversation_id"` } @@ -5787,13 +5787,13 @@ func (p *DeleteMessageResponse) String() string { } type BreakMessageRequest struct { - //会话id + //session id ConversationID int64 `thrift:"conversation_id,1,required" form:"conversation_id,required" json:"conversation_id,string,required" query:"conversation_id,required"` - // 当前问题id + // Current issue id QueryMessageID int64 `thrift:"query_message_id,2,required" form:"query_message_id,required" json:"query_message_id,string,required" query:"query_message_id,required"` - // 当前问题下哪一条回复被打断了 + // Which reply was interrupted under the current question? AnswerMessageID *int64 `thrift:"answer_message_id,3,optional" form:"answer_message_id" json:"answer_message_id,string,omitempty" query:"answer_message_id"` - // 打断位置 + // interrupt position BrokenPos *int32 `thrift:"broken_pos,4,optional" form:"broken_pos" json:"broken_pos,omitempty" query:"broken_pos"` Scene *common.Scene `thrift:"scene,5,optional" form:"scene" json:"scene,omitempty" query:"scene"` } @@ -6342,19 +6342,19 @@ func (p *BreakMessageResponse) String() string { } -// 批量查询 +// batch query type ListMessageApiRequest struct { - //会话id + //session id ConversationID int64 `thrift:"conversation_id,1,required" json:"conversation_id,string,required" query:"conversation_id,required"` - // 限制条数 + // limit number of entries Limit *int64 `thrift:"limit,2,optional" form:"limit" json:"limit,omitempty"` - // 排序方式 desc/asc + // Sort by desc/asc Order *string `thrift:"order,3,optional" form:"order" json:"order,omitempty"` - //一次对话的id + //ID of a conversation ChatID *int64 `thrift:"chat_id,4,optional" form:"chat_id" json:"chat_id,string,omitempty"` - // 向前翻页需要传的ID + // The ID you need to pass to turn the page forward. BeforeID *int64 `thrift:"before_id,5,optional" form:"before_id" json:"before_id,string,omitempty"` - // 向后返回需要传的ID + // Return the ID to be passed backwards. AfterID *int64 `thrift:"after_id,6,optional" form:"after_id" json:"after_id,string,omitempty"` Base *base.Base `thrift:"Base,255" form:"Base" json:"Base" query:"Base"` } @@ -6828,31 +6828,31 @@ func (p *ListMessageApiRequest) String() string { } type OpenMessageApi struct { - // 主键ID + // primary key ID ID int64 `thrift:"id,1" form:"id" json:"id,string" query:"id"` // agent id BotID int64 `thrift:"bot_id,2" form:"bot_id" json:"bot_id,string" query:"bot_id"` // user / assistant/tool Role string `thrift:"role,3" form:"role" json:"role" query:"role"` - //消息内容 + //message content Content string `thrift:"content,4" form:"content" json:"content" query:"content"` - //会话id + //session id ConversationID int64 `thrift:"conversation_id,5" form:"conversation_id" json:"conversation_id" query:"conversation_id"` - // 自定义字段 + // custom field MetaData map[string]string `thrift:"meta_data,6" form:"meta_data" json:"meta_data" query:"meta_data"` - //创建时间 + //creation time CreatedAt int64 `thrift:"created_at,7" form:"created_at" json:"created_at" query:"created_at"` - //更新时间 + //update time UpdatedAt int64 `thrift:"updated_at,8" form:"updated_at" json:"updated_at" query:"updated_at"` - // 一次对话的id + // ID of a conversation ChatID int64 `thrift:"chat_id,9" form:"chat_id" json:"chat_id" query:"chat_id"` - // content 类型 ,text/mix + // Content type, text/mix ContentType string `thrift:"content_type,10" form:"content_type" json:"content_type" query:"content_type"` - //消息类型 answer/question/function_call/tool_response + //Message Type answer/question/function_call/tool_response Type string `thrift:"type,11" form:"type" json:"type" query:"type"` - // 会话的section_id + // The section_id of conversation SectionID string `thrift:"section_id,12" form:"section_id" json:"section_id" query:"section_id"` - //模型思维链 + //Model Thinking Chain ReasoningContent *string `thrift:"reasoning_content,13,optional" form:"reasoning_content" json:"reasoning_content,omitempty" query:"reasoning_content"` } @@ -7561,11 +7561,11 @@ func (p *OpenMessageApi) String() string { type ListMessageApiResponse struct { Messages []*OpenMessageApi `thrift:"messages,1,optional" form:"data" json:"data,omitempty"` - // 是否还有数据,true 有,false 没有 + // Is there still data, true yes, false no HasMore *bool `thrift:"has_more,2,optional" form:"has_more" json:"has_more,omitempty"` - // 第一条数据的id + // The ID of the first piece of data FirstID *int64 `thrift:"first_id,3,optional" form:"first_id" json:"first_id,string,omitempty"` - // 最后一条数据的id + // The id of the last piece of data. LastID *int64 `thrift:"last_id,4,optional" form:"last_id" json:"last_id,string,omitempty"` } diff --git a/backend/api/model/conversation/run/run.go b/backend/api/model/conversation/run/run.go index 190ae552..3c540136 100644 --- a/backend/api/model/conversation/run/run.go +++ b/backend/api/model/conversation/run/run.go @@ -3,12 +3,12 @@ package run import ( - "github.com/coze-dev/coze-studio/backend/api/model/conversation/common" - "github.com/coze-dev/coze-studio/backend/api/model/conversation/message" "database/sql" "database/sql/driver" "fmt" "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-studio/backend/api/model/conversation/common" + "github.com/coze-dev/coze-studio/backend/api/model/conversation/message" ) const ( @@ -2133,23 +2133,23 @@ func (p *AdditionalContent) String() string { type AgentRunRequest struct { //agent id BotID int64 `thrift:"bot_id,1" form:"bot_id" json:"bot_id,string" query:"bot_id"` - // 会话id + // session id ConversationID int64 `thrift:"conversation_id,2,required" form:"conversation_id,required" json:"conversation_id,string,required" query:"conversation_id,required"` Query string `thrift:"query,5,required" form:"query,required" json:"query,required" query:"query,required"` - // ext 透传字段 + // ext pass-through field Extra map[string]string `thrift:"extra,7" form:"extra" json:"extra" query:"extra"` CustomVariables map[string]string `thrift:"custom_variables,9" form:"custom_variables" json:"custom_variables" query:"custom_variables"` - // 草稿bot or 线上bot + // Draft bot or online bot DraftMode *bool `thrift:"draft_mode,10,optional" form:"draft_mode" json:"draft_mode,omitempty" query:"draft_mode"` - // explore场景 + // Explore the scene Scene *common.Scene `thrift:"scene,11,optional" form:"scene" json:"scene,omitempty" query:"scene"` - // 文件 file 图片 image 等 + // Files files pictures images etc ContentType *string `thrift:"content_type,12,optional" form:"content_type" json:"content_type,omitempty" query:"content_type"` - // 重试消息id + // Retry message id RegenMessageID *int64 `thrift:"regen_message_id,13,optional" form:"regen_message_id" json:"regen_message_id,string,omitempty" query:"regen_message_id"` - // 前端本地的message_id 在extra_info 里面透传返回 + // The local message_id on the front end is passed back in the extra_info LocalMessageID *string `thrift:"local_message_id,14,optional" form:"local_message_id" json:"local_message_id,omitempty" query:"local_message_id"` - // 使用的bot模版 代替bot_id bot_version draft_mode参数, coze home使用 preset_bot="coze_home" + // The bot template used, instead of bot_id bot_version draft_mode parameters, coze home uses preset_bot = "coze_home" PresetBot *string `thrift:"preset_bot,15,optional" form:"preset_bot" json:"preset_bot,omitempty" query:"preset_bot"` InsertHistoryMessageList []string `thrift:"insert_history_message_list,16,optional" form:"insert_history_message_list" json:"insert_history_message_list,omitempty" query:"insert_history_message_list"` DeviceID *string `thrift:"device_id,17,optional" form:"device_id" json:"device_id,omitempty" query:"device_id"` @@ -2157,9 +2157,9 @@ type AgentRunRequest struct { MentionList []*message.MsgParticipantInfo `thrift:"mention_list,19,optional" form:"mention_list" json:"mention_list,omitempty" query:"mention_list"` ToolList []*Tool `thrift:"toolList,20,optional" form:"toolList" json:"toolList,omitempty" query:"toolList"` CommitVersion *string `thrift:"commit_version,21,optional" form:"commit_version" json:"commit_version,omitempty" query:"commit_version"` - // scene粒度下进一步区分场景,目前仅给bot模版使用 = bot_template + // Scene granularity further distinguish scenes, currently only used for bot templates = bot_template SubScene *string `thrift:"sub_scene,22,optional" form:"sub_scene" json:"sub_scene,omitempty" query:"sub_scene"` - // diff模式下的聊天配置,仅草稿single bot + // Chat configuration in diff mode, draft only single bot DiffModeIdentifier *DiffModeIdentifier `thrift:"diff_mode_identifier,23,optional" form:"diff_mode_identifier" json:"diff_mode_identifier,omitempty" query:"diff_mode_identifier"` ShortcutCmdID *int64 `thrift:"shortcut_cmd_id,24,optional" form:"shortcut_cmd_id" json:"shortcut_cmd_id,string,omitempty" query:"shortcut_cmd_id"` } @@ -4726,7 +4726,7 @@ func (p *BotConfig) String() string { type ShortcutCommandDetail struct { CommandID int64 `thrift:"command_id,1,required" form:"command_id,required" json:"command_id,string,required" query:"command_id,required"` - // key=参数名 value=值 object_string object 数组序列化之后的 JSON String + // Key = parameter name value = value object_string JSON String after object array serialization Parameters map[string]string `thrift:"parameters,2" form:"parameters" json:"parameters" query:"parameters"` } @@ -4951,21 +4951,21 @@ type ChatV3Request struct { BotID int64 `thrift:"BotID,1,required" form:"bot_id,required" json:"bot_id,string,required"` //conversation_id ConversationID *int64 `thrift:"ConversationID,2,optional" json:"ConversationID,string,omitempty" query:"conversation_id"` - //user_id,数据隔离标识,需要保证唯一 + //user_id, data isolation identification, need to ensure unique User string `thrift:"User,3,required" form:"user_id,required" json:"user_id,required"` - //是否流式,当前仅支持流失 + //Whether to stream, currently only supports churn. Stream *bool `thrift:"Stream,4,optional" form:"stream" json:"stream,omitempty"` - //本次对话消息,当前仅支持role=user + //In this conversation message, only role = user is currently supported. AdditionalMessages []*EnterMessage `thrift:"AdditionalMessages,5,optional" form:"additional_messages" json:"additional_messages,omitempty"` - //用户自定义变量 + //user-defined variables CustomVariables map[string]string `thrift:"CustomVariables,6,optional" form:"custom_variables" json:"custom_variables,omitempty"` MetaData map[string]string `thrift:"MetaData,8,optional" form:"meta_data" json:"meta_data,omitempty"` CustomConfig *CustomConfig `thrift:"CustomConfig,10,optional" form:"custom_config" json:"custom_config,omitempty"` - // 透传参数到 plugin/workflow 等下游 + // Pass parameters to plugin/workflow etc downstream ExtraParams map[string]string `thrift:"ExtraParams,11,optional" form:"extra_params" json:"extra_params,omitempty"` - // 手动指定渠道 id 聊天。目前仅支持 websdk(=999) + // Manually specify channel id chat. Currently only supports websdk (= 999) ConnectorID *int64 `thrift:"ConnectorID,12,optional" form:"connector_id" json:"connector_id,string,omitempty"` - // 指定快捷指令 + // Specify shortcut instructions ShortcutCommand *ShortcutCommandDetail `thrift:"ShortcutCommand,13,optional" form:"shortcut_command" json:"shortcut_command,omitempty"` } @@ -6582,7 +6582,7 @@ func (p *ChatV3MessageDetail) String() string { type EnterMessage struct { // user / assistant Role string `thrift:"Role,1" form:"role" json:"role"` - // 如果是非 text,需要解析 JSON + // If it is not text, you need to parse JSON. Content string `thrift:"Content,2" form:"content" json:"content"` MetaData map[string]string `thrift:"MetaData,3" form:"meta_data" json:"meta_data"` // text, card, object_string diff --git a/backend/api/model/crossdomain/knowledge/knowledge.go b/backend/api/model/crossdomain/knowledge/knowledge.go index 4672af39..5c8789cb 100644 --- a/backend/api/model/crossdomain/knowledge/knowledge.go +++ b/backend/api/model/crossdomain/knowledge/knowledge.go @@ -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 } diff --git a/backend/api/model/crossdomain/plugin/openai.go b/backend/api/model/crossdomain/plugin/openai.go index 2f491011..f4c03b03 100644 --- a/backend/api/model/crossdomain/plugin/openai.go +++ b/backend/api/model/crossdomain/plugin/openai.go @@ -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, diff --git a/backend/api/model/crossdomain/plugin/plugin_manifest.go b/backend/api/model/crossdomain/plugin/plugin_manifest.go index c8380521..766b1e26 100644 --- a/backend/api/model/crossdomain/plugin/plugin_manifest.go +++ b/backend/api/model/crossdomain/plugin/plugin_manifest.go @@ -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 } diff --git a/backend/api/model/crossdomain/plugin/toolinfo.go b/backend/api/model/crossdomain/plugin/toolinfo.go index 8377c6cd..f78def7c 100644 --- a/backend/api/model/crossdomain/plugin/toolinfo.go +++ b/backend/api/model/crossdomain/plugin/toolinfo.go @@ -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 diff --git a/backend/api/model/crossdomain/search/resource_doc.go b/backend/api/model/crossdomain/search/resource_doc.go index 75b388b0..0c6c4249 100644 --- a/backend/api/model/crossdomain/search/resource_doc.go +++ b/backend/api/model/crossdomain/search/resource_doc.go @@ -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 diff --git a/backend/api/model/database/database.go b/backend/api/model/database/database.go index 8e02b862..cff55612 100644 --- a/backend/api/model/database/database.go +++ b/backend/api/model/database/database.go @@ -3,11 +3,11 @@ package database import ( - "github.com/coze-dev/coze-studio/backend/api/model/knowledge/document" - "github.com/coze-dev/coze-studio/backend/api/model/table" "context" "fmt" "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-studio/backend/api/model/knowledge/document" + "github.com/coze-dev/coze-studio/backend/api/model/table" ) type DatabaseService interface { diff --git a/backend/api/model/developer/connector/connector.go b/backend/api/model/developer/connector/connector.go index 04516f55..3587e590 100644 --- a/backend/api/model/developer/connector/connector.go +++ b/backend/api/model/developer/connector/connector.go @@ -13,15 +13,15 @@ import ( type ConfigStatus int64 const ( - // 已配置 + // Configured ConfigStatus_Configured ConfigStatus = 1 - // 未配置 + // Not configured ConfigStatus_NotConfigured ConfigStatus = 2 - // Token发生变化 + // Token changes ConfigStatus_Disconnected ConfigStatus = 3 - // 配置中,授权中 + // Configuring, authorizing ConfigStatus_Configuring ConfigStatus = 4 - // 需要重新配置 https://bytedance.larkoffice.com/docx/KXNed5NWUoplVBxXdQxcfPNwnrf#Gn7dd2KoaoNZo6xw1tkcT92znbG + // Need to reconfigure https://bytedance.larkoffice.com/docx/KXNed5NWUoplVBxXdQxcfPNwnrf#Gn7dd2KoaoNZo6xw1tkcT92znbG ConfigStatus_NeedReconfiguring ConfigStatus = 5 ) @@ -75,19 +75,19 @@ func (p *ConfigStatus) Value() (driver.Value, error) { type BindType int64 const ( - // 无需绑定 + // No binding required BindType_NoBindRequired BindType = 1 - // Auth绑定 + // Auth binding BindType_AuthBind BindType = 2 - // Kv绑定= + // Kv binding = BindType_KvBind BindType = 3 - // Kv并Auth授权 + // Kv and Auth authorization BindType_KvAuthBind BindType = 4 - // api渠道绑定 + // API channel binding BindType_ApiBind BindType = 5 BindType_WebSDKBind BindType = 6 BindType_StoreBind BindType = 7 - // 授权和配置各一个按钮 + // One button each for authorization and configuration BindType_AuthAndConfig BindType = 8 ) @@ -195,11 +195,11 @@ func (p *AllowPublishStatus) Value() (driver.Value, error) { type BotConnectorStatus int64 const ( - // 正常 + // Normal BotConnectorStatus_Normal BotConnectorStatus = 0 - // 审核中 + // Under review. BotConnectorStatus_InReview BotConnectorStatus = 1 - // 已下线 + // offline BotConnectorStatus_Offline BotConnectorStatus = 2 ) @@ -245,11 +245,11 @@ func (p *BotConnectorStatus) Value() (driver.Value, error) { type UserAuthStatus int64 const ( - // 已授权 + // Authorized UserAuthStatus_Authorized UserAuthStatus = 1 - // 未授权 + // unauthorized UserAuthStatus_UnAuthorized UserAuthStatus = 2 - // 授权中 + // Authorizing UserAuthStatus_Authorizing UserAuthStatus = 3 ) @@ -1002,49 +1002,49 @@ func (p *PublishConnectorListRequest) String() string { } type PublishConnectorInfo struct { - // 发布平台 connector_id + // Publishing Platform connector_id ID string `thrift:"id,1,required" form:"id,required" json:"id,required" query:"id,required"` - // 发布平台名称 + // publishing platform name Name string `thrift:"name,2,required" form:"name,required" json:"name,required" query:"name,required"` - // 发布平台图标 + // publishing platform icon Icon string `thrift:"icon,3,required" form:"icon,required" json:"icon,required" query:"icon,required"` - // 发布平台描述 + // Publish Platform Description Desc string `thrift:"desc,4,required" form:"desc,required" json:"desc,required" query:"desc,required"` - // 分享链接 + // share link ShareLink string `thrift:"share_link,5,required" form:"share_link,required" json:"share_link,required" query:"share_link,required"` - // 配置状态 1:已绑定 2:未绑定 + // Configuration Status 1: Bound 2: Unbound ConfigStatus ConfigStatus `thrift:"config_status,6,required" form:"config_status,required" json:"config_status,required" query:"config_status,required"` - // 最近发布时间 + // Last Post LastPublishTime int64 `thrift:"last_publish_time,7,required" form:"last_publish_time,required" json:"last_publish_time,required" query:"last_publish_time,required"` - // 绑定类型 1:无需绑定 2:Auth 3: kv值 + // Binding type 1: No binding required 2: Auth 3: kv value BindType BindType `thrift:"bind_type,8,required" form:"bind_type,required" json:"bind_type,required" query:"bind_type,required"` - // 绑定信息 key字段名 value是值 + // Binding information key field name value is value BindInfo map[string]string `thrift:"bind_info,9,required" form:"bind_info,required" json:"bind_info,required" query:"bind_info,required"` - // 绑定id信息,用于解绑使用 + // Bind id information for unbinding and use BindID *string `thrift:"bind_id,10,optional" form:"bind_id" json:"bind_id,omitempty" query:"bind_id"` - // 用户授权登陆信息 + // user authorization login information AuthLoginInfo *AuthLoginInfo `thrift:"auth_login_info,11,optional" form:"auth_login_info" json:"auth_login_info,omitempty" query:"auth_login_info"` - // 是否为上次发布 + // Is it the last release? IsLastPublished *bool `thrift:"is_last_published,12,optional" form:"is_last_published" json:"is_last_published,omitempty" query:"is_last_published"` - // bot渠道状态 + // bot channel status ConnectorStatus *BotConnectorStatus `thrift:"connector_status,13,optional" form:"connector_status" json:"connector_status,omitempty" query:"connector_status"` - // 隐私政策 + // Privacy Policy PrivacyPolicy *string `thrift:"privacy_policy,14,optional" form:"privacy_policy" json:"privacy_policy,omitempty" query:"privacy_policy"` - // 用户协议 + // User Agreement UserAgreement *string `thrift:"user_agreement,15,optional" form:"user_agreement" json:"user_agreement,omitempty" query:"user_agreement"` - // 渠道是否允许发布 + // Is the channel allowed to publish? AllowPunish *AllowPublishStatus `thrift:"allow_punish,16,optional" form:"allow_punish" json:"allow_punish,omitempty" query:"allow_punish"` - // 不允许发布原因 + // Reason for not allowing posting NotAllowReason *string `thrift:"not_allow_reason,17,optional" form:"not_allow_reason" json:"not_allow_reason,omitempty" query:"not_allow_reason"` - // 配置状态toast + // Configuration status toast ConfigStatusToast *string `thrift:"config_status_toast,18,optional" form:"config_status_toast" json:"config_status_toast,omitempty" query:"config_status_toast"` - // 品牌 ID + // Brand ID BrandID *int64 `thrift:"brand_id,19,optional" form:"brand_id" json:"brand_id,omitempty" query:"brand_id"` - // 支持商业化 + // Support commercialization SupportMonetization *bool `thrift:"support_monetization,20,optional" form:"support_monetization" json:"support_monetization,omitempty" query:"support_monetization"` - // 1: 已授权,2:未授权. 目前仅 bind_type == 8 时这个字段才有 https://bytedance.larkoffice.com/docx/KXNed5NWUoplVBxXdQxcfPNwnrf#Gn7dd2KoaoNZo6xw1tkcT92znbG + // 1: Authorized, 2: Unauthorized. Currently, this field is only available bind_type == 8 https://bytedance.larkoffice.com/docx/KXNed5NWUoplVBxXdQxcfPNwnrf#Gn7dd2KoaoNZo6xw1tkcT92znbG AuthStatus *UserAuthStatus `thrift:"auth_status,21,optional" form:"auth_status" json:"auth_status,omitempty" query:"auth_status"` - // 补全信息按钮的 url + // URL of the complete info button ToCompleteInfoURL *string `thrift:"to_complete_info_url,22,optional" form:"to_complete_info_url" json:"to_complete_info_url,omitempty" query:"to_complete_info_url"` } @@ -2344,7 +2344,7 @@ func (p *PublishConnectorInfo) String() string { } type SubmitBotMarketOption struct { - // 是否可以公开编排 + // Is it possible to publicly orchestrate? CanOpenSource *bool `thrift:"can_open_source,1,optional" form:"can_open_source" json:"can_open_source,omitempty" query:"can_open_source"` } @@ -2495,11 +2495,11 @@ func (p *SubmitBotMarketOption) String() string { } type SubmitBotMarketConfig struct { - // 是否发布到market + // Whether to publish to the market NeedSubmit *bool `thrift:"need_submit,1,optional" form:"need_submit" json:"need_submit,omitempty" query:"need_submit"` - // 是否开源 + // Is it open source? OpenSource *bool `thrift:"open_source,2,optional" form:"open_source" json:"open_source,omitempty" query:"open_source"` - // 分类 + // classification CategoryID *string `thrift:"category_id,3,optional" form:"category_id" json:"category_id,omitempty" query:"category_id"` } @@ -3011,7 +3011,7 @@ func (p *ConnectorBrandInfo) String() string { } type PublishTips struct { - // 成本承担提醒 + // cost-bearing reminder CostTips *string `thrift:"cost_tips,1,optional" form:"cost_tips" json:"cost_tips,omitempty" query:"cost_tips"` } @@ -3166,11 +3166,11 @@ type PublishConnectorListResponse struct { Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` PublishConnectorList []*PublishConnectorInfo `thrift:"publish_connector_list,3" form:"publish_connector_list" json:"publish_connector_list" query:"publish_connector_list"` SubmitBotMarketOption *SubmitBotMarketOption `thrift:"submit_bot_market_option,4,optional" form:"submit_bot_market_option" json:"submit_bot_market_option,omitempty" query:"submit_bot_market_option"` - // 上次提交market的配置 + // The configuration of the last submitted market LastSubmitConfig *SubmitBotMarketConfig `thrift:"last_submit_config,5,optional" form:"last_submit_config" json:"last_submit_config,omitempty" query:"last_submit_config"` - // 渠道品牌信息 + // Channel brand information ConnectorBrandInfoMap map[int64]*ConnectorBrandInfo `thrift:"connector_brand_info_map,6" form:"connector_brand_info_map" json:"connector_brand_info_map" query:"connector_brand_info_map"` - // 发布提醒 + // post alert PublishTips *PublishTips `thrift:"publish_tips,7,optional" form:"publish_tips" json:"publish_tips,omitempty" query:"publish_tips"` } diff --git a/backend/api/model/flow/dataengine/dataset/common.go b/backend/api/model/flow/dataengine/dataset/common.go index 81e72236..32589ad6 100644 --- a/backend/api/model/flow/dataengine/dataset/common.go +++ b/backend/api/model/flow/dataengine/dataset/common.go @@ -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"` } diff --git a/backend/api/model/flow/dataengine/dataset/dataset.go b/backend/api/model/flow/dataengine/dataset/dataset.go index f2323c7c..6ff350d3 100644 --- a/backend/api/model/flow/dataengine/dataset/dataset.go +++ b/backend/api/model/flow/dataengine/dataset/dataset.go @@ -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"` diff --git a/backend/api/model/flow/dataengine/dataset/document.go b/backend/api/model/flow/dataengine/dataset/document.go index 1063a904..d1279a69 100644 --- a/backend/api/model/flow/dataengine/dataset/document.go +++ b/backend/api/model/flow/dataengine/dataset/document.go @@ -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> + // 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"` diff --git a/backend/api/model/flow/dataengine/dataset/flow_dataengine_dataset.go b/backend/api/model/flow/dataengine/dataset/flow_dataengine_dataset.go index 3ef60145..7b23e295 100644 --- a/backend/api/model/flow/dataengine/dataset/flow_dataengine_dataset.go +++ b/backend/api/model/flow/dataengine/dataset/flow_dataengine_dataset.go @@ -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) diff --git a/backend/api/model/flow/dataengine/dataset/review.go b/backend/api/model/flow/dataengine/dataset/review.go index 1fb87fb9..59b2c849 100644 --- a/backend/api/model/flow/dataengine/dataset/review.go +++ b/backend/api/model/flow/dataengine/dataset/review.go @@ -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"` diff --git a/backend/api/model/flow/dataengine/dataset/slice.go b/backend/api/model/flow/dataengine/dataset/slice.go index 3e92a0f2..2329b933 100644 --- a/backend/api/model/flow/dataengine/dataset/slice.go +++ b/backend/api/model/flow/dataengine/dataset/slice.go @@ -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"` } diff --git a/backend/api/model/flow/devops/debugger/coze/flow.devops.debugger.coze.go b/backend/api/model/flow/devops/debugger/coze/flow.devops.debugger.coze.go index b7892eb7..adcae866 100644 --- a/backend/api/model/flow/devops/debugger/coze/flow.devops.debugger.coze.go +++ b/backend/api/model/flow/devops/debugger/coze/flow.devops.debugger.coze.go @@ -3,19 +3,19 @@ package coze import ( + "fmt" + "github.com/apache/thrift/lib/go/thrift" "github.com/coze-dev/coze-studio/backend/api/model/base" "github.com/coze-dev/coze-studio/backend/api/model/flow/devops/debugger/domain/infra" "github.com/coze-dev/coze-studio/backend/api/model/flow/devops/debugger/domain/testcase" - "fmt" - "github.com/apache/thrift/lib/go/thrift" ) // ========== TestCase =========== // type SaveCaseDataReq struct { - // 业务信息 + // business information BizCtx *infra.BizCtx `thrift:"bizCtx,1,optional" form:"bizCtx" json:"bizCtx,omitempty" query:"bizCtx"` BizComponentSubject *infra.ComponentSubject `thrift:"bizComponentSubject,2,optional" form:"bizComponentSubject" json:"bizComponentSubject,omitempty" query:"bizComponentSubject"` - // case基本数据 + // Case basic data CaseBase *testcase.CaseDataBase `thrift:"caseBase,3,optional" form:"caseBase" json:"caseBase,omitempty" query:"caseBase"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -632,9 +632,9 @@ func (p *SaveCaseDataResp) String() string { } type DeleteCaseDataReq struct { - // 业务信息 + // business information BizCtx *infra.BizCtx `thrift:"bizCtx,1,optional" form:"bizCtx" json:"bizCtx,omitempty" query:"bizCtx"` - // 单次上限20个 + // A single maximum of 20 CaseIDs []int64 `thrift:"caseIDs,2,optional" form:"caseIDs" json:"caseIDs,omitempty" query:"caseIDs"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -1246,7 +1246,7 @@ func (p *DeleteCaseDataResp) String() string { type CheckCaseDuplicateReq struct { BizCtx *infra.BizCtx `thrift:"bizCtx,1,optional" form:"bizCtx" json:"bizCtx,omitempty" query:"bizCtx"` - // case名称 + // Case name CaseName *string `thrift:"caseName,2,optional" form:"caseName" json:"caseName,omitempty" query:"caseName"` BizComponentSubject *infra.ComponentSubject `thrift:"bizComponentSubject,3,optional" form:"bizComponentSubject" json:"bizComponentSubject,omitempty" query:"bizComponentSubject"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` @@ -1556,7 +1556,7 @@ func (p *CheckCaseDuplicateReq) String() string { type CheckCaseDuplicateResp struct { IsPass *bool `thrift:"isPass,1,optional" form:"isPass" json:"isPass,omitempty" query:"isPass"` - // 当pass=false时,给出具体的校验不通过的原因 + // When pass = false, give the specific reason why the check failed FailReason *string `thrift:"failReason,2,optional" form:"failReason" json:"failReason,omitempty" query:"failReason"` FailCode *int32 `thrift:"failCode,3,optional" form:"failCode" json:"failCode,omitempty" query:"failCode"` Code *int32 `thrift:"code,253,optional" form:"code" json:"code,omitempty" query:"code"` @@ -1983,7 +1983,7 @@ func (p *CheckCaseDuplicateResp) String() string { } type GetSchemaByIDReq struct { - // 业务信息 + // business information BizCtx *infra.BizCtx `thrift:"bizCtx,1,optional" form:"bizCtx" json:"bizCtx,omitempty" query:"bizCtx"` BizComponentSubject *infra.ComponentSubject `thrift:"bizComponentSubject,2,optional" form:"bizComponentSubject" json:"bizComponentSubject,omitempty" query:"bizComponentSubject"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` @@ -2237,7 +2237,7 @@ func (p *GetSchemaByIDReq) String() string { } type GetSchemaByIDResp struct { - // Json格式的组件input信息,与Input Json Schema保持一致,不包含Value值信息 + // Component input information in JSON format, consistent with Input JSON Schema, does not contain Value information SchemaJson *string `thrift:"schemaJson,1,optional" form:"schemaJson" json:"schemaJson,omitempty" query:"schemaJson"` Code *int32 `thrift:"code,253,optional" form:"code" json:"code,omitempty" query:"code"` Msg *string `thrift:"msg,254,optional" form:"msg" json:"msg,omitempty" query:"msg"` diff --git a/backend/api/model/flow/devops/debugger/domain/infra/infra.go b/backend/api/model/flow/devops/debugger/domain/infra/infra.go index dfc1121f..0be16bf5 100644 --- a/backend/api/model/flow/devops/debugger/domain/infra/infra.go +++ b/backend/api/model/flow/devops/debugger/domain/infra/infra.go @@ -9,7 +9,7 @@ import ( "github.com/apache/thrift/lib/go/thrift" ) -// ComponentType 支持组件类型 +// ComponentType Supports component types type ComponentType int64 const ( @@ -20,23 +20,23 @@ const ( ComponentType_CozeTool ComponentType = 10001 // Coze Workflow ComponentType_CozeWorkflow ComponentType = 10002 - // Coze SubWorkflow,即在Workflow中被引用的子Workflow + // Coze SubWorkflow, which is referenced in Workflow. ComponentType_CozeSubWorkflow ComponentType = 10003 - // Coze workflow中的LLM节点 + // LLM nodes in Coze workflow ComponentType_CozeLLMNode ComponentType = 10004 - // Coze workflow中的Code节点 + // Coding nodes in a Coze workflow ComponentType_CozeCodeNode ComponentType = 10005 - // Coze workflow中的Knowledge节点 + // Knowledge nodes in Coze workflow ComponentType_CozeKnowledgeNode ComponentType = 10006 - // Coze workflow中的Tool节点 + // Tools nodes in Coze workflow ComponentType_CozeToolNode ComponentType = 10007 - // Coze workflow中的start节点 + // Coze workflow start node ComponentType_CozeStartNode ComponentType = 10008 - // Coze workflow中的variable节点 + // Cozing variable nodes in workflow ComponentType_CozeVariableNode ComponentType = 10009 - // Coze 虚拟节点用于标识 variable 依赖的bot + // Coze virtual nodes to identify variable dependent bots ComponentType_CozeVariableBot ComponentType = 20000 - // Coze 虚拟节点用于标识 variable 依赖的chat + // Coze virtual nodes to identify variable dependent chats ComponentType_CozeVariableChat ComponentType = 20001 ) @@ -119,18 +119,18 @@ func (p *ComponentType) Value() (driver.Value, error) { return int64(*p), nil } -// TrafficScene 流量请求场景 +// TrafficScene traffic request scenario type TrafficScene int64 const ( TrafficScene_Undefined TrafficScene = 0 - // 单Agent调试页 + // Single Agent Debug Page TrafficScene_CozeSingleAgentDebug TrafficScene = 10000 - // 多Agent调试页 + // Multi-Agent Debug Page TrafficScene_CozeMultiAgentDebug TrafficScene = 10001 - // Tool调试页 + // Tool Debug Page TrafficScene_CozeToolDebug TrafficScene = 10002 - // Workflow调试页 + // Workflow debugging page TrafficScene_CozeWorkflowDebug TrafficScene = 10003 ) @@ -181,7 +181,7 @@ func (p *TrafficScene) Value() (driver.Value, error) { return int64(*p), nil } -// ComponentMappingType 组件映射类型 +// ComponentMappingType Component Mapping Types type ComponentMappingType int64 const ( @@ -264,7 +264,7 @@ func (p *OrderBy) Value() (driver.Value, error) { type DebugScene int64 const ( - // 默认play ground Debug场景 + // Default play ground Debug scene DebugScene_Debug DebugScene = 0 ) @@ -302,7 +302,7 @@ func (p *DebugScene) Value() (driver.Value, error) { type CozeChannel int64 const ( - // 默认为Coze, 未来扩展到其他渠道 + // Default to Coze, expand to other channels in the future CozeChannel_Coze CozeChannel = 0 ) @@ -337,19 +337,19 @@ func (p *CozeChannel) Value() (driver.Value, error) { return int64(*p), nil } -// BizCtx 业务上下文 +// BizCtx Business Context type BizCtx struct { // connectorID ConnectorID *string `thrift:"connectorID,1,optional" form:"connectorID" json:"connectorID,omitempty" query:"connectorID"` - // connector下用户ID + // User ID under connector ConnectorUID *string `thrift:"connectorUID,2,optional" form:"connectorUID" json:"connectorUID,omitempty" query:"connectorUID"` - // 业务场景 + // business scenario TrafficScene *TrafficScene `thrift:"trafficScene,3,optional" form:"trafficScene" json:"trafficScene,omitempty" query:"trafficScene"` - // 业务场景组件ID,比如Bot调试页,则trafficSceneID为BotID + // Business Scenario Component ID, such as Bot Debug Page, where trafficSceneID is BotID TrafficCallerID *string `thrift:"trafficCallerID,4,optional" form:"trafficCallerID" json:"trafficCallerID,omitempty" query:"trafficCallerID"` - // 业务线SpaceID,用于访问控制 + // Line of business SpaceID for access control BizSpaceID *string `thrift:"bizSpaceID,5,optional" form:"bizSpaceID" json:"bizSpaceID,omitempty" query:"bizSpaceID"` - // 额外信息 + // Additional information Ext map[string]string `thrift:"ext,6,optional" form:"ext" json:"ext,omitempty" query:"ext"` } @@ -804,15 +804,15 @@ func (p *BizCtx) String() string { } -// ComponentSubject 业务组件的二级结构 +// Secondary structure of the ComponentSubject business component type ComponentSubject struct { - // 组件ID,例如Tool ID、Node ID等 + // Component IDs, such as Tool ID, Node ID, etc ComponentID *string `thrift:"componentID,1,optional" form:"componentID" json:"componentID,omitempty" query:"componentID"` - // 组件类型 + // component type ComponentType *ComponentType `thrift:"componentType,2,optional" form:"componentType" json:"componentType,omitempty" query:"componentType"` - // 父组件ID,例如Tool->Plugin, Node->Workflow + // Parent component ID, e.g. Tool- > Plugin, Node- > Workflow ParentComponentID *string `thrift:"parentComponentID,3,optional" form:"parentComponentID" json:"parentComponentID,omitempty" query:"parentComponentID"` - // 父组件类型 + // Parent component type ParentComponentType *ComponentType `thrift:"parentComponentType,4,optional" form:"parentComponentType" json:"parentComponentType,omitempty" query:"parentComponentType"` } diff --git a/backend/api/model/flow/devops/debugger/domain/testcase/testcase.go b/backend/api/model/flow/devops/debugger/domain/testcase/testcase.go index 103ee9af..1470a9b5 100644 --- a/backend/api/model/flow/devops/debugger/domain/testcase/testcase.go +++ b/backend/api/model/flow/devops/debugger/domain/testcase/testcase.go @@ -3,17 +3,17 @@ package testcase import ( - "github.com/coze-dev/coze-studio/backend/api/model/flow/devops/debugger/domain/infra" "fmt" "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-studio/backend/api/model/flow/devops/debugger/domain/infra" ) type CaseDataBase struct { - // 新增时不填,更新时填写 + // Do not fill in when adding, fill in when updating CaseID *int64 `thrift:"caseID,1,optional" json:"caseID,string" form:"caseID" query:"caseID"` Name *string `thrift:"name,2,optional" form:"name" json:"name,omitempty" query:"name"` Description *string `thrift:"description,3,optional" form:"description" json:"description,omitempty" query:"description"` - // json格式的输入信息 + // Input information in JSON format Input *string `thrift:"input,4,optional" form:"input" json:"input,omitempty" query:"input"` IsDefault *bool `thrift:"isDefault,5,optional" form:"isDefault" json:"isDefault,omitempty" query:"isDefault"` } @@ -389,7 +389,7 @@ type CaseDataDetail struct { CreatorID *string `thrift:"creatorID,2,optional" form:"creatorID" json:"creatorID,omitempty" query:"creatorID"` CreateTimeInSec *int64 `thrift:"createTimeInSec,3,optional" form:"createTimeInSec" json:"createTimeInSec,omitempty" query:"createTimeInSec"` UpdateTimeInSec *int64 `thrift:"updateTimeInSec,4,optional" form:"updateTimeInSec" json:"updateTimeInSec,omitempty" query:"updateTimeInSec"` - // schema不兼容 + // Schema incompatibility SchemaIncompatible *bool `thrift:"schemaIncompatible,5,optional" form:"schemaIncompatible" json:"schemaIncompatible,omitempty" query:"schemaIncompatible"` Updater *infra.Creator `thrift:"updater,6,optional" form:"updater" json:"updater,omitempty" query:"updater"` } diff --git a/backend/api/model/flow/marketplace/marketplace_common/marketplace_common.go b/backend/api/model/flow/marketplace/marketplace_common/marketplace_common.go index c7363958..fa28cc08 100644 --- a/backend/api/model/flow/marketplace/marketplace_common/marketplace_common.go +++ b/backend/api/model/flow/marketplace/marketplace_common/marketplace_common.go @@ -12,13 +12,13 @@ import ( type FollowType int64 const ( - // 无关系 + // Unknown FollowType_Unknown FollowType = 0 - // 关注 + // followee FollowType_Followee FollowType = 1 - // 粉丝 + // follower FollowType_Follower FollowType = 2 - // 互相关注 + // MutualFollow FollowType_MutualFollow FollowType = 3 ) @@ -66,11 +66,11 @@ func (p *FollowType) Value() (driver.Value, error) { } type Price struct { - // 金额 + // amount Amount int64 `thrift:"Amount,1" form:"amount" json:"amount,string"` - // 币种,如USD、CNY + // Currencies such as USD and CNY Currency string `thrift:"Currency,2" form:"currency" json:"currency"` - // 小数位数 + // decimal places DecimalNum int8 `thrift:"DecimalNum,3" form:"decimal_num" json:"decimal_num"` } diff --git a/backend/api/model/flow/marketplace/product_common/product_common.go b/backend/api/model/flow/marketplace/product_common/product_common.go index 200674b9..f051ef38 100644 --- a/backend/api/model/flow/marketplace/product_common/product_common.go +++ b/backend/api/model/flow/marketplace/product_common/product_common.go @@ -3,11 +3,11 @@ package product_common import ( - "github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/marketplace_common" "database/sql" "database/sql/driver" "fmt" "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/marketplace_common" ) type ProductEntityType int64 @@ -18,28 +18,28 @@ const ( // Workflow = 3 , ProductEntityType_SocialScene ProductEntityType = 4 ProductEntityType_Project ProductEntityType = 6 - // 历史工作流,后续不会再有(废弃) + // History workflow, no more in the future (abandoned) ProductEntityType_WorkflowTemplate ProductEntityType = 13 - // 历史图像流模板,后续不会再有(废弃) + // Historical image stream template, no more in the future (obsolete) ProductEntityType_ImageflowTemplate ProductEntityType = 15 - // 模板通用标识,仅用于绑定模板相关的配置,不绑定商品 + // Template universal identification, only used to bind template-related configurations, not bind products ProductEntityType_TemplateCommon ProductEntityType = 20 - // Bot 模板 + // Bot template ProductEntityType_BotTemplate ProductEntityType = 21 - // 工作流模板 + // workflow template ProductEntityType_WorkflowTemplateV2 ProductEntityType = 23 - // 图像流模板(该类型已下线,合并入 workflow,但历史数据会保留,前端视作 workflow 展示) + // Image stream template (this type has been offline and merged into workflow, but historical data will be preserved, and the front end will be treated as workflow display) ProductEntityType_ImageflowTemplateV2 ProductEntityType = 25 - // 项目模板 + // project template ProductEntityType_ProjectTemplate ProductEntityType = 26 - // coze token 类商品,理论上只会有一个 + // Coze token products, theoretically there will only be one ProductEntityType_CozeToken ProductEntityType = 50 - // 订阅 credit 的流量包,理论上只会有一个 + // Subscribe to the traffic package of credit, theoretically there will only be one ProductEntityType_MsgCredit ProductEntityType = 55 - // 消息订阅类商品,理论上只有一个 + // There is only one subscription product in theory ProductEntityType_SubsMsgCredit ProductEntityType = 60 ProductEntityType_Common ProductEntityType = 99 - // 专题(兼容之前的设计) + // Special Topics (Compatible with previous designs) ProductEntityType_Topic ProductEntityType = 101 ) @@ -139,9 +139,9 @@ type SortType int64 const ( SortType_Heat SortType = 1 SortType_Newest SortType = 2 - // 收藏时间 + // collection time SortType_FavoriteTime SortType = 3 - // 相关性,只用于搜索场景 + // Correlation, only for search scenarios SortType_Relative SortType = 4 ) @@ -233,9 +233,9 @@ func (p *ProductPublishMode) Value() (driver.Value, error) { type ProductListSource int64 const ( - // 推荐列表页 + // recommended list page ProductListSource_Recommend ProductListSource = 1 - // 个性化推荐 + // personalized recommendation ProductListSource_CustomizedRecommend ProductListSource = 2 ) @@ -362,7 +362,7 @@ func (p *ProductPaidType) Value() (driver.Value, error) { type ProductStatus int64 const ( - // 从未上架 + // NeverListed ProductStatus_NeverListed ProductStatus = 0 ProductStatus_Listed ProductStatus = 1 ProductStatus_Unlisted ProductStatus = 2 @@ -415,15 +415,15 @@ func (p *ProductStatus) Value() (driver.Value, error) { type ProductDraftStatus int64 const ( - // 默认 + // default ProductDraftStatus_Default ProductDraftStatus = 0 - // 审核中 + // Under review. ProductDraftStatus_Pending ProductDraftStatus = 1 - // 审核通过 + // approved ProductDraftStatus_Approved ProductDraftStatus = 2 - // 审核不通过 + // The review failed. ProductDraftStatus_Rejected ProductDraftStatus = 3 - // 已废弃 + // Abandoned ProductDraftStatus_Abandoned ProductDraftStatus = 4 ) @@ -576,27 +576,27 @@ func (p *PluginParamTypeFormat) Value() (driver.Value, error) { type WorkflowNodeType int64 const ( - // 开始 + // start WorkflowNodeType_Start WorkflowNodeType = 1 - // 结束 + // end WorkflowNodeType_End WorkflowNodeType = 2 - // 大模型 + // Large model WorkflowNodeType_LLM WorkflowNodeType = 3 - // 插件 + // plugin WorkflowNodeType_Api WorkflowNodeType = 4 - // 代码 + // code WorkflowNodeType_Code WorkflowNodeType = 5 - // 知识库 + // Knowledge Base WorkflowNodeType_Dataset WorkflowNodeType = 6 - // 选择器 + // selector WorkflowNodeType_If WorkflowNodeType = 8 - // 工作流 + // Workflow WorkflowNodeType_SubWorkflow WorkflowNodeType = 9 - // 变量 + // variable WorkflowNodeType_Variable WorkflowNodeType = 11 - // 数据库 + // database WorkflowNodeType_Database WorkflowNodeType = 12 - // 消息 + // message WorkflowNodeType_Message WorkflowNodeType = 13 ) @@ -721,9 +721,9 @@ func (p *SocialSceneRoleType) Value() (driver.Value, error) { type UIPreviewType int64 const ( - // UI 预览类型,定义对齐 UI Builder,目前用于 Project + // UI preview type, defining alignment UI Builder, currently used in Project UIPreviewType_Web UIPreviewType = 1 - // 移动端 + // mobile end UIPreviewType_Client UIPreviewType = 2 ) @@ -765,7 +765,7 @@ func (p *UIPreviewType) Value() (driver.Value, error) { type FavoriteListSource int64 const ( - // 用户自己创建的 + // Created by users themselves FavoriteListSource_CreatedByMe FavoriteListSource = 1 ) @@ -1837,7 +1837,7 @@ func (p *ImageInfo) String() string { } type OpeningDialog struct { - // Bot开场白 + // Bot OpeningDialog Content string `thrift:"content,1" form:"content" json:"content"` } @@ -2166,13 +2166,13 @@ type FavoriteEntity struct { Name string `thrift:"Name,4" form:"name" json:"name"` IconURL string `thrift:"IconURL,5" form:"icon_url" json:"icon_url"` Description string `thrift:"Description,6" form:"description" json:"description"` - // 废弃,使用UserInfo + // Abandoned, using UserInfo Seller *SellerInfo `thrift:"Seller,7" form:"seller" json:"seller"` - // 用于跳转到Bot编辑页 + // Use to jump to the bot edit page SpaceID int64 `thrift:"SpaceID,8" form:"space_id" json:"space_id,string"` - // 用户是否有该实体所在Space的权限 + // Does the user have permissions to the space where the entity is located? HasSpacePermission bool `thrift:"HasSpacePermission,9" form:"has_space_permission" json:"has_space_permission"` - // 收藏时间 + // collection time FavoriteAt int64 `thrift:"FavoriteAt,10" form:"favorite_at" json:"favorite_at,string"` ProductExtra *FavoriteProductExtra `thrift:"ProductExtra,11,optional" form:"product_extra" json:"product_extra,omitempty"` UserInfo *UserInfo `thrift:"UserInfo,12" form:"user_info" json:"user_info"` diff --git a/backend/api/model/flow/marketplace/product_public_api/public_api.go b/backend/api/model/flow/marketplace/product_public_api/public_api.go index 794465ba..426797b9 100644 --- a/backend/api/model/flow/marketplace/product_public_api/public_api.go +++ b/backend/api/model/flow/marketplace/product_public_api/public_api.go @@ -3,26 +3,26 @@ package product_public_api import ( - "github.com/coze-dev/coze-studio/backend/api/model/base" - "github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/marketplace_common" - "github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/product_common" "context" "database/sql" "database/sql/driver" "fmt" "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-studio/backend/api/model/base" + "github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/marketplace_common" + "github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/product_common" ) type PluginAuthMode int64 const ( - // 不需要授权 + // No authorization required. PluginAuthMode_NoAuth PluginAuthMode = 0 - // 需要授权,但无授权配置 + // Authorization required, but no authorization configuration PluginAuthMode_Required PluginAuthMode = 1 - // 需要授权,且已经配置 + // Authorization is required and has been configured PluginAuthMode_Configured PluginAuthMode = 2 - // 需要授权,但授权配置可能是用户级别,可由用户自己配置 + // Authorization is required, but the authorization configuration may be user-level and can be configured by the user himself PluginAuthMode_Supported PluginAuthMode = 3 ) @@ -1046,32 +1046,32 @@ type GetProductListRequest struct { SortType product_common.SortType `thrift:"SortType,3,required" form:"sort_type,required" json:"sort_type,required"` PageNum int32 `thrift:"PageNum,4,required" form:"page_num,required" json:"page_num,required"` PageSize int32 `thrift:"PageSize,5,required" form:"page_size,required" json:"page_size,required"` - // 不为空则搜索 + // non-empty search Keyword *string `thrift:"Keyword,6,optional" form:"keyword" json:"keyword,omitempty"` - // 公开方式:1-开源;2-闭源 , // 公开方式 + // Open mode: 1-open source; 2-closed source,//open mode PublishMode *product_common.ProductPublishMode `thrift:"PublishMode,7,optional" form:"publish_mode" json:"publish_mode,omitempty"` - // 发布渠道 + // publish platforms PublishPlatformIDs []int64 `thrift:"PublishPlatformIDs,8,optional" form:"PublishPlatformIDs" json:"PublishPlatformIDs,string,omitempty" query:"PublishPlatformIDs"` - // 列表页 tab; 1-运营推荐 + // List tab; 1 - Operational recommendations Source *product_common.ProductListSource `thrift:"Source,9,optional" form:"source" json:"source,omitempty"` - // 个性化推荐场景, 传入当前的实体信息, 获取推荐的商品 + // Personalized recommendation scenarios, enter current entity information, and obtain recommended products CurrentEntityType *product_common.ProductEntityType `thrift:"CurrentEntityType,10,optional" form:"current_entity_type" json:"current_entity_type,omitempty"` - // 当前实体 ID + // Current entity ID CurrentEntityID *int64 `thrift:"CurrentEntityID,11,optional" json:"CurrentEntityID,string,omitempty" query:"current_entity_id"` - // 当前实体版本 + // Current entity version CurrentEntityVersion *int64 `thrift:"CurrentEntityVersion,12,optional" json:"CurrentEntityVersion,string,omitempty" query:"current_entity_version"` - // 专题场景 + // thematic scenario TopicID *int64 `thrift:"TopicID,13,optional" json:"TopicID,string,omitempty" query:"topic_id"` PreviewTopicID *string `thrift:"PreviewTopicID,14,optional" form:"preview_topic_id" json:"preview_topic_id,omitempty"` - // 是否需要过滤出官方商品 + // Do you need to filter out official products? IsOfficial *bool `thrift:"IsOfficial,15,optional" form:"is_official" json:"is_official,omitempty"` - // 是否需要返回额外信息 + // Do you need to return additional information? NeedExtra *bool `thrift:"NeedExtra,16,optional" form:"need_extra" json:"need_extra,omitempty"` - // 商品类型列表, 优先使用该参数,其次使用 EntityType + // List of product types, use this parameter first, followed by EntityType EntityTypes []product_common.ProductEntityType `thrift:"EntityTypes,17,optional" form:"entity_types" json:"entity_types,omitempty"` - // true = 筛选免费的;false = 筛选付费的;不传则不区分免费和付费 + // True = filter for free; false = filter for paid; if you don't pass it, you won't distinguish between free and paid. IsFree *bool `thrift:"IsFree,18,optional" form:"is_free" json:"is_free,omitempty"` - // 插件类型 + // plugin type PluginType *product_common.PluginType `thrift:"PluginType,19,optional" form:"plugin_type" json:"plugin_type,omitempty"` ClientIP *string `thrift:"ClientIP,101,optional" header:"Tt-Agw-Client-Ip" json:"ClientIP,omitempty"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` @@ -4175,44 +4175,44 @@ func (p *ProductLabel) String() string { type ProductMetaInfo struct { ID int64 `thrift:"ID,1" form:"id" json:"id,string"` - // 商品/模板名称 + // Product/Template Name Name string `thrift:"Name,2" form:"name" json:"name"` - // 素材 ID,由 entity_type 来决定是 bot/plugin 的ID + // Creature ID, determined by entity_type is the ID of the bot/plugin EntityID int64 `thrift:"EntityID,3" form:"entity_id" json:"entity_id,string"` - // 商品素材类型 + // Product material type EntityType product_common.ProductEntityType `thrift:"EntityType,4" form:"entity_type" json:"entity_type"` - // 商品/模板头像 + // Product/template avatar IconURL string `thrift:"IconURL,5" form:"icon_url" json:"icon_url"` - // 热度:模板热度=复制量(用于卡片展示/排序);商品热度=不同商品有独立的计算逻辑(仅用于排序)—— heat的计算有一定延迟 + // Heat: Template heat = copy volume (used for card display/sorting); product heat = different products have independent calculation logic (only used for sorting) - the calculation of heat has a certain delay Heat int32 `thrift:"Heat,6" form:"heat" json:"heat"` FavoriteCount int32 `thrift:"FavoriteCount,7" form:"favorite_count" json:"favorite_count"` - // 废弃,使用UserInfo代替 + // Obsolete, use UserInfo instead Seller *SellerInfo `thrift:"Seller,8" form:"seller" json:"seller"` - // 商品描述 + // Product description Description string `thrift:"Description,9" form:"description" json:"description"` ListedAt int64 `thrift:"ListedAt,10" form:"listed_at" json:"listed_at,string"` Status product_common.ProductStatus `thrift:"Status,11" form:"status" json:"status"` - // 商品/模板分类信息 + // Product/template classification information Category *ProductCategory `thrift:"Category,12,optional" form:"category" json:"category,omitempty"` - // 是否收藏 + // Whether to collect IsFavorited bool `thrift:"IsFavorited,13" form:"is_favorited" json:"is_favorited"` IsFree bool `thrift:"IsFree,14" form:"is_free" json:"is_free"` - // 模板介绍/插件介绍(目前是富文本格式) + // Template introduction/plugin introduction (currently in rich text format) Readme string `thrift:"Readme,15" form:"readme" json:"readme"` EntityVersion *int64 `thrift:"EntityVersion,16,optional" form:"entity_version" json:"entity_version,string,omitempty"` Labels []*ProductLabel `thrift:"Labels,17,optional" form:"labels" json:"labels,omitempty"` UserInfo *product_common.UserInfo `thrift:"UserInfo,18" form:"user_info" json:"user_info"` MediumIconURL string `thrift:"MediumIconURL,19" form:"medium_icon_url" json:"medium_icon_url"` OriginIconURL string `thrift:"OriginIconURL,20" form:"origin_icon_url" json:"origin_icon_url"` - // 模板封面 + // Template cover Covers []*product_common.ImageInfo `thrift:"Covers,21,optional" form:"covers" json:"covers,omitempty"` - // 是否专业版特供 + // Is the professional version specially available? IsProfessional *bool `thrift:"IsProfessional,22,optional" form:"is_professional" json:"is_professional,omitempty"` - // 是否为模板 + // Is it a template? IsTemplate bool `thrift:"IsTemplate,23" form:"is_template" json:"is_template"` - // 是否官方商品 + // Is it an official product? IsOfficial bool `thrift:"IsOfficial,24" form:"is_official" json:"is_official"` - // 价格,当前只有模板有 + // Price, currently only available in the template. Price *marketplace_common.Price `thrift:"Price,25,optional" form:"price" json:"price,omitempty"` } @@ -5520,9 +5520,9 @@ func (p *ProductMetaInfo) String() string { } type UserBehaviorInfo struct { - // 用户主页需要返回最近浏览/使用商品的时间 + // The user homepage needs to return the most recently viewed/used product time. ViewedAt *int64 `thrift:"ViewedAt,1,optional" form:"viewed_at" json:"viewed_at,string,omitempty"` - // 最近使用时间戳 + // Recently used timestamp UsedAt *int64 `thrift:"UsedAt,2,optional" form:"used_at" json:"used_at,string,omitempty"` } @@ -5731,18 +5731,18 @@ type PluginExtraInfo struct { Tools []*PluginToolInfo `thrift:"Tools,1,optional" form:"tools" json:"tools,omitempty"` TotalAPICount int32 `thrift:"TotalAPICount,2" form:"total_api_count" json:"total_api_count"` BotsUseCount int32 `thrift:"BotsUseCount,3" form:"bots_use_count" json:"bots_use_count"` - // 是否有隐私声明, 目前只有 PublicGetProductDetail 会取数据 + // Is there a privacy statement, currently only PublicGetProductDetail will take the data HasPrivacyStatement *bool `thrift:"HasPrivacyStatement,4,optional" form:"has_private_statement" json:"has_private_statement,omitempty"` - // 隐私声明, 目前只有 PublicGetProductDetail 会取数据 + // Privacy statement, currently only PublicGetProductDetail will access data PrivacyStatement *string `thrift:"PrivacyStatement,5,optional" form:"private_statement" json:"private_statement,omitempty"` AssociatedBotsUseCount int32 `thrift:"AssociatedBotsUseCount,6" form:"associated_bots_use_count" json:"associated_bots_use_count"` IsPremium bool `thrift:"IsPremium,7" form:"is_premium" json:"is_premium"` IsOfficial bool `thrift:"IsOfficial,8" form:"is_official" json:"is_official"` - // 调用量 + // call amount CallAmount *int32 `thrift:"CallAmount,9,optional" form:"call_amount" json:"call_amount,omitempty"` - // 成功率 + // success rate SuccessRate *float64 `thrift:"SuccessRate,10,optional" form:"success_rate" json:"success_rate,omitempty"` - // 平均执行时长 + // average execution time AvgExecTime *float64 `thrift:"AvgExecTime,11,optional" form:"avg_exec_time" json:"avg_exec_time,omitempty"` IsDefaultIcon *bool `thrift:"IsDefaultIcon,12,optional" form:"is_default_icon" json:"is_default_icon,omitempty"` SpaceID *int64 `thrift:"SpaceID,13,optional" form:"space_id" json:"space_id,string,omitempty"` @@ -7096,7 +7096,7 @@ func (p *ToolParameter) String() string { type CardInfo struct { CardURL string `thrift:"CardURL,1" form:"card_url" json:"card_url"` - // 以下只有详情页返回 + // Only the details page returns CardID int64 `thrift:"CardID,2" form:"card_id" json:"card_id,string"` MappingRule string `thrift:"MappingRule,3" form:"MappingRule" json:"MappingRule" query:"MappingRule"` MaxDisplayRows int64 `thrift:"MaxDisplayRows,4" form:"max_display_rows" json:"max_display_rows,string"` @@ -7605,15 +7605,15 @@ type PluginToolInfo struct { Parameters []*ToolParameter `thrift:"Parameters,4,optional" form:"parameters" json:"parameters,omitempty"` CardInfo *CardInfo `thrift:"CardInfo,5,optional" form:"card_info" json:"card_info,omitempty"` Example *PluginToolExample `thrift:"Example,6,optional" form:"example" json:"example,omitempty"` - // 调用量 + // call amount CallAmount *int32 `thrift:"CallAmount,7,optional" form:"call_amount" json:"call_amount,omitempty"` - // 成功率 + // success rate SuccessRate *float64 `thrift:"SuccessRate,8,optional" form:"success_rate" json:"success_rate,omitempty"` - // 平均执行时长 + // average execution time AvgExecTime *float64 `thrift:"AvgExecTime,9,optional" form:"avg_exec_time" json:"avg_exec_time,omitempty"` - // tool 被bot引用数 + // Number of tool bot references BotsUseCount *int32 `thrift:"BotsUseCount,10,optional" form:"bots_use_count" json:"bots_use_count,omitempty"` - // 运行模式 + // operating mode RunMode *PluginRunMode `thrift:"RunMode,11,optional" form:"run_mode" json:"run_mode,omitempty"` } @@ -9347,9 +9347,9 @@ func (p *BotVoiceInfo) String() string { } type UserQueryCollectConf struct { - // bot用户query收集配置 + // Bot user query collection configuration IsCollected bool `thrift:"IsCollected,1" form:"is_collected" json:"is_collected"` - // 隐私协议链接 + // Privacy Policy Link PrivatePolicy string `thrift:"PrivatePolicy,2" form:"private_policy" json:"private_policy"` } @@ -9533,39 +9533,39 @@ func (p *UserQueryCollectConf) String() string { } type BotConfig struct { - // 模型 + // model Models []*ProductMaterial `thrift:"Models,1,optional" form:"models" json:"models,omitempty"` - // 插件 + // plugin Plugins []*ProductMaterial `thrift:"Plugins,2,optional" form:"plugins" json:"plugins,omitempty"` - // 知识库 + // Knowledge Base Knowledges []*ProductMaterial `thrift:"Knowledges,3,optional" form:"knowledges" json:"knowledges,omitempty"` - // 工作流 + // Workflow Workflows []*ProductMaterial `thrift:"Workflows,4,optional" form:"workflows" json:"workflows,omitempty"` - // 私有插件数量 + // number of private plugins PrivatePluginsCount *int32 `thrift:"PrivatePluginsCount,5,optional" form:"private_plugins_count" json:"private_plugins_count,omitempty"` - // 私有知识库数量 + // Number of private repositories PrivateKnowledgesCount *int32 `thrift:"PrivateKnowledgesCount,6,optional" form:"private_knowledges_count" json:"private_knowledges_count,omitempty"` - // 私有工作流数量 + // number of private workflows PrivateWorkflowsCount *int32 `thrift:"PrivateWorkflowsCount,7,optional" form:"private_workflows_count" json:"private_workflows_count,omitempty"` - // 判断 multiagent 是否有 bot 节点 + // Determine if the multiagent has a bot node HasBotAgent *bool `thrift:"HasBotAgent,8,optional" form:"has_bot_agent" json:"has_bot_agent,omitempty"` - // bot 配置的声音列表 + // List of sounds configured by bot BotVoices []*BotVoiceInfo `thrift:"BotVoices,9,optional" form:"bot_voices" json:"bot_voices,omitempty"` - // 所有插件数量 + // Number of all plugins TotalPluginsCount *int32 `thrift:"TotalPluginsCount,10,optional" form:"total_plugins_count" json:"total_plugins_count,omitempty"` - // 所有知识库数量 + // Number of all knowledge bases TotalKnowledgesCount *int32 `thrift:"TotalKnowledgesCount,11,optional" form:"total_knowledges_count" json:"total_knowledges_count,omitempty"` - // 所有工作流数量 + // Number of all workflows TotalWorkflowsCount *int32 `thrift:"TotalWorkflowsCount,12,optional" form:"total_workflows_count" json:"total_workflows_count,omitempty"` - // 时间胶囊模式 + // Time Capsule Mode TimeCapsuleMode *TimeCapsuleMode `thrift:"TimeCapsuleMode,13,optional" form:"time_capsule_mode" json:"time_capsule_mode,omitempty"` - // 文件盒模式 + // File box mode FileboxMode *FileboxInfoMode `thrift:"FileboxMode,14,optional" form:"filebox_mode" json:"filebox_mode,omitempty"` - // 私有图片工作流数量 + // Number of private image workflows PrivateImageWorkflowCount *int32 `thrift:"PrivateImageWorkflowCount,15,optional" form:"private_image_workflow_count" json:"private_image_workflow_count,omitempty"` - // 用户qeury收集配置 + // User qeury collection configuration UserQueryCollectConf *UserQueryCollectConf `thrift:"UserQueryCollectConf,16,optional" form:"user_query_collect_conf" json:"user_query_collect_conf,omitempty"` - // 是否关闭语音通话(默认是打开) + // Whether to turn off voice calls (the default is on) IsCloseVoiceCall *bool `thrift:"IsCloseVoiceCall,17,optional" form:"is_close_voice_call" json:"is_close_voice_call,omitempty"` } @@ -10694,7 +10694,7 @@ func (p *BotConfig) String() string { } -// 消息涉及的bot信息,在home分享场景,消息属于多个bot +// The bot information involved in the message, sharing the scene in the home, the message belongs to multiple bots type ConversationRelateBot struct { ID int64 `thrift:"ID,1" form:"id" json:"id,string"` Name string `thrift:"Name,2" form:"name" json:"name"` @@ -10969,7 +10969,7 @@ func (p *ConversationRelateBot) String() string { } -// 消息涉及的user信息,在home分享场景,消息属于多个user +// The user information involved in the message, sharing the scene in the home, the message belongs to multiple users type ConversationRelateUser struct { UserInfo *product_common.UserInfo `thrift:"UserInfo,1,optional" form:"user_info" json:"user_info,omitempty"` } @@ -11118,21 +11118,21 @@ func (p *ConversationRelateUser) String() string { } type Conversation struct { - // 对话示例 + // conversation example Snippets []string `thrift:"Snippets,1,optional" form:"snippets" json:"snippets,omitempty"` - // 对话标题 + // conversation title Title *string `thrift:"Title,2,optional" form:"title" json:"title,omitempty"` - // 对话ID,idGen生成 + // Conversation ID, generated by idGen ID *int64 `thrift:"ID,3,optional" form:"id" json:"id,string,omitempty"` - // 是否需要生成对话 + // Do you need to generate a conversation? GenTitle *bool `thrift:"GenTitle,4,optional" form:"gen_title" json:"gen_title,omitempty"` - // 对话审核状态 + // conversation moderation status AuditStatus *product_common.AuditStatus `thrift:"AuditStatus,5,optional" form:"audit_status" json:"audit_status,omitempty"` - // 开场白 + // opening statement OpeningDialog *product_common.OpeningDialog `thrift:"OpeningDialog,6,optional" form:"opening_dialog" json:"opening_dialog,omitempty"` - // 消息涉及的bot信息,key bot_id + // The bot information involved in the message, key bot_id RelateBots map[string]*ConversationRelateBot `thrift:"RelateBots,7,optional" form:"relate_bots" json:"relate_bots,omitempty"` - // 消息涉及的user信息,key user_id + // The user information involved in the message, key user_id RelateUsers map[string]*ConversationRelateUser `thrift:"RelateUsers,8,optional" form:"relate_users" json:"relate_users,omitempty"` } @@ -11744,25 +11744,25 @@ func (p *Conversation) String() string { } type BotExtraInfo struct { - // 发布渠道 + // publish platforms PublishPlatforms []*BotPublishPlatform `thrift:"PublishPlatforms,1" form:"publish_platforms" json:"publish_platforms"` - // 用户数 + // user count UserCount int32 `thrift:"UserCount,2" form:"user_count" json:"user_count"` - // 公开方式 + // public method PublishMode product_common.ProductPublishMode `thrift:"PublishMode,3" form:"publish_mode" json:"publish_mode"` - // 详情页特有 + // Details page unique ConversationSnippets [][]string `thrift:"ConversationSnippets,4,optional" form:"conversation_snippets" json:"conversation_snippets,omitempty"` - // 配置 + // configuration Config *BotConfig `thrift:"Config,5,optional" form:"config" json:"config,omitempty"` - // 白名单 + // whitelist IsInhouseUser *bool `thrift:"IsInhouseUser,6,optional" form:"is_inhouse_user" json:"is_inhouse_user,omitempty"` - // 复制创建 bot 数量 + // Number of copy-created bots DuplicateBotCount *int32 `thrift:"DuplicateBotCount,7,optional" form:"duplicate_bot_count" json:"duplicate_bot_count,omitempty"` - // 分享对话 + // Share the conversation Conversations []*Conversation `thrift:"Conversations,8,optional" form:"conversations" json:"conversations,omitempty"` - // 与 Bot 聊天的对话数 + // Number of conversations with Bot ChatConversationCount *int64 `thrift:"ChatConversationCount,9,optional" form:"chat_conversation_count" json:"chat_conversation_count,string,omitempty"` - // 关联商品数 + // number of related products RelatedProductCount *int64 `thrift:"RelatedProductCount,10,optional" form:"related_product_count" json:"related_product_count,string,omitempty"` } @@ -12457,22 +12457,22 @@ type WorkflowParameter struct { IsRequired bool `thrift:"IsRequired,3" form:"is_required" json:"is_required"` InputType product_common.InputType `thrift:"InputType,4" form:"input_type" json:"input_type"` SubParameters []*WorkflowParameter `thrift:"SubParameters,5" form:"sub_parameters" json:"sub_parameters"` - // 如果Type是数组,则有subtype + // If Type is an array, there is a subtype SubType product_common.InputType `thrift:"SubType,6" form:"sub_type" json:"sub_type"` - // 如果入参是用户手输 就放这里 + // If the imported parameter is the user's hand input, put it here Value *string `thrift:"Value,7,optional" form:"value" json:"value,omitempty"` Format *product_common.PluginParamTypeFormat `thrift:"Format,8,optional" form:"format" json:"format,omitempty"` FromNodeId *string `thrift:"FromNodeId,9,optional" form:"from_node_id" json:"from_node_id,omitempty"` FromOutput []string `thrift:"FromOutput,10,optional" form:"from_output" json:"from_output,omitempty"` - // InputType (+ AssistType) 定义一个变量的最终类型,仅需透传 + // InputType (+ AssistType) defines the final type of a variable, which only needs to be passed through AssistType *int64 `thrift:"AssistType,11,optional" form:"assist_type" json:"assist_type,omitempty"` - // 展示名称( store 独有的,用于详情页 GUI 展示参数) + // Display name (unique to the store, used for details page GUI display parameters) ShowName *string `thrift:"ShowName,12,optional" form:"show_name" json:"show_name,omitempty"` - // 如果InputType是数组,则有subassisttype + // If the InputType is an array, there is a subassistant type SubAssistType *int64 `thrift:"SubAssistType,13,optional" form:"sub_assist_type" json:"sub_assist_type,omitempty"` - // 组件配置,由前端解析并渲染 + // Component configuration, parsed and rendered by the front end ComponentConfig *string `thrift:"ComponentConfig,14,optional" form:"component_config" json:"component_config,omitempty"` - // 组件配置类型,前端展示需要 + // Component configuration type, required for front-end display ComponentType *string `thrift:"ComponentType,15,optional" form:"component_type" json:"component_type,omitempty"` } @@ -13368,9 +13368,9 @@ func (p *WorkflowParameter) String() string { } type WorkflowTerminatePlan struct { - // 对应 workflow 结束节点的回答模式:1-返回变量,由Bot生成回答;2-使用设定的内容直接回答 + // The answer mode corresponding to the end node of the workflow: 1 - Return the variable, and the Bot generates the answer; 2 - Use the set content to answer directly TerminatePlanType int32 `thrift:"TerminatePlanType,1" form:"terminate_plan_type" json:"terminate_plan_type"` - // 对应 terminate_plan_type = 2 的场景配置的返回内容 + // Return content of scene configuration corresponding to terminate_plan_type = 2 Content string `thrift:"Content,2" form:"content" json:"content"` } @@ -13856,9 +13856,9 @@ type WorkflowNodeInfo struct { NodeID string `thrift:"NodeID,1" form:"node_id" json:"node_id"` NodeType product_common.WorkflowNodeType `thrift:"NodeType,2" form:"node_type" json:"node_type"` NodeParam *WorkflowNodeParam `thrift:"NodeParam,3,optional" form:"node_param" json:"node_param,omitempty"` - // 节点icon + // Node icon NodeIconURL string `thrift:"NodeIconURL,4" form:"node_icon_url" json:"node_icon_url"` - // 展示名称( store 独有的,用于详情页 GUI 展示消息节点的名称) + // Presentation name (unique to the store, the name used for the details page GUI display message node) ShowName *string `thrift:"ShowName,5,optional" form:"show_name" json:"show_name,omitempty"` } @@ -14193,7 +14193,7 @@ func (p *WorkflowNodeInfo) String() string { } type WorkflowEntity struct { - // 商品ID + // Product ID ProductID int64 `thrift:"ProductID,1" form:"product_id" json:"product_id,string"` Name string `thrift:"Name,2" form:"name" json:"name"` EntityID int64 `thrift:"EntityID,3" form:"entity_id" json:"entity_id,string"` @@ -14203,13 +14203,13 @@ type WorkflowEntity struct { EntityName string `thrift:"EntityName,7" form:"entity_name" json:"entity_name"` Readme string `thrift:"Readme,8" form:"readme" json:"readme"` Category *ProductCategory `thrift:"Category,9" form:"category" json:"category"` - // 推荐分类 , + // Recommended categories, RecommendedCategory *ProductCategory `thrift:"RecommendedCategory,10,optional" form:"recommended_category" json:"recommended_category,omitempty"` Nodes []*WorkflowNodeInfo `thrift:"Nodes,11,optional" form:"nodes" json:"nodes,omitempty"` Desc string `thrift:"Desc,12" form:"desc" json:"desc"` - // 入参 图片icon + // Imported parameters Picture icon CaseInputIconURL *string `thrift:"CaseInputIconURL,13,optional" form:"case_input_icon_url" json:"case_input_icon_url,omitempty"` - // 出参 图片icon + // Exported parameters Image icon CaseOutputIconURL *string `thrift:"CaseOutputIconURL,14,optional" form:"case_output_icon_url" json:"case_output_icon_url,omitempty"` LatestPublishCommitID *string `thrift:"LatestPublishCommitID,15,optional" form:"latest_publish_commit_id" json:"latest_publish_commit_id,omitempty"` } @@ -15044,10 +15044,10 @@ func (p *WorkflowEntity) String() string { } type WorkflowGUIConfig struct { - // 用于将 workflow 的输入/输出/中间消息节点节点转为用户可视化配置 + // Used to convert the input/output/intermediate message node of a workflow into a user visual configuration StartNode *WorkflowNodeInfo `thrift:"StartNode,1" form:"start_node" json:"start_node"` EndNode *WorkflowNodeInfo `thrift:"EndNode,2" form:"end_node" json:"end_node"` - // 消息节点会输出中间过程,也需要展示 + // The message node will output the intermediate process, which also needs to be displayed. MessageNodes []*WorkflowNodeInfo `thrift:"MessageNodes,3,optional" form:"message_nodes" json:"message_nodes,omitempty"` } @@ -15320,25 +15320,25 @@ func (p *WorkflowGUIConfig) String() string { type WorkflowExtraInfo struct { RelatedWorkflows []*WorkflowEntity `thrift:"RelatedWorkflows,1" form:"related_workflows" json:"related_workflows"` DuplicateCount *int32 `thrift:"DuplicateCount,2,optional" form:"duplicate_count" json:"duplicate_count,omitempty"` - // workflow画布信息 + // Workflow canvas information WorkflowSchema *string `thrift:"WorkflowSchema,3,optional" form:"workflow_schema" json:"workflow_schema,omitempty"` // /api/workflowV2/query schema_json RecommendedCategory *ProductCategory `thrift:"RecommendedCategory,4,optional" form:"recommended_category" json:"recommended_category,omitempty"` Nodes []*WorkflowNodeInfo `thrift:"Nodes,5,optional" form:"nodes" json:"nodes,omitempty"` StartNode *WorkflowNodeInfo `thrift:"StartNode,6,optional" form:"start_node" json:"start_node,omitempty"` - // 实体名称(用于展示) + // Entity name (for presentation) EntityName *string `thrift:"EntityName,7,optional" form:"entity_name" json:"entity_name,omitempty"` - // 用例图入参 + // Use case diagrams imported parameters CaseInputIconURL *string `thrift:"CaseInputIconURL,8,optional" form:"case_input_icon_url" json:"case_input_icon_url,omitempty"` - // 用例图出参 + // Use case diagram exported parameters CaseOutputIconURL *string `thrift:"CaseOutputIconURL,9,optional" form:"case_output_icon_url" json:"case_output_icon_url,omitempty"` - // 案例执行ID + // case execution ID CaseExecuteID *int64 `thrift:"CaseExecuteID,10,optional" form:"case_execute_id" json:"case_execute_id,string,omitempty"` HoverText *string `thrift:"HoverText,11,optional" form:"hover_text" json:"hover_text,omitempty"` LatestPublishCommitID *string `thrift:"LatestPublishCommitID,12,optional" form:"latest_publish_commit_id" json:"latest_publish_commit_id,omitempty"` - // 试运行次数,从数仓取 + // Practice running times, take from the number of warehouses UsedCount *int32 `thrift:"UsedCount,13,optional" form:"used_count" json:"used_count,omitempty"` - // 用于将 workflow 的输入/输出/中间消息节点节点转为用户可视化配置 + // Used to convert the input/output/intermediate message node of a workflow into a user visual configuration GUIConfig *WorkflowGUIConfig `thrift:"GUIConfig,14,optional" form:"gui_config" json:"gui_config,omitempty"` } @@ -16453,13 +16453,13 @@ func (p *SocialScenePlayerInfo) String() string { } type SocialSceneExtraInfo struct { - // 角色 + // role Players []*SocialScenePlayerInfo `thrift:"Players,1,optional" form:"players" json:"players,omitempty"` - // 使用过的人数 + // Number of people used UsedCount int64 `thrift:"UsedCount,2" form:"used_count" json:"used_count,string"` - // 开始过的次数 + // number of times started StartedCount int64 `thrift:"StartedCount,3" form:"started_count" json:"started_count,string"` - // 开闭源 + // publish_mode PublishMode product_common.ProductPublishMode `thrift:"PublishMode,4" form:"publish_mode" json:"publish_mode"` } @@ -16762,13 +16762,13 @@ func (p *SocialSceneExtraInfo) String() string { } type ProjectConfig struct { - // 插件数量 + // number of plugins PluginCount int32 `thrift:"PluginCount,1" form:"plugin_count" json:"plugin_count"` - // 工作流数量 + // number of workflows WorkflowCount int32 `thrift:"WorkflowCount,2" form:"workflow_count" json:"workflow_count"` - // 知识库数量 + // Number of knowledge bases KnowledgeCount int32 `thrift:"KnowledgeCount,3" form:"knowledge_count" json:"knowledge_count"` - // 数据库数量 + // Number of databases DatabaseCount int32 `thrift:"DatabaseCount,4" form:"database_count" json:"database_count"` } @@ -17040,20 +17040,20 @@ func (p *ProjectConfig) String() string { } type ProjectExtraInfo struct { - // Project 上架为模板前生成一个模板副本,使用或者复制模板,需要用 TemplateProjectID 和 TemplateProjectVersion + // Generate a copy of the template before Project is put on the shelves. To use or copy the template, you need to use TemplateProjectID and TemplateProjectVersion TemplateProjectID int64 `thrift:"TemplateProjectID,1" form:"template_project_id" json:"template_project_id,string"` TemplateProjectVersion int64 `thrift:"TemplateProjectVersion,2" form:"template_project_version" json:"template_project_version,string"` - // Project 绑定的 UI 支持的预览类型 + // Project-bound UI supported preview types PreviewTypes []product_common.UIPreviewType `thrift:"PreviewTypes,3" form:"preview_types" json:"preview_types"` - // 用户数 + // user count UserCount int32 `thrift:"UserCount,4" form:"user_count" json:"user_count"` - // 运行数 + // number of runs ExecuteCount int32 `thrift:"ExecuteCount,5" form:"execute_count" json:"execute_count"` - // 发布渠道 + // publish platforms PublishPlatforms []*BotPublishPlatform `thrift:"PublishPlatforms,6" form:"publish_platforms" json:"publish_platforms"` - // 近实时复制量,从数仓接口获取(复制 - 上报埋点 - 数仓计算落库) + // Near real-time copy volume, obtained from the data warehouse interface (copy-report event tracking-data warehouse calculation drop library) DupliacateCount int32 `thrift:"DupliacateCount,7" form:"duplicate_count" json:"duplicate_count"` - // 配置 + // configuration Config *ProjectConfig `thrift:"Config,8,optional" form:"config" json:"config,omitempty"` } @@ -17552,7 +17552,7 @@ type GetProductDetailRequest struct { ProductID *int64 `thrift:"ProductID,1,optional" json:"ProductID,string,omitempty" query:"product_id"` EntityType *product_common.ProductEntityType `thrift:"EntityType,2,optional" form:"entity_type" json:"entity_type,omitempty"` EntityID *int64 `thrift:"EntityID,3,optional" json:"EntityID,string,omitempty" query:"entity_id"` - // 是否查看最新的审核失败草稿 + // Whether to check the latest audit failure draft NeedAuditFailed *bool `thrift:"NeedAuditFailed,4,optional" form:"need_audit_failed" json:"need_audit_failed,omitempty"` ClientIP *string `thrift:"ClientIP,101,optional" header:"Tt-Agw-Client-Ip" json:"ClientIP,omitempty"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` @@ -18511,7 +18511,7 @@ func (p *Price) String() string { type SKUInfo struct { ID int64 `thrift:"ID,1" form:"id" json:"id,string"` - // 待废弃 + // to be abandoned Price []*Price `thrift:"Price,2" form:"price" json:"price"` Description string `thrift:"Description,3" form:"description" json:"description"` PriceV2 []*marketplace_common.Price `thrift:"PriceV2,4" form:"price_v2" json:"price_v2"` @@ -19313,7 +19313,7 @@ func (p *SellAttr) String() string { type SellInfo struct { SKUs map[int64]*SKUInfo `thrift:"SKUs,1" form:"skus" json:"skus,string"` Attr []*SellAttr `thrift:"Attr,2" form:"attr" json:"attr"` - // Key 是 attrkey:attrvalue 路径,value 是 skuID + // Key is attrkey: attrvalue path, value is skuID SKUAttrRef map[string]int64 `thrift:"SKUAttrRef,3" form:"sku_attr_ref" json:"sku_attr_ref,string"` } @@ -19623,12 +19623,12 @@ type Topic struct { Name string `thrift:"Name,2" form:"name" json:"name"` Description string `thrift:"Description,3" form:"description" json:"description"` BannerURL string `thrift:"BannerURL,4" form:"banner_url" json:"banner_url"` - // 背景小图,前端优先加载 + // Small background image, front-end priority loading BannerURLSmall string `thrift:"BannerURLSmall,5" form:"banner_url_small" json:"banner_url_small"` Reason string `thrift:"Reason,6" form:"reason" json:"reason"` - // 运营提供的专题介绍文档,用户可见 + // The presentation document provided by the operation is visible to users IntroductionURL string `thrift:"IntroductionURL,7" form:"introduction_url" json:"introduction_url"` - // 用户是否收藏专题 + // Does the user collect the topic? IsFavorite bool `thrift:"IsFavorite,8" form:"is_favorite" json:"is_favorite"` } @@ -20076,7 +20076,7 @@ func (p *Topic) String() string { } type ProductDataIndicator struct { - // 数据分析指标,来源数仓,比如模板购买量、复制量等 + // Data analytics metrics, source number, such as template purchases, replicas, etc PurchaseCount *int32 `thrift:"PurchaseCount,1,optional" form:"purchase_count" json:"purchase_count,omitempty"` } @@ -20227,17 +20227,17 @@ func (p *ProductDataIndicator) String() string { } type GetProductDetailData struct { - // 下架的商品只返回非 optional 字段 + // Products removed from the shelves only return non-optional fields MetaInfo *ProductMetaInfo `thrift:"MetaInfo,1,required" form:"meta_info,required" json:"meta_info,required"` - // 用以区分主/客态 + // To distinguish between host and guest states IsOwner bool `thrift:"IsOwner,2,required" form:"is_owner,required" json:"is_owner,required"` - // 审核状态,主态下返回需要关注,如果主态且审核中,需要展示审核中状态 + // Audit status, return in the main state, you need to pay attention. If the main state is under review, you need to show the status under review. AuditStatus product_common.ProductDraftStatus `thrift:"AuditStatus,3" form:"audit_status" json:"audit_status"` SellInfo *SellInfo `thrift:"SellInfo,4,optional" form:"sell_info" json:"sell_info,omitempty"` SpaceID *int64 `thrift:"SpaceID,5,optional" form:"space_id" json:"space_id,string,omitempty"` - // 详情页返回 + // Details page Back Topic *Topic `thrift:"Topic,6,optional" form:"topic" json:"topic,omitempty"` - // 详情页返回 + // Details page Back CanDuplicate *bool `thrift:"CanDuplicate,7,optional" form:"can_duplicate" json:"can_duplicate,omitempty"` CommercialSetting *product_common.CommercialSetting `thrift:"CommercialSetting,8,optional" form:"commercial_setting" json:"commercial_setting,omitempty"` PluginExtra *PluginExtraInfo `thrift:"PluginExtra,20,optional" form:"plugin_extra" json:"plugin_extra,omitempty"` @@ -21071,23 +21071,23 @@ func (p *GetProductDetailData) String() string { } type GetUserFavoriteListV2Request struct { - // 第一页不传,后续调用时传上一次返回的cursor_id + // The first page is not passed, and the last returned cursor_id is passed when subsequent calls are made CursorID *string `thrift:"CursorID,1,optional" json:"CursorID,omitempty" query:"cursor_id"` PageSize int32 `thrift:"PageSize,2,required" json:"PageSize,required" query:"page_size,required"` EntityType *product_common.ProductEntityType `thrift:"EntityType,3,optional" json:"EntityType,omitempty" query:"entity_type"` SortType product_common.SortType `thrift:"SortType,4,required" json:"SortType,required" query:"sort_type,required"` - // 不为空则搜索 + // Search keyword,optional Keyword *string `thrift:"Keyword,5,optional" json:"Keyword,omitempty" query:"keyword"` - // 列表页 tab + // List page tab Source *product_common.FavoriteListSource `thrift:"Source,6,optional" json:"Source,omitempty" query:"source"` - // 是否需要查询用户对Bot的触发器配置,为true时,才会返回EntityUserTriggerConfig + // Whether you need to query the user's trigger configuration for the Bot, when true, it will return EntityUserTriggerConfig NeedUserTriggerConfig *bool `thrift:"NeedUserTriggerConfig,7,optional" json:"NeedUserTriggerConfig,omitempty" query:"need_user_trigger_config"` - // 筛选收藏时间 + // Filter collection time BeginAt *int64 `thrift:"BeginAt,8,optional" json:"BeginAt,string,omitempty" query:"begin_at"` - // 筛选收藏时间 + // Filter collection time EndAt *int64 `thrift:"EndAt,9,optional" json:"EndAt,string,omitempty" query:"end_at"` EntityTypes []product_common.ProductEntityType `thrift:"EntityTypes,10,optional" json:"EntityTypes,omitempty" query:"entity_types"` - // 组织ID,企业版想获取用户收藏的所有内容时需传递 + // Organization ID, Enterprise Edition needs to be passed when you want to get all the content in the user's collection OrganizationID *int64 `thrift:"OrganizationID,11,optional" json:"OrganizationID,omitempty" query:"organization_id"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -22164,7 +22164,7 @@ type GetUserFavoriteListDataV2 struct { FavoriteEntities []*product_common.FavoriteEntity `thrift:"FavoriteEntities,1" form:"favorite_entities" json:"favorite_entities"` CursorID string `thrift:"CursorID,2" form:"cursor_id" json:"cursor_id"` HasMore bool `thrift:"HasMore,3" form:"has_more" json:"has_more"` - // 用户定时任务配置,对应flow.bot.task服务的TriggerEnabled + // User timed task configuration, corresponding to flow.bot TriggerEnabled of the task service EntityUserTriggerConfig map[int64]*UserTriggerConfig `thrift:"EntityUserTriggerConfig,4" form:"entity_user_trigger_config" json:"entity_user_trigger_config"` } @@ -23347,9 +23347,9 @@ func (p *DuplicateProductResponse) String() string { } type DuplicateProductData struct { - // 复制后的新id + // New ID after copy NewEntityID int64 `thrift:"NewEntityID,1" form:"new_entity_id" json:"new_entity_id,string"` - // workflow对应的插件id + // Plugin ID for workflow NewPluginID *int64 `thrift:"NewPluginID,2,optional" form:"new_plugin_id" json:"new_plugin_id,string,omitempty"` } diff --git a/backend/api/model/intelligence/common/common_struct.go b/backend/api/model/intelligence/common/common_struct.go index b4451810..ac216c27 100644 --- a/backend/api/model/intelligence/common/common_struct.go +++ b/backend/api/model/intelligence/common/common_struct.go @@ -13,11 +13,11 @@ import ( type AuditStatus int64 const ( - // 审核中 + // Under review. AuditStatus_Auditing AuditStatus = 0 - // 审核通过 + // approved AuditStatus_Success AuditStatus = 1 - // 审核失败 + // audit failed AuditStatus_Failed AuditStatus = 2 ) @@ -225,11 +225,11 @@ func (p *OrderByType) Value() (driver.Value, error) { type PermissionType int64 const ( - //不能查看详情 + //Can't view details PermissionType_NoDetail PermissionType = 1 - //可以查看详情 + //You can check the details. PermissionType_Detail PermissionType = 2 - //可以查看和操作 + //Can be viewed and operated PermissionType_Operate PermissionType = 3 ) @@ -635,13 +635,13 @@ func (p *UserLabel) String() string { type User struct { UserID int64 `thrift:"user_id,1" form:"user_id" json:"user_id,string" query:"user_id"` - // 用户昵称 + // user nickname Nickname string `thrift:"nickname,2" form:"nickname" json:"nickname" query:"nickname"` - // 用户头像 + // user avatar AvatarURL string `thrift:"avatar_url,3" form:"avatar_url" json:"avatar_url" query:"avatar_url"` - // 用户名 + // user name UserUniqueName string `thrift:"user_unique_name,4" form:"user_unique_name" json:"user_unique_name" query:"user_unique_name"` - // 用户标签 + // user tag UserLabel *UserLabel `thrift:"user_label,5" form:"user_label" json:"user_label" query:"user_label"` } @@ -1225,11 +1225,11 @@ func (p *AuditInfo) String() string { } -// 审核结果 +// Audit results type AuditData struct { - // true:机审校验不通过 + // True: The machine audit verification failed CheckNotPass bool `thrift:"check_not_pass,1" form:"check_not_pass" json:"check_not_pass" query:"check_not_pass"` - // 机审校验不通过文案 + // The machine audit verification failed the copy. CheckNotPassMsg *string `thrift:"check_not_pass_msg,2,optional" form:"check_not_pass_msg" json:"check_not_pass_msg,omitempty" query:"check_not_pass_msg"` } diff --git a/backend/api/model/intelligence/common/intelligence_common_struct.go b/backend/api/model/intelligence/common/intelligence_common_struct.go index 4f843518..b493fcf1 100644 --- a/backend/api/model/intelligence/common/intelligence_common_struct.go +++ b/backend/api/model/intelligence/common/intelligence_common_struct.go @@ -15,11 +15,11 @@ const ( IntelligenceStatus_Using IntelligenceStatus = 1 IntelligenceStatus_Deleted IntelligenceStatus = 2 IntelligenceStatus_Banned IntelligenceStatus = 3 - // 迁移失败 + // Migration failed IntelligenceStatus_MoveFailed IntelligenceStatus = 4 - // 复制中 + // Copying IntelligenceStatus_Copying IntelligenceStatus = 5 - // 复制失败 + // Copy failed IntelligenceStatus_CopyFailed IntelligenceStatus = 6 ) diff --git a/backend/api/model/intelligence/intelligence.go b/backend/api/model/intelligence/intelligence.go index 95eed4ce..785990bc 100644 --- a/backend/api/model/intelligence/intelligence.go +++ b/backend/api/model/intelligence/intelligence.go @@ -3,12 +3,12 @@ package intelligence import ( - "github.com/coze-dev/coze-studio/backend/api/model/project" - "github.com/coze-dev/coze-studio/backend/api/model/publish" - "github.com/coze-dev/coze-studio/backend/api/model/task" "context" "fmt" "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-studio/backend/api/model/project" + "github.com/coze-dev/coze-studio/backend/api/model/publish" + "github.com/coze-dev/coze-studio/backend/api/model/task" ) type IntelligenceService interface { diff --git a/backend/api/model/intelligence/search.go b/backend/api/model/intelligence/search.go index 46703282..f69b1e98 100644 --- a/backend/api/model/intelligence/search.go +++ b/backend/api/model/intelligence/search.go @@ -3,12 +3,12 @@ package intelligence import ( - "github.com/coze-dev/coze-studio/backend/api/model/base" - "github.com/coze-dev/coze-studio/backend/api/model/intelligence/common" "database/sql" "database/sql/driver" "fmt" "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-studio/backend/api/model/base" + "github.com/coze-dev/coze-studio/backend/api/model/intelligence/common" ) type OrderBy int64 @@ -190,7 +190,7 @@ func (p *BotMode) Value() (driver.Value, error) { } type GetDraftIntelligenceListOption struct { - // 是否需要个人版本Bot数据 + //need personal version Bot data NeedReplica bool `thrift:"need_replica,1" form:"need_replica" json:"need_replica" query:"need_replica"` } @@ -1435,9 +1435,9 @@ func (p *IntelligencePublishInfo) String() string { type IntelligencePermissionInfo struct { InCollaboration bool `thrift:"in_collaboration,1" form:"in_collaboration" json:"in_collaboration" query:"in_collaboration"` - // 当前用户是否可删除 + // can delete CanDelete bool `thrift:"can_delete,2" form:"can_delete" json:"can_delete" query:"can_delete"` - // 当前用户是否可查看,当前判断逻辑为用户是否在bot所在空间 + // Whether the current user can view it, the current judgment logic is whether the user is in the space where the bot is located CanView bool `thrift:"can_view,3" form:"can_view" json:"can_view" query:"can_view"` } @@ -1665,9 +1665,9 @@ func (p *IntelligencePermissionInfo) String() string { } type FavoriteInfo struct { - // 是否收藏;收藏列表使用 + // Whether to collect; use the collection list IsFav bool `thrift:"is_fav,1" form:"is_fav" json:"is_fav" query:"is_fav"` - // 收藏时间;收藏列表使用 + // Collection time; collection list use FavTime string `thrift:"fav_time,2" form:"fav_time" json:"fav_time" query:"fav_time"` } @@ -1851,9 +1851,9 @@ func (p *FavoriteInfo) String() string { } type OtherInfo struct { - // 最近打开时间;最近打开筛选时使用 + // Last opened time; used when recently opened filter RecentlyOpenTime string `thrift:"recently_open_time,1" form:"recently_open_time" json:"recently_open_time" query:"recently_open_time"` - // 仅bot类型返回 + // Only bot type returns BotMode BotMode `thrift:"bot_mode,2" form:"bot_mode" json:"bot_mode" query:"bot_mode"` } @@ -2037,15 +2037,15 @@ func (p *OtherInfo) String() string { } type Intelligence struct { - // 基本信息 + // Basic information BasicInfo *common.IntelligenceBasicInfo `thrift:"basic_info,1" form:"basic_info" json:"basic_info" query:"basic_info"` - // 智能体类型 + // Agent Type Type common.IntelligenceType `thrift:"type,2" form:"type" json:"type" query:"type"` - // 智能体发布信息,可选 + // Agent publishes information, optional PublishInfo *IntelligencePublishInfo `thrift:"publish_info,3" form:"publish_info" json:"publish_info" query:"publish_info"` - // 智能体所有者信息,可选 + // Agent owner information, optional OwnerInfo *common.User `thrift:"owner_info,4" form:"owner_info" json:"owner_info" query:"owner_info"` - // 当前用户对智能体的权限信息,可选 + // The current user's permission information to the agent, optional PermissionInfo *IntelligencePermissionInfo `thrift:"permission_info,5" form:"permission_info" json:"permission_info" query:"permission_info"` } @@ -2384,7 +2384,7 @@ func (p *Intelligence) String() string { } -// For前端 +// For the front end type IntelligenceData struct { BasicInfo *common.IntelligenceBasicInfo `thrift:"basic_info,1" form:"basic_info" json:"basic_info" query:"basic_info"` Type common.IntelligenceType `thrift:"type,2" form:"type" json:"type" query:"type"` @@ -3466,7 +3466,7 @@ func (p *GetDraftIntelligenceListResponse) String() string { type GetDraftIntelligenceInfoRequest struct { IntelligenceID int64 `thrift:"intelligence_id,1" form:"intelligence_id" json:"intelligence_id,string" query:"intelligence_id"` IntelligenceType common.IntelligenceType `thrift:"intelligence_type,2" form:"intelligence_type" json:"intelligence_type" query:"intelligence_type"` - // 预览版本时传入 + // Pass in when previewing the version Version *int64 `thrift:"version,3,optional" form:"version" json:"version,string,omitempty" query:"version"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -4344,9 +4344,9 @@ func (p *GetDraftIntelligenceInfoResponse) String() string { type GetUserRecentlyEditIntelligenceRequest struct { Size int32 `thrift:"size,1" form:"size" json:"size" query:"size"` Types []common.IntelligenceType `thrift:"types,2,optional" form:"types" json:"types,omitempty" query:"types"` - // 企业id + // Enterprise ID EnterpriseID *string `thrift:"enterprise_id,3,optional" form:"enterprise_id" json:"enterprise_id,omitempty" query:"enterprise_id"` - // 组织id + // organization id OrganizationID *string `thrift:"organization_id,4,optional" form:"organization_id" json:"organization_id,omitempty" query:"organization_id"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } diff --git a/backend/api/model/knowledge/document/kdocument.go b/backend/api/model/knowledge/document/kdocument.go index 7041086f..7de749f2 100644 --- a/backend/api/model/knowledge/document/kdocument.go +++ b/backend/api/model/knowledge/document/kdocument.go @@ -3,19 +3,19 @@ package document import ( - "github.com/coze-dev/coze-studio/backend/api/model/base" - "github.com/coze-dev/coze-studio/backend/api/model/common" "fmt" "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-studio/backend/api/model/base" + "github.com/coze-dev/coze-studio/backend/api/model/common" ) -// 获取表格结构、预览数据 +// Get table structure, preview data type GetDocumentTableInfoRequest struct { - // 如果为第一次本地文件上传的表格,传递该值 + // If the table is uploaded for the first local file, pass the value TosURI *string `thrift:"tos_uri,2,optional" form:"tos_uri" json:"tos_uri,omitempty" query:"tos_uri"` - // 如果为已有 document 的表格,传递该值 + // If it is a document with an existing table, pass the value DocumentID *int64 `thrift:"document_id,3,optional" form:"document_id" json:"document_id,string,omitempty"` - // 创建人[http接口不需要传递] + // Creator [http interface does not need to be passed] CreatorID int64 `thrift:"creator_id,4" form:"creator_id" json:"creator_id" query:"creator_id"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -848,9 +848,9 @@ type GetTableSchemaInfoResponse struct { Code int32 `thrift:"code,1" form:"code" json:"code" query:"code"` Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` SheetList []*common.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 []*common.DocTableColumn `thrift:"table_meta,4" form:"table_meta" json:"table_meta" query:"table_meta"` - // knowledge table 场景中会返回 + // The knowledge table will return PreviewData []map[int64]string `thrift:"preview_data,5" form:"preview_data" json:"preview_data" query:"preview_data"` BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"-" json:"-" query:"-"` } diff --git a/backend/api/model/kvmemory/kvmemory.go b/backend/api/model/kvmemory/kvmemory.go index 0c02de05..a43ad0ce 100644 --- a/backend/api/model/kvmemory/kvmemory.go +++ b/backend/api/model/kvmemory/kvmemory.go @@ -3,11 +3,11 @@ package kvmemory import ( + "fmt" + "github.com/apache/thrift/lib/go/thrift" "github.com/coze-dev/coze-studio/backend/api/model/base" "github.com/coze-dev/coze-studio/backend/api/model/project_memory" "github.com/coze-dev/coze-studio/backend/api/model/table" - "fmt" - "github.com/apache/thrift/lib/go/thrift" ) type KVItem struct { @@ -1448,7 +1448,7 @@ type SetKvMemoryReq struct { UserID *int64 `thrift:"user_id,2,optional" form:"user_id" json:"user_id,omitempty" query:"user_id"` Data []*KVItem `thrift:"data,3,required" form:"data,required" json:"data,required" query:"data,required"` ConnectorID *int64 `thrift:"connector_id,4,optional" form:"connector_id" json:"connector_id,omitempty" query:"connector_id"` - // 引用信息 + // citation information RefInfo *table.RefInfo `thrift:"ref_info,5,optional" form:"ref_info" json:"ref_info,omitempty" query:"ref_info"` ProjectID *string `thrift:"project_id,6,optional" form:"project_id" json:"project_id,omitempty" query:"project_id"` ProjectVersion *int64 `thrift:"ProjectVersion,7,optional" form:"ProjectVersion" json:"ProjectVersion,omitempty" query:"ProjectVersion"` @@ -3041,7 +3041,7 @@ type DelProfileMemoryRequest struct { BotID int64 `thrift:"bot_id,2" form:"bot_id" json:"bot_id,string"` Keywords []string `thrift:"keywords,3" form:"keywords" json:"keywords" query:"keywords"` ConnectorID *int64 `thrift:"connector_id,4,optional" form:"connector_id" json:"connector_id,omitempty" query:"connector_id"` - // 引用信息 + // citation information RefInfo *table.RefInfo `thrift:"ref_info,5,optional" form:"ref_info" json:"ref_info,omitempty" query:"ref_info"` ProjectID string `thrift:"project_id,6" form:"project_id" json:"project_id" query:"project_id"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` @@ -3499,7 +3499,7 @@ type GetProfileMemoryRequest struct { Keywords []string `thrift:"keywords,3" form:"keywords" json:"keywords" query:"keywords"` ConnectorID *int64 `thrift:"connector_id,4,optional" form:"connector_id" json:"connector_id,omitempty" query:"connector_id"` Version *string `thrift:"version,5,optional" form:"version" json:"version,omitempty" query:"version"` - // 引用信息 + // citation information RefInfo *table.RefInfo `thrift:"ref_info,6,optional" form:"ref_info" json:"ref_info,omitempty" query:"ref_info"` Ext *string `thrift:"ext,7,optional" form:"ext" json:"ext,omitempty" query:"ext"` ProjectID *string `thrift:"project_id,8,optional" form:"project_id" json:"project_id,omitempty" query:"project_id"` diff --git a/backend/api/model/ocean/cloud/bot_common/bot_common.go b/backend/api/model/ocean/cloud/bot_common/bot_common.go index ee658407..758afd10 100644 --- a/backend/api/model/ocean/cloud/bot_common/bot_common.go +++ b/backend/api/model/ocean/cloud/bot_common/bot_common.go @@ -108,7 +108,7 @@ func (p *ModelResponseFormat) Value() (driver.Value, error) { return int64(*p), nil } -// 上下文允许传输的类型 +// The type of transmission allowed by the context type ContextMode int64 const ( @@ -397,15 +397,15 @@ func (p *WorkflowMode) Value() (driver.Value, error) { return int64(*p), nil } -// onboarding内容生成模式 +// onboarding content generation mode type OnboardingMode int64 const ( - // 不需要 + // No. OnboardingMode_NO_NEED OnboardingMode = 1 - // 人工指定内容(多语言支持由LLM兜底) + // Manually specify content (multi-language support is covered by LLM) OnboardingMode_USE_MANUAL OnboardingMode = 2 - // 由LLM生成 + // Generated by LLM OnboardingMode_USE_LLM OnboardingMode = 3 ) @@ -498,7 +498,7 @@ const ( SuggestReplyMode_System SuggestReplyMode = 0 SuggestReplyMode_Custom SuggestReplyMode = 1 SuggestReplyMode_Disable SuggestReplyMode = 2 - // agent专用,复用源Bot配置 + // Agent specific, multiplexed source Bot configuration SuggestReplyMode_OriBot SuggestReplyMode = 3 ) @@ -548,13 +548,13 @@ func (p *SuggestReplyMode) Value() (driver.Value, error) { type DefaultUserInputType int64 const ( - // 没设置 + // Not set DefaultUserInputType_NotSet DefaultUserInputType = 0 - // 文字 + // Text DefaultUserInputType_Text DefaultUserInputType = 1 - // 按住语音 + // Hold down the voice DefaultUserInputType_Voice DefaultUserInputType = 2 - // 语音通话 + // voice call DefaultUserInputType_Call DefaultUserInputType = 3 ) @@ -647,11 +647,11 @@ func (p *AnswerActionsMode) Value() (driver.Value, error) { type AnswerActionTriggerType int64 const ( - // 平台预设Trigger action + // Platform preset Trigger action AnswerActionTriggerType_Direct AnswerActionTriggerType = 1 - // 点击Action 显示自定义的H5页面 + // Click Action to display the custom H5 page AnswerActionTriggerType_WebView AnswerActionTriggerType = 2 - // 点击Action 发送自定义的用户消息 + // Click Action to send a custom user message AnswerActionTriggerType_SendMessage AnswerActionTriggerType = 3 ) @@ -697,11 +697,11 @@ func (p *AnswerActionTriggerType) Value() (driver.Value, error) { type SearchStrategy int64 const ( - // 语义搜索 + // semantic search SearchStrategy_SemanticSearch SearchStrategy = 0 - // 混合搜索 + // Hybrid Search SearchStrategy_HybirdSearch SearchStrategy = 1 - // 全文搜索 + // Full Text Search SearchStrategy_FullTextSearch SearchStrategy = 20 ) @@ -833,11 +833,11 @@ func (p *KnowledgeNoRecallReplyMode) Value() (driver.Value, error) { type SocietyVisibility int64 const ( - // 对所有人可见 + // Visible to all SocietyVisibility_Public SocietyVisibility = 1 - // 仅对host可见 + // Visible to host only SocietyVisibility_Anonymous SocietyVisibility = 2 - // 自定义 + // custom SocietyVisibility_Custom SocietyVisibility = 3 ) @@ -883,11 +883,11 @@ func (p *SocietyVisibility) Value() (driver.Value, error) { type FieldItemType int64 const ( - // 文本 String + // Text String FieldItemType_Text FieldItemType = 1 - // 数字 Integer + // Digital Integer FieldItemType_Number FieldItemType = 2 - // 时间 Time + // Time Time FieldItemType_Date FieldItemType = 3 // float Number FieldItemType_Float FieldItemType = 4 @@ -1051,7 +1051,7 @@ func (p *AgentType) Value() (driver.Value, error) { return int64(*p), nil } -// 版本兼容:0-旧版本 1-可回退的新版本 2-不可回退的新版本 3-可回退的新版本(不再提示) +// Version Compatibility: 0 - Old Version 1 - Rollback New Version 2 - Non-Rollback New Version 3 - Rollback New Version (no longer prompted) type AgentVersionCompat int64 const ( @@ -1238,9 +1238,9 @@ func (p *BotMode) Value() (driver.Value, error) { type BotSpecies int64 const ( - // bot种类 + // Bot type BotSpecies_Default BotSpecies = 0 - // 从coze创建 + // Created from coze BotSpecies_Function BotSpecies = 1 ) @@ -1282,9 +1282,9 @@ func (p *BotSpecies) Value() (driver.Value, error) { type TimeCapsuleMode int64 const ( - // 关 + // close TimeCapsuleMode_Off TimeCapsuleMode = 0 - // 开 + // open TimeCapsuleMode_On TimeCapsuleMode = 1 ) @@ -1593,11 +1593,11 @@ func (p *RecognitionMode) Value() (driver.Value, error) { type IndependentTiming int64 const ( - // 判断用户输入(前置) + // Determine user input (front) IndependentTiming_Pre IndependentTiming = 1 - // 判断节点输出(后置) + // Determine node output (postfix) IndependentTiming_Post IndependentTiming = 2 - // 前置模式和后置模式支持同时选择 + // Front mode and rear mode support simultaneous selection IndependentTiming_PreAndPost IndependentTiming = 3 ) @@ -1643,9 +1643,9 @@ func (p *IndependentTiming) Value() (driver.Value, error) { type IndependentRecognitionModelType int64 const ( - // 小模型 + // Small model IndependentRecognitionModelType_SLM IndependentRecognitionModelType = 0 - // 大模型 + // Large model IndependentRecognitionModelType_LLM IndependentRecognitionModelType = 1 ) @@ -1737,13 +1737,13 @@ type MessageFeedbackDetailType int64 const ( MessageFeedbackDetailType_UnlikeDefault MessageFeedbackDetailType = 0 - // 有害信息 + // Harmful information MessageFeedbackDetailType_UnlikeHarmful MessageFeedbackDetailType = 1 - // 信息有误 + // incorrect information MessageFeedbackDetailType_UnlikeIncorrect MessageFeedbackDetailType = 2 - // 未遵循指令 + // Did not follow instructions MessageFeedbackDetailType_UnlikeNotFollowInstructions MessageFeedbackDetailType = 3 - // 其他 + // other MessageFeedbackDetailType_UnlikeOthers MessageFeedbackDetailType = 4 ) @@ -1802,12 +1802,12 @@ const ( Scene_BotStore Scene = 2 Scene_CozeHome Scene = 3 Scene_Playground Scene = 4 - // 评测平台 + // evaluation platform Scene_Evaluation Scene = 5 Scene_AgentAPP Scene = 6 - //prompt优化 + //Prompt optimization Scene_PromptOptimize Scene = 7 - // createbot的nl2bot功能 + // Createbot's nl2bot features Scene_GenerateAgentInfo Scene = 8 ) @@ -1888,21 +1888,21 @@ func (p *Scene) Value() (driver.Value, error) { // // struct EnterMessage { // 1: required string Role (api.body = "role") -// 2: string Content(api.body = "content") // 内容 +// 2: string Content (api.body = "content")//content // 3: map MetaData(api.body = "meta_data") // 4: string ContentType(api.body = "content_type")//text/card/object_string // 5: string Type(api.body = "type") // } // // struct OpenMessageApi { -// 1: string Id(api.body = "id") // 主键ID -// 2: string BotId(api.body = "bot_id") // bot id //已TODO 所有的i64加注解str,入参和出参都要 +// 1: string Id (api.body = "id")//primary key ID +// 2: string BotId (api.body = "bot_id")//bot id//TODO All i64 plus annotation str, imported parameters and exported parameters are required // 3: string Role(api.body = "role") -// 4: string Content(api.body = "content") // 内容 +// 4: string Content (api.body = "content")//content // 5: string ConversationId(api.body = "conversation_id") // conversation id // 6: map MetaData(api.body = "meta_data") -// 7: string CreatedAt(api.body = "created_at") // 创建时间 -// 8: string UpdatedAt(api.body = "updated_at") // 更新时间 //已TODO 时间改成int +// 7: string CreatedAt (api.body = "created_at")//create_time +// 8: string UpdatedAt (api.body = "updated_at")//Update time//Change TODO time to int // 9: string ChatId(api.body = "chat_id") // 10: string ContentType(api.body = "content_type") // 11: string Type(api.body = "type") @@ -1952,9 +1952,9 @@ func (p *ReferenceUpdateType) Value() (driver.Value, error) { type ReferenceInfoStatus int64 const ( - // 1:有可用更新 + // 1: Updates are available ReferenceInfoStatus_HasUpdates ReferenceInfoStatus = 1 - // 2:被删除 + // 2: Deleted ReferenceInfoStatus_IsDelete ReferenceInfoStatus = 2 ) @@ -2448,7 +2448,7 @@ func (p *AuthToken) String() string { } type PromptInfo struct { - // 文本prompt + // Text prompt Prompt *string `thrift:"Prompt,1,optional" form:"prompt" json:"prompt,omitempty"` } @@ -2599,25 +2599,25 @@ func (p *PromptInfo) String() string { } type ModelInfo struct { - // 模型id + // Model ID ModelId *int64 `thrift:"ModelId,1,optional" form:"model_id" json:"model_id,string,omitempty"` - // 温度,模型输出随机性,值越大越随机,越小越保守(0-1] + // Temperature, model output randomness, the larger the value, the more random, the smaller the more conservative (0-1] Temperature *float64 `thrift:"Temperature,2,optional" form:"temperature" json:"temperature,omitempty"` - // 回复最大Token数 + // Maximum Token Reply MaxTokens *int32 `thrift:"MaxTokens,3,optional" form:"max_tokens" json:"max_tokens,omitempty"` - // 另一种模型的输出随机性,值越大越随机[0,1] + // Another model's output randomness, the larger the value, the more random [0, 1] TopP *float64 `thrift:"TopP,4,optional" form:"top_p" json:"top_p,omitempty"` - // 频率惩罚,调整生成内容中的单词频率,正值单词越少见[-1.0,1.0] + // Frequency penalty, adjust the frequency of words in the generated content, the fewer positive words are [-1.0, 1.0] FrequencyPenalty *float64 `thrift:"FrequencyPenalty,5,optional" form:"frequency_penalty" json:"frequency_penalty,omitempty"` - // 存在惩罚,调整生成内容中新词语频率,正值避免重复单词,用新词[-1.0,1.0] + // There is a penalty, adjust the frequency of new words in the generated content, avoid repeating words with positive values, and use new words [-1.0, 1.0] PresencePenalty *float64 `thrift:"PresencePenalty,6,optional" form:"presence_penalty" json:"presence_penalty,omitempty"` - // 上下文策略 + // contextual policy ShortMemoryPolicy *ShortMemoryPolicy `thrift:"ShortMemoryPolicy,7,optional" form:"short_memory_policy" json:"short_memory_policy,omitempty"` - // 生成时,采样候选集的大小 + // When generating, sample the size of the candidate set TopK *int32 `thrift:"TopK,8,optional" form:"top_k" json:"top_k,omitempty"` - // 模型回复内容格式 + // model reply content format ResponseFormat *ModelResponseFormat `thrift:"ResponseFormat,9,optional" form:"response_format" json:"response_format,omitempty"` - // 用户选择的模型风格 + // User-selected model style ModelStyle *ModelStyle `thrift:"ModelStyle,10,optional" form:"model_style" json:"model_style,omitempty"` } @@ -3262,9 +3262,9 @@ func (p *ModelInfo) String() string { } type ShortMemoryPolicy struct { - // 上下文允许传输的类型 + // The type of transmission allowed by the context ContextMode *ContextMode `thrift:"ContextMode,1,optional" form:"context_mode" json:"context_mode,omitempty"` - // 上下文带的轮数 + // Number of rounds of context band HistoryRound *int32 `thrift:"HistoryRound,2,optional" form:"history_round" json:"history_round,omitempty"` } @@ -3471,11 +3471,11 @@ func (p *ShortMemoryPolicy) String() string { } type PluginInfo struct { - // 插件id + // Plugin ID PluginId *int64 `thrift:"PluginId,1,optional" form:"plugin_id" json:"plugin_id,string,omitempty"` // api Id ApiId *int64 `thrift:"ApiId,2,optional" form:"api_id" json:"api_id,string,omitempty"` - // api name O项目用 + // API name O project ApiName *string `thrift:"ApiName,3,optional" form:"api_name" json:"api_name,omitempty"` // api version ApiVersionMs *int64 `thrift:"ApiVersionMs,100,optional" form:"api_version_ms" json:"api_version_ms,string,omitempty"` @@ -3795,11 +3795,11 @@ func (p *PluginInfo) String() string { type WorkflowInfo struct { // WorkflowId WorkflowId *int64 `thrift:"WorkflowId,1,optional" form:"workflow_id" json:"workflow_id,string,omitempty"` - // 插件id + // Plugin ID PluginId *int64 `thrift:"PluginId,2,optional" form:"plugin_id" json:"plugin_id,string,omitempty"` // api Id ApiId *int64 `thrift:"ApiId,3,optional" form:"api_id" json:"api_id,string,omitempty"` - // workflow or imageflow, 默认为workflow + // Workflow or imageflow, default to workflow FlowMode *WorkflowMode `thrift:"FlowMode,4,optional" form:"flow_mode" json:"flow_mode,omitempty"` // workflow name WorkflowName *string `thrift:"WorkflowName,5,optional" form:"workflow_name" json:"workflow_name,omitempty"` @@ -4366,7 +4366,7 @@ type PluginParameter struct { Required *bool `thrift:"Required,3,optional" form:"required" json:"required,omitempty"` Type *string `thrift:"Type,4,optional" form:"type" json:"type,omitempty"` SubParameters []*PluginParameter `thrift:"SubParameters,5,optional" form:"sub_parameters" json:"sub_parameters,omitempty"` - // 如果Type是数组,则有subtype + // If Type is an array, there is a subtype SubType *string `thrift:"SubType,6,optional" form:"sub_type" json:"sub_type,omitempty"` } @@ -4812,15 +4812,15 @@ func (p *PluginParameter) String() string { } type OnboardingInfo struct { - // 对应 Coze Opening Dialog + // Coze Opening Dialog Prologue *string `thrift:"Prologue,1,optional" form:"prologue" json:"prologue,omitempty"` - // 建议问题 + // suggestion question SuggestedQuestions []string `thrift:"SuggestedQuestions,2,optional" form:"suggested_questions" json:"suggested_questions,omitempty"` - // 开场白模型 + // Opener model OnboardingMode *OnboardingMode `thrift:"OnboardingMode,3,optional" form:"onboarding_mode" json:"onboarding_mode,omitempty"` - // LLM生成,用户自定义 Prompt + // LLM Generation, User-defined Prompt CustomizedOnboardingPrompt *string `thrift:"CustomizedOnboardingPrompt,4,optional" form:"customized_onboarding_prompt" json:"customized_onboarding_prompt,omitempty"` - // 开场白预设问题展示方式 默认0 随机展示 + // The opening statement presets the problem display method, and the default is 0 random display. SuggestedQuestionsShowMode *SuggestedQuestionsShowMode `thrift:"SuggestedQuestionsShowMode,5,optional" form:"suggested_questions_show_mode" json:"suggested_questions_show_mode,omitempty"` } @@ -5214,11 +5214,11 @@ func (p *OnboardingInfo) String() string { // suggest type SuggestReplyInfo struct { - // 对应 Coze Auto-Suggestion + // Coze Auto-Suggestion SuggestReplyMode *SuggestReplyMode `thrift:"SuggestReplyMode,1,optional" form:"suggest_reply_mode" json:"suggest_reply_mode,omitempty"` - // 用户自定义建议问题 + // user-defined suggestion questions CustomizedSuggestPrompt *string `thrift:"CustomizedSuggestPrompt,2,optional" form:"customized_suggest_prompt" json:"customized_suggest_prompt,omitempty"` - // 运行Prompt的ChainTask名称 + // The name of the ChainTask that runs the Prompt ChainTaskName *string `thrift:"ChainTaskName,3,optional" form:"chain_task_name" json:"chain_task_name,omitempty"` } @@ -5481,19 +5481,19 @@ func (p *SuggestReplyInfo) String() string { // tts Voices type VoicesInfo struct { - // 对应 Coze Voices + // Coze Voices Muted *bool `thrift:"Muted,1,optional" form:"muted" json:"muted,omitempty"` - // 多语音音色配置 + // Multi-voice voice configuration I18nLangVoice map[string]int64 `thrift:"I18nLangVoice,2,optional" form:"i18n_lang_voice" json:"i18n_lang_voice,omitempty"` - // 多语音音色配置, string类型 + // Multi-voice tone configuration, string type I18nLangVoiceStr map[string]string `thrift:"I18nLangVoiceStr,7,optional" form:"i18n_lang_voice_str" json:"i18n_lang_voice_str,omitempty"` - // 是否自动播放 + // Whether to play automatically Autoplay *bool `thrift:"Autoplay,3,optional" form:"autoplay" json:"autoplay,omitempty"` - // 自动播放的音色 + // autoplay timbre AutoplayVoice map[string]int64 `thrift:"AutoplayVoice,4,optional" form:"autoplay_voice" json:"autoplay_voice,omitempty"` - // 是否关闭语音通话,true:关闭 false:开启 默认为false + // Whether to turn off voice calls, true: turn off false: turn on, default is false CloseVoiceCall *bool `thrift:"CloseVoiceCall,5,optional" form:"voice_call" json:"voice_call,omitempty"` - // 默认用户输入类型 + // Default user input type DefaultUserInputType *DefaultUserInputType `thrift:"DefaultUserInputType,6,optional" form:"default_user_input_type" json:"default_user_input_type,omitempty"` } @@ -6064,7 +6064,7 @@ func (p *VoicesInfo) String() string { type AnswerActionTriggerRule struct { Type AnswerActionTriggerType `thrift:"Type,1" form:"type" json:"type"` NeedPreloading bool `thrift:"NeedPreloading,2" form:"need_preloading" json:"need_preloading"` - // 根据 AnswerActionTriggerType决定 + // According to AnswerActionTriggerType TriggerData map[string]string `thrift:"TriggerData,3" form:"trigger_data" json:"trigger_data"` } @@ -6321,15 +6321,15 @@ func (p *AnswerActionTriggerRule) String() string { } type ActionIcon struct { - // 自定义的按钮 type 不用传 + // Customized button type does not need to be passed Type string `thrift:"Type,1" form:"type" json:"type"` - // 默认状态 + // default state DefaultUrl string `thrift:"DefaultUrl,2" form:"default_url" json:"default_url"` - // 按下按钮的状态 + // The state of pressing the button ActiveUrl string `thrift:"ActiveUrl,3" form:"active_url" json:"active_url"` - // 默认状态 + // default state DefaultUri string `thrift:"DefaultUri,4" form:"default_uri" json:"default_uri"` - // 按下按钮的状态 + // The state of pressing the button ActiveUri string `thrift:"ActiveUri,5" form:"active_uri" json:"active_uri"` } @@ -6645,17 +6645,17 @@ func (p *ActionIcon) String() string { } type AnswerActionConfig struct { - // 预制的只需要传key + // The prefabricated one only needs to pass the key. Key string `thrift:"Key,1" form:"key" json:"key"` - // 默认 + // default Name string `thrift:"Name,2" form:"name" json:"name"` - // 下发uri + // Send uri. Icon *ActionIcon `thrift:"Icon,3" form:"icon" json:"icon"` - // 存储用户i18的name + // Store the name of user i18 NameI18n map[string]string `thrift:"NameI18n,4" form:"name_i18n" json:"name_i18n"` - // Direct 没有值; WebView 包含 webview_url和 webview_callback_psm两个key;SendMessage 包含send_message_prompt + // Direct has no value; WebView contains webview_url and webview_callback_psm keys; SendMessage contains send_message_prompt TriggerRule *AnswerActionTriggerRule `thrift:"TriggerRule,5" form:"trigger_rule" json:"trigger_rule"` - // 位置 + // location Position int32 `thrift:"Position,6" form:"position" json:"position"` } @@ -7267,7 +7267,7 @@ type BotExtInfo struct { BotTemplateName *string `thrift:"BotTemplateName,4,optional" form:"bot_template_name" json:"bot_template_name,omitempty"` UseUGCVoice *bool `thrift:"UseUGCVoice,5,optional" form:"use_ugc_voice" json:"use_ugc_voice,omitempty"` AppId *int32 `thrift:"AppId,6,optional" form:"app_id" json:"app_id,omitempty"` - // 是否绑定小程序标识 + // Whether to bind the Mini Program logo BindingMp *bool `thrift:"BindingMp,7,optional" form:"binding_mp" json:"binding_mp,omitempty"` } @@ -7765,9 +7765,9 @@ func (p *BotExtInfo) String() string { } type KnowledgeInfo struct { - // 知识库id + // Knowledge ID Id *string `thrift:"Id,1,optional" form:"id" json:"id,omitempty"` - // 知识库名称 + // Knowledge base name Name *string `thrift:"Name,2,optional" form:"name" json:"name,omitempty"` } @@ -7973,25 +7973,25 @@ func (p *KnowledgeInfo) String() string { } type Knowledge struct { - // 知识库信息 + // Knowledge Base Information KnowledgeInfo []*KnowledgeInfo `thrift:"KnowledgeInfo,1,optional" form:"knowledge_info" json:"knowledge_info,omitempty"` - // 召回最大数据量 + // recall maximum data volume TopK *int64 `thrift:"TopK,2,optional" form:"top_k" json:"top_k,omitempty"` - // 最小匹配度 + // minimum match MinScore *float64 `thrift:"MinScore,3,optional" form:"min_score" json:"min_score,omitempty"` - // 自动召回 + // automatic recall Auto *bool `thrift:"Auto,4,optional" form:"auto" json:"auto,omitempty"` - // 搜索策略 + // search strategy SearchStrategy *SearchStrategy `thrift:"SearchStrategy,5,optional" form:"search_strategy" json:"search_strategy,omitempty"` - // 是否展示来源 + // Whether to show the source ShowSource *bool `thrift:"ShowSource,6,optional" form:"show_source" json:"show_source,omitempty"` - // 无召回回复mode,默认0 + // No recall reply mode, default 0 NoRecallReplyMode *KnowledgeNoRecallReplyMode `thrift:"NoRecallReplyMode,7,optional" form:"no_recall_reply_mode" json:"no_recall_reply_mode,omitempty"` - // 无召回回复时自定义prompt,当NoRecallReplyMode=1时生效 + // Custom prompt for no recall reply, effective when NoRecallReplyMode = 1 NoRecallReplyCustomizePrompt *string `thrift:"NoRecallReplyCustomizePrompt,8,optional" form:"no_recall_reply_customize_prompt" json:"no_recall_reply_customize_prompt,omitempty"` - // 来源展示方式 默认值0 卡片列表方式 + // Source display method, default value 0 card list method ShowSourceMode *KnowledgeShowSourceMode `thrift:"ShowSourceMode,9,optional" form:"show_source_mode" json:"show_source_mode,omitempty"` - // 召回策略, 默认值为true + // Recall policy, default value is true RecallStrategy *RecallStrategy `thrift:"RecallStrategy,10,optional" form:"recall_strategy" json:"recall_strategy,omitempty"` } @@ -8919,9 +8919,9 @@ func (p *RecallStrategy) String() string { } type SocietyVisibiltyConfig struct { - // 社会场景中可见性: Public = 1,Anonymous = 2 + // Visibility in Social Scene: Public = 1, Anonymous = 2 VisibilityType SocietyVisibility `thrift:"VisibilityType,1" json:"visibility_type,omitempty" form:"visibility_type" ` - // 可见角色列表 + // list of visible characters VisibilityRoles []string `thrift:"VisibilityRoles,2" json:"visibility_roles,omitempty" form:"visibility_roles" ` } @@ -9127,17 +9127,17 @@ func (p *SocietyVisibiltyConfig) String() string { type Variable struct { // key, Field Key *string `thrift:"Key,1,optional" form:"key" json:"key,omitempty"` - // 描述 + // describe Description *string `thrift:"Description,2,optional" form:"description" json:"description,omitempty"` - // 默认值 + // default value DefaultValue *string `thrift:"DefaultValue,3,optional" form:"default_value" json:"default_value,omitempty"` - // 是否系统值系统值 + // Whether the system value is the system value IsSystem *bool `thrift:"IsSystem,4,optional" form:"is_system" json:"is_system,omitempty"` - // 是否支持在Prompt中调用 默认支持 + // Whether to support calling in Prompt, the default is supported PromptDisabled *bool `thrift:"PromptDisabled,5,optional" form:"prompt_disabled" json:"prompt_disabled,omitempty"` - // 社会场景中可见性: Public = 1,Anonymous = 2 + // Visibility in Social Scene: Public = 1, Anonymous = 2 SocietyVisibilityConfig *SocietyVisibiltyConfig `thrift:"SocietyVisibilityConfig,6,optional" json:"society_visibility_config,omitempty" form:"society_visibility_config" ` - // 是否禁用,默认为false代表启用 + // Whether to disable, the default is false to enable IsDisabled *bool `thrift:"IsDisabled,7,optional" form:"is_disabled" json:"is_disabled,omitempty"` } @@ -9615,9 +9615,9 @@ func (p *Variable) String() string { } type TaskInfo struct { - // coze 上的 Scheduled Tasks + // Scheduled Tasks on Coze UserTaskAllowed *bool `thrift:"UserTaskAllowed,1,optional" form:"user_task_allowed" json:"user_task_allowed,omitempty"` - // 允许预设任务 + // Allow preset tasks EnablePresetTask *int64 `thrift:"EnablePresetTask,2,optional" form:"enable_preset_task" json:"enable_preset_task,omitempty"` } @@ -9823,19 +9823,19 @@ func (p *TaskInfo) String() string { } type FieldItem struct { - // 字段名称 + // field name Name *string `thrift:"Name,1,optional" form:"name" json:"name,omitempty"` - // 字段描述 + // Field description Desc *string `thrift:"Desc,2,optional" form:"desc" json:"desc,omitempty"` - // 字段类型 + // field type Type *FieldItemType `thrift:"Type,3,optional" form:"type" json:"type,omitempty"` - // 是否必填 + // Is it required? MustRequired *bool `thrift:"MustRequired,4,optional" form:"must_required" json:"must_required,omitempty"` - // 字段Id 新增为0 + // The field Id is added as 0. Id *int64 `thrift:"Id,5,optional" form:"id" json:"id,string,omitempty"` - // 字段类型 str + // Field type str TypeStr *string `thrift:"TypeStr,6,optional" form:"type_str" json:"type_str,omitempty"` - // 字段类型 str + // Field type str AlterId *int64 `thrift:"AlterId,7,optional" form:"alterId" json:"alterId,omitempty"` } @@ -10319,13 +10319,13 @@ func (p *FieldItem) String() string { type Database struct { // table id TableId *string `thrift:"TableId,1,optional" form:"table_id" json:"table_id,omitempty"` - // table名称 + // Table name TableName *string `thrift:"TableName,2,optional" form:"table_name" json:"table_name,omitempty"` - // table简介 + // Table Introduction TableDesc *string `thrift:"TableDesc,3,optional" form:"table_desc" json:"table_desc,omitempty"` - // table字段信息 + // Table field information FieldList []*FieldItem `thrift:"FieldList,4,optional" form:"field_list" json:"field_list,omitempty"` - // 是否支持在Prompt中调用 默认支持 + // Whether to support calling in Prompt, the default is supported PromptDisabled *bool `thrift:"PromptDisabled,5,optional" form:"prompt_disabled" json:"prompt_disabled,omitempty"` RWMode *BotTableRWMode `thrift:"RWMode,6,optional" form:"rw_mode" json:"rw_mode,omitempty"` } @@ -10775,20 +10775,20 @@ func (p *Database) String() string { type Agent struct { AgentId int64 `thrift:"AgentId,1" form:"agent_id" json:"agent_id,string"` AgentName string `thrift:"AgentName,2" form:"agent_name" json:"agent_name"` - // prompt 信息 + // Prompt message PromptInfo *PromptInfo `thrift:"PromptInfo,3" form:"prompt_info" json:"prompt_info"` - // plugin列表 + // List of plugins PluginInfoList []*PluginInfo `thrift:"PluginInfoList,4" form:"plugin_info_list" json:"plugin_info_list"` - // 数据集 + // dataset Knowledge *Knowledge `thrift:"Knowledge,5" form:"knowledge" json:"knowledge"` - // Workflow 列表 + // Workflow List WorkflowInfoList []*WorkflowInfo `thrift:"WorkflowInfoList,6" form:"workflow_info_list" json:"workflow_info_list"` - // 模型配置 + // model configuration ModelInfo *ModelInfo `thrift:"ModelInfo,7" form:"model_info" json:"model_info"` - // 意图信息 + // intent information Intents []*Intent `thrift:"Intents,8" form:"intents" json:"intents"` AgentType AgentType `thrift:"AgentType,9" form:"agent_type" json:"agent_type"` - // 是否是rootagent + // Is it a rootagent? RootAgent bool `thrift:"RootAgent,10" form:"root_agent" json:"root_agent"` ReferenceId int64 `thrift:"ReferenceId,11" form:"reference_id" json:"reference_id,string"` FirstVersion string `thrift:"FirstVersion,12" form:"first_version" json:"first_version"` @@ -10798,14 +10798,14 @@ type Agent struct { JumpConfig *JumpConfig `thrift:"JumpConfig,16" form:"jump_config" json:"jump_config"` SuggestReplyInfo *SuggestReplyInfo `thrift:"SuggestReplyInfo,17" form:"suggest_reply_info" json:"suggest_reply_info"` Description string `thrift:"Description,18" form:"description" json:"description"` - // multi_agent版本兼容字段 + // multi_agent version compatibility field VersionCompat AgentVersionCompat `thrift:"VersionCompat,19" form:"version_compat" json:"version_compat"` HookInfo *HookInfo `thrift:"HookInfo,20,optional" form:"hook_info" json:"hook_info,omitempty"` - //子bot当前版本 + //The current version of the subbot CurrentVersion *string `thrift:"CurrentVersion,21,optional" form:"current_version" json:"current_version,omitempty"` - // 1:有可用更新 2:被删除 + // 1: Available update 2: Removed ReferenceInfoStatus *ReferenceInfoStatus `thrift:"ReferenceInfoStatus,22,optional" form:"reference_info_status" json:"reference_info_status,omitempty"` - //子bot更新类型 + //Subbot update type UpdateType *ReferenceUpdateType `thrift:"UpdateType,23,optional" form:"update_type" json:"update_type,omitempty"` } @@ -12509,7 +12509,7 @@ func (p *Intent) String() string { } -// 时间胶囊信息 +// Time Capsule Information type TimeCapsuleInfo struct { TimeCapsuleMode *TimeCapsuleMode `thrift:"TimeCapsuleMode,1,optional" form:"time_capsule_mode" json:"time_capsule_mode,omitempty"` DisablePromptCalling *DisablePromptCalling `thrift:"DisablePromptCalling,2,optional" form:"disable_prompt_calling" json:"disable_prompt_calling,omitempty"` @@ -12719,7 +12719,7 @@ func (p *TimeCapsuleInfo) String() string { } type BotTagInfo struct { - // 时间胶囊信息 tag key : time_capsule + // Time capsule information tag key: time_capsule TimeCapsuleInfo *TimeCapsuleInfo `thrift:"TimeCapsuleInfo,1,optional" form:"time_capsule_info" json:"time_capsule_info,omitempty"` } @@ -13017,74 +13017,74 @@ func (p *FileboxInfo) String() string { } -// bot信息 +// bot information type BotInfo struct { // bot id BotId int64 `thrift:"BotId,1" form:"bot_id" json:"bot_id,string"` - // bot名称 + // bot name Name string `thrift:"Name,2" form:"name" json:"name"` - // bot描述 + // Bot description Description string `thrift:"Description,3" form:"description" json:"description"` - // bot 图标uri + // Bot icon uri IconUri string `thrift:"IconUri,4" form:"icon_uri" json:"icon_uri"` - // bot 图标url + // Bot icon url IconUrl string `thrift:"IconUrl,5" form:"icon_url" json:"icon_url"` - // 创建人id + // creator id CreatorId int64 `thrift:"CreatorId,6" form:"creator_id" json:"creator_id,string"` - // 创建时间 + // create_time CreateTime int64 `thrift:"CreateTime,7" form:"create_time" json:"create_time,string"` - // 更新时间 + // update time UpdateTime int64 `thrift:"UpdateTime,8" form:"update_time" json:"update_time,string"` - // 业务线 + // line of business ConnectorId int64 `thrift:"ConnectorId,9" form:"connector_id" json:"connector_id,string"` - // 版本,毫秒 + // Version, ms Version string `thrift:"Version,10" form:"version" json:"version"` - // 模型配置 + // model configuration ModelInfo *ModelInfo `thrift:"ModelInfo,11" form:"model_info" json:"model_info"` - // prompt 信息 + // Prompt message PromptInfo *PromptInfo `thrift:"PromptInfo,12" form:"prompt_info" json:"prompt_info"` - // plugin列表 + // List of plugins PluginInfoList []*PluginInfo `thrift:"PluginInfoList,13" form:"plugin_info_list" json:"plugin_info_list"` - // Workflow 列表 + // Workflow List WorkflowInfoList []*WorkflowInfo `thrift:"WorkflowInfoList,14" form:"workflow_info_list" json:"workflow_info_list"` - // 开场白 + // opening statement OnboardingInfo *OnboardingInfo `thrift:"OnboardingInfo,15" form:"onboarding_info" json:"onboarding_info"` - // 数据集 + // dataset Knowledge *Knowledge `thrift:"Knowledge,16" form:"knowledge" json:"knowledge"` - // kv存储 + // KV storage VariableList []*Variable `thrift:"VariableList,17" form:"variable_list" json:"variable_list"` - // 任务管理/预设任务 + // Task management/preset tasks TaskInfo *TaskInfo `thrift:"TaskInfo,18" form:"task_info" json:"task_info"` - // 数据表 + // data table DatabaseList []*Database `thrift:"DatabaseList,19" form:"database_list" json:"database_list"` - // 推荐问题 + // referral question SuggestReplyInfo *SuggestReplyInfo `thrift:"SuggestReplyInfo,20" form:"suggest_reply_info" json:"suggest_reply_info"` - // 音色配置 + // Timbre Configuration VoicesInfo *VoicesInfo `thrift:"VoicesInfo,21" form:"voices_info" json:"voices_info"` - // 额外信息,扩展字段 + // Additional information, extended fields BotExtInfo *BotExtInfo `thrift:"BotExtInfo,22" form:"bot_ext_info" json:"bot_ext_info"` - // bot 类型,single agent or multi agent + // Bot type, single agent or multi agent BotMode BotMode `thrift:"BotMode,23" form:"bot_mode" json:"bot_mode"` - // multi agent mode agent信息 + // Multi agent mode agent information Agents []*Agent `thrift:"Agents,24" form:"agents" json:"agents"` - // Bot种类 + // Bot type BotSpecies BotSpecies `thrift:"BotSpecies,25" form:"bot_species" json:"bot_species"` - // bot tag 信息,用户新增字段 + // Bot tag information, user new field BotTagInfo *BotTagInfo `thrift:"BotTagInfo,26" form:"bot_tag_info" json:"bot_tag_info"` - // filebox 信息 + // FileBox Information FileboxInfo *FileboxInfo `thrift:"FileboxInfo,27" form:"filebox_info" json:"filebox_info"` - // multi_agent结构体 + // multi_agent structure MultiAgentInfo *MultiAgentInfo `thrift:"MultiAgentInfo,28" form:"multi_agent_info" json:"multi_agent_info"` - // 背景图列表结构体 + // Background cover list structure BackgroundImageInfoList []*BackgroundImageInfo `thrift:"BackgroundImageInfoList,29" form:"background_image_info_list" json:"background_image_info_list"` ShortcutSort []string `thrift:"ShortcutSort,30" form:"shortcut_sort" json:"shortcut_sort"` - // bot状态 + // bot state Status BotStatus `thrift:"Status,31" form:"status" json:"status"` - // hook信息 + // Hook information HookInfo *HookInfo `thrift:"HookInfo,32,optional" form:"hook_info" json:"hook_info,omitempty"` - // 用户query收集配置 + // User query collection configuration UserQueryCollectConf *UserQueryCollectConf `thrift:"UserQueryCollectConf,33" form:"user_query_collect_conf" json:"user_query_collect_conf"` - // workflow模式的编排信息 + // Orchestration information for workflow patterns LayoutInfo *LayoutInfo `thrift:"LayoutInfo,34" form:"layout_info" json:"layout_info"` BusinessType BusinessType `thrift:"BusinessType,35" form:"business_type" json:"business_type"` } @@ -14947,7 +14947,7 @@ func (p *BotInfo) String() string { } type CommonKnowledge struct { - // 知识库信息 + // Knowledge Base Information KnowledgeInfos []*KnowledgeInfo `thrift:"knowledge_infos,1" form:"knowledge_infos" json:"knowledge_infos" query:"knowledge_infos"` } @@ -15107,19 +15107,19 @@ func (p *CommonKnowledge) String() string { } type ShortcutCommandComponent struct { - // panel参数 + // Panel parameters Name string `thrift:"name,1" form:"name" json:"name" query:"name"` - //参数描述 + //parameter description Description string `thrift:"description,2" form:"description" json:"description" query:"description"` - // 输入类型 text、select、file + // Input type text, select, file Type string `thrift:"type,3" form:"type" json:"type" query:"type"` - // 请求工具时,参数的key 对应tool的参数名称,没有则为不返回 + // When requesting a tool, the key of the parameter corresponds to the parameter name of the tool. If not, it will not be returned. ToolParameter *string `thrift:"tool_parameter,4,optional" form:"tool_parameter" json:"tool_parameter,omitempty" query:"tool_parameter"` - // type为select时的可选项列表 or type为file时,支持哪些类型 image、doc、table、audio、video、zip、code、txt、ppt + // Options list when type is select or what types are supported when type is file image, doc, table, audio, video, zip, code, txt, ppt Options []string `thrift:"options,5,optional" form:"options" json:"options,omitempty" query:"options"` - // 默认值 没配置时不返回 + // Default value, not returned when not configured DefaultValue *string `thrift:"default_value,6,optional" form:"default_value" json:"default_value,omitempty" query:"default_value"` - // 是否隐藏不展示 线上bot tool类型的快捷指令不返回hide=true的component + // Whether to hide or not to show, the shortcut command of the online bot tool type does not return the component with hide = true IsHide bool `thrift:"is_hide,7" form:"is_hide" json:"is_hide" query:"is_hide"` } @@ -15578,7 +15578,7 @@ func (p *ShortcutCommandComponent) String() string { type ShortcutCommandToolInfo struct { // Name string `thrift:"name,1" form:"name" json:"name" query:"name"` - // tool类型 workflow plugin + // Tool type workflow plugin Type string `thrift:"type,2" form:"type" json:"type" query:"type"` } @@ -15762,23 +15762,23 @@ func (p *ShortcutCommandToolInfo) String() string { } type ShortcutCommandInfo struct { - // 快捷指令id + // Quick Command ID ID int64 `thrift:"id,1" form:"id" json:"id,string" query:"id"` - // 快捷指令按钮名称 + // Shortcut button name Name string `thrift:"name,2" form:"name" json:"name" query:"name"` - // 快捷指令 + // Quick Instruction Command string `thrift:"command,3" form:"command" json:"command" query:"command"` - // 快捷指令描述 + // shortcut description Description string `thrift:"description,4" form:"description" json:"description" query:"description"` - // 指令query模版 + // Command query template QueryTemplate string `thrift:"query_template,5" form:"query_template" json:"query_template" query:"query_template"` - // 快捷指令icon + // Quick command icon IconURL string `thrift:"icon_url,6" form:"icon_url" json:"icon_url" query:"icon_url"` - // 组件列表(参数列表) + // Component list (parameter list) Components []*ShortcutCommandComponent `thrift:"components,7,optional" form:"components" json:"components,omitempty" query:"components"` - // tool信息 + // Tool information Tool *ShortcutCommandToolInfo `thrift:"tool,8,optional" form:"tool" json:"tool,omitempty" query:"tool"` - //multi的指令时,该指令由哪个节点执行 没配置不返回 + //When the multi instruction is executed by which node, it will not be returned without configuration AgentID *int64 `thrift:"agent_id,9,optional" form:"agent_id" json:"agent_id,string,omitempty" query:"agent_id"` } @@ -16322,41 +16322,41 @@ func (p *ShortcutCommandInfo) String() string { type OpenAPIBotInfo struct { // bot id BotID int64 `thrift:"bot_id,1" form:"bot_id" json:"bot_id,string" query:"bot_id"` - // bot名称 + // bot name Name string `thrift:"name,2" form:"name" json:"name" query:"name"` - // bot描述 + // Bot description Description string `thrift:"description,3" form:"description" json:"description" query:"description"` - // bot图像url + // Bot image url IconURL string `thrift:"icon_url,4" form:"icon_url" json:"icon_url" query:"icon_url"` - // 创建时间 + // create_time CreateTime int64 `thrift:"create_time,5" form:"create_time" json:"create_time" query:"create_time"` - // 更新时间 + // update time UpdateTime int64 `thrift:"update_time,6" form:"update_time" json:"update_time" query:"update_time"` - // 版本 + // version Version string `thrift:"version,7" form:"version" json:"version" query:"version"` - // prompt 信息 + // Prompt message PromptInfo *PromptInfo `thrift:"prompt_info,8" form:"prompt_info" json:"prompt_info" query:"prompt_info"` - // 开场白 + // opening statement OnboardingInfo *OnboardingInfo `thrift:"onboarding_info,9" form:"onboarding_info" json:"onboarding_info" query:"onboarding_info"` - // bot 类型,single agent or multi agent + // Bot type, single agent or multi agent BotMode BotMode `thrift:"bot_mode,10" form:"bot_mode" json:"bot_mode" query:"bot_mode"` - // 11: optional list voice_data_list, // 选择的语音信息 + // 11: optional list < VoiceData > voice_data_list,//selected voice message ModelInfo *ModelInfo `thrift:"model_info,12,optional" form:"model_info" json:"model_info,omitempty" query:"model_info"` - // 插件信息列表 + // Plugin information list PluginInfoList []*PluginInfo `thrift:"plugin_info_list,13" form:"plugin_info_list" json:"plugin_info_list" query:"plugin_info_list"` - // 知识库信息 + // Knowledge Base Information Knowledge *CommonKnowledge `thrift:"knowledge,14,optional" form:"knowledge" json:"knowledge,omitempty" query:"knowledge"` - // workflow信息列表 + // Workflow information list WorkflowInfoList []*WorkflowInfo `thrift:"workflow_info_list,15" form:"workflow_info_list" json:"workflow_info_list" query:"workflow_info_list"` - // 快捷指令信息列表 + // Quick Command Information List ShortcutCommands []*ShortcutCommandInfo `thrift:"shortcut_commands,16" form:"shortcut_commands" json:"shortcut_commands" query:"shortcut_commands"` - // 17: list voice_info_list, // 音色配置 + // 17: list < Voice > voice_info_list,//Tone Configuration DefaultUserInputType string `thrift:"default_user_input_type,18" form:"default_user_input_type" json:"default_user_input_type" query:"default_user_input_type"` - // 用户问题建议 + // User Question Suggestions SuggestReplyInfo *SuggestReplyInfo `thrift:"suggest_reply_info,19" form:"suggest_reply_info" json:"suggest_reply_info" query:"suggest_reply_info"` - // 背景图片 + // background image BackgroundImageInfo *BackgroundImageInfo `thrift:"background_image_info,20" form:"background_image_info" json:"background_image_info" query:"background_image_info"` - // 变量列表 + // Variable list Variables []*Variable `thrift:"variables,21" form:"variables" json:"variables" query:"variables"` } @@ -17594,9 +17594,9 @@ func (p *LayoutInfo) String() string { } type UserQueryCollectConf struct { - // 是否开启收集开关 + // Whether to turn on the collection switch IsCollected bool `thrift:"IsCollected,1" form:"is_collected" json:"is_collected"` - // 隐私协议链接 + // Privacy Policy Link PrivatePolicy string `thrift:"PrivatePolicy,2" form:"private_policy" json:"private_policy"` } @@ -17780,11 +17780,11 @@ func (p *UserQueryCollectConf) String() string { } type MultiAgentInfo struct { - // multi_agent会话接管方式 + // multi_agent session takeover SessionType MultiAgentSessionType `thrift:"SessionType,1" form:"session_type" json:"session_type"` - // multi_agent版本兼容字段 前端用 + // multi_agent version compatibility field, front-end use VersionCompatInfo *AgentVersionCompatInfo `thrift:"VersionCompatInfo,2" form:"version_compat_info" json:"version_compat_info"` - // multi_agent连线类型 前端用 + // multi_agent connection type, front end ConnectorType MultiAgentConnectorType `thrift:"ConnectorType,3" form:"connector_type" json:"connector_type"` } @@ -18202,9 +18202,9 @@ func (p *AgentVersionCompatInfo) String() string { } type BackgroundImageInfo struct { - // web端背景图 + // Web background cover WebBackgroundImage *BackgroundImageDetail `thrift:"WebBackgroundImage,1,optional" form:"web_background_image" json:"web_background_image,omitempty"` - // 移动端背景图 + // Mobile end background cover MobileBackgroundImage *BackgroundImageDetail `thrift:"MobileBackgroundImage,2,optional" form:"mobile_background_image" json:"mobile_background_image,omitempty"` } @@ -18404,16 +18404,16 @@ func (p *BackgroundImageInfo) String() string { } type BackgroundImageDetail struct { - // 原始图片 + // original image OriginImageUri *string `thrift:"OriginImageUri,1,optional" form:"origin_image_uri" json:"origin_image_uri,omitempty"` OriginImageUrl *string `thrift:"OriginImageUrl,2,optional" form:"origin_image_url" json:"origin_image_url,omitempty"` - // 实际使用图片 + // Actual use of pictures ImageUri *string `thrift:"ImageUri,3,optional" form:"image_uri" json:"image_uri,omitempty"` ImageUrl *string `thrift:"ImageUrl,4,optional" form:"image_url" json:"image_url,omitempty"` ThemeColor *string `thrift:"ThemeColor,5,optional" form:"theme_color" json:"theme_color,omitempty"` - // 渐变位置 + // Gradual change of position GradientPosition *GradientPosition `thrift:"GradientPosition,6,optional" form:"gradient_position" json:"gradient_position,omitempty"` - // 裁剪画布位置 + // Crop canvas position CanvasPosition *CanvasPosition `thrift:"CanvasPosition,7,optional" form:"canvas_position" json:"canvas_position,omitempty"` } @@ -19411,71 +19411,71 @@ func (p *CanvasPosition) String() string { } -// bot信息 for 更新 +// Update for bot information type BotInfoForUpdate struct { // bot id BotId *int64 `thrift:"BotId,1,optional" form:"bot_id" json:"bot_id,string,omitempty"` - // bot名称 + // bot name Name *string `thrift:"Name,2,optional" form:"name" json:"name,omitempty"` - // bot描述 + // Bot description Description *string `thrift:"Description,3,optional" form:"description" json:"description,omitempty"` - // bot 图标uri + // Bot icon uri IconUri *string `thrift:"IconUri,4,optional" form:"icon_uri" json:"icon_uri,omitempty"` - // bot 图标url + // Bot icon url IconUrl *string `thrift:"IconUrl,5,optional" form:"icon_url" json:"icon_url,omitempty"` - // 创建人id + // creator id CreatorId *int64 `thrift:"CreatorId,6,optional" form:"creator_id" json:"creator_id,string,omitempty"` - // 创建时间 + // create_time CreateTime *int64 `thrift:"CreateTime,7,optional" form:"create_time" json:"create_time,string,omitempty"` - // 更新时间 + // update time UpdateTime *int64 `thrift:"UpdateTime,8,optional" form:"update_time" json:"update_time,string,omitempty"` - // 业务线 + // line of business ConnectorId *int64 `thrift:"ConnectorId,9,optional" form:"connector_id" json:"connector_id,string,omitempty"` - // 版本,毫秒 + // Version, ms Version *string `thrift:"Version,10,optional" form:"version" json:"version,omitempty"` - // 模型配置 + // model configuration ModelInfo *ModelInfo `thrift:"ModelInfo,11,optional" form:"model_info" json:"model_info,omitempty"` - // prompt 信息 + // Prompt message PromptInfo *PromptInfo `thrift:"PromptInfo,12,optional" form:"prompt_info" json:"prompt_info,omitempty"` - // plugin列表 + // List of plugins PluginInfoList []*PluginInfo `thrift:"PluginInfoList,13,optional" form:"plugin_info_list" json:"plugin_info_list,omitempty"` - // Workflow 列表 + // Workflow List WorkflowInfoList []*WorkflowInfo `thrift:"WorkflowInfoList,14,optional" form:"workflow_info_list" json:"workflow_info_list,omitempty"` - // 开场白 + // opening statement OnboardingInfo *OnboardingInfo `thrift:"OnboardingInfo,15,optional" form:"onboarding_info" json:"onboarding_info,omitempty"` - // 数据集 + // dataset Knowledge *Knowledge `thrift:"Knowledge,16,optional" form:"knowledge" json:"knowledge,omitempty"` - // kv存储 + // KV storage VariableList []*Variable `thrift:"VariableList,17,optional" form:"variable_list" json:"variable_list,omitempty"` - // 任务管理/预设任务 + // Task management/preset tasks TaskInfo *TaskInfo `thrift:"TaskInfo,18,optional" form:"task_info" json:"task_info,omitempty"` - // 数据表 + // data table DatabaseList []*Database `thrift:"DatabaseList,19,optional" form:"database_list" json:"database_list,omitempty"` - // 推荐问题 + // referral question SuggestReplyInfo *SuggestReplyInfo `thrift:"SuggestReplyInfo,20,optional" form:"suggest_reply_info" json:"suggest_reply_info,omitempty"` - // 音色配置 + // Timbre Configuration VoicesInfo *VoicesInfo `thrift:"VoicesInfo,21,optional" form:"voices_info" json:"voices_info,omitempty"` - // 额外信息,扩展字段 + // Additional information, extended fields BotExtInfo *BotExtInfo `thrift:"BotExtInfo,22,optional" form:"bot_ext_info" json:"bot_ext_info,omitempty"` - // bot 类型,single agent or multi agent + // Bot type, single agent or multi agent BotMode *BotMode `thrift:"BotMode,23,optional" form:"bot_mode" json:"bot_mode,omitempty"` - // multi agent mode agent信息 + // Multi agent mode agent information Agents []*AgentForUpdate `thrift:"Agents,24,optional" form:"agents" json:"agents,omitempty"` - // Bot种类 + // Bot type BotSpecies BotSpecies `thrift:"BotSpecies,25" form:"bot_species" json:"bot_species"` - // bot tag 信息,用户新增字段 + // Bot tag information, user new field BotTagInfo *BotTagInfo `thrift:"BotTagInfo,26,optional" form:"bot_tag_info" json:"bot_tag_info,omitempty"` - // filebox 信息 + // FileBox Information FileboxInfo *FileboxInfo `thrift:"FileboxInfo,27,optional" form:"filebox_info" json:"filebox_info,omitempty"` - // multi_agent结构体 + // multi_agent structure MultiAgentInfo *MultiAgentInfo `thrift:"MultiAgentInfo,28,optional" form:"multi_agent_info" json:"multi_agent_info,omitempty"` - // 背景图列表结构体 + // Background cover list structure BackgroundImageInfoList []*BackgroundImageInfo `thrift:"BackgroundImageInfoList,29,optional" form:"background_image_info_list" json:"background_image_info_list,omitempty"` ShortcutSort []string `thrift:"ShortcutSort,30,optional" form:"shortcut_sort" json:"shortcut_sort,omitempty"` HookInfo *HookInfo `thrift:"HookInfo,31,optional" form:"hook_info" json:"hook_info,omitempty"` - // 用户query收集配置 + // User query collection configuration UserQueryCollectConf *UserQueryCollectConf `thrift:"UserQueryCollectConf,32,optional" form:"user_query_collect_conf" json:"user_query_collect_conf,omitempty"` - // workflow模式的编排信息 + // Orchestration information for workflow patterns LayoutInfo *LayoutInfo `thrift:"LayoutInfo,33,optional" form:"layout_info" json:"layout_info,omitempty"` } @@ -21474,24 +21474,24 @@ func (p *BotInfoForUpdate) String() string { } type AgentForUpdate struct { - // agw字段名做了特殊映射 注意 + // The agw field names are specially mapped, note that AgentId *int64 `thrift:"AgentId,1,optional" form:"id" json:"id,string,omitempty"` - // agw字段名做了特殊映射 注意 + // The agw field names are specially mapped, note that AgentName *string `thrift:"AgentName,2,optional" form:"name" json:"name,omitempty"` - // prompt 信息 + // Prompt message PromptInfo *PromptInfo `thrift:"PromptInfo,3,optional" form:"prompt_info" json:"prompt_info,omitempty"` - // plugin列表 + // List of plugins PluginInfoList []*PluginInfo `thrift:"PluginInfoList,4,optional" form:"plugin_info_list" json:"plugin_info_list,omitempty"` - // 数据集 + // dataset Knowledge *Knowledge `thrift:"Knowledge,5,optional" form:"knowledge" json:"knowledge,omitempty"` - // Workflow 列表 + // Workflow List WorkflowInfoList []*WorkflowInfo `thrift:"WorkflowInfoList,6,optional" form:"workflow_info_list" json:"workflow_info_list,omitempty"` - // 模型配置 + // model configuration ModelInfo *ModelInfo `thrift:"ModelInfo,7,optional" form:"model_info" json:"model_info,omitempty"` - // 意图信息 + // intent information Intents []*Intent `thrift:"Intents,8,optional" form:"intents" json:"intents,omitempty"` AgentType *AgentType `thrift:"AgentType,9,optional" form:"agent_type" json:"agent_type,omitempty"` - // 是否是rootagent + // Is it a rootagent? RootAgent *bool `thrift:"RootAgent,10,optional" form:"root_agent" json:"root_agent,omitempty"` ReferenceId *int64 `thrift:"ReferenceId,11,optional" form:"reference_id" json:"reference_id,string,omitempty"` FirstVersion *string `thrift:"FirstVersion,12,optional" form:"first_version" json:"first_version,omitempty"` @@ -21501,7 +21501,7 @@ type AgentForUpdate struct { JumpConfig *JumpConfig `thrift:"JumpConfig,16,optional" form:"jump_config" json:"jump_config,omitempty"` SuggestReplyInfo *SuggestReplyInfo `thrift:"SuggestReplyInfo,17,optional" form:"suggest_reply_info" json:"suggest_reply_info,omitempty"` Description *string `thrift:"Description,18,optional" form:"description" json:"description,omitempty"` - // multi_agent版本兼容字段 + // multi_agent version compatibility field VersionCompat *AgentVersionCompat `thrift:"VersionCompat,19,optional" form:"version_compat" json:"version_compat,omitempty"` HookInfo *HookInfo `thrift:"HookInfo,20,optional" form:"hook_info" json:"hook_info,omitempty"` } @@ -22741,13 +22741,13 @@ func (p *AgentForUpdate) String() string { type TableDetail struct { // table id TableId *string `thrift:"TableId,1,optional" form:"TableId" json:"TableId,omitempty" query:"TableId"` - // table名称 + // Table name TableName *string `thrift:"TableName,2,optional" form:"TableName" json:"TableName,omitempty" query:"TableName"` - // table简介 + // Table Introduction TableDesc *string `thrift:"TableDesc,3,optional" form:"TableDesc" json:"TableDesc,omitempty" query:"TableDesc"` - // table字段信息 + // Table field information FieldList []*FieldItem `thrift:"FieldList,4,optional" form:"FieldList" json:"FieldList,omitempty" query:"FieldList"` - // 是否支持在Prompt中调用 默认支持 + // Whether to support calling in Prompt, the default is supported PromptDisabled *bool `thrift:"PromptDisabled,5,optional" form:"prompt_disabled" json:"prompt_disabled,omitempty"` } @@ -24081,33 +24081,33 @@ func (p *TaskWebhookOutput) String() string { type TaskInfoDetail struct { // Tasks Detail TaskId *string `thrift:"TaskId,1,optional" form:"TaskId" json:"TaskId,omitempty" query:"TaskId"` - // 定时器触发时执行的 query,例如:提醒我喝水. 二期:TriggerType == "Time" + // The query executed when the timer fires, for example: Remind me to drink water. Phase 2: TriggerType == "Time" UserQuestion *string `thrift:"UserQuestion,2,optional" form:"UserQuestion" json:"UserQuestion,omitempty" query:"UserQuestion"` - // 定时任务创建时间 + // Timed task create_time CreateTime *string `thrift:"CreateTime,3,optional" form:"CreateTime" json:"CreateTime,omitempty" query:"CreateTime"` - // 定时任务下次执行的时间点 + // The time when the scheduled task will next execute NextTime *string `thrift:"NextTime,4,optional" form:"NextTime" json:"NextTime,omitempty" query:"NextTime"` - // 任务状态:有效/无效 + // Task Status: Valid/Invalid Status *int64 `thrift:"Status,5,optional" form:"Status" json:"Status,omitempty" query:"Status"` - // 1-草稿,2-线上 + // 1-Draft, 2-Online PresetType *int32 `thrift:"PresetType,6,optional" form:"PresetType" json:"PresetType,omitempty" query:"PresetType"` - // 定时任务的 crontab 表达式 + // crontab expression for timed tasks CronExpr *string `thrift:"CronExpr,7,optional" form:"CronExpr" json:"CronExpr,omitempty" query:"CronExpr"` - // 处理过后的 UserQuestion,例如:喝水 + // Treated UserQuestions, such as Drinking Water TaskContent *string `thrift:"TaskContent,8,optional" form:"TaskContent" json:"TaskContent,omitempty" query:"TaskContent"` - // 时区 + // Time Zone TimeZone *string `thrift:"TimeZone,9,optional" form:"TimeZone" json:"TimeZone,omitempty" query:"TimeZone"` - // 任务名称 + // task name TaskName *string `thrift:"TaskName,10,optional" form:"TaskName" json:"TaskName,omitempty" query:"TaskName"` // "Time", "Event" TriggerType *string `thrift:"TriggerType,11,optional" form:"TriggerType" json:"TriggerType,omitempty" query:"TriggerType"` // "Bot query", "Plugin", "Workflow" Action *string `thrift:"Action,12,optional" form:"Action" json:"Action,omitempty" query:"Action"` - // Action == "Bot query" 时的输入 + // Action == "Bot query" BotQuery *string `thrift:"BotQuery,13,optional" form:"BotQuery" json:"BotQuery,omitempty" query:"BotQuery"` - // plugin 和 workflow 都用这个字段 + // Both plugins and workflows use this field PluginName *string `thrift:"PluginName,14,optional" form:"PluginName" json:"PluginName,omitempty" query:"PluginName"` - // plugin 和 workflow 都用这个字段 + // Both plugins and workflows use this field PluginInput *TaskPluginInput `thrift:"PluginInput,15,optional" form:"PluginInput" json:"PluginInput,omitempty" query:"PluginInput"` // TriggerType == "Event" WebhookUrl *string `thrift:"WebhookUrl,16,optional" form:"WebhookUrl" json:"WebhookUrl,omitempty" query:"WebhookUrl"` @@ -24115,7 +24115,7 @@ type TaskInfoDetail struct { WebhookBearerToken *string `thrift:"WebhookBearerToken,17,optional" form:"WebhookBearerToken" json:"WebhookBearerToken,omitempty" query:"WebhookBearerToken"` // TriggerType == "Event" WebhookOutput *TaskWebhookOutput `thrift:"WebhookOutput,18,optional" form:"WebhookOutput" json:"WebhookOutput,omitempty" query:"WebhookOutput"` - // 溯源 ID。创建时生成,更新/发布不变 + // Traceability ID. Generated when created, updated/released unchanged OriginId *string `thrift:"OriginId,19,optional" form:"OriginId" json:"OriginId,omitempty" query:"OriginId"` } @@ -25972,7 +25972,7 @@ func (p *JumpConfig) String() string { } type IndependentModeConfig struct { - // 判断时机 + // judge timing JudgeTiming IndependentTiming `thrift:"judge_timing,1" form:"judge_timing" json:"judge_timing" query:"judge_timing"` HistoryRound int32 `thrift:"history_round,2" form:"history_round" json:"history_round" query:"history_round"` ModelType IndependentRecognitionModelType `thrift:"model_type,3" form:"model_type" json:"model_type" query:"model_type"` @@ -26314,11 +26314,11 @@ func (p *IndependentModeConfig) String() string { } type MessageFeedback struct { - // 反馈类型 + // feedback type FeedbackType MessageFeedbackType `thrift:"feedback_type,1" form:"feedback_type" json:"feedback_type" query:"feedback_type"` - // 细分类型 + // segmentation type DetailTypes []MessageFeedbackDetailType `thrift:"detail_types,2" form:"detail_types" json:"detail_types" query:"detail_types"` - // 负反馈自定义内容,对应用户选择Others + // Negative feedback custom content, corresponding to user selection Others DetailContent string `thrift:"detail_content,3" form:"detail_content" json:"detail_content" query:"detail_content"` } @@ -29915,17 +29915,17 @@ func (p *ChatV3MessageDetail) String() string { } type HookInfo struct { - // pre agent跳转hook + // Pre agent jump hook PreAgentJumpHook []*HookItem `thrift:"pre_agent_jump_hook,1,optional" form:"pre_agent_jump_hook" json:"pre_agent_jump_hook,omitempty" query:"pre_agent_jump_hook"` - // post agent跳转hook + // Post agent jump hook PostAgentJumpHook []*HookItem `thrift:"post_agent_jump_hook,2,optional" form:"post_agent_jump_hook" json:"post_agent_jump_hook,omitempty" query:"post_agent_jump_hook"` - // 流程hook + // Process hook FlowHook []*HookItem `thrift:"flow_hook,3,optional" form:"flow_hook" json:"flow_hook,omitempty" query:"flow_hook"` - // 原子能力hook + // Atomic power hook AtomicHook []*HookItem `thrift:"atomic_hook,4,optional" form:"atomic_hook" json:"atomic_hook,omitempty" query:"atomic_hook"` - // 模型调用hook + // Model call hook LlmCallHook []*HookItem `thrift:"llm_call_hook,5,optional" form:"llm_call_hook" json:"llm_call_hook,omitempty" query:"llm_call_hook"` - // 对话结果hook + // Conversation result hook ResParsingHook []*HookItem `thrift:"res_parsing_hook,6,optional" form:"res_parsing_hook" json:"res_parsing_hook,omitempty" query:"res_parsing_hook"` // suggesion hook SuggestionHook []*HookItem `thrift:"suggestion_hook,7,optional" form:"suggestion_hook" json:"suggestion_hook,omitempty" query:"suggestion_hook"` diff --git a/backend/api/model/ocean/cloud/bot_open_api/bot_open_api.go b/backend/api/model/ocean/cloud/bot_open_api/bot_open_api.go index fc9c9b3b..3d43bf92 100644 --- a/backend/api/model/ocean/cloud/bot_open_api/bot_open_api.go +++ b/backend/api/model/ocean/cloud/bot_open_api/bot_open_api.go @@ -3,10 +3,10 @@ package bot_open_api import ( - "github.com/coze-dev/coze-studio/backend/api/model/base" "context" "fmt" "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-studio/backend/api/model/base" ) type OauthAuthorizationCodeReq struct { diff --git a/backend/api/model/ocean/cloud/developer_api/developer_api.go b/backend/api/model/ocean/cloud/developer_api/developer_api.go index ffe726e7..667ea97c 100644 --- a/backend/api/model/ocean/cloud/developer_api/developer_api.go +++ b/backend/api/model/ocean/cloud/developer_api/developer_api.go @@ -15,9 +15,9 @@ import ( type VisibilityType int64 const ( - // 不可见 + // invisible VisibilityType_Invisible VisibilityType = 0 - // 可见 + // visible VisibilityType_Visible VisibilityType = 1 ) @@ -112,11 +112,11 @@ func (p *TabStatus) Value() (driver.Value, error) { type PublishResultStatus int64 const ( - // 成功 + // success PublishResultStatus_Success PublishResultStatus = 1 - // 失败 + // fail PublishResultStatus_Failed PublishResultStatus = 2 - // 审批中 + // in approval PublishResultStatus_InReview PublishResultStatus = 3 ) @@ -219,9 +219,9 @@ func (p *AgentType) Value() (driver.Value, error) { type ReferenceInfoStatus int64 const ( - // 1:有可用更新 + // 1: Updates are available ReferenceInfoStatus_HasUpdates ReferenceInfoStatus = 1 - // 2:被删除 + // 2: Deleted ReferenceInfoStatus_IsDelete ReferenceInfoStatus = 2 ) @@ -399,11 +399,11 @@ func (p *RecognitionMode) Value() (driver.Value, error) { type IndependentTiming int64 const ( - // 判断用户输入(前置) + // Determine user input (front) IndependentTiming_Pre IndependentTiming = 1 - // 判断节点输出(后置) + // Determine node output (postfix) IndependentTiming_Post IndependentTiming = 2 - // 前置模式和后置模式支持同时选择 + // Front mode and rear mode support simultaneous selection IndependentTiming_PreAndPost IndependentTiming = 3 ) @@ -449,9 +449,9 @@ func (p *IndependentTiming) Value() (driver.Value, error) { type IndependentRecognitionModelType int64 const ( - // 小模型 + // Small model IndependentRecognitionModelType_SLM IndependentRecognitionModelType = 0 - // 大模型 + // Large model IndependentRecognitionModelType_LLM IndependentRecognitionModelType = 1 ) @@ -584,13 +584,13 @@ func (p *BotMode) Value() (driver.Value, error) { type HistoryType int64 const ( - // 废弃 + // abandoned HistoryType_SUBMIT HistoryType = 1 - // 发布 + // publish HistoryType_FLAG HistoryType = 2 - // 提交 + // submit HistoryType_COMMIT HistoryType = 4 - // 提交和发布 + // Submit and publish HistoryType_COMMITANDFLAG HistoryType = 5 ) @@ -912,25 +912,25 @@ const ( ModelClass_StableDiffusion ModelClass = 6 ModelClass_ByteArtist ModelClass = 7 ModelClass_Maas ModelClass = 9 - // 废弃:千帆(百度云) + // Abandoned: Qianfan (Baidu Cloud) ModelClass_QianFan ModelClass = 10 // name:Google Gemini ModelClass_Gemini ModelClass = 11 // name: Moonshot ModelClass_Moonshot ModelClass = 12 - // name:智谱 + // Name: Zhipu ModelClass_GLM ModelClass = 13 - // name: 火山方舟 + // Name: Volcano Ark ModelClass_MaaSAutoSync ModelClass = 14 - // name:通义千问 + // Name: Tongyi Qianwen ModelClass_QWen ModelClass = 15 // name: Cohere ModelClass_Cohere ModelClass = 16 - // name: 百川智能 + // Name: Baichuan Intelligent ModelClass_Baichuan ModelClass = 17 - // name:文心一言 + // Name: ERNIE Bot ModelClass_Ernie ModelClass = 18 - // name: 幻方 + // Name: Magic Square ModelClass_DeekSeek ModelClass = 19 // name: Llama ModelClass_Llama ModelClass = 20 @@ -1056,7 +1056,7 @@ const ( ModelTagClass_ModelUserRight ModelTagClass = 2 ModelTagClass_ModelFeature ModelTagClass = 3 ModelTagClass_ModelFunction ModelTagClass = 4 - // 本期不做 + // Do not do this issue ModelTagClass_Custom ModelTagClass = 20 ModelTagClass_Others ModelTagClass = 100 ) @@ -1255,11 +1255,11 @@ type CommitStatus int64 const ( CommitStatus_Undefined CommitStatus = 0 - // 已是最新,同主草稿相同 + // It is the latest, the same as the main draft CommitStatus_Uptodate CommitStatus = 1 - // 落后主草稿 + // Behind the main draft CommitStatus_Behind CommitStatus = 2 - // 无个人草稿 + // No personal draft CommitStatus_NoDraftReplica CommitStatus = 3 ) @@ -1309,15 +1309,15 @@ func (p *CommitStatus) Value() (driver.Value, error) { type ConfigStatus int64 const ( - // 已配置 + // Configured ConfigStatus_Configured ConfigStatus = 1 - // 未配置 + // Not configured ConfigStatus_NotConfigured ConfigStatus = 2 - // Token发生变化 + // Token changes ConfigStatus_Disconnected ConfigStatus = 3 - // 配置中,授权中 + // Configuring, authorizing ConfigStatus_Configuring ConfigStatus = 4 - // 需要重新配置 + // Need to reconfigure ConfigStatus_NeedReconfiguring ConfigStatus = 5 ) @@ -1371,19 +1371,19 @@ func (p *ConfigStatus) Value() (driver.Value, error) { type BindType int64 const ( - // 无需绑定 + // No binding required BindType_NoBindRequired BindType = 1 - // Auth绑定 + // Auth binding BindType_AuthBind BindType = 2 - // Kv绑定= + // Kv binding = BindType_KvBind BindType = 3 - // Kv并Auth授权 + // Kv and Auth authorization BindType_KvAuthBind BindType = 4 - // api渠道绑定 + // API channel binding BindType_ApiBind BindType = 5 BindType_WebSDKBind BindType = 6 BindType_StoreBind BindType = 7 - // 授权和配置各一个按钮 + // One button each for authorization and configuration BindType_AuthAndConfig BindType = 8 ) @@ -1491,11 +1491,11 @@ func (p *AllowPublishStatus) Value() (driver.Value, error) { type BotConnectorStatus int64 const ( - // 正常 + // Normal BotConnectorStatus_Normal BotConnectorStatus = 0 - // 审核中 + // Under review. BotConnectorStatus_InReview BotConnectorStatus = 1 - // 已下线 + // offline BotConnectorStatus_Offline BotConnectorStatus = 2 ) @@ -1541,11 +1541,11 @@ func (p *BotConnectorStatus) Value() (driver.Value, error) { type UserAuthStatus int64 const ( - // 已授权 + // Authorized UserAuthStatus_Authorized UserAuthStatus = 1 - // 未授权 + // unauthorized UserAuthStatus_UnAuthorized UserAuthStatus = 2 - // 授权中 + // Authorizing UserAuthStatus_Authorizing UserAuthStatus = 3 ) @@ -1595,7 +1595,7 @@ type DraftBotCreateRequest struct { IconURI string `thrift:"icon_uri,4" form:"icon_uri" json:"icon_uri" query:"icon_uri"` Visibility VisibilityType `thrift:"visibility,5" form:"visibility" json:"visibility" query:"visibility"` MonetizationConf *MonetizationConf `thrift:"monetization_conf,6,optional" form:"monetization_conf" json:"monetization_conf,omitempty" query:"monetization_conf"` - // 创建来源 navi:导航栏 space:空间 + // Create source navi: navbar space: space CreateFrom *string `thrift:"create_from,7,optional" form:"create_from" json:"create_from,omitempty" query:"create_from"` BusinessType *bot_common.BusinessType `thrift:"business_type,9,optional" form:"business_type" json:"business_type,omitempty" query:"business_type"` } @@ -2234,9 +2234,9 @@ func (p *MonetizationConf) String() string { type DraftBotCreateData struct { BotID int64 `thrift:"bot_id,1" form:"bot_id" json:"bot_id,string" query:"bot_id"` - // true:机审校验不通过 + // True: The machine audit verification failed CheckNotPass bool `thrift:"check_not_pass,2" form:"check_not_pass" json:"check_not_pass" query:"check_not_pass"` - // 机审校验不通过文案 + // The machine audit verification failed the copy. CheckNotPassMsg *string `thrift:"check_not_pass_msg,3,optional" form:"check_not_pass_msg" json:"check_not_pass_msg,omitempty" query:"check_not_pass_msg"` } @@ -3761,14 +3761,14 @@ func (p *UserLabel) String() string { type Creator struct { ID int64 `thrift:"id,1" form:"id" json:"id,string" query:"id"` - // 昵称 + // nickname Name string `thrift:"name,2" form:"name" json:"name" query:"name"` AvatarURL string `thrift:"avatar_url,3" form:"avatar_url" json:"avatar_url" query:"avatar_url"` - // 是否是自己创建的 + // Did you create it yourself? Self bool `thrift:"self,4" form:"self" json:"self" query:"self"` - // 用户名 + // user name UserUniqueName string `thrift:"user_unique_name,5" form:"user_unique_name" json:"user_unique_name" query:"user_unique_name"` - // 用户标签 + // user tag UserLabel *UserLabel `thrift:"user_label,6" form:"user_label" json:"user_label" query:"user_label"` } @@ -7058,19 +7058,19 @@ func (p *PublishDraftBotResponse) String() string { } type PublishDraftBotData struct { - // key代表connector_name 枚举 飞书="feishu" -- 废弃 + // Key represents connector_name enumeration Feishu = "feishu" -- obsolete ConnectorBindResult map[string][]*ConnectorBindResult `thrift:"connector_bind_result,1" form:"connector_bind_result" json:"connector_bind_result" query:"connector_bind_result"` - // key代表connector_id,value是发布结果 + // The key represents connector_id, and the value is the published result PublishResult map[string]*ConnectorBindResult `thrift:"publish_result,2" form:"publish_result" json:"publish_result" query:"publish_result"` - // true:机审校验不通过 + // True: The machine audit verification failed CheckNotPass bool `thrift:"check_not_pass,3" form:"check_not_pass" json:"check_not_pass" query:"check_not_pass"` - // 上架bot market结果 + // Added bot marketing results SubmitBotMarketResult *SubmitBotMarketResult `thrift:"submit_bot_market_result,4,optional" form:"submit_bot_market_result" json:"submit_bot_market_result,omitempty" query:"submit_bot_market_result"` - // 是否命中人审 + // In human moderation HitManualCheck *bool `thrift:"hit_manual_check,5,optional" form:"hit_manual_check" json:"hit_manual_check,omitempty" query:"hit_manual_check"` - // 机审校验不通过原因的starlingKey列表 + // starlingKey list of reasons why the machine audit failed NotPassReason []string `thrift:"not_pass_reason,6,optional" form:"not_pass_reason" json:"not_pass_reason,omitempty" query:"not_pass_reason"` - // 发布bot计费结果 + // Publish bot billing results PublishMonetizationResult *bool `thrift:"publish_monetization_result,7,optional" form:"publish_monetization_result" json:"publish_monetization_result,omitempty" query:"publish_monetization_result"` } @@ -7614,11 +7614,11 @@ func (p *PublishDraftBotData) String() string { type ConnectorBindResult struct { Connector *Connector `thrift:"connector,1" form:"connector" json:"connector" query:"connector"` - // 发布调用下游返回的状态码,前端不消费 + // The status code returned downstream of the publish call is not consumed by the front end. Code int64 `thrift:"code,2" form:"code" json:"code" query:"code"` - // 发布状态的附加文案,前端按照markdown格式解析 + // Additional copy of the release status, the front end is parsed in markdown format Msg string `thrift:"msg,3" form:"msg" json:"msg" query:"msg"` - // 发布结果状态 + // post result status PublishResultStatus *PublishResultStatus `thrift:"publish_result_status,4,optional" form:"publish_result_status" json:"publish_result_status,omitempty" query:"publish_result_status"` } @@ -7908,7 +7908,7 @@ func (p *ConnectorBindResult) String() string { } type Connector struct { - // connector_name 枚举 飞书="feishu" + // connector_name enumeration Feishu = "feishu" Name string `thrift:"name,1" form:"name" json:"name" query:"name"` AppID string `thrift:"app_id,2" form:"app_id" json:"app_id" query:"app_id"` AppSecret string `thrift:"app_secret,3" form:"app_secret" json:"app_secret" query:"app_secret"` @@ -8268,9 +8268,9 @@ func (p *Connector) String() string { } type SubmitBotMarketResult struct { - // 上架状态,0-成功 + // Shelf status, 0-success ResultCode *int64 `thrift:"result_code,1,optional" form:"result_code" json:"result_code,omitempty" query:"result_code"` - // 上架结果的文案 + // msg Msg *string `thrift:"msg,2,optional" form:"msg" json:"msg,omitempty" query:"msg"` } @@ -8486,7 +8486,7 @@ type AgentInfo struct { ReferenceID *string `thrift:"reference_id,8,optional" form:"reference_id" json:"reference_id,omitempty" query:"reference_id"` FirstVersion *string `thrift:"first_version,9,optional" form:"first_version" json:"first_version,omitempty" query:"first_version"` CurrentVersion *string `thrift:"current_version,10,optional" form:"current_version" json:"current_version,omitempty" query:"current_version"` - // 1:有可用更新 2:被删除 + // 1: Available update 2: Removed ReferenceInfoStatus *ReferenceInfoStatus `thrift:"reference_info_status,11,optional" form:"reference_info_status" json:"reference_info_status,omitempty" query:"reference_info_status"` Description *string `thrift:"description,12,optional" form:"description" json:"description,omitempty" query:"description"` UpdateType *ReferenceUpdateType `thrift:"update_type,13,optional" form:"update_type" json:"update_type,omitempty" query:"update_type"` @@ -9761,25 +9761,25 @@ func (p *Intent) String() string { } -// agent 工作区间各个模块的信息 +// Information about each module in the agent workspace type AgentWorkInfo struct { - // agent prompt 前端信息,server不需要感知 + // The agent prompts the front-end information, the server does not need to perceive Prompt *string `thrift:"prompt,1,optional" form:"prompt" json:"prompt,omitempty" query:"prompt"` - // 模型配置 + // model configuration OtherInfo *string `thrift:"other_info,2,optional" form:"other_info" json:"other_info,omitempty" query:"other_info"` - // plugin 信息 + // Plugin information Tools *string `thrift:"tools,3,optional" form:"tools" json:"tools,omitempty" query:"tools"` - // dataset 信息 + // Dataset information Dataset *string `thrift:"dataset,4,optional" form:"dataset" json:"dataset,omitempty" query:"dataset"` - // workflow 信息 + // Workflow information Workflow *string `thrift:"workflow,5,optional" form:"workflow" json:"workflow,omitempty" query:"workflow"` - // 同bot的 system_info_all + // system_info_all with bot SystemInfoAll *string `thrift:"system_info_all,6,optional" form:"system_info_all" json:"system_info_all,omitempty" query:"system_info_all"` - // 回溯配置 + // backtrack configuration JumpConfig *JumpConfig `thrift:"jump_config,7,optional" form:"jump_config" json:"jump_config,omitempty" query:"jump_config"` - // 推荐回复配置 + // Referral Configuration SuggestReply *string `thrift:"suggest_reply,8,optional" form:"suggest_reply" json:"suggest_reply,omitempty" query:"suggest_reply"` - // hook配置 + // Hook configuration HookInfo *string `thrift:"hook_info,9,optional" form:"hook_info" json:"hook_info,omitempty" query:"hook_info"` } @@ -10604,7 +10604,7 @@ func (p *JumpConfig) String() string { } type IndependentModeConfig struct { - // 判断时机 + // Judge timing JudgeTiming IndependentTiming `thrift:"judge_timing,1" form:"judge_timing" json:"judge_timing" query:"judge_timing"` HistoryRound int32 `thrift:"history_round,2" form:"history_round" json:"history_round" query:"history_round"` ModelType IndependentRecognitionModelType `thrift:"model_type,3" form:"model_type" json:"model_type" query:"model_type"` @@ -11225,25 +11225,25 @@ type PublishDraftBotRequest struct { SpaceID int64 `thrift:"space_id,1,required" form:"space_id,required" json:"space_id,string,required" query:"space_id,required"` BotID int64 `thrift:"bot_id,2,required" form:"bot_id,required" json:"bot_id,string,required" query:"bot_id,required"` WorkInfo *WorkInfo `thrift:"work_info,3" form:"work_info" json:"work_info" query:"work_info"` - // key代表connector_name 枚举 飞书="feishu" -- 废弃 + // Key represents connector_name enumeration Feishu = "feishu" -- obsolete ConnectorList map[string][]*Connector `thrift:"connector_list,4" form:"connector_list" json:"connector_list" query:"connector_list"` - // key代表connector_id,value是发布的参数 + // The key represents connector_id, and the value is the published parameter Connectors map[string]map[string]string `thrift:"connectors,5" form:"connectors" json:"connectors" query:"connectors"` - // 默认0 + // Default 0 BotMode *BotMode `thrift:"botMode,6,optional" form:"botMode" json:"botMode,omitempty" query:"botMode"` Agents []*AgentInfo `thrift:"agents,7,optional" form:"agents" json:"agents,omitempty" query:"agents"` CanvasData *string `thrift:"canvas_data,8,optional" form:"canvas_data" json:"canvas_data,omitempty" query:"canvas_data"` BotTagInfo []*BotTagInfo `thrift:"bot_tag_info,9,optional" form:"bot_tag_info" json:"bot_tag_info,omitempty" query:"bot_tag_info"` - // 发布到market的配置 + // Configuration published to the market SubmitBotMarketConfig *SubmitBotMarketConfig `thrift:"submit_bot_market_config,10,optional" form:"submit_bot_market_config" json:"submit_bot_market_config,omitempty" query:"submit_bot_market_config"` PublishID *string `thrift:"publish_id,11,optional" form:"publish_id" json:"publish_id,omitempty" query:"publish_id"` - // 指定发布某个CommitVersion + // Specify the release of a CommitVersion CommitVersion *string `thrift:"commit_version,12,optional" form:"commit_version" json:"commit_version,omitempty" query:"commit_version"` - // 发布类型,线上发布/预发布 + // Release type, online release/pre-release PublishType *PublishType `thrift:"publish_type,13,optional" form:"publish_type" json:"publish_type,omitempty" query:"publish_type"` - // 预发布其他信息 + // Pre-release other information PrePublishExt *string `thrift:"pre_publish_ext,14,optional" form:"pre_publish_ext" json:"pre_publish_ext,omitempty" query:"pre_publish_ext"` - // 替换原workinfo中的 history_info + // Replace the history_info in the original workinfo HistoryInfo *string `thrift:"history_info,15,optional" form:"history_info" json:"history_info,omitempty" query:"history_info"` } @@ -12276,11 +12276,11 @@ func (p *PublishDraftBotRequest) String() string { } type SubmitBotMarketConfig struct { - // 是否发布到market + // Whether to publish to the market NeedSubmit *bool `thrift:"need_submit,1,optional" form:"need_submit" json:"need_submit,omitempty" query:"need_submit"` - // 是否开源 + // Is it open source? OpenSource *bool `thrift:"open_source,2,optional" form:"open_source" json:"open_source,omitempty" query:"open_source"` - // 分类 + // classification CategoryID *string `thrift:"category_id,3,optional" form:"category_id" json:"category_id,omitempty" query:"category_id"` } @@ -12540,7 +12540,7 @@ func (p *SubmitBotMarketConfig) String() string { } -// 工作区间各个模块的信息 +// Information for each module in the workspace type WorkInfo struct { MessageInfo *string `thrift:"message_info,1,optional" form:"message_info" json:"message_info,omitempty" query:"message_info"` Prompt *string `thrift:"prompt,2,optional" form:"prompt" json:"prompt,omitempty" query:"prompt"` @@ -12558,13 +12558,13 @@ type WorkInfo struct { SuggestReply *string `thrift:"suggest_reply,14,optional" form:"suggest_reply" json:"suggest_reply,omitempty" query:"suggest_reply"` Tts *string `thrift:"tts,15,optional" form:"tts" json:"tts,omitempty" query:"tts"` BackgroundImageInfoList *string `thrift:"background_image_info_list,16,optional" form:"background_image_info_list" json:"background_image_info_list,omitempty" query:"background_image_info_list"` - // 快捷指令 + // Quick Instruction Shortcuts *playground.ShortcutStruct `thrift:"shortcuts,17,optional" form:"shortcuts" json:"shortcuts,omitempty" query:"shortcuts"` - // hook配置 + // Hook configuration HookInfo *string `thrift:"hook_info,18,optional" form:"hook_info" json:"hook_info,omitempty" query:"hook_info"` - // 用户query收集配置 + // User query collection configuration UserQueryCollectConf *UserQueryCollectConf `thrift:"user_query_collect_conf,19,optional" form:"user_query_collect_conf" json:"user_query_collect_conf,omitempty" query:"user_query_collect_conf"` - //workflow模式编排数据 + //Workflow pattern orchestration data LayoutInfo *LayoutInfo `thrift:"layout_info,20,optional" form:"layout_info" json:"layout_info,omitempty" query:"layout_info"` } @@ -13751,9 +13751,9 @@ func (p *WorkInfo) String() string { } type UserQueryCollectConf struct { - // 是否开启收集开关 + // Whether to turn on the collection switch IsCollected bool `thrift:"IsCollected,1" form:"is_collected" json:"is_collected"` - // 隐私协议链接 + // Privacy Policy Link PrivatePolicy string `thrift:"PrivatePolicy,2" form:"private_policy" json:"private_policy"` } @@ -14980,17 +14980,17 @@ func (p *ListDraftBotHistoryData) String() string { } -// 如果保存历史信息 +// If historical information is preserved type HistoryInfo struct { Version string `thrift:"version,1" form:"version" json:"version" query:"version"` HistoryType HistoryType `thrift:"history_type,2" form:"history_type" json:"history_type" query:"history_type"` - // 对历史记录补充的其他信息 + // Additional information added to the historical record Info string `thrift:"info,3" form:"info" json:"info" query:"info"` CreateTime string `thrift:"create_time,4" form:"create_time" json:"create_time" query:"create_time"` ConnectorInfos []*ConnectorInfo `thrift:"connector_infos,5" form:"connector_infos" json:"connector_infos" query:"connector_infos"` Creator *Creator `thrift:"creator,6" form:"creator" json:"creator" query:"creator"` PublishID *string `thrift:"publish_id,7,optional" form:"publish_id" json:"publish_id,omitempty" query:"publish_id"` - // 提交时填写的说明 + // Instructions to fill in when submitting CommitRemark *string `thrift:"commit_remark,8,optional" form:"commit_remark" json:"commit_remark,omitempty" query:"commit_remark"` } @@ -17596,9 +17596,9 @@ func (p *GetUploadAuthTokenRequest) String() string { } type UploadFileRequest struct { - // 文件相关描述 + // Document related description FileHead *CommonFileInfo `thrift:"file_head,1" form:"file_head" json:"file_head" query:"file_head"` - // 文件数据 + // file data Data string `thrift:"data,2" form:"data" json:"data" query:"data"` } @@ -17787,11 +17787,11 @@ func (p *UploadFileRequest) String() string { } -// 上传文件,文件头 +// Upload file, file header type CommonFileInfo struct { - // 文件类型,后缀 + // File type, suffix FileType string `thrift:"file_type,1" form:"file_type" json:"file_type" query:"file_type"` - // 业务类型 + // business type BizType FileBizType `thrift:"biz_type,2" form:"biz_type" json:"biz_type" query:"biz_type"` } @@ -17977,7 +17977,7 @@ func (p *CommonFileInfo) String() string { type UploadFileResponse struct { Code int64 `thrift:"code,1" form:"code" json:"code" query:"code"` Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` - // 数据 + // data Data *UploadFileData `thrift:"data,3" form:"data" json:"data" query:"data"` } @@ -18215,11 +18215,11 @@ type GetTypeListRequest struct { Voice *bool `thrift:"voice,2,optional" form:"voice" json:"voice,omitempty" query:"voice"` RawModel *bool `thrift:"raw_model,3,optional" form:"raw_model" json:"raw_model,omitempty" query:"raw_model"` SpaceID *string `thrift:"space_id,4,optional" form:"space_id" json:"space_id,omitempty" query:"space_id"` - // 当前bot使用的模型ID,用于处理cici/doubao同步过来的bot模型不能展示的问题 + // The model ID used by the current bot to handle issues that cannot be displayed by the bot model synchronized by cici/doubao CurModelID *string `thrift:"cur_model_id,5,optional" form:"cur_model_id" json:"cur_model_id,omitempty" query:"cur_model_id"` - // 兼容MultiAgent,有多个cur_model_id + // Compatible with MultiAgent, with multiple cur_model_id CurModelIds []string `thrift:"cur_model_ids,6,optional" form:"cur_model_ids" json:"cur_model_ids,omitempty" query:"cur_model_ids"` - // 模型场景 + // model scenario ModelScene *ModelScene `thrift:"model_scene,7,optional" form:"model_scene" json:"model_scene,omitempty" query:"model_scene"` } @@ -18721,29 +18721,29 @@ func (p *GetTypeListRequest) String() string { } type ModelQuota struct { - // 最大总 token 数量 + // Maximum total number of tokens TokenLimit int32 `thrift:"token_limit,1" form:"token_limit" json:"token_limit" query:"token_limit"` - // 最终回复最大 token 数量 + // Final reply maximum number of tokens TokenResp int32 `thrift:"token_resp,2" form:"token_resp" json:"token_resp" query:"token_resp"` - // Prompt 系统最大 token 数量 + // Prompt system maximum number of tokens TokenSystem int32 `thrift:"token_system,3" form:"token_system" json:"token_system" query:"token_system"` - // Prompt 用户输入最大 token 数量 + // Prompt user to enter maximum number of tokens TokenUserIn int32 `thrift:"token_user_in,4" form:"token_user_in" json:"token_user_in" query:"token_user_in"` - // Prompt 工具输入最大 token 数量 + // Prompt tool to enter maximum number of tokens TokenToolsIn int32 `thrift:"token_tools_in,5" form:"token_tools_in" json:"token_tools_in" query:"token_tools_in"` - // Prompt 工具输出最大 token 数量 + // Prompt tool output maximum number of tokens TokenToolsOut int32 `thrift:"token_tools_out,6" form:"token_tools_out" json:"token_tools_out" query:"token_tools_out"` - // Prompt 数据最大 token 数量 + // Prompt data maximum number of tokens TokenData int32 `thrift:"token_data,7" form:"token_data" json:"token_data" query:"token_data"` - // Prompt 历史最大 token 数量 + // Prompt history maximum number of tokens TokenHistory int32 `thrift:"token_history,8" form:"token_history" json:"token_history" query:"token_history"` - // Prompt 历史最大 token 数量 + // Prompt history maximum number of tokens TokenCutSwitch bool `thrift:"token_cut_switch,9" form:"token_cut_switch" json:"token_cut_switch" query:"token_cut_switch"` - // 输入成本 + // input cost PriceIn float64 `thrift:"price_in,10" form:"price_in" json:"price_in" query:"price_in"` - // 输出成本 + // output cost PriceOut float64 `thrift:"price_out,11" form:"price_out" json:"price_out" query:"price_out"` - // systemprompt输入限制,如果没有传,对输入不做限制 + // Systemprompt input restrictions, if not passed, no input restrictions SystemPromptLimit *int32 `thrift:"system_prompt_limit,12,optional" form:"system_prompt_limit" json:"system_prompt_limit,omitempty" query:"system_prompt_limit"` } @@ -19878,9 +19878,9 @@ func (p *ModelParamClass) String() string { } type Option struct { - // option展示的值 + // The value displayed by the option Label string `thrift:"label,1" form:"label" json:"label" query:"label"` - // 填入的值 + // Filled in value Value string `thrift:"value,2" form:"value" json:"value" query:"value"` } @@ -20064,25 +20064,25 @@ func (p *Option) String() string { } type ModelParameter struct { - // 配置字段,如max_tokens + // Configuration fields, such as max_tokens Name string `thrift:"name,1,required" form:"name,required" json:"name,required" query:"name,required"` - // 配置字段展示名称 + // Configure field display name Label string `thrift:"label,2" form:"label" json:"label" query:"label"` - // 配置字段详情描述 + // Configuration field detail description Desc string `thrift:"desc,3" form:"desc" json:"desc" query:"desc"` - // 类型 + // type Type ModelParamType `thrift:"type,4,required" form:"type,required" json:"type,required" query:"type,required"` - // 数值类型参数,允许设置的最小值 + // Numerical type parameters, the minimum value allowed to be set Min string `thrift:"min,5" form:"min" json:"min" query:"min"` - // 数值类型参数,允许设置的最大值 + // Numerical type parameter, the maximum value allowed to be set Max string `thrift:"max,6" form:"max" json:"max" query:"max"` - // float类型参数的精度 + // Precision of float type parameters Precision int32 `thrift:"precision,7" form:"precision" json:"precision" query:"precision"` - // 参数默认值{"default": xx, "creative":xx} + // Parameter default {"default": xx, "creative": xx} DefaultVal *ModelParamDefaultValue `thrift:"default_val,8,required" form:"default_val,required" json:"default_val,required" query:"default_val,required"` - // 枚举值,如response_format支持text,markdown,json + // Enumeration values such as response_format support text, markdown, json Options []*Option `thrift:"options,9" form:"options" json:"options" query:"options"` - // 参数分类,"Generation diversity", "Input and output length", "Output format" + // Parameter classification, "Generation diversity", "Input and output length", "Output format" ParamClass *ModelParamClass `thrift:"param_class,10" form:"param_class" json:"param_class" query:"param_class"` } @@ -21435,21 +21435,21 @@ func (p *ModelSeriesInfo) String() string { } type ModelStatusDetails struct { - // 是否为新模型 + // Is it a new model? IsNewModel bool `thrift:"is_new_model,1" form:"is_new_model" json:"is_new_model" query:"is_new_model"` - // 是否是高级模型 + // Is it a high-level model? IsAdvancedModel bool `thrift:"is_advanced_model,2" form:"is_advanced_model" json:"is_advanced_model" query:"is_advanced_model"` - // 是否是免费模型 + // Is it a free model? IsFreeModel bool `thrift:"is_free_model,3" form:"is_free_model" json:"is_free_model" query:"is_free_model"` - // 是否即将下架 + // Will it be removed from the shelves soon? IsUpcomingDeprecated bool `thrift:"is_upcoming_deprecated,11" form:"is_upcoming_deprecated" json:"is_upcoming_deprecated" query:"is_upcoming_deprecated"` - // 下架日期 + // removal date DeprecatedDate string `thrift:"deprecated_date,12" form:"deprecated_date" json:"deprecated_date" query:"deprecated_date"` - // 下架替换的模型 + // Remove the replacement model from the shelves. ReplaceModelName string `thrift:"replace_model_name,13" form:"replace_model_name" json:"replace_model_name" query:"replace_model_name"` - // 最近更新信息 + // Recently updated information UpdateInfo string `thrift:"update_info,21" form:"update_info" json:"update_info" query:"update_info"` - // 模型特色 + // Model Features ModelFeature ModelTagValue `thrift:"model_feature,22" form:"model_feature" json:"model_feature" query:"model_feature"` } @@ -21897,19 +21897,19 @@ func (p *ModelStatusDetails) String() string { } type ModelAbility struct { - // 是否展示cot + // Do you want to show cot? CotDisplay *bool `thrift:"cot_display,1,optional" form:"cot_display" json:"cot_display,omitempty" query:"cot_display"` - // 是否支持function call + // Supports function calls FunctionCall *bool `thrift:"function_call,2,optional" form:"function_call" json:"function_call,omitempty" query:"function_call"` - // 是否支持图片理解 + // Does it support picture understanding? ImageUnderstanding *bool `thrift:"image_understanding,3,optional" form:"image_understanding" json:"image_understanding,omitempty" query:"image_understanding"` - // 是否支持视频理解 + // Does it support video understanding? VideoUnderstanding *bool `thrift:"video_understanding,4,optional" form:"video_understanding" json:"video_understanding,omitempty" query:"video_understanding"` - // 是否支持音频理解 + // Does it support audio understanding? AudioUnderstanding *bool `thrift:"audio_understanding,5,optional" form:"audio_understanding" json:"audio_understanding,omitempty" query:"audio_understanding"` - // 是否支持多模态 + // Does it support multimodality? SupportMultiModal *bool `thrift:"support_multi_modal,6,optional" form:"support_multi_modal" json:"support_multi_modal,omitempty" query:"support_multi_modal"` - // 是否支持续写 + // Whether to support continuation PrefillResp *bool `thrift:"prefill_resp,7,optional" form:"prefill_resp" json:"prefill_resp,omitempty" query:"prefill_resp"` } @@ -22393,32 +22393,32 @@ type Model struct { Name string `thrift:"name,1" form:"name" json:"name" query:"name"` ModelType int64 `thrift:"model_type,2" form:"model_type" json:"model_type" query:"model_type"` ModelClass ModelClass `thrift:"model_class,3" form:"model_class" json:"model_class" query:"model_class"` - // model icon的url + // Model icon url ModelIcon string `thrift:"model_icon,4" form:"model_icon" json:"model_icon" query:"model_icon"` ModelInputPrice float64 `thrift:"model_input_price,5" form:"model_input_price" json:"model_input_price" query:"model_input_price"` ModelOutputPrice float64 `thrift:"model_output_price,6" form:"model_output_price" json:"model_output_price" query:"model_output_price"` ModelQuota *ModelQuota `thrift:"model_quota,7" form:"model_quota" json:"model_quota" query:"model_quota"` - // model真实名,前端计算token用 + // Model real name, front-end calculation token ModelName string `thrift:"model_name,8" form:"model_name" json:"model_name" query:"model_name"` ModelClassName string `thrift:"model_class_name,9" form:"model_class_name" json:"model_class_name" query:"model_class_name"` IsOffline bool `thrift:"is_offline,10" form:"is_offline" json:"is_offline" query:"is_offline"` ModelParams []*ModelParameter `thrift:"model_params,11" form:"model_params" json:"model_params" query:"model_params"` ModelDesc []*ModelDescGroup `thrift:"model_desc,12,optional" form:"model_desc" json:"model_desc,omitempty" query:"model_desc"` - // 模型功能配置 + // model function configuration FuncConfig map[bot_common.ModelFuncConfigType]bot_common.ModelFuncConfigStatus `thrift:"func_config,13,optional" form:"func_config" json:"func_config,omitempty" query:"func_config"` - // 方舟模型节点名称 + // Ark model node name EndpointName *string `thrift:"endpoint_name,14,optional" form:"endpoint_name" json:"endpoint_name,omitempty" query:"endpoint_name"` - // 模型标签 + // model label ModelTagList []*ModelTag `thrift:"model_tag_list,15,optional" form:"model_tag_list" json:"model_tag_list,omitempty" query:"model_tag_list"` - // user prompt是否必须有且不能为空 + // User prompt must have and cannot be empty IsUpRequired *bool `thrift:"is_up_required,16,optional" form:"is_up_required" json:"is_up_required,omitempty" query:"is_up_required"` - // 模型简要描述 + // Model brief description ModelBriefDesc string `thrift:"model_brief_desc,17" form:"model_brief_desc" json:"model_brief_desc" query:"model_brief_desc"` - // 模型系列 + // Model series ModelSeries *ModelSeriesInfo `thrift:"model_series,18" form:"model_series" json:"model_series" query:"model_series"` - // 模型状态 + // model state ModelStatusDetails *ModelStatusDetails `thrift:"model_status_details,19" form:"model_status_details" json:"model_status_details" query:"model_status_details"` - // 模型能力 + // model capability ModelAbility *ModelAbility `thrift:"model_ability,20" form:"model_ability" json:"model_ability" query:"model_ability"` } @@ -24458,9 +24458,9 @@ func (p *GetTypeListResponse) String() string { } type UploadFileData struct { - // 文件url + // File URL UploadURL string `thrift:"upload_url,1" form:"upload_url" json:"upload_url" query:"upload_url"` - // 文件uri,提交使用这个 + // File URI, submit using this UploadURI string `thrift:"upload_uri,2" form:"upload_uri" json:"upload_uri" query:"upload_uri"` } @@ -25239,7 +25239,7 @@ func (p *Committer) String() string { } -// 检查草稿是否可以提交返回 +// Check if the draft can be submitted and returned. type CheckDraftBotCommitResponse struct { Code *int64 `thrift:"code,1,optional" form:"code" json:"code,omitempty" query:"code"` Msg *string `thrift:"msg,2,optional" form:"msg" json:"msg,omitempty" query:"msg"` @@ -25501,11 +25501,11 @@ func (p *CheckDraftBotCommitResponse) String() string { type CheckDraftBotCommitData struct { Status *CommitStatus `thrift:"status,1,optional" form:"status" json:"status,omitempty" query:"status"` - // 主草稿版本 + // master draft version BaseCommitVersion *string `thrift:"base_commit_version,2,optional" form:"base_commit_version" json:"base_commit_version,omitempty" query:"base_commit_version"` - // 主草稿提交信息 + // Master Draft Submission Information BaseCommitter *Committer `thrift:"base_committer,3,optional" form:"base_committer" json:"base_committer,omitempty" query:"base_committer"` - // 个人草稿版本 + // Personal draft version CommitVersion *string `thrift:"commit_version,4,optional" form:"commit_version" json:"commit_version,omitempty" query:"commit_version"` } @@ -25818,7 +25818,7 @@ func (p *CheckDraftBotCommitData) String() string { } -// 检查草稿是否可以提交请求 +// Check if the draft can be submitted to the request type CheckDraftBotCommitRequest struct { SpaceID string `thrift:"space_id,1,required" form:"space_id,required" json:"space_id,required" query:"space_id,required"` BotID string `thrift:"bot_id,2,required" form:"bot_id,required" json:"bot_id,required" query:"bot_id,required"` @@ -26639,9 +26639,9 @@ func (p *GetOnboardingResponse) String() string { } type OnboardingContent struct { - // 开场白 + // opening statement Prologue *string `thrift:"prologue,1,optional" form:"prologue" json:"prologue,omitempty" query:"prologue"` - // 建议问题 + // suggestion question SuggestedQuestions []string `thrift:"suggested_questions,2,optional" form:"suggested_questions" json:"suggested_questions,omitempty" query:"suggested_questions"` } @@ -27576,49 +27576,49 @@ func (p *PublishConnectorListRequest) String() string { } type PublishConnectorInfo struct { - // 发布平台 connector_id + // Publishing Platform connector_id ID string `thrift:"id,1,required" form:"id,required" json:"id,required" query:"id,required"` - // 发布平台名称 + // publishing platform name Name string `thrift:"name,2,required" form:"name,required" json:"name,required" query:"name,required"` - // 发布平台图标 + // publishing platform icon Icon string `thrift:"icon,3,required" form:"icon,required" json:"icon,required" query:"icon,required"` - // 发布平台描述 + // Publish Platform Description Desc string `thrift:"desc,4,required" form:"desc,required" json:"desc,required" query:"desc,required"` - // 分享链接 + // share link ShareLink string `thrift:"share_link,5,required" form:"share_link,required" json:"share_link,required" query:"share_link,required"` - // 配置状态 1:已绑定 2:未绑定 + // Configuration Status 1: Bound 2: Unbound ConfigStatus ConfigStatus `thrift:"config_status,6,required" form:"config_status,required" json:"config_status,required" query:"config_status,required"` - // 最近发布时间 + // Last Post LastPublishTime int64 `thrift:"last_publish_time,7,required" form:"last_publish_time,required" json:"last_publish_time,required" query:"last_publish_time,required"` - // 绑定类型 1:无需绑定 2:Auth 3: kv值 + // Binding type 1: No binding required 2: Auth 3: kv value BindType BindType `thrift:"bind_type,8,required" form:"bind_type,required" json:"bind_type,required" query:"bind_type,required"` - // 绑定信息 key字段名 value是值 + // Binding information key field name value is value BindInfo map[string]string `thrift:"bind_info,9,required" form:"bind_info,required" json:"bind_info,required" query:"bind_info,required"` - // 绑定id信息,用于解绑使用 + // Bind id information for unbinding and use BindID *string `thrift:"bind_id,10,optional" form:"bind_id" json:"bind_id,omitempty" query:"bind_id"` - // 用户授权登陆信息 + // user authorization login information AuthLoginInfo *AuthLoginInfo `thrift:"auth_login_info,11,optional" form:"auth_login_info" json:"auth_login_info,omitempty" query:"auth_login_info"` - // 是否为上次发布 + // Is it the last release? IsLastPublished *bool `thrift:"is_last_published,12,optional" form:"is_last_published" json:"is_last_published,omitempty" query:"is_last_published"` - // bot渠道状态 + // bot channel status ConnectorStatus *BotConnectorStatus `thrift:"connector_status,13,optional" form:"connector_status" json:"connector_status,omitempty" query:"connector_status"` - // 隐私政策 + // Privacy Policy PrivacyPolicy *string `thrift:"privacy_policy,14,optional" form:"privacy_policy" json:"privacy_policy,omitempty" query:"privacy_policy"` - // 用户协议 + // User Agreement UserAgreement *string `thrift:"user_agreement,15,optional" form:"user_agreement" json:"user_agreement,omitempty" query:"user_agreement"` - // 渠道是否允许发布 + // Is the channel allowed to publish? AllowPunish *AllowPublishStatus `thrift:"allow_punish,16,optional" form:"allow_punish" json:"allow_punish,omitempty" query:"allow_punish"` - // 不允许发布原因 + // Reason for not allowing posting NotAllowReason *string `thrift:"not_allow_reason,17,optional" form:"not_allow_reason" json:"not_allow_reason,omitempty" query:"not_allow_reason"` - // 配置状态toast + // Configuration status toast ConfigStatusToast *string `thrift:"config_status_toast,18,optional" form:"config_status_toast" json:"config_status_toast,omitempty" query:"config_status_toast"` - // 品牌 ID + // Brand ID BrandID *int64 `thrift:"brand_id,19,optional" form:"brand_id" json:"brand_id,omitempty" query:"brand_id"` - // 支持商业化 + // Support commercialization SupportMonetization *bool `thrift:"support_monetization,20,optional" form:"support_monetization" json:"support_monetization,omitempty" query:"support_monetization"` - // 1: 已授权,2:未授权. 目前仅 bind_type == 8 时这个字段才有 + // 1: Authorized, 2: Unauthorized. Currently this field is only available bind_type == 8 AuthStatus *UserAuthStatus `thrift:"auth_status,21,optional" form:"auth_status" json:"auth_status,omitempty" query:"auth_status"` - // 补全信息按钮的 url + // URL of the complete info button ToCompleteInfoURL *string `thrift:"to_complete_info_url,22,optional" form:"to_complete_info_url" json:"to_complete_info_url,omitempty" query:"to_complete_info_url"` } @@ -28918,7 +28918,7 @@ func (p *PublishConnectorInfo) String() string { } type SubmitBotMarketOption struct { - // 是否可以公开编排 + // Is it possible to publicly orchestrate? CanOpenSource *bool `thrift:"can_open_source,1,optional" form:"can_open_source" json:"can_open_source,omitempty" query:"can_open_source"` } @@ -29320,7 +29320,7 @@ func (p *ConnectorBrandInfo) String() string { } type PublishTips struct { - // 成本承担提醒 + // cost-bearing reminder CostTips *string `thrift:"cost_tips,1,optional" form:"cost_tips" json:"cost_tips,omitempty" query:"cost_tips"` } @@ -29475,11 +29475,11 @@ type PublishConnectorListResponse struct { Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` PublishConnectorList []*PublishConnectorInfo `thrift:"publish_connector_list,3" form:"publish_connector_list" json:"publish_connector_list" query:"publish_connector_list"` SubmitBotMarketOption *SubmitBotMarketOption `thrift:"submit_bot_market_option,4,optional" form:"submit_bot_market_option" json:"submit_bot_market_option,omitempty" query:"submit_bot_market_option"` - // 上次提交market的配置 + // The configuration of the last submitted market LastSubmitConfig *SubmitBotMarketConfig `thrift:"last_submit_config,5,optional" form:"last_submit_config" json:"last_submit_config,omitempty" query:"last_submit_config"` - // 渠道品牌信息 + // Channel brand information ConnectorBrandInfoMap map[int64]*ConnectorBrandInfo `thrift:"connector_brand_info_map,6" form:"connector_brand_info_map" json:"connector_brand_info_map" query:"connector_brand_info_map"` - // 发布提醒 + // post alert PublishTips *PublishTips `thrift:"publish_tips,7,optional" form:"publish_tips" json:"publish_tips,omitempty" query:"publish_tips"` } diff --git a/backend/api/model/ocean/cloud/memory/ocean_cloud_memory.go b/backend/api/model/ocean/cloud/memory/ocean_cloud_memory.go index 9f86848c..55f91bbb 100644 --- a/backend/api/model/ocean/cloud/memory/ocean_cloud_memory.go +++ b/backend/api/model/ocean/cloud/memory/ocean_cloud_memory.go @@ -3,13 +3,13 @@ package memory import ( + "context" + "fmt" + "github.com/apache/thrift/lib/go/thrift" "github.com/coze-dev/coze-studio/backend/api/model/knowledge/document" "github.com/coze-dev/coze-studio/backend/api/model/kvmemory" "github.com/coze-dev/coze-studio/backend/api/model/project_memory" "github.com/coze-dev/coze-studio/backend/api/model/table" - "context" - "fmt" - "github.com/apache/thrift/lib/go/thrift" ) type MemoryService interface { diff --git a/backend/api/model/ocean/cloud/playground/playground.go b/backend/api/model/ocean/cloud/playground/playground.go index 80b6265c..39919875 100644 --- a/backend/api/model/ocean/cloud/playground/playground.go +++ b/backend/api/model/ocean/cloud/playground/playground.go @@ -3,25 +3,25 @@ package playground import ( - "github.com/coze-dev/coze-studio/backend/api/model/base" - "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common" "context" "database/sql" "database/sql/driver" "fmt" "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-studio/backend/api/model/base" + "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common" ) -// 分支 +// branch type Branch int64 const ( Branch_Undefined Branch = 0 - // 草稿 + // draft Branch_PersonalDraft Branch = 1 - // space草稿 + // Space draft Branch_Base Branch = 2 - // 线上版本,diff场景下使用 + // Online version, used in diff scenarios Branch_Publish Branch = 3 ) @@ -71,11 +71,11 @@ func (p *Branch) Value() (driver.Value, error) { type DataSetType int64 const ( - // 文本 + // Text DataSetType_Text DataSetType = 0 - // 表格 + // table DataSetType_Table DataSetType = 1 - // 图片 + // image DataSetType_Image DataSetType = 2 ) @@ -121,9 +121,9 @@ func (p *DataSetType) Value() (driver.Value, error) { type BotMarketStatus int64 const ( - // 下架 + // offline BotMarketStatus_Offline BotMarketStatus = 0 - // 上架 + // put on the shelves BotMarketStatus_Online BotMarketStatus = 1 ) @@ -212,11 +212,11 @@ func (p *ConnectorDynamicStatus) Value() (driver.Value, error) { type AuditStatus int64 const ( - // 审核中 + // Under review. AuditStatus_Auditing AuditStatus = 0 - // 审核通过 + // approved AuditStatus_Success AuditStatus = 1 - // 审核失败 + // audit failed AuditStatus_Failed AuditStatus = 2 ) @@ -262,9 +262,9 @@ func (p *AuditStatus) Value() (driver.Value, error) { type ScopeType int64 const ( - // 企业下所有的(企业下生效) + // All under the enterprise (effective under the enterprise) ScopeType_All ScopeType = 0 - // 我加入的(企业&个人都生效,不传默认Self) + // I joined (both companies and individuals are valid, no default self is passed on) ScopeType_Self ScopeType = 1 ) @@ -306,9 +306,9 @@ func (p *ScopeType) Value() (driver.Value, error) { type SpaceType int64 const ( - // 个人 + // individual SpaceType_Personal SpaceType = 1 - // 小组 + // group SpaceType_Team SpaceType = 2 ) @@ -392,7 +392,7 @@ func (p *SpaceMode) Value() (driver.Value, error) { type SpaceTag int64 const ( - // 专业版 + // Professional Edition SpaceTag_Professional SpaceTag = 1 ) @@ -430,13 +430,13 @@ func (p *SpaceTag) Value() (driver.Value, error) { type SpaceRoleType int64 const ( - // 默认 + // default SpaceRoleType_Default SpaceRoleType = 0 // owner SpaceRoleType_Owner SpaceRoleType = 1 - // 管理员 + // administrator SpaceRoleType_Admin SpaceRoleType = 2 - // 普通成员 + // ordinary member SpaceRoleType_Member SpaceRoleType = 3 ) @@ -483,17 +483,17 @@ func (p *SpaceRoleType) Value() (driver.Value, error) { return int64(*p), nil } -// 申请管理列表 +// Application management list type SpaceApplyStatus int64 const ( - // 所有 + // all SpaceApplyStatus_All SpaceApplyStatus = 0 - // 已加入 + // Joined SpaceApplyStatus_Joined SpaceApplyStatus = 1 - // 确认中 + // Confirming SpaceApplyStatus_Confirming SpaceApplyStatus = 2 - // 已拒绝 + // Rejected SpaceApplyStatus_Rejected SpaceApplyStatus = 3 ) @@ -1066,14 +1066,14 @@ func (p *UpdateDraftBotInfoAgwResponse) String() string { } type UpdateDraftBotInfoAgwData struct { - // 是否有变更 + // Is there any change? HasChange *bool `thrift:"has_change,1,optional" form:"has_change" json:"has_change,omitempty" query:"has_change"` - // true:机审校验不通过 + // True: The machine audit verification failed CheckNotPass bool `thrift:"check_not_pass,2" form:"check_not_pass" json:"check_not_pass" query:"check_not_pass"` - // 当前是在哪个分支 + // Which branch is it currently on? Branch *Branch `thrift:"branch,3,optional" form:"branch" json:"branch,omitempty" query:"branch"` SameWithOnline *bool `thrift:"same_with_online,4,optional" form:"same_with_online" json:"same_with_online,omitempty" query:"same_with_online"` - // 机审校验不通过文案 + // The machine audit verification failed the copy. CheckNotPassMsg *string `thrift:"check_not_pass_msg,5,optional" form:"check_not_pass_msg" json:"check_not_pass_msg,omitempty" query:"check_not_pass_msg"` } @@ -1688,11 +1688,11 @@ func (p *UpdateDraftBotInfoAgwRequest) String() string { } type GetDraftBotInfoAgwRequest struct { - // 草稿bot_id + // Draft bot_id BotID int64 `thrift:"bot_id,1,required" form:"bot_id,required" json:"bot_id,string,required" query:"bot_id,required"` - // 查历史记录,历史版本的id,对应 bot_draft_history的id + // Check the history, the id of the historical version, corresponding to the id of the bot_draft_history Version *string `thrift:"version,2,optional" form:"version" json:"version,omitempty" query:"version"` - // 查询指定commit_version版本,预发布使用,貌似和version是同一个东西,但是获取逻辑有区别 + // Query specifies commit_version version, pre-release use, seems to be the same thing as version, but the acquisition logic is different CommitVersion *string `thrift:"commit_version,3,optional" form:"commit_version" json:"commit_version,omitempty" query:"commit_version"` Base *base.Base `thrift:"Base,255" form:"-" json:"-" query:"-"` } @@ -2316,45 +2316,45 @@ func (p *GetDraftBotInfoAgwResponse) String() string { } type GetDraftBotInfoAgwData struct { - // 核心bot数据 + // core bot data BotInfo *bot_common.BotInfo `thrift:"bot_info,1,required" form:"bot_info,required" json:"bot_info,required" query:"bot_info,required"` - // bot选项信息 + // bot option information BotOptionData *BotOptionData `thrift:"bot_option_data,2,optional" form:"bot_option_data" json:"bot_option_data,omitempty" query:"bot_option_data"` - // 是否有未发布的变更 + // Are there any unpublished changes? HasUnpublishedChange *bool `thrift:"has_unpublished_change,3,optional" form:"has_unpublished_change" json:"has_unpublished_change,omitempty" query:"has_unpublished_change"` - // bot上架后的商品状态 + // The product status after the bot is put on the shelves BotMarketStatus *BotMarketStatus `thrift:"bot_market_status,4,optional" form:"bot_market_status" json:"bot_market_status,omitempty" query:"bot_market_status"` - // bot是否处于多人协作模式 + // Is the bot in multiplayer cooperative mode? InCollaboration *bool `thrift:"in_collaboration,5,optional" form:"in_collaboration" json:"in_collaboration,omitempty" query:"in_collaboration"` - // commit内容是否和线上内容一致 + // Is the content committed consistent with the online content? SameWithOnline *bool `thrift:"same_with_online,6,optional" form:"same_with_online" json:"same_with_online,omitempty" query:"same_with_online"` - // for前端,权限相关,当前用户是否可编辑此bot + // For frontend, permission related, can the current user edit this bot Editable *bool `thrift:"editable,7,optional" form:"editable" json:"editable,omitempty" query:"editable"` - // for前端,权限相关,当前用户是否可删除此bot + // For frontend, permission related, can the current user delete this bot Deletable *bool `thrift:"deletable,8,optional" form:"deletable" json:"deletable,omitempty" query:"deletable"` - // 是最新发布版本时传发布人 + // Is the publisher of the latest release version Publisher *UserInfo `thrift:"publisher,9,optional" form:"publisher" json:"publisher,omitempty" query:"publisher"` - // 是否已发布 + // Has it been published? HasPublish bool `thrift:"has_publish,10" form:"has_publish" json:"has_publish" query:"has_publish"` - // 空间id + // Space ID SpaceID int64 `thrift:"space_id,11" form:"space_id" json:"space_id,string" query:"space_id"` - // 发布的业务线详情 + // Published business line details Connectors []*BotConnectorInfo `thrift:"connectors,12" form:"connectors" json:"connectors" query:"connectors"` - // 获取的是什么分支的内容 + // What branch did you get the content of? Branch *Branch `thrift:"branch,13,optional" form:"branch" json:"branch,omitempty" query:"branch"` - // 如果branch=PersonalDraft,则为checkout/rebase的版本号;如果branch=base,则为提交的版本 + // If branch=PersonalDraft, the version number of checkout/rebase; if branch = base, the committed version CommitVersion *string `thrift:"commit_version,14,optional" form:"commit_version" json:"commit_version,omitempty" query:"commit_version"` - // for前端,最近一次的提交人 + // For the front end, the most recent author CommitterName *string `thrift:"committer_name,15,optional" form:"committer_name" json:"committer_name,omitempty" query:"committer_name"` - // for前端,提交时间 + // For frontend, commit time CommitTime *string `thrift:"commit_time,16,optional" form:"commit_time" json:"commit_time,omitempty" query:"commit_time"` - // for前端,发布时间 + // For frontend, release time PublishTime *string `thrift:"publish_time,17,optional" form:"publish_time" json:"publish_time,omitempty" query:"publish_time"` - // 多人协作相关操作权限 + // Multi-person collaboration related operation permissions CollaboratorStatus *BotCollaboratorStatus `thrift:"collaborator_status,18,optional" form:"collaborator_status" json:"collaborator_status,omitempty" query:"collaborator_status"` - // 最近一次审核详情 + // Details of the most recent review LatestAuditInfo *AuditInfo `thrift:"latest_audit_info,19,optional" form:"latest_audit_info" json:"latest_audit_info,omitempty" query:"latest_audit_info"` - // 抖音分身的bot会有appId + // Douyin's doppelganger bot will have appId. AppID *string `thrift:"app_id,20,optional" form:"app_id" json:"app_id,omitempty" query:"app_id"` } @@ -3530,17 +3530,17 @@ func (p *GetDraftBotInfoAgwData) String() string { } type BotOptionData struct { - // 模型详情 + // model details ModelDetailMap map[int64]*ModelDetail `thrift:"model_detail_map,1,optional" form:"model_detail_map" json:"model_detail_map,omitempty" query:"model_detail_map"` - // 插件详情 + // plugin details PluginDetailMap map[int64]*PluginDetal `thrift:"plugin_detail_map,2,optional" form:"plugin_detail_map" json:"plugin_detail_map,omitempty" query:"plugin_detail_map"` - // 插件API详情 + // Plugin API Details PluginAPIDetailMap map[int64]*PluginAPIDetal `thrift:"plugin_api_detail_map,3,optional" form:"plugin_api_detail_map" json:"plugin_api_detail_map,omitempty" query:"plugin_api_detail_map"` - // workflow详情 + // Workflow Details WorkflowDetailMap map[int64]*WorkflowDetail `thrift:"workflow_detail_map,4,optional" form:"workflow_detail_map" json:"workflow_detail_map,omitempty" query:"workflow_detail_map"` - // knowledge详情 + // Knowledge Details KnowledgeDetailMap map[string]*KnowledgeDetail `thrift:"knowledge_detail_map,5,optional" form:"knowledge_detail_map" json:"knowledge_detail_map,omitempty" query:"knowledge_detail_map"` - // 快捷指令list + // Quick command list ShortcutCommandList []*ShortcutCommand `thrift:"shortcut_command_list,6,optional" form:"shortcut_command_list" json:"shortcut_command_list,omitempty" query:"shortcut_command_list"` } @@ -4131,13 +4131,13 @@ func (p *BotOptionData) String() string { } type ModelDetail struct { - // 模型展示名(对用户) + // Model display name (to the user) Name *string `thrift:"name,1,optional" form:"name" json:"name,omitempty" query:"name"` - // 模型名(对内部) + // Model name (for internal) ModelName *string `thrift:"model_name,2,optional" form:"model_name" json:"model_name,omitempty" query:"model_name"` - // 模型ID + // Model ID ModelID *int64 `thrift:"model_id,3,optional" form:"model_id" json:"model_id,string,omitempty" query:"model_id"` - // 模型类别 + // Model Category ModelFamily *int64 `thrift:"model_family,4,optional" form:"model_family" json:"model_family,omitempty" query:"model_family"` // IconURL ModelIconURL *string `thrift:"model_icon_url,5,optional" form:"model_icon_url" json:"model_icon_url,omitempty" query:"model_icon_url"` @@ -5395,7 +5395,7 @@ type PluginParameter struct { IsRequired *bool `thrift:"is_required,3,optional" form:"is_required" json:"is_required,omitempty" query:"is_required"` Type *string `thrift:"type,4,optional" form:"type" json:"type,omitempty" query:"type"` SubParameters []*PluginParameter `thrift:"sub_parameters,5,optional" form:"sub_parameters" json:"sub_parameters,omitempty" query:"sub_parameters"` - // 如果Type是数组,则有subtype + // If Type is an array, there is a subtype SubType *string `thrift:"sub_type,6,optional" form:"sub_type" json:"sub_type,omitempty" query:"sub_type"` AssistType *int64 `thrift:"assist_type,7,optional" form:"assist_type" json:"assist_type,omitempty" query:"assist_type"` } @@ -5902,9 +5902,9 @@ type WorkflowDetail struct { Description *string `thrift:"description,3,optional" form:"description" json:"description,omitempty" query:"description"` IconURL *string `thrift:"icon_url,4,optional" form:"icon_url" json:"icon_url,omitempty" query:"icon_url"` Status *int64 `thrift:"status,5,optional" form:"status" json:"status,omitempty" query:"status"` - // 类型,1:官方模版 + // Type 1: Official Template Type *int64 `thrift:"type,6,optional" form:"type" json:"type,omitempty" query:"type"` - // workfklow对应的插件id + // Plugin ID corresponding to workfklow PluginID *int64 `thrift:"plugin_id,7,optional" form:"plugin_id" json:"plugin_id,string,omitempty" query:"plugin_id"` IsOfficial *bool `thrift:"is_official,8,optional" form:"is_official" json:"is_official,omitempty" query:"is_official"` APIDetail *PluginAPIDetal `thrift:"api_detail,9,optional" form:"api_detail" json:"api_detail,omitempty" query:"api_detail"` @@ -6801,11 +6801,11 @@ func (p *KnowledgeDetail) String() string { } type UserInfo struct { - // 用户id + // user id UserID int64 `thrift:"user_id,1" form:"user_id" json:"user_id,string" query:"user_id"` - // 用户名称 + // user name Name string `thrift:"name,2" form:"name" json:"name" query:"name"` - // 用户图标 + // user icon IconURL string `thrift:"icon_url,3" form:"icon_url" json:"icon_url" query:"icon_url"` } @@ -7363,11 +7363,11 @@ func (p *BotConnectorInfo) String() string { } type BotCollaboratorStatus struct { - // 当前用户是否可以提交 + // Can the current user submit? Commitable bool `thrift:"commitable,1" form:"commitable" json:"commitable" query:"commitable"` - // 当前用户是否可运维 + // Is the current user operable? Operateable bool `thrift:"operateable,2" form:"operateable" json:"operateable" query:"operateable"` - // 当前用户是否可管理协作者 + // Can the current user manage collaborators? Manageable bool `thrift:"manageable,3" form:"manageable" json:"manageable" query:"manageable"` } @@ -8041,11 +8041,11 @@ func (p *AuditResult) String() string { } -// Onboarding json结构 +// Onboarding json structure type OnboardingContent struct { - // 开场白(C端使用场景,只有1个;后台场景,可能为多个) + // Introductory remarks (C-end usage scenarios, only 1; background scenarios, possibly multiple) Prologue *string `thrift:"prologue,1,optional" form:"prologue" json:"prologue,omitempty" query:"prologue"` - // 建议问题 + // suggestion question SuggestedQuestions []string `thrift:"suggested_questions,2,optional" form:"suggested_questions" json:"suggested_questions,omitempty" query:"suggested_questions"` SuggestedQuestionsShowMode *bot_common.SuggestedQuestionsShowMode `thrift:"suggested_questions_show_mode,3,optional" form:"suggested_questions_show_mode" json:"suggested_questions_show_mode,omitempty" query:"suggested_questions_show_mode"` } @@ -8328,17 +8328,17 @@ func (p *OnboardingContent) String() string { } type GetSpaceListV2Request struct { - // 搜索词 + // Search term SearchWord *string `thrift:"search_word,1,optional" form:"search_word" json:"search_word,omitempty" query:"search_word"` - // 企业id + // Enterprise ID EnterpriseID *int64 `thrift:"enterprise_id,2,optional" form:"enterprise_id" json:"enterprise_id,string,omitempty" query:"enterprise_id"` - // 组织id + // organization id OrganizationID *int64 `thrift:"organization_id,3,optional" form:"organization_id" json:"organization_id,string,omitempty" query:"organization_id"` - // 范围类型 + // range type ScopeType *ScopeType `thrift:"scope_type,4,optional" form:"scope_type" json:"scope_type,omitempty" query:"scope_type"` - // 分页信息 + // paging information Page *int32 `thrift:"page,5,optional" form:"page" json:"page,omitempty" query:"page"` - // 分页大小 -- page 和 size不传则认为不分页 + // Paging size -- if page and size are not passed on, it is considered not paging Size *int32 `thrift:"size,6,optional" form:"size" json:"size,omitempty" query:"size"` Base *base.Base `thrift:"Base,255,optional" form:"-" json:"-" query:"-"` } @@ -9276,47 +9276,47 @@ func (p *ConnectorInfo) String() string { } type BotSpaceV2 struct { - // 空间id,新建为0 + // Space id, newly created as 0 ID int64 `thrift:"id,1" form:"id" json:"id,string" query:"id"` - // 发布平台 + // publishing platform AppIds []*AppIDInfo `thrift:"app_ids,2" form:"app_ids" json:"app_ids" query:"app_ids"` - // 空间名称 + // space name Name string `thrift:"name,3" form:"name" json:"name" query:"name"` - // 空间描述 + // spatial description Description string `thrift:"description,4" form:"description" json:"description" query:"description"` - // 图标url + // icon url IconURL string `thrift:"icon_url,5" form:"icon_url" json:"icon_url" query:"icon_url"` - // 空间类型 + // space type SpaceType SpaceType `thrift:"space_type,6" form:"space_type" json:"space_type" query:"space_type"` - // 发布平台 + // publishing platform Connectors []*ConnectorInfo `thrift:"connectors,7" form:"connectors" json:"connectors" query:"connectors"` - // 是否隐藏新建,复制删除按钮 + // Whether to hide New, Copy Delete buttons HideOperation bool `thrift:"hide_operation,8" form:"hide_operation" json:"hide_operation" query:"hide_operation"` - // 在team中的角色 1-owner 2-admin 3-member + // Role in team 1-owner 2-admin 3-member RoleType int32 `thrift:"role_type,9" form:"role_type" json:"role_type" query:"role_type"` - // 空间模式 + // Spatial Mode SpaceMode *SpaceMode `thrift:"space_mode,10,optional" form:"space_mode" json:"space_mode,omitempty" query:"space_mode"` - // 是否显示端侧插件创建入口 + // Whether to display the end-side plug-in creation entry DisplayLocalPlugin bool `thrift:"display_local_plugin,11" form:"display_local_plugin" json:"display_local_plugin" query:"display_local_plugin"` - // 角色类型,枚举 + // Role type, enumeration SpaceRoleType SpaceRoleType `thrift:"space_role_type,12" form:"space_role_type" json:"space_role_type" query:"space_role_type"` - // 空间标签 + // spatial label SpaceTag *SpaceTag `thrift:"space_tag,13,optional" form:"space_tag" json:"space_tag,omitempty" query:"space_tag"` - // 企业id + // Enterprise ID EnterpriseID *int64 `thrift:"enterprise_id,14,optional" form:"enterprise_id" json:"enterprise_id,string,omitempty" query:"enterprise_id"` - // 组织id + // organization id OrganizationID *int64 `thrift:"organization_id,15,optional" form:"organization_id" json:"organization_id,string,omitempty" query:"organization_id"` - // 空间owner uid + // Space owner uid OwnerUserID *int64 `thrift:"owner_user_id,16,optional" form:"owner_user_id" json:"owner_user_id,string,omitempty" query:"owner_user_id"` - // 空间owner昵称 + // Space owner nickname OwnerName *string `thrift:"owner_name,17,optional" form:"owner_name" json:"owner_name,omitempty" query:"owner_name"` - // 空间owner用户名 + // Space owner username OwnerUserName *string `thrift:"owner_user_name,18,optional" form:"owner_user_name" json:"owner_user_name,omitempty" query:"owner_user_name"` - // 空间owner图像 + // Space owner image OwnerIconURL *string `thrift:"owner_icon_url,19,optional" form:"owner_icon_url" json:"owner_icon_url,omitempty" query:"owner_icon_url"` - // 当前访问用户加入空间状态 + // The current visiting user joins the space status SpaceApplyStatus *SpaceApplyStatus `thrift:"space_apply_status,20,optional" form:"space_apply_status" json:"space_apply_status,omitempty" query:"space_apply_status"` - // 空间成员总数,只有组织空间才查询 + // The total number of space members, only the organization space can be queried. TotalMemberNum *int64 `thrift:"total_member_num,21,optional" form:"total_member_num" json:"total_member_num,omitempty" query:"total_member_num"` } @@ -10489,19 +10489,19 @@ func (p *BotSpaceV2) String() string { } type SpaceInfo struct { - // 用户加入空间列表 + // User joins space list BotSpaceList []*BotSpaceV2 `thrift:"bot_space_list,1" form:"bot_space_list" json:"bot_space_list" query:"bot_space_list"` - // 是否有个人空间 + // Is there any personal space available? HasPersonalSpace bool `thrift:"has_personal_space,2" form:"has_personal_space" json:"has_personal_space" query:"has_personal_space"` - // 个人创建team空间数量 + // Number of team spaces created by individuals TeamSpaceNum int32 `thrift:"team_space_num,3" form:"team_space_num" json:"team_space_num" query:"team_space_num"` - // 个人最大能创建的空间数量 + // The maximum number of spaces an individual can create MaxTeamSpaceNum int32 `thrift:"max_team_space_num,4" form:"max_team_space_num" json:"max_team_space_num" query:"max_team_space_num"` - // 最近使用空间列表 + // list of recently used spaces RecentlyUsedSpaceList []*BotSpaceV2 `thrift:"recently_used_space_list,5" form:"recently_used_space_list" json:"recently_used_space_list" query:"recently_used_space_list"` - // 分页时生效 + // Effective when paging Total *int32 `thrift:"total,6,optional" form:"total" json:"total,omitempty" query:"total"` - // 分页时生效 + // Effective when paging HasMore *bool `thrift:"has_more,7,optional" form:"has_more" json:"has_more,omitempty" query:"has_more"` } @@ -11583,7 +11583,7 @@ func (p *GetImagexShortUrlResponse) String() string { } type GetImagexShortUrlData struct { - //审核状态,key uri,value url 和 审核状态 + //Audit status, key uri, value url and, audit status URLInfo map[string]*UrlInfo `thrift:"url_info,1" form:"url_info" json:"url_info" query:"url_info"` } @@ -12192,15 +12192,15 @@ func (p *GetImagexShortUrlRequest) String() string { type UserBasicInfo struct { UserId int64 `thrift:"UserId,1,required" form:"user_id,required" json:"user_id,string,required"` - // 昵称 + // nickname Username string `thrift:"Username,3,required" form:"user_name,required" json:"user_name,required"` - // 头像 + // avatar UserAvatar string `thrift:"UserAvatar,4,required" form:"user_avatar,required" json:"user_avatar,required"` - // 用户名 + // user name UserUniqueName *string `thrift:"UserUniqueName,5,optional" form:"user_unique_name" json:"user_unique_name,omitempty"` - // 用户标签 + // user tag UserLabel *bot_common.UserLabel `thrift:"UserLabel,6,optional" form:"user_label" json:"user_label,omitempty"` - // 用户创建时间 + // user creation time CreateTime *int64 `thrift:"CreateTime,7,optional" form:"create_time" json:"create_time,omitempty"` } @@ -12614,9 +12614,9 @@ func (p *UserBasicInfo) String() string { type MGetUserBasicInfoRequest struct { UserIds []string `thrift:"UserIds,1,required" form:"user_ids,required" json:"user_ids,string,required"` NeedUserStatus *bool `thrift:"NeedUserStatus,2,optional" form:"need_user_status" json:"need_user_status,omitempty"` - // 是否需要企业认证信息,前端通过AGW调用时默认为true + // Whether enterprise authentication information is required, the default is true when the front end is called through AGW NeedEnterpriseIdentity *bool `thrift:"NeedEnterpriseIdentity,3,optional" form:"need_enterprise_identity" json:"need_enterprise_identity,omitempty"` - // 是否需要火山用户名 + // Do you need a volcano username? NeedVolcanoUserName *bool `thrift:"NeedVolcanoUserName,4,optional" form:"need_volcano_user_name" json:"need_volcano_user_name,omitempty"` Base *base.Base `thrift:"Base,255,optional" form:"-" json:"-" query:"-"` } @@ -14595,7 +14595,7 @@ type ReportUserBehaviorRequest struct { ResourceID int64 `thrift:"ResourceID,1,required" form:"resource_id,required" json:"resource_id,string,required"` ResourceType SpaceResourceType `thrift:"ResourceType,2,required" form:"resource_type,required" json:"resource_type,required"` BehaviorType BehaviorType `thrift:"BehaviorType,3,required" form:"behavior_type,required" json:"behavior_type,required"` - // 本需求必传 + // This requirement must be passed on SpaceID *int64 `thrift:"SpaceID,4,optional" form:"space_id" json:"space_id,string,omitempty"` Base *base.Base `thrift:"Base,255" form:"-" json:"-" query:"-"` } @@ -15882,9 +15882,9 @@ func (p *GetFileUrlsResponse) String() string { } type UploadFileOpenRequest struct { - // 文件类型 + // file type ContentType string `thrift:"ContentType,1,required" header:"Content-Type,required" json:"ContentType,required"` - // 二进制数据 + // binary data Data []byte `thrift:"Data,2,required" json:"Data,required" raw_body:",required"` Base *base.Base `thrift:"Base,255" form:"Base" json:"Base" query:"Base"` } @@ -16437,13 +16437,13 @@ func (p *UploadFileOpenResponse) String() string { } type File struct { - // 文件URI + // File URI URI string `thrift:"URI,1" form:"uri" json:"uri"` - // 文件字节数 + // file bytes Bytes int64 `thrift:"Bytes,2" form:"bytes" json:"bytes"` - // 上传时间戳,单位s + // Upload timestamp in s CreatedAt int64 `thrift:"CreatedAt,3" form:"CreatedAt" json:"CreatedAt" query:"CreatedAt"` - // 文件名 + // file name FileName string `thrift:"FileName,4" form:"file_name" json:"file_name"` URL string `thrift:"URL,5" form:"url" json:"url"` } @@ -16762,9 +16762,9 @@ func (p *File) String() string { type GetBotOnlineInfoReq struct { // botId BotID int64 `thrift:"bot_id,1,required" form:"bot_id,required" json:"bot_id,string,required" query:"bot_id,required"` - // 先保留,不暴露且不使用该字段 + // Keep it first, don't expose it, and don't use the field ConnectorID *string `thrift:"connector_id,2,optional" form:"connector_id" json:"connector_id,omitempty" query:"connector_id"` - // bot版本,不传则获取最新版本 + // bot version, get the latest version if you don't pass it on. Version *string `thrift:"version,3,optional" form:"version" json:"version,omitempty" query:"version"` } @@ -17291,7 +17291,7 @@ type PlaygroundService interface { UpdateBotPopupInfo(ctx context.Context, request *UpdateBotPopupInfoRequest) (r *UpdateBotPopupInfoResponse, err error) ReportUserBehavior(ctx context.Context, request *ReportUserBehaviorRequest) (r *ReportUserBehaviorResponse, err error) - // 创建快捷指令 + // Create shortcut instructions CreateUpdateShortcutCommand(ctx context.Context, req *CreateUpdateShortcutCommandRequest) (r *CreateUpdateShortcutCommandResponse, err error) GetFileUrls(ctx context.Context, req *GetFileUrlsRequest) (r *GetFileUrlsResponse, err error) @@ -17309,7 +17309,7 @@ type PlaygroundService interface { MGetUserBasicInfo(ctx context.Context, request *MGetUserBasicInfoRequest) (r *MGetUserBasicInfoResponse, err error) //openapi GetBotOnlineInfo(ctx context.Context, request *GetBotOnlineInfoReq) (r *GetBotOnlineInfoResp, err error) - // File 相关 OpenAPI + // File related OpenAPI UploadFileOpen(ctx context.Context, request *UploadFileOpenRequest) (r *UploadFileOpenResponse, err error) } diff --git a/backend/api/model/ocean/cloud/playground/prompt_resource.go b/backend/api/model/ocean/cloud/playground/prompt_resource.go index bfac237b..fdc3d177 100644 --- a/backend/api/model/ocean/cloud/playground/prompt_resource.go +++ b/backend/api/model/ocean/cloud/playground/prompt_resource.go @@ -3,25 +3,25 @@ package playground 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 ActionKey int64 const ( - //复制 + //copy ActionKey_Copy ActionKey = 1 - //删除 + //delete ActionKey_Delete ActionKey = 2 - //启用/禁用 + //enable/disable ActionKey_EnableSwitch ActionKey = 3 - //编辑 + //edit ActionKey_Edit ActionKey = 4 - // 跨空间复制 + //Cross-space copy ActionKey_CrossSpaceCopy ActionKey = 10 ) @@ -75,9 +75,9 @@ func (p *ActionKey) Value() (driver.Value, error) { type ResourcePublishStatus int64 const ( - //未发布 + //unpublished ResourcePublishStatus_UnPublished ResourcePublishStatus = 1 - //已发布 + //Published ResourcePublishStatus_Published ResourcePublishStatus = 2 ) @@ -2629,7 +2629,7 @@ func (p *DeletePromptResourceResponse) String() string { } -// 参数优先级从上往下 +// Parameter priority from top to bottom type SyncPromptResourceToEsRequest struct { SyncAll *bool `thrift:"SyncAll,1,optional" form:"SyncAll" json:"SyncAll,omitempty" query:"SyncAll"` PromptResourceIDList []int64 `thrift:"PromptResourceIDList,2,optional" form:"PromptResourceIDList" json:"PromptResourceIDList,omitempty" query:"PromptResourceIDList"` @@ -3137,9 +3137,9 @@ func (p *SyncPromptResourceToEsResponse) String() string { } type MGetDisplayResourceInfoRequest struct { - // 最大传一页的数量,实现方可以限制最大100个 + // The maximum number of one page can be transferred, and the implementer can limit the maximum to 100. ResIDs []int64 `thrift:"ResIDs,1" form:"ResIDs" json:"ResIDs" query:"ResIDs"` - // 当前的用户,实现方用于判断权限 + // The current user, the implementation is used to determine the authority CurrentUserID int64 `thrift:"CurrentUserID,2" form:"CurrentUserID" json:"CurrentUserID" query:"CurrentUserID"` Base *base.Base `thrift:"Base,255" form:"Base" json:"Base" query:"Base"` } @@ -3612,9 +3612,9 @@ func (p *MGetDisplayResourceInfoResponse) String() string { } type ResourceAction struct { - // 一个操作对应一个唯一的key,key由资源侧约束 + // An operation corresponds to a unique key, and the key is constrained by the resource side Key ActionKey `thrift:"Key,1,required" json:"key" form:"Key,required" query:"Key,required"` - //ture=可以操作该Action,false=置灰 + //ture = can operate this Action, false = grey out Enable bool `thrift:"Enable,2,required" json:"enable" form:"Enable,required" query:"Enable,required"` } @@ -3812,29 +3812,29 @@ func (p *ResourceAction) String() string { } -// 展示用,实现方提供展示信息 +// For display, the implementer provides display information type DisplayResourceInfo struct { - // 资源id + // Resource ID ResID *int64 `thrift:"ResID,1,optional" form:"ResID" json:"ResID,omitempty" query:"ResID"` - // 资源描述 + // resource description Desc *string `thrift:"Desc,5,optional" form:"Desc" json:"Desc,omitempty" query:"Desc"` - // 资源Icon,完整url + // Resource Icon, full url Icon *string `thrift:"Icon,6,optional" form:"Icon" json:"Icon,omitempty" query:"Icon"` - // 资源状态,各类型资源自身定义 + // Resource status, each type of resource defines itself BizResStatus *int32 `thrift:"BizResStatus,12,optional" form:"BizResStatus" json:"BizResStatus,omitempty" query:"BizResStatus"` - // 是否开启多人编辑 + // Whether to enable multi-person editing CollaborationEnable *bool `thrift:"CollaborationEnable,13,optional" form:"CollaborationEnable" json:"CollaborationEnable,omitempty" query:"CollaborationEnable"` - // 业务携带的扩展信息,以res_type区分,每个res_type定义的schema和含义不一样,使用前需要判断res_type + // Business carry extended information to res_type distinguish, each res_type defined schema and meaning is not the same, need to judge before use res_type BizExtend map[string]string `thrift:"BizExtend,16,optional" form:"BizExtend" json:"BizExtend,omitempty" query:"BizExtend"` - // 不同类型的不同操作按钮,由资源实现方和前端约定。返回则展示,要隐藏某个按钮,则不要返回; + // Different types of different operation buttons are agreed upon by the resource implementer and the front end. Return is displayed, if you want to hide a button, do not return; Actions []*ResourceAction `thrift:"Actions,17,optional" form:"Actions" json:"Actions,omitempty" query:"Actions"` - // 是否禁止进详情页 + // Whether to ban entering the details page DetailDisable *bool `thrift:"DetailDisable,18,optional" form:"DetailDisable" json:"DetailDisable,omitempty" query:"DetailDisable"` - // 资源名称 + // resource name Name *string `thrift:"Name,19,optional" form:"Name" json:"Name,omitempty" query:"Name"` - // 资源发布状态,1-未发布,2-已发布 + // Resource release status, 1 - unpublished, 2 - published PublishStatus *ResourcePublishStatus `thrift:"PublishStatus,20,optional" form:"PublishStatus" json:"PublishStatus,omitempty" query:"PublishStatus"` - // 最近编辑时间, unix秒级时间戳 + // Last edited, unix timestamp EditTime *int64 `thrift:"EditTime,21,optional" form:"EditTime" json:"EditTime,omitempty" query:"EditTime"` } diff --git a/backend/api/model/ocean/cloud/playground/shortcut_command.go b/backend/api/model/ocean/cloud/playground/shortcut_command.go index 2b0eb0e7..be5b5459 100644 --- a/backend/api/model/ocean/cloud/playground/shortcut_command.go +++ b/backend/api/model/ocean/cloud/playground/shortcut_command.go @@ -3,19 +3,19 @@ package playground 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 SendType int64 const ( - // 直接发query + // Send query directly SendType_SendTypeQuery SendType = 0 - // 使用面板 + // use panel SendType_SendTypePanel SendType = 1 ) @@ -57,9 +57,9 @@ func (p *SendType) Value() (driver.Value, error) { type ToolType int64 const ( - // 使用WorkFlow + // Using WorkFlow ToolType_ToolTypeWorkFlow ToolType = 1 - // 使用插件 + // use plug-ins ToolType_ToolTypePlugin ToolType = 2 ) @@ -636,9 +636,9 @@ func (p *CreateShortcutCommandResponse) String() string { } type ShortcutStruct struct { - // 快捷指令ID列表 实体上绑定的 + // Shortcut ID list, bound on the entity ShortcutSort []string `thrift:"shortcut_sort,16,optional" form:"shortcut_sort" json:"shortcut_sort,omitempty" query:"shortcut_sort"` - // 快捷指令内容list + // Quick command content list ShortcutList []*ShortcutCommand `thrift:"shortcut_list,17,optional" form:"shortcut_list" json:"shortcut_list,omitempty" query:"shortcut_list"` } @@ -884,34 +884,34 @@ func (p *ShortcutStruct) String() string { } type ShortcutCommand struct { - // 绑定实体ID + // Binding Entity ID ObjectID int64 `thrift:"object_id,2" form:"object_id" json:"object_id,string" query:"object_id"` - // 命令名称 + // command name CommandName string `thrift:"command_name,3" form:"command_name" json:"command_name" query:"command_name"` - // 快捷指令 + // Quick Instruction ShortcutCommand string `thrift:"shortcut_command,4" form:"shortcut_command" json:"shortcut_command" query:"shortcut_command"` - // 描述 + // describe Description string `thrift:"description,5" form:"description" json:"description" query:"description"` - // 发送类型 + // Send type SendType SendType `thrift:"send_type,6" form:"send_type" json:"send_type" query:"send_type"` - // 使用工具type + // Use tool type ToolType ToolType `thrift:"tool_type,7" form:"tool_type" json:"tool_type" query:"tool_type"` WorkFlowID string `thrift:"work_flow_id,8" form:"work_flow_id" json:"work_flow_id" query:"work_flow_id"` PluginID string `thrift:"plugin_id,9" form:"plugin_id" json:"plugin_id" query:"plugin_id"` PluginAPIName string `thrift:"plugin_api_name,10" form:"plugin_api_name" json:"plugin_api_name" query:"plugin_api_name"` - // 模板query + // Template query TemplateQuery string `thrift:"template_query,11" form:"template_query" json:"template_query" query:"template_query"` - // panel参数 + // Panel parameters ComponentsList []*Components `thrift:"components_list,12" form:"components_list" json:"components_list" query:"components_list"` - // 表单的schema + // Form schema CardSchema string `thrift:"card_schema,15" form:"card_schema" json:"card_schema" query:"card_schema"` - // 指令ID + // Instruction ID CommandID int64 `thrift:"command_id,16" form:"command_id" json:"command_id,string" query:"command_id"` - //工具信息 包含name+变量列表+... + //Tool information, including name + variable list +... ToolInfo *ToolInfo `thrift:"tool_info,17" form:"tool_info" json:"tool_info" query:"tool_info"` - // 指令图标 + // command icon ShortcutIcon *ShortcutFileInfo `thrift:"shortcut_icon,18" form:"shortcut_icon" json:"shortcut_icon" query:"shortcut_icon"` - //multi的指令时,该指令由哪个节点执行 + //Multi instruction, which node executes the instruction AgentID *string `thrift:"agent_id,21,optional" form:"agent_id" json:"agent_id,omitempty" query:"agent_id"` PluginAPIID int64 `thrift:"plugin_api_id,22" form:"plugin_api_id" json:"plugin_api_id,string" query:"plugin_api_id"` } @@ -1983,17 +1983,17 @@ func (p *ShortcutFileInfo) String() string { } type Components struct { - // panel参数 + // Panel parameters Name string `thrift:"name,1" form:"name" json:"name" query:"name"` Description string `thrift:"description,2" form:"description" json:"description" query:"description"` InputType InputType `thrift:"input_type,3" form:"input_type" json:"input_type" query:"input_type"` - // 请求工具时,参数的key + // When requesting the tool, the key of the parameter Parameter string `thrift:"parameter,4" form:"parameter" json:"parameter" query:"parameter"` Options []string `thrift:"options,5" form:"options" json:"options" query:"options"` DefaultValue *DefaultValue `thrift:"default_value,6" form:"default_value" json:"default_value" query:"default_value"` - // 是否隐藏不展示 + // Whether to hide or not to show Hide bool `thrift:"hide,7" form:"hide" json:"hide" query:"hide"` - // input_type为MixUpload时,支持哪些类型 + // What types are supported input_type MixUpload UploadOptions []InputType `thrift:"upload_options,8" form:"upload_options" json:"upload_options" query:"upload_options"` } @@ -2672,7 +2672,7 @@ func (p *DefaultValue) String() string { type ToolInfo struct { ToolName string `thrift:"tool_name,1" form:"tool_name" json:"tool_name" query:"tool_name"` - // 变量列表 插件&workFLow + // Variable lists, plugins & workFLow ToolParamsList []*ToolParams `thrift:"tool_params_list,2" form:"tool_params_list" json:"tool_params_list" query:"tool_params_list"` } @@ -2876,14 +2876,14 @@ func (p *ToolInfo) String() string { } type ToolParams struct { - // 参数列表 + // parameter list Name string `thrift:"name,1" form:"name" json:"name" query:"name"` Required bool `thrift:"required,2" form:"required" json:"required" query:"required"` Desc string `thrift:"desc,3" form:"desc" json:"desc" query:"desc"` Type string `thrift:"type,4" form:"type" json:"type" query:"type"` - // 默认值 + // default value DefaultValue string `thrift:"default_value,6" form:"default_value" json:"default_value" query:"default_value"` - // 是否是panel参数 + // Is it a panel parameter? ReferComponent bool `thrift:"refer_component,8" form:"refer_component" json:"refer_component" query:"refer_component"` } diff --git a/backend/api/model/ocean/cloud/plugin_develop/plugin_develop.go b/backend/api/model/ocean/cloud/plugin_develop/plugin_develop.go index 8e592a12..1f89819f 100644 --- a/backend/api/model/ocean/cloud/plugin_develop/plugin_develop.go +++ b/backend/api/model/ocean/cloud/plugin_develop/plugin_develop.go @@ -3,31 +3,31 @@ package plugin_develop import ( - "github.com/coze-dev/coze-studio/backend/api/model/base" - "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" "context" "fmt" "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-studio/backend/api/model/base" + "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common" ) type GetPlaygroundPluginListRequest struct { - // 页码 + // page number Page *int32 `thrift:"page,1,optional" form:"page" json:"page,omitempty"` - // 每页大小 + // page size Size *int32 `thrift:"size,2,optional" form:"size" json:"size,omitempty"` // ignore Name *string `thrift:"name,4,optional" form:"name" json:"name,omitempty"` - // 空间id + // Space ID SpaceID *int64 `thrift:"space_id,5,optional" form:"space_id" json:"space_id,string,omitempty"` - // 如果存在,则根据插件id查询,无分页逻辑 + // If present, query according to plug-in id, no paging logic PluginIds []string `thrift:"plugin_ids,6" form:"plugin_ids" json:"plugin_ids"` - // 长度为1 ,且为workflow时,返回已发布的workflow列表,默认返回已发布的plugin列表 + // When the length is 1 and it is a workflow, return the list of published workflows, and return the list of published plugins by default PluginTypes []int32 `thrift:"plugin_types,7" form:"plugin_types" json:"plugin_types"` // ignore ChannelID *int32 `thrift:"channel_id,8,optional" form:"channel_id" json:"channel_id,omitempty"` // ignore SelfCreated *bool `thrift:"self_created,9,optional" form:"self_created" json:"self_created,omitempty"` - // 排序 + // sort OrderBy *int32 `thrift:"order_by,10,optional" form:"order_by" json:"order_by,omitempty"` // ignore IsGetOffline *bool `thrift:"is_get_offline,11,optional" form:"is_get_offline" json:"is_get_offline,omitempty"` @@ -1095,13 +1095,13 @@ func (p *GetPlaygroundPluginListResponse) String() string { } type GetPluginAPIsRequest struct { - // 插件id + // Plugin ID PluginID int64 `thrift:"plugin_id,1,required" form:"plugin_id,required" json:"plugin_id,string,required" query:"plugin_id,required"` - // 如果存在,则根据工具id查询,无分页逻辑 + // If present, query according to tool id, no paging logic APIIds []string `thrift:"api_ids,2" form:"api_ids" json:"api_ids" query:"api_ids"` - // 页码 + // page number Page int32 `thrift:"page,3" form:"page" json:"page" query:"page"` - // 每页大小 + // page size Size int32 `thrift:"size,4" form:"size" json:"size" query:"size"` // ignore Order *plugin_develop_common.APIListOrder `thrift:"order,5" form:"order" json:"order" query:"order"` @@ -1955,7 +1955,7 @@ func (p *GetPluginAPIsResponse) String() string { } type GetUpdatedAPIsRequest struct { - // 插件id + // Plugin ID PluginID int64 `thrift:"plugin_id,1,required" form:"plugin_id,required" json:"plugin_id,string,required" query:"plugin_id,required"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -2158,11 +2158,11 @@ func (p *GetUpdatedAPIsRequest) String() string { type GetUpdatedAPIsResponse struct { Code int64 `thrift:"code,1" form:"code" json:"code" query:"code"` Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` - // 新创建的工具名 + // Newly created tool name CreatedAPINames []string `thrift:"created_api_names,3" form:"created_api_names" json:"created_api_names" query:"created_api_names"` - // 被删除的工具名 + // Deleted tool name DeletedAPINames []string `thrift:"deleted_api_names,4" form:"deleted_api_names" json:"deleted_api_names" query:"deleted_api_names"` - // 被更新的工具名 + // updated tool name UpdatedAPINames []string `thrift:"updated_api_names,5" form:"updated_api_names" json:"updated_api_names" query:"updated_api_names"` BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` } @@ -2591,7 +2591,7 @@ func (p *GetUpdatedAPIsResponse) String() string { } type GetPluginInfoRequest struct { - // 目前只支持插件openapi插件的信息 + // Currently only plugins are supported OpenAPI plugin information PluginID int64 `thrift:"plugin_id,1,required" form:"plugin_id,required" json:"plugin_id,string,required" query:"plugin_id,required"` // ignore PreviewVersionTsx *string `thrift:"preview_version_tsx,2,optional" form:"preview_version_tsx" json:"preview_version_tsx,omitempty" query:"preview_version_tsx"` @@ -2853,11 +2853,11 @@ type GetPluginInfoResponse struct { Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` MetaInfo *plugin_develop_common.PluginMetaInfo `thrift:"meta_info,3" form:"meta_info" json:"meta_info" query:"meta_info"` CodeInfo *plugin_develop_common.CodeInfo `thrift:"code_info,4" form:"code_info" json:"code_info" query:"code_info"` - // 0 无更新 1 有更新未发布 + // 0 No updates 1 Yes updates Not released Status bool `thrift:"status,5" form:"status" json:"status" query:"status"` - // 是否已发布 + // Has it been published? Published bool `thrift:"published,6" form:"published" json:"published" query:"published"` - // 创建人信息 + // creator information Creator *plugin_develop_common.Creator `thrift:"creator,7" form:"creator" json:"creator" query:"creator"` // ignore StatisticData *plugin_develop_common.PluginStatisticData `thrift:"statistic_data,8" form:"statistic_data" json:"statistic_data" query:"statistic_data"` @@ -4572,27 +4572,27 @@ func (p *UpdatePluginResponse) String() string { } type RegisterPluginMetaRequest struct { - // 插件名 + // plugin name Name string `thrift:"name,1,required" form:"name,required" json:"name,required" query:"name,required"` - // 插件描述 + // Plugin description Desc string `thrift:"desc,2,required" form:"desc,required" json:"desc,required" query:"desc,required"` - // 插件服务地址前缀 + // Plugin service address prefix URL *string `thrift:"url,3,optional" form:"url" json:"url,omitempty" query:"url"` - // 插件图标 + // plugin icon Icon *plugin_develop_common.PluginIcon `thrift:"icon,4,required" form:"icon,required" json:"icon,required" query:"icon,required"` - // 插件授权类型 + // plug-in authorization type AuthType *plugin_develop_common.AuthorizationType `thrift:"auth_type,5,optional" form:"auth_type" json:"auth_type,omitempty" query:"auth_type"` - // 子授权类型为api/token时,token参数位置 + // When the sub-authorization type is api/token, the token parameter position Location *plugin_develop_common.AuthorizationServiceLocation `thrift:"location,6,optional" form:"location" json:"location,omitempty" query:"location"` - // 子授权类型为api/token时,token参数key + // When the sub-authorization type is api/token, the token parameter key Key *string `thrift:"key,7,optional" form:"key" json:"key,omitempty" query:"key"` - // 子授权类型为api/token时,token参数value + // When the sub-authorization type is api/token, the token parameter value ServiceToken *string `thrift:"service_token,8,optional" form:"service_token" json:"service_token,omitempty" query:"service_token"` - // 授权类型为oauth是,oauth信息,见GetOAuthSchema返回值 + // The authorization type is oauth Yes, oauth information, see GetOAuthSchema return value OauthInfo *string `thrift:"oauth_info,9,optional" form:"oauth_info" json:"oauth_info,omitempty" query:"oauth_info"` - // 空间id + // Space ID SpaceID int64 `thrift:"space_id,10,required" form:"space_id,required" json:"space_id,string,required" query:"space_id,required"` - // 插件公共参数,key为参数位置,value为参数列表 + // Plugin public parameters, key is the parameter position, value is the parameter list CommonParams map[plugin_develop_common.ParameterLocation][]*plugin_develop_common.CommonParamSchema `thrift:"common_params,11,optional" form:"common_params" json:"common_params,omitempty" query:"common_params"` // ignore CreationMethod *plugin_develop_common.CreationMethod `thrift:"creation_method,12,optional" form:"creation_method" json:"creation_method,omitempty" query:"creation_method"` @@ -4600,9 +4600,9 @@ type RegisterPluginMetaRequest struct { IdeCodeRuntime *string `thrift:"ide_code_runtime,13,optional" form:"ide_code_runtime" json:"ide_code_runtime,omitempty" query:"ide_code_runtime"` // ignore PluginType *plugin_develop_common.PluginType `thrift:"plugin_type,14,optional" form:"plugin_type" json:"plugin_type,omitempty" query:"plugin_type"` - // 应用id + // App ID ProjectID *int64 `thrift:"project_id,15,optional" form:"project_id" json:"project_id,string,omitempty" query:"project_id"` - // 二级授权类型,0:api/token of service,10:client credentials of oauth + // Level 2 authorization type, 0: api/token of service, 10: client credentials of oauth SubAuthType *int32 `thrift:"sub_auth_type,16,optional" form:"sub_auth_type" json:"sub_auth_type,omitempty" query:"sub_auth_type"` // ignore AuthPayload *string `thrift:"auth_payload,17,optional" form:"auth_payload" json:"auth_payload,omitempty" query:"auth_payload"` @@ -6078,22 +6078,22 @@ type UpdatePluginMetaRequest struct { URL *string `thrift:"url,4,optional" form:"url" json:"url,omitempty" query:"url"` Icon *plugin_develop_common.PluginIcon `thrift:"icon,5,optional" form:"icon" json:"icon,omitempty" query:"icon"` AuthType *plugin_develop_common.AuthorizationType `thrift:"auth_type,6,optional" form:"auth_type" json:"auth_type,omitempty" query:"auth_type"` - // 子授权类型为api/token时,token参数位置 + // When the sub-authorization type is api/token, the token parameter position Location *plugin_develop_common.AuthorizationServiceLocation `thrift:"location,7,optional" form:"location" json:"location,omitempty" query:"location"` - // 子授权类型为api/token时,token参数key + // When the sub-authorization type is api/token, the token parameter key Key *string `thrift:"key,8,optional" form:"key" json:"key,omitempty" query:"key"` - // 子授权类型为api/token时,token参数value + // When the sub-authorization type is api/token, the token parameter value ServiceToken *string `thrift:"service_token,9,optional" form:"service_token" json:"service_token,omitempty" query:"service_token"` - // 子授权类型为oauth时,oauth信息,见GetOAuthSchema返回值 + // When the sub-authorization type is oauth, for oauth information, see GetOAuthSchema return value OauthInfo *string `thrift:"oauth_info,10,optional" form:"oauth_info" json:"oauth_info,omitempty" query:"oauth_info"` - // json序列化 + // JSON serialization CommonParams map[plugin_develop_common.ParameterLocation][]*plugin_develop_common.CommonParamSchema `thrift:"common_params,11,optional" form:"common_params" json:"common_params,omitempty" query:"common_params"` // ignore CreationMethod *plugin_develop_common.CreationMethod `thrift:"creation_method,12,optional" form:"creation_method" json:"creation_method,omitempty" query:"creation_method"` // ignore EditVersion *int32 `thrift:"edit_version,13,optional" form:"edit_version" json:"edit_version,omitempty" query:"edit_version"` PluginType *plugin_develop_common.PluginType `thrift:"plugin_type,14,optional" form:"plugin_type" json:"plugin_type,omitempty" query:"plugin_type"` - // 二级授权类型 + // Level 2 authorization type SubAuthType *int32 `thrift:"sub_auth_type,15,optional" form:"sub_auth_type" json:"sub_auth_type,omitempty" query:"sub_auth_type"` // ignore AuthPayload *string `thrift:"auth_payload,16,optional" form:"auth_payload" json:"auth_payload,omitempty" query:"auth_payload"` @@ -7511,9 +7511,9 @@ func (p *UpdatePluginMetaResponse) String() string { type PublishPluginRequest struct { PluginID int64 `thrift:"plugin_id,1,required" form:"plugin_id,required" json:"plugin_id,string,required" query:"plugin_id,required"` - // 隐私声明状态 + // Privacy Statement Status PrivacyStatus bool `thrift:"privacy_status,2" form:"privacy_status" json:"privacy_status" query:"privacy_status"` - // 隐私声明内容 + // Privacy Statement Content PrivacyInfo string `thrift:"privacy_info,3" form:"privacy_info" json:"privacy_info" query:"privacy_info"` VersionName string `thrift:"version_name,4" form:"version_name" json:"version_name" query:"version_name"` VersionDesc string `thrift:"version_desc,5" form:"version_desc" json:"version_desc" query:"version_desc"` @@ -8173,7 +8173,7 @@ func (p *PublishPluginResponse) String() string { } -// bot引用plugin +// Bot reference plugin type GetBotDefaultParamsRequest struct { SpaceID int64 `thrift:"space_id,1" form:"space_id" json:"space_id,string" query:"space_id"` BotID int64 `thrift:"bot_id,2" form:"bot_id" json:"bot_id,string" query:"bot_id"` @@ -10130,8 +10130,8 @@ type DeleteBotDefaultParamsRequest struct { DevID string `thrift:"dev_id,2" form:"dev_id" json:"dev_id" query:"dev_id"` PluginID int64 `thrift:"plugin_id,3" form:"plugin_id" json:"plugin_id,string" query:"plugin_id"` APIName string `thrift:"api_name,4" form:"api_name" json:"api_name" query:"api_name"` - // bot删除工具时: DeleteBot = false , APIName要设置 - // 删除bot时 : DeleteBot = true , APIName为空 + // Bot removal tool when: DeleteBot = false, APIName to set + // Delete bot: DeleteBot = true, APIName is empty DeleteBot bool `thrift:"delete_bot,5" form:"delete_bot" json:"delete_bot" query:"delete_bot"` SpaceID int64 `thrift:"space_id,6" form:"space_id" json:"space_id,string" query:"space_id"` PluginReferrerID string `thrift:"plugin_referrer_id,7" form:"plugin_referrer_id" json:"plugin_referrer_id" query:"plugin_referrer_id"` @@ -14418,7 +14418,7 @@ type GetOAuthSchemaResponse struct { Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` OauthSchema string `thrift:"oauth_schema,3" form:"oauth_schema" json:"oauth_schema" query:"oauth_schema"` IdeConf string `thrift:"ide_conf,4" form:"ide_conf" json:"ide_conf" query:"ide_conf"` - // 约定的json + // The agreed json BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` } @@ -15341,7 +15341,7 @@ func (p *GetUserAuthorityResponse) String() string { } -// 获取授权状态--plugin debug区 +// Get authorization status--plugin debug area type GetOAuthStatusRequest struct { PluginID int64 `thrift:"plugin_id,1,required" form:"plugin_id,required" json:"plugin_id,string,required" query:"plugin_id,required"` Base *base.Base `thrift:"Base,255" form:"Base" json:"Base" query:"Base"` @@ -15541,11 +15541,11 @@ func (p *GetOAuthStatusRequest) String() string { } type GetOAuthStatusResponse struct { - // 是否为授权插件 + // Is it an authorized plugin? IsOauth bool `thrift:"is_oauth,1" form:"is_oauth" json:"is_oauth" query:"is_oauth"` - // 用户授权状态 + // user authorization status Status plugin_develop_common.OAuthStatus `thrift:"status,2" form:"status" json:"status" query:"status"` - // 未授权,返回授权url + // Unauthorized, return the authorized url. Content string `thrift:"content,3" form:"content" json:"content" query:"content"` Code int64 `thrift:"code,253" form:"code" json:"code" query:"code"` Msg string `thrift:"msg,254" form:"msg" json:"msg" query:"msg"` @@ -16427,9 +16427,9 @@ func (p *CheckAndLockPluginEditResponse) String() string { type GetPluginPublishHistoryRequest struct { PluginID int64 `thrift:"plugin_id,1,required" form:"plugin_id,required" json:"plugin_id,string,required" query:"plugin_id,required"` SpaceID int64 `thrift:"space_id,2,required" form:"space_id,required" json:"space_id,string,required" query:"space_id,required"` - // 翻页,第几页 + // Turn the page, what page? Page *int32 `thrift:"page,3,optional" form:"page" json:"page,omitempty" query:"page"` - // 翻页,每页几条 + // Flip pages, a few entries per page Size *int32 `thrift:"size,4,optional" form:"size" json:"size,omitempty" query:"size"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -16793,9 +16793,9 @@ func (p *GetPluginPublishHistoryRequest) String() string { type GetPluginPublishHistoryResponse struct { Code int64 `thrift:"code,1" form:"code" json:"code" query:"code"` Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` - // 时间倒序 + // reverse time PluginPublishInfoList []*plugin_develop_common.PluginPublishInfo `thrift:"plugin_publish_info_list,3" form:"plugin_publish_info_list" json:"plugin_publish_info_list" query:"plugin_publish_info_list"` - // 总共多少条,大于 page x size 说明还有下一页 + // How many in total, greater than page x size description and next page Total int32 `thrift:"total,4" form:"total" json:"total" query:"total"` BaseResp *base.BaseResp `thrift:"BaseResp,255" form:"BaseResp" json:"BaseResp" query:"BaseResp"` } @@ -20032,14 +20032,14 @@ type GetDevPluginListRequest struct { SpaceID int64 `thrift:"space_id,5" form:"space_id" json:"space_id,string"` ScopeType *plugin_develop_common.ScopeType `thrift:"scope_type,6,optional" form:"scope_type" json:"scope_type,omitempty" query:"scope_type"` OrderBy *plugin_develop_common.OrderBy `thrift:"order_by,7,optional" form:"order_by" json:"order_by,omitempty" query:"order_by"` - // 发布状态筛选:true:已发布, false:未发布 + // Release status filter: true: published, false: not published PublishStatus *bool `thrift:"publish_status,8,optional" form:"publish_status" json:"publish_status,omitempty" query:"publish_status"` - // 插件名或工具名 + // Plugin name or tool name Name *string `thrift:"name,9,optional" form:"name" json:"name,omitempty" query:"name"` - // 插件种类筛选 端/云 + // Plugin Type Filter, End/Cloud PluginTypeForFilter *plugin_develop_common.PluginTypeForFilter `thrift:"plugin_type_for_filter,10,optional" form:"plugin_type_for_filter" json:"plugin_type_for_filter,omitempty" query:"plugin_type_for_filter"` ProjectID int64 `thrift:"project_id,11" form:"project_id" json:"project_id,string"` - // 插件id列表 + // plugin id list PluginIds []int64 `thrift:"plugin_ids,12" form:"plugin_ids" json:"plugin_ids"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -21683,8 +21683,8 @@ type Convert2OpenAPIResponse struct { // ignore DuplicateAPIInfos []*plugin_develop_common.DuplicateAPIInfo `thrift:"duplicate_api_infos,6" form:"duplicate_api_infos" json:"duplicate_api_infos" query:"duplicate_api_infos"` // BaseResp.StatusCode - // DuplicateAPIPath: 导入的文件中有重复的API Path,且 request.MergeSamePaths = false - // InvalidParam: 其他错误 + // DuplicateAPIPath: Duplicate API Path in imported file with request. MergeSamePaths = false + // InvalidParam: Other errors BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` } @@ -22707,14 +22707,14 @@ func (p *BatchCreateAPIRequest) String() string { type BatchCreateAPIResponse struct { Code int64 `thrift:"code,1" form:"code" json:"code" query:"code"` Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` - // PathsToReplace表示要覆盖的tools, - // 如果BaseResp.StatusCode = DuplicateAPIPath,那么PathsToReplace不为空 + // PathsToReplace represents the tools to override, + // If BaseResp. StatusCode = DuplicateAPIPath, then PathsToReplace is not empty PathsDuplicated []*plugin_develop_common.PluginAPIInfo `thrift:"paths_duplicated,3,optional" form:"paths_duplicated" json:"paths_duplicated,omitempty" query:"paths_duplicated"` PathsCreated []*plugin_develop_common.PluginAPIInfo `thrift:"paths_created,4,optional" form:"paths_created" json:"paths_created,omitempty" query:"paths_created"` EditVersion int32 `thrift:"edit_version,5" form:"edit_version" json:"edit_version" query:"edit_version"` // BaseResp.StatusCode - // DuplicateAPIPath: 有重复的API Path,且 request.ReplaceDupPath = false - // InvalidParam: 其他错误 + // DuplicateAPIPath: There is a duplicate API Path with request. ReplaceDupPath = false + // InvalidParam: Other errors BaseResp *base.BaseResp `thrift:"BaseResp,255,required" form:"BaseResp,required" json:"BaseResp,required" query:"BaseResp,required"` } @@ -23151,7 +23151,7 @@ func (p *BatchCreateAPIResponse) String() string { type RevokeAuthTokenRequest struct { PluginID int64 `thrift:"plugin_id,1,required" form:"plugin_id,required" json:"plugin_id,string,required"` - // 如果不传使用uid赋值 bot_id = connector_uid + // If not passed using uid assignment bot_id = connector_uid BotID *int64 `thrift:"bot_id,2,optional" form:"bot_id" json:"bot_id,string,omitempty"` ContextType *int32 `thrift:"context_type,3,optional" form:"context_type" json:"context_type,omitempty"` Base *base.Base `thrift:"Base,255" form:"Base" json:"Base" query:"Base"` @@ -23615,11 +23615,11 @@ func (p *RevokeAuthTokenResponse) String() string { type OAuthPluginInfo struct { PluginID int64 `thrift:"plugin_id,1" form:"plugin_id" json:"plugin_id,string" query:"plugin_id"` - // 用户授权状态 + // user authorization status Status plugin_develop_common.OAuthStatus `thrift:"status,2" form:"status" json:"status" query:"status"` - // 插件name + // Plugin name Name string `thrift:"name,3" form:"name" json:"name" query:"name"` - // 插件头像 + // plugin avatar PluginIcon string `thrift:"plugin_icon,4" form:"plugin_icon" json:"plugin_icon" query:"plugin_icon"` } @@ -24400,17 +24400,17 @@ type PluginDevelopService interface { GetOAuthSchema(ctx context.Context, request *GetOAuthSchemaRequest) (r *GetOAuthSchemaResponse, err error) GetOAuthSchemaAPI(ctx context.Context, request *GetOAuthSchemaRequest) (r *GetOAuthSchemaResponse, err error) - // 获取已发布 workflow、plugin 列表,或者多个插件的详情 + // Get a list of published workflows, plugins, or details of multiple plugins GetPlaygroundPluginList(ctx context.Context, request *GetPlaygroundPluginListRequest) (r *GetPlaygroundPluginListResponse, err error) - // 通过 code 创建插件 + // Creating plugins with code RegisterPlugin(ctx context.Context, request *RegisterPluginRequest) (r *RegisterPluginResponse, err error) - // 通过 UI 创建插件 + // Create plugins through UI RegisterPluginMeta(ctx context.Context, request *RegisterPluginMetaRequest) (r *RegisterPluginMetaResponse, err error) - // 获取插件工具列表,或者多个工具详情 + // Get a list of plug-in tools, or multiple tool details GetPluginAPIs(ctx context.Context, request *GetPluginAPIsRequest) (r *GetPluginAPIsResponse, err error) - // 获取插件详情 + // Get plugin details GetPluginInfo(ctx context.Context, request *GetPluginInfoRequest) (r *GetPluginInfoResponse, err error) - // 与最近一次发布版本相比,更新的工具列表 + // Updated list of tools compared to the most recent release GetUpdatedAPIs(ctx context.Context, request *GetUpdatedAPIsRequest) (r *GetUpdatedAPIsResponse, err error) GetOAuthStatus(ctx context.Context, request *GetOAuthStatusRequest) (r *GetOAuthStatusResponse, err error) @@ -24418,23 +24418,23 @@ type PluginDevelopService interface { CheckAndLockPluginEdit(ctx context.Context, request *CheckAndLockPluginEditRequest) (r *CheckAndLockPluginEditResponse, err error) UnlockPluginEdit(ctx context.Context, request *UnlockPluginEditRequest) (r *UnlockPluginEditResponse, err error) - // 通过 code 更新插件 + // Update plugins via code UpdatePlugin(ctx context.Context, request *UpdatePluginRequest) (r *UpdatePluginResponse, err error) - // 删除工具 + // removal tool DeleteAPI(ctx context.Context, request *DeleteAPIRequest) (r *DeleteAPIResponse, err error) - // 删除插件 + // Remove plugin DelPlugin(ctx context.Context, request *DelPluginRequest) (r *DelPluginResponse, err error) - // 发布插件 + // publishing plugin PublishPlugin(ctx context.Context, request *PublishPluginRequest) (r *PublishPluginResponse, err error) - // 通过UI更新插件 + // Update plugins via UI UpdatePluginMeta(ctx context.Context, request *UpdatePluginMetaRequest) (r *UpdatePluginMetaResponse, err error) GetBotDefaultParams(ctx context.Context, request *GetBotDefaultParamsRequest) (r *GetBotDefaultParamsResponse, err error) UpdateBotDefaultParams(ctx context.Context, request *UpdateBotDefaultParamsRequest) (r *UpdateBotDefaultParamsResponse, err error) - // 创建工具 + // creation tool CreateAPI(ctx context.Context, request *CreateAPIRequest) (r *CreateAPIResponse, err error) - // 更新工具 + // update tool UpdateAPI(ctx context.Context, request *UpdateAPIRequest) (r *UpdateAPIResponse, err error) GetUserAuthority(ctx context.Context, request *GetUserAuthorityRequest) (r *GetUserAuthorityResponse, err error) @@ -24444,9 +24444,9 @@ type PluginDevelopService interface { GetPluginNextVersion(ctx context.Context, request *GetPluginNextVersionRequest) (r *GetPluginNextVersionResponse, err error) GetDevPluginList(ctx context.Context, request *GetDevPluginListRequest) (r *GetDevPluginListResponse, err error) - // 协议转换,如将 curl 、postman collection 协议转换为 openapi3 协议 + // Protocol conversion, such as converting curl and mail carrier collection protocols to openapi3 protocols Convert2OpenAPI(ctx context.Context, request *Convert2OpenAPIRequest) (r *Convert2OpenAPIResponse, err error) - // 批量创建工具,目前是配合 Convert2OpenAPI 接口使用 + // Batch creation tool, currently used with the Convert2 OpenAPI interface BatchCreateAPI(ctx context.Context, request *BatchCreateAPIRequest) (r *BatchCreateAPIResponse, err error) RevokeAuthToken(ctx context.Context, request *RevokeAuthTokenRequest) (r *RevokeAuthTokenResponse, err error) diff --git a/backend/api/model/ocean/cloud/workflow/ocean_cloud_workflow.go b/backend/api/model/ocean/cloud/workflow/ocean_cloud_workflow.go index 8f6a437a..6035fd9d 100644 --- a/backend/api/model/ocean/cloud/workflow/ocean_cloud_workflow.go +++ b/backend/api/model/ocean/cloud/workflow/ocean_cloud_workflow.go @@ -9,13 +9,13 @@ import ( ) type WorkflowService interface { - // 创建流程 + // Create process CreateWorkflow(ctx context.Context, request *CreateWorkflowRequest) (r *CreateWorkflowResponse, err error) - // 查询流程 + // query process GetCanvasInfo(ctx context.Context, request *GetCanvasInfoRequest) (r *GetCanvasInfoResponse, err error) GetHistorySchema(ctx context.Context, request *GetHistorySchemaRequest) (r *GetHistorySchemaResponse, err error) - // 保存流程 + // save process SaveWorkflow(ctx context.Context, request *SaveWorkflowRequest) (r *SaveWorkflowResponse, err error) UpdateWorkflowMeta(ctx context.Context, request *UpdateWorkflowMetaRequest) (r *UpdateWorkflowMetaResponse, err error) @@ -25,7 +25,7 @@ type WorkflowService interface { BatchDeleteWorkflow(ctx context.Context, request *BatchDeleteWorkflowRequest) (r *BatchDeleteWorkflowResponse, err error) GetDeleteStrategy(ctx context.Context, request *GetDeleteStrategyRequest) (r *GetDeleteStrategyResponse, err error) - // 发布流程。该接口的用途是发布非 project 内部的流程。 + // Publish process. The purpose of this interface is to publish processes that are not internal to the project. PublishWorkflow(ctx context.Context, request *PublishWorkflowRequest) (r *PublishWorkflowResponse, err error) CopyWorkflow(ctx context.Context, request *CopyWorkflowRequest) (r *CopyWorkflowResponse, err error) @@ -35,13 +35,13 @@ type WorkflowService interface { GetReleasedWorkflows(ctx context.Context, request *GetReleasedWorkflowsRequest) (r *GetReleasedWorkflowsResponse, err error) GetWorkflowReferences(ctx context.Context, request *GetWorkflowReferencesRequest) (r *GetWorkflowReferencesResponse, err error) - // 获取示例流程列表 + // Get a list of sample processes GetExampleWorkFlowList(ctx context.Context, request *GetExampleWorkFlowListRequest) (r *GetExampleWorkFlowListResponse, err error) - // 获取流程列表。 + // Gets a list of processes. GetWorkFlowList(ctx context.Context, request *GetWorkFlowListRequest) (r *GetWorkFlowListResponse, err error) QueryWorkflowNodeTypes(ctx context.Context, request *QueryWorkflowNodeTypeRequest) (r *QueryWorkflowNodeTypeResponse, err error) - // 画布 + // Canvas NodeTemplateList(ctx context.Context, request *NodeTemplateListRequest) (r *NodeTemplateListResponse, err error) NodePanelSearch(ctx context.Context, request *NodePanelSearchRequest) (r *NodePanelSearchResponse, err error) @@ -49,13 +49,13 @@ type WorkflowService interface { GetLLMNodeFCSettingsMerged(ctx context.Context, req *GetLLMNodeFCSettingsMergedRequest) (r *GetLLMNodeFCSettingsMergedResponse, err error) GetLLMNodeFCSettingDetail(ctx context.Context, req *GetLLMNodeFCSettingDetailRequest) (r *GetLLMNodeFCSettingDetailResponse, err error) - // 试运行流程(test run) + // Practice running process (test run) WorkFlowTestRun(ctx context.Context, request *WorkFlowTestRunRequest) (r *WorkFlowTestRunResponse, err error) WorkFlowTestResume(ctx context.Context, request *WorkflowTestResumeRequest) (r *WorkflowTestResumeResponse, err error) CancelWorkFlow(ctx context.Context, request *CancelWorkFlowRequest) (r *CancelWorkFlowResponse, err error) - // 查看试运行执行历史。 + // View practice run history. GetWorkFlowProcess(ctx context.Context, request *GetWorkflowProcessRequest) (r *GetWorkflowProcessResponse, err error) GetNodeExecuteHistory(ctx context.Context, request *GetNodeExecuteHistoryRequest) (r *GetNodeExecuteHistoryResponse, err error) @@ -63,7 +63,7 @@ type WorkflowService interface { GetApiDetail(ctx context.Context, request *GetApiDetailRequest) (r *GetApiDetailResponse, err error) WorkflowNodeDebugV2(ctx context.Context, request *WorkflowNodeDebugV2Request) (r *WorkflowNodeDebugV2Response, err error) - // 文件上传 + // file upload GetWorkflowUploadAuthToken(ctx context.Context, request *GetUploadAuthTokenRequest) (r *GetUploadAuthTokenResponse, err error) SignImageURL(ctx context.Context, request *SignImageURLRequest) (r *SignImageURLResponse, err error) @@ -76,7 +76,7 @@ type WorkflowService interface { ListProjectConversationDef(ctx context.Context, request *ListProjectConversationRequest) (r *ListProjectConversationResponse, err error) // Trace - // 列出历史执行的trace + // List traces of historical execution ListRootSpans(ctx context.Context, req *ListRootSpansRequest) (r *ListRootSpansResponse, err error) GetTraceSDK(ctx context.Context, req *GetTraceSDKRequest) (r *GetTraceSDKResponse, err error) @@ -92,7 +92,7 @@ type WorkflowService interface { CreateChatFlowRole(ctx context.Context, request *CreateChatFlowRoleRequest) (r *CreateChatFlowRoleResponse, err error) DeleteChatFlowRole(ctx context.Context, request *DeleteChatFlowRoleRequest) (r *DeleteChatFlowRoleResponse, err error) - // App 发布管理 + // App Release Management ListPublishWorkflow(ctx context.Context, request *ListPublishWorkflowRequest) (r *ListPublishWorkflowResponse, err error) // Open API OpenAPIRunFlow(ctx context.Context, request *OpenAPIRunFlowRequest) (r *OpenAPIRunFlowResponse, err error) diff --git a/backend/api/model/ocean/cloud/workflow/trace.go b/backend/api/model/ocean/cloud/workflow/trace.go index e84acded..cfcfbe5c 100644 --- a/backend/api/model/ocean/cloud/workflow/trace.go +++ b/backend/api/model/ocean/cloud/workflow/trace.go @@ -3,21 +3,21 @@ package workflow 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 FrontedTagType int64 const ( - // 文本 + // Text FrontedTagType_TEXT FrontedTagType = 0 - // 时间,用时间戳,单位是毫秒 + // Time, with timestamp, in milliseconds FrontedTagType_TIME FrontedTagType = 1 - // 时间间隔,单位是毫秒 + // Time interval, in milliseconds FrontedTagType_TIME_DURATION FrontedTagType = 2 ) @@ -229,11 +229,11 @@ func (p *TagType) Value() (driver.Value, error) { type QueryScene int64 const ( - // doubao cici 全链路调试台 + // Doubao cici full link debugging station QueryScene_ALICE_OP QueryScene = 0 - // doubao cici debug 功能 + // Doubao cici debugging function QueryScene_DOUBAO_CICI_DEBUG QueryScene = 1 - // workflow debug 功能 + // Workflow debugging QueryScene_WORKFLOW_DEBUG QueryScene = 2 ) @@ -321,7 +321,7 @@ func (p *TenantLevel) Value() (driver.Value, error) { type InputOutputType int64 const ( - // 文本类型 + // Text type InputOutputType_TEXT InputOutputType = 0 ) @@ -1008,9 +1008,9 @@ func (p *FilterTag) String() string { } type ListRootSpansRequest struct { - // 单位是毫秒 + // It's in milliseconds. StartAt int64 `thrift:"StartAt,2,required" json:"start_at" form:"start_at,required" ` - // 单位是毫秒 + // It's in milliseconds. EndAt int64 `thrift:"EndAt,3,required" json:"end_at" form:"end_at,required" ` Limit *int16 `thrift:"Limit,4,optional" json:"limit" form:"limit" ` DescByStartTime *bool `thrift:"DescByStartTime,5,optional" json:"desc_by_start_time" form:"desc_by_start_time" ` @@ -1018,7 +1018,7 @@ type ListRootSpansRequest struct { WorkflowID string `thrift:"WorkflowID,7,required" json:"workflow_id" form:"workflow_id,required" ` Input *string `thrift:"Input,8,optional" json:"input" form:"input" ` Status *SpanStatus `thrift:"Status,9,optional" json:"status" form:"status" ` - // 正式运行/试运行/节点Debug + // Formal run/practice run/Node Debug ExecuteMode *int32 `thrift:"ExecuteMode,10,optional" json:"execute_mode" form:"execute_mode" ` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -1661,9 +1661,9 @@ type Span struct { Type string `thrift:"Type,7" json:"type" form:"Type" query:"Type"` Name string `thrift:"Name,8" json:"name" form:"Name" query:"Name"` ParentID string `thrift:"ParentID,9" json:"parent_id" form:"ParentID" query:"ParentID"` - // 单位是毫秒 + // It's in milliseconds. Duration int64 `thrift:"Duration,10" json:"duration" form:"Duration" query:"Duration"` - // 单位是毫秒 + // It's in milliseconds. StartTime int64 `thrift:"StartTime,11" json:"start_time" form:"StartTime" query:"StartTime"` StatusCode int32 `thrift:"StatusCode,12" json:"status_code" form:"StatusCode" query:"StatusCode"` Tags []*TraceTag `thrift:"Tags,13" json:"tags" form:"Tags" query:"Tags"` @@ -2951,9 +2951,9 @@ func (p *ListRootSpansResponse) String() string { type GetTraceSDKRequest struct { LogID *string `thrift:"LogID,2,optional" json:"log_id" query:"log_id" ` - // 单位是毫秒 + // It's in milliseconds. StartAt *int64 `thrift:"StartAt,4,optional" json:"start_at" query:"start_at" ` - // 单位是毫秒 + // It's in milliseconds. EndAt *int64 `thrift:"EndAt,5,optional" json:"end_at" query:"end_at" ` WorkflowID *int64 `thrift:"WorkflowID,6,optional" json:"workflow_id" query:"workflow_id" ` ExecuteID *int64 `thrift:"ExecuteID,7,optional" json:"execute_id" query:"execute_id" ` @@ -3579,22 +3579,22 @@ func (p *GetTraceSDKResponse) String() string { } type KeyScene struct { - // 场景,如"拆分搜索词"\"搜索" + // Scenarios such as "Split search terms"\ "Search" Scene *string `thrift:"Scene,1,optional" json:"scene" form:"Scene" query:"Scene"` - // 状态信息 + // status information StatusMessage *string `thrift:"StatusMessage,2,optional" json:"status_message" form:"StatusMessage" query:"StatusMessage"` System *string `thrift:"System,3,optional" json:"system" form:"System" query:"System"` - // 历史消息 + // chat history HistoryMessages []*MessageItem `thrift:"HistoryMessages,4,optional" json:"history_messages" form:"HistoryMessages" query:"HistoryMessages"` - // 输入 + // input Input *KeySceneInput `thrift:"Input,5,optional" json:"input" form:"Input" query:"Input"` - // 输出 + // output Output *KeySceneOutput `thrift:"Output,6,optional" json:"output" form:"Output" query:"Output"` - // 单位是毫秒 + // It's in milliseconds. Duration *int64 `thrift:"Duration,7,optional" json:"duration" form:"Duration" query:"Duration"` - // 开始时间,用于排序,单位是毫秒 + // Start time, used for sorting, in milliseconds StartTime *int64 `thrift:"StartTime,8,optional" json:"start_time" form:"start_time" ` - // 子场景 + // subscene SubKeyScenes []*KeyScene `thrift:"SubKeyScenes,9,optional" json:"sub_key_scenes" form:"SubKeyScenes" query:"SubKeyScenes"` } @@ -4671,9 +4671,9 @@ func (p *KeySceneOutput) String() string { } type TraceSummaryContent struct { - // 键 + // key Key *string `thrift:"Key,1,optional" json:"key" form:"Key" query:"Key"` - // 内容 + // content Content *string `thrift:"Content,2,optional" json:"content" form:"Content" query:"Content"` } @@ -4879,9 +4879,9 @@ func (p *TraceSummaryContent) String() string { } type MessageItem struct { - // 角色 + // role Role *string `thrift:"Role,1,optional" json:"role" form:"Role" query:"Role"` - // 内容 + // content Content *string `thrift:"Content,2,optional" json:"content" form:"Content" query:"Content"` } @@ -5258,13 +5258,13 @@ func (p *SpanSummary) String() string { type FrontendTag struct { Key string `thrift:"Key,1,required" json:"key" form:"Key,required" query:"Key,required"` - // 多语,如无配置时值沿用 key + // Multilingual, if there is no configuration value, use the key KeyAlias *string `thrift:"KeyAlias,2,optional" json:"key_alias" form:"KeyAlias" query:"KeyAlias"` TagType TagType `thrift:"TagType,3,required" json:"tag_type" form:"TagType,required" query:"TagType,required"` Value *Value `thrift:"Value,4,optional" json:"value" form:"Value" query:"Value"` - // 前端类型,用于前端处理 + // Front-end type for front-end processing FrontendTagType *FrontedTagType `thrift:"FrontendTagType,5,optional" json:"frontend_tag_type" form:"FrontendTagType" query:"FrontendTagType"` - // 是否可复制 + // Can it be copied? CanCopy *bool `thrift:"canCopy,6,optional" json:"can_copy" form:"canCopy" query:"canCopy"` } @@ -5681,18 +5681,18 @@ func (p *FrontendTag) String() string { } type TraceSummary struct { - // 一级 System 的文本 + // System 1 text System *string `thrift:"System,1,optional" json:"system" form:"System" query:"System"` - // 一级历史消息 + // Level 1 chat history HistoryMessages []*MessageItem `thrift:"HistoryMessages,2,optional" json:"history_messages" form:"HistoryMessages" query:"HistoryMessages"` KeyScenes []*KeyScene `thrift:"KeyScenes,3,optional" json:"key_scenes" form:"KeyScenes" query:"KeyScenes"` - // 输入 + // input Input *string `thrift:"Input,4,optional" json:"input" form:"Input" query:"Input"` - // 输出 + // output Output *string `thrift:"Output,5,optional" json:"output" form:"Output" query:"Output"` - // 一级当前对话的耗时, 单位是毫秒 + // The duration of the current conversation, in milliseconds Duration *int64 `thrift:"Duration,6,optional" json:"duration" form:"Duration" query:"Duration"` - // 用户ID + // user ID UserID *string `thrift:"UserID,7,optional" json:"user_id" form:"UserID" query:"UserID"` } @@ -6213,15 +6213,15 @@ func (p *TraceSummary) String() string { } type TraceHeader struct { - // 单位是毫秒 + // It's in milliseconds. Duration *int64 `thrift:"Duration,1,optional" json:"duration" form:"Duration" query:"Duration"` - // 输入消耗token数 + // Enter the number of tokens consumed Tokens *int32 `thrift:"Tokens,2,optional" form:"Tokens" json:"Tokens,omitempty" query:"Tokens"` StatusCode *int32 `thrift:"StatusCode,3,optional" json:"status_code" form:"StatusCode" query:"StatusCode"` Tags []*FrontendTag `thrift:"Tags,4,optional" json:"tags" form:"Tags" query:"Tags"` - // 消息ID + // Message ID MessageID *string `thrift:"MessageID,5,optional" json:"message_id" form:"MessageID" query:"MessageID"` - // 单位是毫秒 + // It's in milliseconds. StartTime *int64 `thrift:"StartTime,6,optional" json:"start_time" form:"StartTime" query:"StartTime"` } @@ -7381,25 +7381,25 @@ type TraceFrontendSpan struct { Name string `thrift:"Name,5" json:"name" form:"Name" query:"Name"` AliasName string `thrift:"AliasName,6" json:"alias_name" form:"AliasName" query:"AliasName"` ParentID string `thrift:"ParentID,7" json:"parent_id" form:"ParentID" query:"ParentID"` - // 单位是毫秒 + // It's in milliseconds. Duration int64 `thrift:"Duration,8" json:"duration" form:"Duration" query:"Duration"` - // 单位是毫秒 + // It's in milliseconds. StartTime int64 `thrift:"StartTime,9" json:"start_time" form:"StartTime" query:"StartTime"` StatusCode int32 `thrift:"StatusCode,10" json:"status_code" form:"StatusCode" query:"StatusCode"` Tags []*TraceTag `thrift:"Tags,11,optional" json:"tags" form:"Tags" query:"Tags"` - // 节点详情 + // node details Summary *SpanSummary `thrift:"summary,12,optional" json:"summary" form:"summary" query:"summary"` Input *SpanInputOutput `thrift:"Input,13,optional" json:"input" form:"Input" query:"Input"` Output *SpanInputOutput `thrift:"Output,14,optional" json:"output" form:"Output" query:"Output"` - // 是否是入口节点 + // Is it an entry node? IsEntry *bool `thrift:"IsEntry,15,optional" json:"is_entry" form:"IsEntry" query:"IsEntry"` - // 产品线 + // product line ProductLine *string `thrift:"ProductLine,16,optional" json:"product_line" form:"ProductLine" query:"ProductLine"` - // 是否是关键节点 + // Is it a key node? IsKeySpan *bool `thrift:"IsKeySpan,17,optional" json:"is_key_span" form:"IsKeySpan" query:"IsKeySpan"` - // 节点负责人列表, 邮箱前缀 + // Node owner list, mailbox prefix OwnerList []string `thrift:"OwnerList,18,optional" json:"owner_list" form:"OwnerList" query:"OwnerList"` - // 节点详情文档 + // Node Details Document RundownDocURL *string `thrift:"RundownDocURL,19,optional" json:"rundown_doc_url" form:"RundownDocURL" query:"RundownDocURL"` } diff --git a/backend/api/model/ocean/cloud/workflow/workflow.go b/backend/api/model/ocean/cloud/workflow/workflow.go index d5f81899..80eb5f76 100644 --- a/backend/api/model/ocean/cloud/workflow/workflow.go +++ b/backend/api/model/ocean/cloud/workflow/workflow.go @@ -57,7 +57,7 @@ func (p *PersistenceModel) Value() (driver.Value, error) { return int64(*p), nil } -// WorkflowMode 用来区分 Workflow 和 chatflow +// WorkflowMode is used to distinguish between Workflow and chatflow. type WorkflowMode int64 const ( @@ -65,7 +65,7 @@ const ( WorkflowMode_Imageflow WorkflowMode = 1 WorkflowMode_SceneFlow WorkflowMode = 2 WorkflowMode_ChatFlow WorkflowMode = 3 - // 仅在查询时使用 + // Use only when querying WorkflowMode_All WorkflowMode = 100 ) @@ -116,19 +116,19 @@ func (p *WorkflowMode) Value() (driver.Value, error) { return int64(*p), nil } -// workflow 商品审核草稿状态 +// Workflow Product Review Draft Status type ProductDraftStatus int64 const ( - // 默认 + // default ProductDraftStatus_Default ProductDraftStatus = 0 - // 审核中 + // Under review. ProductDraftStatus_Pending ProductDraftStatus = 1 - // 审核通过 + // approved ProductDraftStatus_Approved ProductDraftStatus = 2 - // 审核不通过 + // The review failed. ProductDraftStatus_Rejected ProductDraftStatus = 3 - // 已废弃 + // Abandoned ProductDraftStatus_Abandoned ProductDraftStatus = 4 ) @@ -182,9 +182,9 @@ func (p *ProductDraftStatus) Value() (driver.Value, error) { type CollaboratorMode int64 const ( - // 关闭多人协作模式 + // Turn off multiplayer collaboration mode CollaboratorMode_Close CollaboratorMode = 0 - // 开启多人协作模式 + // Enable multiplayer collaboration mode CollaboratorMode_Open CollaboratorMode = 1 ) @@ -226,10 +226,10 @@ func (p *CollaboratorMode) Value() (driver.Value, error) { type SchemaType int64 const ( - // 废弃 + // abandoned SchemaType_DAG SchemaType = 0 SchemaType_FDL SchemaType = 1 - // 废弃 + // abandoned SchemaType_BlockWise SchemaType = 2 ) @@ -275,9 +275,9 @@ func (p *SchemaType) Value() (driver.Value, error) { type WorkFlowType int64 const ( - // 用户自定义 + // user defined WorkFlowType_User WorkFlowType = 0 - // 官方模板 + // official template WorkFlowType_GuanFang WorkFlowType = 1 ) @@ -443,7 +443,7 @@ func (p *Tag) Value() (driver.Value, error) { return int64(*p), nil } -// 节点结构 +// Node structure type NodeType int64 const ( @@ -626,7 +626,7 @@ func (p *NodeType) Value() (driver.Value, error) { return int64(*p), nil } -// 节点模版类型,与NodeType基本保持一致,copy一份是因为新增了一个Imageflow类型,避免影响原来NodeType的业务语意 +// The node template type is basically the same as NodeType. One copy is due to the addition of an Imageflow type to avoid affecting the business semantics of the original NodeType type NodeTemplateType int64 const ( @@ -1147,9 +1147,9 @@ func (p *TerminatePlanType) Value() (driver.Value, error) { type SupportBatch int64 const ( - // 1:不支持 + // 1: Not supported SupportBatch_NOT_SUPPORT SupportBatch = 1 - // 2:支持 + // 2: Support SupportBatch_SUPPORT SupportBatch = 2 ) @@ -1225,17 +1225,17 @@ func (p *PluginParamTypeFormat) Value() (driver.Value, error) { return int64(*p), nil } -// 状态,1不可提交 2可提交 3已提交 4废弃 +// Status, 1 Not Submitted 2 Submitted 3 Submitted 4 Obsolete type WorkFlowDevStatus int64 const ( - // 不可提交 + // unsubmittable WorkFlowDevStatus_CanNotSubmit WorkFlowDevStatus = 1 - // 可提交 + // submittable WorkFlowDevStatus_CanSubmit WorkFlowDevStatus = 2 - // 已提交 + // Submitted WorkFlowDevStatus_HadSubmit WorkFlowDevStatus = 3 - // 删除 + // delete WorkFlowDevStatus_Deleted WorkFlowDevStatus = 4 ) @@ -1282,19 +1282,19 @@ func (p *WorkFlowDevStatus) Value() (driver.Value, error) { return int64(*p), nil } -// 状态,1不可发布 2可发布 3已发布 4删除 5下架 +// Status, 1 Unpublishable 2 Publishable 3 Published 4 Deleted 5 Removed type WorkFlowStatus int64 const ( - // 不可发布 + // unpublishable WorkFlowStatus_CanNotPublish WorkFlowStatus = 1 - // 可发布 + // publishable WorkFlowStatus_CanPublish WorkFlowStatus = 2 - // 已发布 + // Published WorkFlowStatus_HadPublished WorkFlowStatus = 3 - // 删除 + // delete WorkFlowStatus_Deleted WorkFlowStatus = 4 - // 下架 + // offline WorkFlowStatus_Unlisted WorkFlowStatus = 5 ) @@ -1452,9 +1452,9 @@ func (p *OperateType) Value() (driver.Value, error) { type DeleteAction int64 const ( - // Blockwise的解绑 + // Blockwise Unbinding DeleteAction_BlockwiseUnbind DeleteAction = 1 - // Blockwise的删除 + // Blockwise removal DeleteAction_BlockwiseDelete DeleteAction = 2 ) @@ -1538,11 +1538,11 @@ func (p *DeleteStatus) Value() (driver.Value, error) { type DeleteType int64 const ( - // 可以删除:无workflow商品/商品下架/第一次上架且审核失败 + // Can be deleted: No workflow product/product removed from the shelves/first time on the shelves and the review failed DeleteType_CanDelete DeleteType = 0 - // 删除后审核失败:workflow商品第一次上架并处于审核中 + // Review failed after deletion: The workflow product is on the shelves for the first time and is under review. DeleteType_RejectProductDraft DeleteType = 1 - // 需要商品先下架:workflow商品已上架 + // Products that need to be removed from the shelves first: workflow products have been put on the shelves. DeleteType_UnListProduct DeleteType = 2 ) @@ -1746,7 +1746,7 @@ type BindBizType int64 const ( BindBizType_Agent BindBizType = 1 BindBizType_Scene BindBizType = 2 - // 抖音分身 + // Douyin doppelganger BindBizType_DouYinBot BindBizType = 3 ) @@ -2267,13 +2267,13 @@ func (p *ParameterLocation) Value() (driver.Value, error) { return int64(*p), nil } -// 默认入参的设置来源 +// Default imported parameter settings source type DefaultParamSource int64 const ( - // 默认用户输入 + // default user input DefaultParamSource_Input DefaultParamSource = 0 - // 引用变量 + // reference variable DefaultParamSource_Variable DefaultParamSource = 1 ) @@ -2312,7 +2312,7 @@ func (p *DefaultParamSource) Value() (driver.Value, error) { return int64(*p), nil } -// 针对File类型参数的细分类型 +// Subdivision types for File type parameters type AssistParameterType int64 const ( @@ -2492,11 +2492,11 @@ func (p *CreateEnv) Value() (driver.Value, error) { type SuggestReplyInfoMode int64 const ( - // 关闭 + // close SuggestReplyInfoMode_Disable SuggestReplyInfoMode = 0 - // 系统 + // system SuggestReplyInfoMode_System SuggestReplyInfoMode = 1 - // 自定义 + // custom SuggestReplyInfoMode_Custom SuggestReplyInfoMode = 2 ) @@ -2584,9 +2584,9 @@ func (p *Caller) Value() (driver.Value, error) { type InputMode int64 const ( - // 打字输入 + // Type input InputMode_Text InputMode = 1 - // 语音输入 + // Voice input InputMode_Audio InputMode = 2 ) @@ -2628,9 +2628,9 @@ func (p *InputMode) Value() (driver.Value, error) { type SendVoiceMode int64 const ( - // 文本消息 + // text message SendVoiceMode_Text SendVoiceMode = 1 - // 发送为语音 + // Send as voice SendVoiceMode_Audio SendVoiceMode = 2 ) @@ -2781,11 +2781,11 @@ func (p *OrderByType) Value() (driver.Value, error) { type PermissionType int64 const ( - //不能查看详情 + //Can't view details PermissionType_NoDetail PermissionType = 1 - //可以查看详情 + //You can check the details. PermissionType_Detail PermissionType = 2 - //可以查看和操作 + //Can be viewed and operated PermissionType_Operate PermissionType = 3 ) @@ -2828,7 +2828,7 @@ func (p *PermissionType) Value() (driver.Value, error) { return int64(*p), nil } -// 这个枚举需要与plugin的PluginInterruptType对齐 +// This enumeration needs to be aligned with the plugin's PluginInterruptType type InterruptType int64 const ( @@ -2945,42 +2945,42 @@ type Workflow struct { URL string `thrift:"url,4" form:"url" json:"url" query:"url"` IconURI string `thrift:"icon_uri,5" form:"icon_uri" json:"icon_uri" query:"icon_uri"` Status WorkFlowDevStatus `thrift:"status,6" form:"status" json:"status" query:"status"` - // 类型,1:官方模版 + // Type 1: Official Template Type WorkFlowType `thrift:"type,7" form:"type" json:"type" query:"type"` - // workflow对应的插件id + // Plugin ID for workflow PluginID string `thrift:"plugin_id,8" form:"plugin_id" json:"plugin_id" query:"plugin_id"` CreateTime int64 `thrift:"create_time,9" form:"create_time" json:"create_time" query:"create_time"` UpdateTime int64 `thrift:"update_time,10" form:"update_time" json:"update_time" query:"update_time"` SchemaType SchemaType `thrift:"schema_type,11" form:"schema_type" json:"schema_type" query:"schema_type"` StartNode *Node `thrift:"start_node,12,optional" form:"start_node" json:"start_node,omitempty" query:"start_node"` Tag *Tag `thrift:"tag,13,optional" form:"tag" json:"tag,omitempty" query:"tag"` - // 模版创作者id + // template creator id TemplateAuthorID *string `thrift:"template_author_id,14,optional" form:"template_author_id" json:"template_author_id,omitempty" query:"template_author_id"` - // 模版创作者昵称 + // template creator nickname TemplateAuthorName *string `thrift:"template_author_name,15,optional" form:"template_author_name" json:"template_author_name,omitempty" query:"template_author_name"` - // 模版创作者头像 + // template creator avatar TemplateAuthorPictureURL *string `thrift:"template_author_picture_url,16,optional" form:"template_author_picture_url" json:"template_author_picture_url,omitempty" query:"template_author_picture_url"` - // 空间id + // Space ID SpaceID *string `thrift:"space_id,17,optional" form:"space_id" json:"space_id,omitempty" query:"space_id"` - // 流程出入参 + // process entry and exit InterfaceStr *string `thrift:"interface_str,18,optional" form:"interface_str" json:"interface_str,omitempty" query:"interface_str"` - // 新版workflow的定义 schema + // New workflow definition schema SchemaJSON *string `thrift:"schema_json,19,optional" form:"schema_json" json:"schema_json,omitempty" query:"schema_json"` - // workflow创作者信息 + // Workflow creator information Creator *Creator `thrift:"creator,20" form:"creator" json:"creator" query:"creator"` - // 存储模型 + // Storage Model PersistenceModel PersistenceModel `thrift:"persistence_model,21" form:"persistence_model" json:"persistence_model" query:"persistence_model"` - // workflow or imageflow,默认值为workflow + // Workflow or imageflow, the default is workflow FlowMode WorkflowMode `thrift:"flow_mode,22" form:"flow_mode" json:"flow_mode" query:"flow_mode"` - // workflow商品审核版本状态 + // Workflow product review version status ProductDraftStatus ProductDraftStatus `thrift:"product_draft_status,23" form:"product_draft_status" json:"product_draft_status" query:"product_draft_status"` // {"project_id":"xxx","flow_id":xxxx} ExternalFlowInfo *string `thrift:"external_flow_info,24,optional" form:"external_flow_info" json:"external_flow_info,omitempty" query:"external_flow_info"` - // workflow多人协作按钮状态 + // Workflow Multiplayer Collaboration Button Status CollaboratorMode CollaboratorMode `thrift:"collaborator_mode,25" form:"collaborator_mode" json:"collaborator_mode" query:"collaborator_mode"` CheckResult []*CheckResult `thrift:"check_result,26" form:"check_result" json:"check_result" query:"check_result"` ProjectID *string `thrift:"project_id,27,optional" form:"project_id" json:"project_id,omitempty" query:"project_id"` - // project 下的 workflow 才有 + // Only the workflow under the project is available. DevPluginID *string `thrift:"dev_plugin_id,28,optional" form:"dev_plugin_id" json:"dev_plugin_id,omitempty" query:"dev_plugin_id"` } @@ -4453,11 +4453,11 @@ func (p *Workflow) String() string { } type CheckResult struct { - // 校验类型 + // check type Type CheckType `thrift:"type,1" form:"type" json:"type" query:"type"` - // 是否通过 + // Whether to pass IsPass bool `thrift:"is_pass,2" form:"is_pass" json:"is_pass" query:"is_pass"` - // 不通过原因 + // Reason for not passing Reason string `thrift:"reason,3" form:"reason" json:"reason" query:"reason"` } @@ -4688,7 +4688,7 @@ type Creator struct { ID string `thrift:"id,1" form:"id" json:"id" query:"id"` Name string `thrift:"name,2" form:"name" json:"name" query:"name"` AvatarURL string `thrift:"avatar_url,3" form:"avatar_url" json:"avatar_url" query:"avatar_url"` - // 是否是自己创建的 + // Did you create it yourself? Self bool `thrift:"self,4" form:"self" json:"self" query:"self"` } @@ -4965,7 +4965,7 @@ type Param struct { Type InputType `thrift:"type,3" form:"type" json:"type" query:"type"` Required bool `thrift:"required,4" form:"required" json:"required" query:"required"` Value string `thrift:"value,5" form:"value" json:"value" query:"value"` - // 要求 1不允许删除 2不允许更改名称 3什么都可修改 4只显示,全部不允许更改 + // Requirements 1 Do not allow deletion 2 Do not allow name change 3 Anything can be modified 4 Only display, all are not allowed to be changed Requirement ParamRequirementType `thrift:"requirement,6" form:"requirement" json:"requirement" query:"requirement"` FromNodeID *string `thrift:"from_node_id,7,optional" form:"from_node_id" json:"from_node_id,omitempty" query:"from_node_id"` FromOutput []string `thrift:"from_output,8,optional" form:"from_output" json:"from_output,omitempty" query:"from_output"` @@ -6658,11 +6658,11 @@ func (p *IfParam) String() string { } type IfBranch struct { - // 该分支的条件 + // Conditions for this branch IfConditions []*IfCondition `thrift:"if_conditions,1,optional" form:"if_conditions" json:"if_conditions,omitempty" query:"if_conditions"` - // 该分支各条件的关系 + // The relationship between the conditions of this branch IfConditionRelation *IfConditionRelation `thrift:"if_condition_relation,2,optional" form:"if_condition_relation" json:"if_condition_relation,omitempty" query:"if_condition_relation"` - // 该分支对应的下一个节点 + // The next node corresponding to this branch NextNodeID []string `thrift:"next_node_id,3,optional" form:"next_node_id" json:"next_node_id,omitempty" query:"next_node_id"` } @@ -7411,7 +7411,7 @@ func (p *LayOut) String() string { } type TerminatePlan struct { - //结束方式 + //End method Plan TerminatePlanType `thrift:"plan,1" form:"plan" json:"plan" query:"plan"` Content string `thrift:"content,2" form:"content" json:"content" query:"content"` } @@ -7596,27 +7596,27 @@ func (p *TerminatePlan) String() string { } type NodeParam struct { - // 输入参数列表,支持多级;支持mapping + // Enter parameter list, support multi-level; support mapping InputList []*Param `thrift:"input_list,1,optional" form:"input_list" json:"input_list,omitempty" query:"input_list"` - // 输出参数列表,支持多级 + // Output parameter list, support multi-level OutputList []*Param `thrift:"output_list,2,optional" form:"output_list" json:"output_list,omitempty" query:"output_list"` - // 如果是API类型的Node,插件名、API名、插件版本、API的描述 + // If it is an API type Node, plug-in name, API name, plug-in version, API description APIParam *APIParam `thrift:"api_param,3,optional" form:"api_param" json:"api_param,omitempty" query:"api_param"` - // 如果是代码片段,则包含代码内容 + // If it is a code snippet, include the code content CodeParam *CodeParam `thrift:"code_param,4,optional" form:"code_param" json:"code_param,omitempty" query:"code_param"` - // 如果是模型,则包含模型的基础信息 + // If it is a model, include the basic information of the model LlmParam *LLMParam `thrift:"llm_param,5,optional" form:"llm_param" json:"llm_param,omitempty" query:"llm_param"` - // 如果是数据集,选择数据集的片段 + // If it is a dataset, select a fragment of the dataset DatasetParam *DatasetParam `thrift:"dataset_param,6,optional" form:"dataset_param" json:"dataset_param,omitempty" query:"dataset_param"` - // end节点,如何结束 + // End node, how to end TerminatePlan *TerminatePlan `thrift:"terminate_plan,7,optional" form:"terminate_plan" json:"terminate_plan,omitempty" query:"terminate_plan"` - // (新)输入参数列表 + // (New) input parameter list InputParameters []*Parameter `thrift:"input_parameters,8,optional" form:"input_parameters" json:"input_parameters,omitempty" query:"input_parameters"` - // (新)输出参数列表 + // (New) Output parameter list OutputParameters []*Parameter `thrift:"output_parameters,9,optional" form:"output_parameters" json:"output_parameters,omitempty" query:"output_parameters"` - // 批量设置情况 + // batch setup Batch *Batch `thrift:"batch,10,optional" form:"batch" json:"batch,omitempty" query:"batch"` - // if节点参数 + // if node parameter IfParam *IfParam `thrift:"if_param,11,optional" form:"if_param" json:"if_param,omitempty" query:"if_param"` } @@ -8377,13 +8377,13 @@ func (p *NodeParam) String() string { type NodeDesc struct { Desc string `thrift:"desc,1" form:"desc" json:"desc" query:"desc"` - // 副标题名称 + // Subtitle name Name string `thrift:"name,2" form:"name" json:"name" query:"name"` - // 该类型的icon + // This type of icon IconURL string `thrift:"icon_url,3" form:"icon_url" json:"icon_url" query:"icon_url"` - // 是否支持批量,1不支持,2支持 + // Whether to support batch, 1 does not support, 2 supports SupportBatch int32 `thrift:"support_batch,4" form:"support_batch" json:"support_batch" query:"support_batch"` - // 连接要求 1左右都可连接 2只支持右侧 + // Connection requirements 1 or so can be connected 2 only support the right side LinkLimit int32 `thrift:"link_limit,5" form:"link_limit" json:"link_limit" query:"link_limit"` } @@ -8923,11 +8923,11 @@ func (p *OpenAPI) String() string { } type Batch struct { - // batch开关是否打开 + // Is the batch switch on? IsBatch bool `thrift:"is_batch,1" form:"is_batch" json:"is_batch" query:"is_batch"` - // 只处理数组[0,take_count)范围的输入 + // Only process input in the range [0, take_count) TakeCount int64 `thrift:"take_count,2" form:"take_count" json:"take_count" query:"take_count"` - // 需要Batch的输入 + // Batch input required InputParam *Parameter `thrift:"input_param,3" form:"input_param" json:"input_param" query:"input_param"` } @@ -9162,21 +9162,21 @@ func (p *Batch) String() string { type Node struct { WorkflowID string `thrift:"workflow_id,1" form:"workflow_id" json:"workflow_id" query:"workflow_id"` - // 节点id + // Node ID NodeID string `thrift:"node_id,2" form:"node_id" json:"node_id" query:"node_id"` - // 更改node名称 + // Change node name NodeName string `thrift:"node_name,3" form:"node_name" json:"node_name" query:"node_name"` - // 节点类型 + // Node type NodeType NodeType `thrift:"node_type,4" form:"node_type" json:"node_type" query:"node_type"` - // 节点的核心参数 + // Core parameters of the node NodeParam *NodeParam `thrift:"node_param,5" form:"node_param" json:"node_param" query:"node_param"` - // Node的位置 + // Node location LayOut *LayOut `thrift:"lay_out,6" form:"lay_out" json:"lay_out" query:"lay_out"` - // Node的描述,说明链接 + // Description of Node, explaining the link Desc *NodeDesc `thrift:"desc,7" form:"desc" json:"desc" query:"desc"` - // 依赖的上游节点 + // dependent upstream node DependsOn []string `thrift:"depends_on,8" form:"depends_on" json:"depends_on" query:"depends_on"` - // 所有的输入和输出 + // All inputs and outputs OpenAPI *OpenAPI `thrift:"open_api,9" form:"open_api" json:"open_api" query:"open_api"` } @@ -9717,18 +9717,18 @@ type Parameter struct { Required bool `thrift:"required,3" form:"required" json:"required" query:"required"` Type InputType `thrift:"type,4" form:"type" json:"type" query:"type"` SubParameters []*Parameter `thrift:"sub_parameters,5" form:"sub_parameters" json:"sub_parameters" query:"sub_parameters"` - // 如果Type是数组,则有subtype + // If Type is an array, there is a subtype SubType InputType `thrift:"sub_type,6" form:"sub_type" json:"sub_type" query:"sub_type"` - // 如果入参的值是引用的则有fromNodeId + // fromNodeId if the value of the imported parameter is a reference FromNodeID *string `thrift:"from_node_id,7,optional" form:"from_node_id" json:"from_node_id,omitempty" query:"from_node_id"` - // 具体引用哪个节点的key + // Which node's key is specifically referenced? FromOutput []string `thrift:"from_output,8,optional" form:"from_output" json:"from_output,omitempty" query:"from_output"` - // 如果入参是用户手输 就放这里 + // If the imported parameter is the user's hand input, put it here Value *string `thrift:"value,9,optional" form:"value" json:"value,omitempty" query:"value"` Format *PluginParamTypeFormat `thrift:"format,10,optional" form:"format" json:"format,omitempty" query:"format"` - // 辅助类型;type=string生效,0 为unset + // Auxiliary type; type = string takes effect, 0 is unset AssistType *int64 `thrift:"assist_type,11,optional" form:"assist_type" json:"assist_type,omitempty" query:"assist_type"` - // 如果Type是数组,表示子元素的辅助类型;sub_type=string生效,0 为unset + // If Type is an array, it represents the auxiliary type of the child element; sub_type = string takes effect, 0 is unset SubAssistType *int64 `thrift:"sub_assist_type,12,optional" form:"sub_assist_type" json:"sub_assist_type,omitempty" query:"sub_assist_type"` } @@ -10459,23 +10459,23 @@ func (p *Parameter) String() string { } type CreateWorkflowRequest struct { - // 流程名 + // process name Name string `thrift:"name,1,required" form:"name,required" json:"name,required" query:"name,required"` - // 流程描述,不可为空 + // Process description, not null Desc string `thrift:"desc,2,required" form:"desc,required" json:"desc,required" query:"desc,required"` - // 流程图标uri,不可为空 + // Process icon uri, not nullable IconURI string `thrift:"icon_uri,3,required" form:"icon_uri,required" json:"icon_uri,required" query:"icon_uri,required"` - // 空间id,不可为空 + // Space id, cannot be empty SpaceID string `thrift:"space_id,4,required" form:"space_id,required" json:"space_id,required" query:"space_id,required"` - // workflow or chatflow,默认值为workflow + // Workflow or chatflow, the default is workflow FlowMode *WorkflowMode `thrift:"flow_mode,5,optional" form:"flow_mode" json:"flow_mode,omitempty" query:"flow_mode"` SchemaType *SchemaType `thrift:"schema_type,6,optional" form:"schema_type" json:"schema_type,omitempty" query:"schema_type"` BindBizID *string `thrift:"bind_biz_id,7,optional" form:"bind_biz_id" json:"bind_biz_id,omitempty" query:"bind_biz_id"` - // 绑定业务类型,非必要不填写。参考BindBizType结构体,值为3时代表抖音分身 + // Bind the business type, do not fill in if necessary. Refer to the BindBizType structure, when the value is 3, it represents the Douyin doppelganger. BindBizType *int32 `thrift:"bind_biz_type,8,optional" form:"bind_biz_type" json:"bind_biz_type,omitempty" query:"bind_biz_type"` - // 应用id,填写时代表流程是project下的流程,需要跟随project发布 + // Application id, when filled in, it means that the process is the process under the project, and it needs to be released with the project. ProjectID *string `thrift:"project_id,9,optional" form:"project_id" json:"project_id,omitempty" query:"project_id"` - // 是否创建会话,仅当flow_mode=chatflow时生效 + // Whether to create a session, only if flow_mode = chatflow CreateConversation *bool `thrift:"create_conversation,10,optional" form:"create_conversation" json:"create_conversation,omitempty" query:"create_conversation"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -11161,9 +11161,9 @@ func (p *CreateWorkflowRequest) String() string { } type CreateWorkflowData struct { - // 流程的id,用来标识唯一的流程 + // The ID of the process, used to identify a unique process WorkflowID string `thrift:"workflow_id,1" form:"workflow_id" json:"workflow_id" query:"workflow_id"` - // 流程名 + // process name Name string `thrift:"name,2" form:"name" json:"name" query:"name"` URL string `thrift:"url,3" form:"url" json:"url" query:"url"` Status WorkFlowStatus `thrift:"status,4" form:"status" json:"status" query:"status"` @@ -11919,16 +11919,16 @@ func (p *CreateWorkflowResponse) String() string { } type SaveWorkflowRequest struct { - // 流程的id,用来标识唯一的流程 + // The ID of the process, used to identify a unique process WorkflowID string `thrift:"workflow_id,1,required" form:"workflow_id,required" json:"workflow_id,required" query:"workflow_id,required"` - // 流程的schema + // Process schema Schema *string `thrift:"schema,2,optional" form:"schema" json:"schema,omitempty" query:"schema"` - // required,空间id,不可为空 + // Required, space id, not nullable SpaceID *string `thrift:"space_id,3,optional" form:"space_id" json:"space_id,omitempty" query:"space_id"` Name *string `thrift:"name,4,optional" form:"name" json:"name,omitempty" query:"name"` Desc *string `thrift:"desc,5,optional" form:"desc" json:"desc,omitempty" query:"desc"` IconURI *string `thrift:"icon_uri,6,optional" form:"icon_uri" json:"icon_uri,omitempty" query:"icon_uri"` - // 提交的 commit_id。其作用是唯一标识一个流程的单个提交版本(每个 commit_id 仅对应且仅能对应一个流程的一次提交版本)。 + // The commit_id of a commit. This is used to uniquely identify individual commit versions of a process (each commit_id corresponds only and only to one commit version of a process). SubmitCommitID string `thrift:"submit_commit_id,7,required" form:"submit_commit_id,required" json:"submit_commit_id,required" query:"submit_commit_id,required"` IgnoreStatusTransfer *bool `thrift:"ignore_status_transfer,8,optional" form:"ignore_status_transfer" json:"ignore_status_transfer,omitempty" query:"ignore_status_transfer"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` @@ -15574,7 +15574,7 @@ type CanvasData struct { DbData *DBCanvasData `thrift:"db_data,3" form:"db_data" json:"db_data" query:"db_data"` OperationInfo *OperationInfo `thrift:"operation_info,4" form:"operation_info" json:"operation_info" query:"operation_info"` ExternalFlowInfo *string `thrift:"external_flow_info,5,optional" form:"external_flow_info" json:"external_flow_info,omitempty" query:"external_flow_info"` - // 是否绑定了Agent + // Is the Agent bound? IsBindAgent *bool `thrift:"is_bind_agent,6,optional" form:"is_bind_agent" json:"is_bind_agent,omitempty" query:"is_bind_agent"` BindBizID *string `thrift:"bind_biz_id,7,optional" form:"bind_biz_id" json:"bind_biz_id,omitempty" query:"bind_biz_id"` BindBizType *int32 `thrift:"bind_biz_type,8,optional" form:"bind_biz_type" json:"bind_biz_type,omitempty" query:"bind_biz_type"` @@ -16148,9 +16148,9 @@ func (p *CanvasData) String() string { } type GetCanvasInfoRequest struct { - // 空间id,不可为空 + // Space id, cannot be empty SpaceID string `thrift:"space_id,1,required" form:"space_id,required" json:"space_id,required" query:"space_id,required"` - // required,流程id,不可为空 + // Required, process id, not null WorkflowID *string `thrift:"workflow_id,2,optional" form:"workflow_id" json:"workflow_id,omitempty" query:"workflow_id"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -16723,7 +16723,7 @@ func (p *GetCanvasInfoResponse) String() string { type GetHistorySchemaRequest struct { SpaceID string `thrift:"space_id,1,required" form:"space_id,required" json:"space_id,required" query:"space_id,required"` WorkflowID string `thrift:"workflow_id,2,required" form:"workflow_id,required" json:"workflow_id,required" query:"workflow_id,required"` - // 多次分页的时候需要传入 + // You need to pass in when paging multiple times. CommitID *string `thrift:"commit_id,3,optional" form:"commit_id" json:"commit_id,omitempty" query:"commit_id"` Type OperateType `thrift:"type,4,required" form:"type,required" json:"type,required" query:"type,required"` Env *string `thrift:"env,5,optional" form:"env" json:"env,omitempty" query:"env"` @@ -20450,15 +20450,15 @@ type PublishWorkflowRequest struct { WorkflowID string `thrift:"workflow_id,1,required" form:"workflow_id,required" json:"workflow_id,required" query:"workflow_id,required"` SpaceID string `thrift:"space_id,2,required" form:"space_id,required" json:"space_id,required" query:"space_id,required"` HasCollaborator bool `thrift:"has_collaborator,3,required" form:"has_collaborator,required" json:"has_collaborator,required" query:"has_collaborator,required"` - // 发布到哪个环境,不填默认线上 + // Which environment to publish to, do not fill in the default line Env *string `thrift:"env,4,optional" form:"env" json:"env,omitempty" query:"env"` - // 使用哪个版本发布,不填默认最新提交版本 + // Which version to use to release, do not fill in the default latest commit version CommitID *string `thrift:"commit_id,5,optional" form:"commit_id" json:"commit_id,omitempty" query:"commit_id"` - // 强制发布。若流程发布前执行了 TestRun 步骤,“force” 参数值应为 false,或不传递该参数;若流程发布前未执行 TestRun 步骤,“force” 参数值应为 true 。 + // Force release. If the TestRun step was executed before the process was published, the "force" parameter value should be false, or not passed; if the TestRun step was not executed before the process was published, the "force" parameter value should be true. Force *bool `thrift:"force,6,optional" form:"force" json:"force,omitempty" query:"force"` - // required, 发布workflow的版本号,遵循 SemVer 格式为"vx.y.z",必须比当前版本大,可通过 GetCanvasInfo 获取当前版本 + // Required, the version number of the published workflow, in SemVer format "vx.y.z", must be larger than the current version, the current version can be obtained through GetCanvasInfo WorkflowVersion *string `thrift:"workflow_version,7,optional" form:"workflow_version" json:"workflow_version,omitempty" query:"workflow_version"` - // workflow的版本描述 + // Workflow version description VersionDescription *string `thrift:"version_description,8,optional" form:"version_description" json:"version_description,omitempty" query:"version_description"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -22349,7 +22349,7 @@ type UserInfo struct { UserID int64 `thrift:"user_id,1" form:"user_id" json:"user_id" query:"user_id"` UserName string `thrift:"user_name,2" form:"user_name" json:"user_name" query:"user_name"` UserAvatar string `thrift:"user_avatar,3" form:"user_avatar" json:"user_avatar" query:"user_avatar"` - // 用户昵称 + // user nickname Nickname string `thrift:"nickname,4" form:"nickname" json:"nickname" query:"nickname"` } @@ -22839,7 +22839,7 @@ type ReleasedWorkflow struct { Version string `thrift:"version,12" form:"version" json:"version" query:"version"` CreateTime int64 `thrift:"create_time,13" form:"create_time" json:"create_time" query:"create_time"` UpdateTime int64 `thrift:"update_time,14" form:"update_time" json:"update_time" query:"update_time"` - // workflow创作者信息 + // Workflow creator information Creator *Creator `thrift:"creator,15" form:"creator" json:"creator" query:"creator"` FlowMode WorkflowMode `thrift:"flow_mode,16" form:"flow_mode" json:"flow_mode" query:"flow_mode"` FlowVersion string `thrift:"flow_version,17" form:"flow_version" json:"flow_version" query:"flow_version"` @@ -24139,7 +24139,7 @@ func (p *SubWorkflow) String() string { } -// Workflow 过滤条件 +// Workflow filter type WorkflowFilter struct { WorkflowID string `thrift:"workflow_id,1" form:"workflow_id" json:"workflow_id" query:"workflow_id"` WorkflowVersion *string `thrift:"workflow_version,2,optional" form:"workflow_version" json:"workflow_version,omitempty" query:"workflow_version"` @@ -24345,9 +24345,9 @@ type GetReleasedWorkflowsRequest struct { SpaceID *string `thrift:"space_id,8,optional" form:"space_id" json:"space_id,omitempty" query:"space_id"` OrderBy *OrderBy `thrift:"order_by,9,optional" form:"order_by" json:"order_by,omitempty" query:"order_by"` LoginUserCreate *bool `thrift:"login_user_create,10,optional" form:"login_user_create" json:"login_user_create,omitempty" query:"login_user_create"` - // workflow or imageflow, 默认为workflow + // Workflow or imageflow, default to workflow FlowMode *WorkflowMode `thrift:"flow_mode,11,optional" form:"flow_mode" json:"flow_mode,omitempty" query:"flow_mode"` - // 过滤条件,支持workflow_id和workflow_version + // Filter conditions, support workflow_id and workflow_version WorkflowFilterList []*WorkflowFilter `thrift:"workflow_filter_list,12,optional" form:"workflow_filter_list" json:"workflow_filter_list,omitempty" query:"workflow_filter_list"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -26501,15 +26501,15 @@ func (p *GetExampleWorkFlowListResponse) String() string { } type GetExampleWorkFlowListRequest struct { - // 分页功能,指定希望获取的结果列表的页码。 + // Paging function, specifying the page number of the list of results you want to retrieve. Page *int32 `thrift:"page,1,optional" form:"page" json:"page,omitempty" query:"page"` - // 分页功能,指定每页返回的条目数量, 必须大于0,小于等于100 + // Paging function, specifies the number of entries returned per page, must be greater than 0, less than or equal to 100 Size *int32 `thrift:"size,2,optional" form:"size" json:"size,omitempty" query:"size"` - // 根据工作流的名称来筛选示例工作流列表。 + // Filter the list of sample workflows by the name of the workflow. Name *string `thrift:"name,5,optional" form:"name" json:"name,omitempty" query:"name"` - // 根据工作流的模式(例如:标准工作流、对话流等)筛选示例工作流列表。 + // Filter the sample workflow list based on the workflow pattern (e.g., standard workflow, conversation flow, etc.). FlowMode *WorkflowMode `thrift:"flow_mode,11,optional" form:"flow_mode" json:"flow_mode,omitempty" query:"flow_mode"` - // Bot的 Workflow as Agent模式会使用,只会使用BotAgent = 3的场景 + // Bot's Workflow as Agent mode will be used, only scenarios with BotAgent = 3 will be used Checker []CheckType `thrift:"checker,14,optional" form:"checker" json:"checker,omitempty" query:"checker"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -26955,30 +26955,30 @@ func (p *GetExampleWorkFlowListRequest) String() string { type GetWorkFlowListRequest struct { Page *int32 `thrift:"page,1,optional" form:"page" json:"page,omitempty" query:"page"` - // 分页大小,一般为10 + // Page size, usually 10. Size *int32 `thrift:"size,2,optional" form:"size" json:"size,omitempty" query:"size"` - // 根据流程id列表查询对应的流程 + // Query the corresponding process according to the process id list WorkflowIds []string `thrift:"workflow_ids,3,optional" form:"workflow_ids" json:"workflow_ids,omitempty" query:"workflow_ids"` - // 根据流程类型筛选流程 + // Filter processes by process type Type *WorkFlowType `thrift:"type,4,optional" form:"type" json:"type,omitempty" query:"type"` - // 根据流程名称筛选流程 + // Filter processes by process name Name *string `thrift:"name,5,optional" form:"name" json:"name,omitempty" query:"name"` - // 根据标签筛选流程 + // Filter process by label Tags *Tag `thrift:"tags,6,optional" form:"tags" json:"tags,omitempty" query:"tags"` - // required,空间id + // Required, space id SpaceID *string `thrift:"space_id,7,optional" form:"space_id" json:"space_id,omitempty" query:"space_id"` - // 根据流程是否已发布筛选流程 + // Filter process according to whether the process has been published Status *WorkFlowListStatus `thrift:"status,8,optional" form:"status" json:"status,omitempty" query:"status"` OrderBy *OrderBy `thrift:"order_by,9,optional" form:"order_by" json:"order_by,omitempty" query:"order_by"` - // 根据接口请求人是否为流程创建人筛选流程 + // Filter processes based on whether the interface requester is the process creator LoginUserCreate *bool `thrift:"login_user_create,10,optional" form:"login_user_create" json:"login_user_create,omitempty" query:"login_user_create"` - // workflow or chatflow, 默认为workflow。根据流程类型筛选流程 + // Workflow or chatflow, the default is workflow. Filter processes by process type FlowMode *WorkflowMode `thrift:"flow_mode,11,optional" form:"flow_mode" json:"flow_mode,omitempty" query:"flow_mode"` - // 新增字段,用于筛选schema_type + // New field for filtering schema_type SchemaTypeList []SchemaType `thrift:"schema_type_list,12,optional" form:"schema_type_list" json:"schema_type_list,omitempty" query:"schema_type_list"` - // 在对应project下查询流程 + // Query process under the corresponding project ProjectID *string `thrift:"project_id,13,optional" form:"project_id" json:"project_id,omitempty" query:"project_id"` - // 用于project发布过滤,此列表中的每个 CheckType 元素可指定特定规则,决定了返回的流程是否通过检查。 + // For project publication filtering, each CheckType element in this list can specify a specific rule that determines whether the returned process passes the check. Checker []CheckType `thrift:"checker,14,optional" form:"checker" json:"checker,omitempty" query:"checker"` BindBizID *string `thrift:"bind_biz_id,15,optional" form:"bind_biz_id" json:"bind_biz_id,omitempty" query:"bind_biz_id"` BindBizType *BindBizType `thrift:"bind_biz_type,16,optional" form:"bind_biz_type" json:"bind_biz_type,omitempty" query:"bind_biz_type"` @@ -28360,11 +28360,11 @@ func (p *ResourceActionAuth) String() string { } type ResourceAuthInfo struct { - // 资源id + // Resource ID WorkflowID string `thrift:"workflow_id,1" form:"workflow_id" json:"workflow_id" query:"workflow_id"` - // 用户id + // user id UserID string `thrift:"user_id,2" form:"user_id" json:"user_id" query:"user_id"` - // 用户资源操作权限 + // user resource operation permission Auth *ResourceActionAuth `thrift:"auth,3" form:"auth" json:"auth" query:"auth"` } @@ -30447,11 +30447,11 @@ type WorkFlowTestRunRequest struct { WorkflowID string `thrift:"workflow_id,1,required" form:"workflow_id,required" json:"workflow_id,required" query:"workflow_id,required"` Input map[string]string `thrift:"input,2" form:"input" json:"input" query:"input"` SpaceID *string `thrift:"space_id,3,optional" form:"space_id" json:"space_id,omitempty" query:"space_id"` - // agent的id,非project下的流程,涉及变量节点、数据库的流程 + // The id of the agent, the process under non-project, the process involving variable nodes and databases BotID *string `thrift:"bot_id,4,optional" form:"bot_id" json:"bot_id,omitempty" query:"bot_id"` - // 废弃 + // abandoned SubmitCommitID *string `thrift:"submit_commit_id,5,optional" form:"submit_commit_id" json:"submit_commit_id,omitempty" query:"submit_commit_id"` - // 指定vcs commit_id,默认为空 + // Specify vcs commit_id, default is empty CommitID *string `thrift:"commit_id,6,optional" form:"commit_id" json:"commit_id,omitempty" query:"commit_id"` ProjectID *string `thrift:"project_id,7,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"` @@ -32778,7 +32778,7 @@ func (p *CancelWorkFlowResponse) String() string { } -// workflow快照基本信息 +// Workflow snapshot basic information type WkPluginBasicData struct { WorkflowID int64 `thrift:"workflow_id,1" form:"workflow_id" json:"workflow_id,string" query:"workflow_id"` SpaceID int64 `thrift:"space_id,2" form:"space_id" json:"space_id,string" query:"space_id"` @@ -32787,7 +32787,7 @@ type WkPluginBasicData struct { URL string `thrift:"url,5" form:"url" json:"url" query:"url"` IconURI string `thrift:"icon_uri,6" form:"icon_uri" json:"icon_uri" query:"icon_uri"` Status WorkFlowStatus `thrift:"status,7" form:"status" json:"status" query:"status"` - // workflow 对应的插件id + // Plugin ID for workflow PluginID int64 `thrift:"plugin_id,8" form:"plugin_id" json:"plugin_id,string" query:"plugin_id"` CreateTime int64 `thrift:"create_time,9" form:"create_time" json:"create_time" query:"create_time"` UpdateTime int64 `thrift:"update_time,10" form:"update_time" json:"update_time" query:"update_time"` @@ -33724,7 +33724,7 @@ func (p *WkPluginBasicData) String() string { type CopyWkTemplateApiRequest struct { WorkflowIds []string `thrift:"workflow_ids,1,required" form:"workflow_ids,required" json:"workflow_ids,required" query:"workflow_ids,required"` - // 拷贝的目标空间 + // Copy target space TargetSpaceID int64 `thrift:"target_space_id,2,required" form:"target_space_id,required" json:"target_space_id,string,required" query:"target_space_id,required"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -33996,7 +33996,7 @@ func (p *CopyWkTemplateApiRequest) String() string { } type CopyWkTemplateApiResponse struct { - // 模板ID:拷贝副本的数据 + // Template ID: Copy copy of data Data map[int64]*WkPluginBasicData `thrift:"data,1,required" form:"data,required" json:"data,string,required" query:"data,required"` 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"` @@ -34336,17 +34336,17 @@ func (p *CopyWkTemplateApiResponse) String() string { // === node history === type GetWorkflowProcessRequest struct { - // 流程id,不为空 + // Process id, not empty WorkflowID string `thrift:"workflow_id,1,required" form:"workflow_id,required" json:"workflow_id,required" query:"workflow_id,required"` - // 空间id,不为空 + // Space id, not empty SpaceID string `thrift:"space_id,2,required" form:"space_id,required" json:"space_id,required" query:"space_id,required"` - // 流程的执行id + // Execution ID of the process ExecuteID *string `thrift:"execute_id,3,optional" form:"execute_id" json:"execute_id,omitempty" query:"execute_id"` - // 子流程的执行id + // Execution ID of the subprocess SubExecuteID *string `thrift:"sub_execute_id,4,optional" form:"sub_execute_id" json:"sub_execute_id,omitempty" query:"sub_execute_id"` - // 是否返回所有的batch节点内容 + // Whether to return all batch node contents NeedAsync *bool `thrift:"need_async,5,optional" form:"need_async" json:"need_async,omitempty" query:"need_async"` - // 未传execute_id时,可通过log_id取到execute_id + // When execute_id is not transmitted, it can be obtained through log_id execute_id LogID *string `thrift:"log_id,6,optional" form:"log_id" json:"log_id,omitempty" query:"log_id"` NodeID *int64 `thrift:"node_id,7,optional" form:"node_id" json:"node_id,string,omitempty" query:"node_id"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` @@ -35168,17 +35168,17 @@ func (p *GetWorkflowProcessResponse) String() string { } type TokenAndCost struct { - // input消耗Token数 + // Input Consumption Tokens InputTokens *string `thrift:"inputTokens,1,optional" form:"inputTokens" json:"inputTokens,omitempty" query:"inputTokens"` - // input花费 + // Input cost InputCost *string `thrift:"inputCost,2,optional" form:"inputCost" json:"inputCost,omitempty" query:"inputCost"` - // Output消耗Token数 + // Output Consumption Tokens OutputTokens *string `thrift:"outputTokens,3,optional" form:"outputTokens" json:"outputTokens,omitempty" query:"outputTokens"` - // Output花费 + // Output cost OutputCost *string `thrift:"outputCost,4,optional" form:"outputCost" json:"outputCost,omitempty" query:"outputCost"` - // 总消耗Token数 + // Total Consumed Tokens TotalTokens *string `thrift:"totalTokens,5,optional" form:"totalTokens" json:"totalTokens,omitempty" query:"totalTokens"` - // 总花费 + // total cost TotalCost *string `thrift:"totalCost,6,optional" form:"totalCost" json:"totalCost,omitempty" query:"totalCost"` } @@ -35607,11 +35607,11 @@ type GetNodeExecuteHistoryRequest struct { WorkflowID string `thrift:"workflow_id,1,required" form:"workflow_id,required" json:"workflow_id,required" query:"workflow_id,required"` SpaceID string `thrift:"space_id,2,required" form:"space_id,required" json:"space_id,required" query:"space_id,required"` ExecuteID string `thrift:"execute_id,3,required" form:"execute_id,required" json:"execute_id,required" query:"execute_id,required"` - // 节点id + // Node ID NodeID string `thrift:"node_id,5,required" form:"node_id,required" json:"node_id,required" query:"node_id,required"` - // 是否批次节点 + // Whether batch node IsBatch *bool `thrift:"is_batch,6,optional" form:"is_batch" json:"is_batch,omitempty" query:"is_batch"` - // 执行批次 + // execution batch BatchIndex *int32 `thrift:"batch_index,7,optional" form:"batch_index" json:"batch_index,omitempty" query:"batch_index"` NodeType string `thrift:"node_type,8,required" form:"node_type,required" json:"node_type,required" query:"node_type,required"` NodeHistoryScene *NodeHistoryScene `thrift:"node_history_scene,9,optional" form:"node_history_scene" json:"node_history_scene,omitempty" query:"node_history_scene"` @@ -36474,20 +36474,20 @@ type GetWorkFlowProcessData struct { ExecuteId string `thrift:"executeId,2" form:"executeId" json:"executeId" query:"executeId"` ExecuteStatus WorkflowExeStatus `thrift:"executeStatus,3" form:"executeStatus" json:"executeStatus" query:"executeStatus"` NodeResults []*NodeResult `thrift:"nodeResults,4" form:"nodeResults" json:"nodeResults" query:"nodeResults"` - // 执行进度 + // execution progress Rate string `thrift:"rate,5" form:"rate" json:"rate" query:"rate"` - // 现节点试运行状态 1:没有试运行 2:试运行过 + // Current node practice run state 1: no practice run 2: practice run ExeHistoryStatus WorkflowExeHistoryStatus `thrift:"exeHistoryStatus,6" form:"exeHistoryStatus" json:"exeHistoryStatus" query:"exeHistoryStatus"` - // workflow试运行耗时 + // Workflow practice running time WorkflowExeCost string `thrift:"workflowExeCost,7" form:"workflowExeCost" json:"workflowExeCost" query:"workflowExeCost"` - // 消耗 + // consume TokenAndCost *TokenAndCost `thrift:"tokenAndCost,8,optional" form:"tokenAndCost" json:"tokenAndCost,omitempty" query:"tokenAndCost"` - // 失败原因 + // reason for failure Reason *string `thrift:"reason,9,optional" form:"reason" json:"reason,omitempty" query:"reason"` - // 最后一个节点的ID + // The ID of the last node LastNodeID *string `thrift:"lastNodeID,10,optional" form:"lastNodeID" json:"lastNodeID,omitempty" query:"lastNodeID"` LogID string `thrift:"logID,11" form:"logID" json:"logID" query:"logID"` - // 只返回中断中的 event + // Returns only events in the interrupt NodeEvents []*NodeEvent `thrift:"nodeEvents,12" form:"nodeEvents" json:"nodeEvents" query:"nodeEvents"` ProjectId string `thrift:"projectId,13" form:"projectId" json:"projectId" query:"projectId"` } @@ -37231,15 +37231,15 @@ type NodeResult struct { NodeName string `thrift:"NodeName,3" form:"NodeName" json:"NodeName" query:"NodeName"` NodeStatus NodeExeStatus `thrift:"nodeStatus,5" form:"nodeStatus" json:"nodeStatus" query:"nodeStatus"` ErrorInfo string `thrift:"errorInfo,6" form:"errorInfo" json:"errorInfo" query:"errorInfo"` - // 入参 jsonstring类型 + // Imported parameters jsonString type Input string `thrift:"input,7" form:"input" json:"input" query:"input"` - // 出参 jsonstring + // Exported parameter jsonString Output string `thrift:"output,8" form:"output" json:"output" query:"output"` - // 运行耗时 eg:3s + // Running time eg: 3s NodeExeCost string `thrift:"nodeExeCost,9" form:"nodeExeCost" json:"nodeExeCost" query:"nodeExeCost"` - // 消耗 + // consume TokenAndCost *TokenAndCost `thrift:"tokenAndCost,10,optional" form:"tokenAndCost" json:"tokenAndCost,omitempty" query:"tokenAndCost"` - // 直接输出 + // direct output RawOutput *string `thrift:"raw_output,11,optional" form:"raw_output" json:"raw_output,omitempty" query:"raw_output"` ErrorLevel string `thrift:"errorLevel,12" form:"errorLevel" json:"errorLevel" query:"errorLevel"` Index *int32 `thrift:"index,13,optional" form:"index" json:"index,omitempty" query:"index"` @@ -38494,9 +38494,9 @@ type NodeEvent struct { NodeTitle string `thrift:"node_title,3" form:"node_title" json:"node_title" query:"node_title"` Data string `thrift:"data,4" form:"data" json:"data" query:"data"` NodeIcon string `thrift:"node_icon,5" form:"node_icon" json:"node_icon" query:"node_icon"` - // 实际为node_execute_id + // Actually node_execute_id NodeID string `thrift:"node_id,6" form:"node_id" json:"node_id" query:"node_id"` - // 与画布里的node_id对应 + // Corresponds to node_id on canvas SchemaNodeID string `thrift:"schema_node_id,7" form:"schema_node_id" json:"schema_node_id" query:"schema_node_id"` } @@ -41022,7 +41022,7 @@ func (p *NodeError) String() string { type PathError struct { Start string `thrift:"start,1" form:"start" json:"start" query:"start"` End string `thrift:"end,2" form:"end" json:"end" query:"end"` - // 路径上的节点ID + // Node ID on the path Path []string `thrift:"path,3" form:"path" json:"path" query:"path"` } @@ -41723,13 +41723,13 @@ func (p *NodeTemplate) String() string { } -// 插件配置 +// plug-in configuration type PluginAPINode struct { - // 实际的插件配置 + // Actual plug-in configuration PluginID string `thrift:"plugin_id,1" form:"plugin_id" json:"plugin_id" query:"plugin_id"` APIID string `thrift:"api_id,2" form:"api_id" json:"api_id" query:"api_id"` APIName string `thrift:"api_name,3" form:"api_name" json:"api_name" query:"api_name"` - // 用于节点展示 + // For node display Name string `thrift:"name,4" form:"name" json:"name" query:"name"` Desc string `thrift:"desc,5" form:"desc" json:"desc" query:"desc"` IconURL string `thrift:"icon_url,6" form:"icon_url" json:"icon_url" query:"icon_url"` @@ -42135,11 +42135,11 @@ func (p *PluginAPINode) String() string { } -// 查看更多图像插件 +// View more image plugins type PluginCategory struct { PluginCategoryID string `thrift:"plugin_category_id,1" form:"plugin_category_id" json:"plugin_category_id" query:"plugin_category_id"` OnlyOfficial bool `thrift:"only_official,2" form:"only_official" json:"only_official" query:"only_official"` - // 用于节点展示 + // For node display Name string `thrift:"name,3" form:"name" json:"name" query:"name"` IconURL string `thrift:"icon_url,4" form:"icon_url" json:"icon_url" query:"icon_url"` NodeType string `thrift:"node_type,5" form:"node_type" json:"node_type" query:"node_type"` @@ -42457,9 +42457,9 @@ func (p *PluginCategory) String() string { } type NodeTemplateListRequest struct { - // 需要的节点类型 不传默认返回全部 + // Required node type, return all by default without passing NeedTypes []NodeTemplateType `thrift:"need_types,1,optional" form:"need_types" json:"need_types,omitempty" query:"need_types"` - // 需要的节点类型, string 类型 + // Required node type, string type NodeTypes []string `thrift:"node_types,2,optional" form:"node_types" json:"node_types,omitempty" query:"node_types"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -42759,7 +42759,7 @@ func (p *NodeTemplateListRequest) String() string { type NodeTemplateListData struct { TemplateList []*NodeTemplate `thrift:"template_list,1" form:"template_list" json:"template_list" query:"template_list"` - // 节点的展示分类配置 + // Display classification configuration of nodes CateList []*NodeCategory `thrift:"cate_list,2" form:"cate_list" json:"cate_list" query:"cate_list"` PluginAPIList []*PluginAPINode `thrift:"plugin_api_list,3" form:"plugin_api_list" json:"plugin_api_list" query:"plugin_api_list"` PluginCategoryList []*PluginCategory `thrift:"plugin_category_list,4" form:"plugin_category_list" json:"plugin_category_list" query:"plugin_category_list"` @@ -43113,12 +43113,12 @@ func (p *NodeTemplateListData) String() string { } type NodeCategory struct { - // 分类名,空字符串表示下面的节点不属于任何分类 + // Category name, empty string indicates that the following node does not belong to any category Name string `thrift:"name,1" form:"name" json:"name" query:"name"` NodeTypeList []string `thrift:"node_type_list,2" form:"node_type_list" json:"node_type_list" query:"node_type_list"` - // 插件的api_id列表 + // List of api_id plugins PluginAPIIDList []string `thrift:"plugin_api_id_list,3,optional" form:"plugin_api_id_list" json:"plugin_api_id_list,omitempty" query:"plugin_api_id_list"` - // 跳转官方插件列表的分类配置 + // Jump to the classification configuration of the official plug-in list PluginCategoryIDList []string `thrift:"plugin_category_id_list,4,optional" form:"plugin_category_id_list" json:"plugin_category_id_list,omitempty" query:"plugin_category_id_list"` } @@ -47089,7 +47089,7 @@ func (p *NodeInfo) String() string { } type GetWorkflowDetailInfoRequest struct { - // 过滤条件,支持workflow_id和workflow_version + // Filter conditions, support workflow_id and workflow_version WorkflowFilterList []*WorkflowFilter `thrift:"workflow_filter_list,1,optional" form:"workflow_filter_list" json:"workflow_filter_list,omitempty" query:"workflow_filter_list"` SpaceID *string `thrift:"space_id,2,optional" form:"space_id" json:"space_id,omitempty" query:"space_id"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` @@ -47713,7 +47713,7 @@ type WorkflowDetailInfoData struct { IconURI string `thrift:"icon_uri,13" form:"icon_uri" json:"icon_uri" query:"icon_uri"` FlowMode WorkflowMode `thrift:"flow_mode,14" form:"flow_mode" json:"flow_mode" query:"flow_mode"` PluginID string `thrift:"plugin_id,15" form:"plugin_id" json:"plugin_id" query:"plugin_id"` - // workflow创作者信息 + // Workflow creator information Creator *Creator `thrift:"creator,16" form:"creator" json:"creator" query:"creator"` FlowVersion string `thrift:"flow_version,17" form:"flow_version" json:"flow_version" query:"flow_version"` FlowVersionDesc string `thrift:"flow_version_desc,18" form:"flow_version_desc" json:"flow_version_desc" query:"flow_version_desc"` @@ -50186,7 +50186,7 @@ func (p *WorkflowDetailData) String() string { } type APIParameter struct { - // for前端,无实际意义 + // For the front end, no practical significance ID string `thrift:"id,1" form:"id" json:"id" query:"id"` Name string `thrift:"name,2" form:"name" json:"name" query:"name"` Desc string `thrift:"desc,3" form:"desc" json:"desc" query:"desc"` @@ -50209,9 +50209,9 @@ type APIParameter struct { ExclusiveMinimum *bool `thrift:"exclusive_minimum,20,optional" form:"exclusive_minimum" json:"exclusive_minimum,omitempty" query:"exclusive_minimum"` ExclusiveMaximum *bool `thrift:"exclusive_maximum,21,optional" form:"exclusive_maximum" json:"exclusive_maximum,omitempty" query:"exclusive_maximum"` BizExtend *string `thrift:"biz_extend,22,optional" form:"biz_extend" json:"biz_extend,omitempty" query:"biz_extend"` - // 默认入参的设置来源 + // Default imported parameter settings source DefaultParamSource *DefaultParamSource `thrift:"default_param_source,23,optional" form:"default_param_source" json:"default_param_source,omitempty" query:"default_param_source"` - // 引用variable的key + // Reference variable key VariableRef *string `thrift:"variable_ref,24,optional" form:"variable_ref" json:"variable_ref,omitempty" query:"variable_ref"` AssistType *AssistParameterType `thrift:"assist_type,25,optional" form:"assist_type" json:"assist_type,omitempty" query:"assist_type"` } @@ -51954,7 +51954,7 @@ type FCPluginSetting struct { RequestParams []*APIParameter `thrift:"request_params,4" form:"request_params" json:"request_params" query:"request_params"` ResponseParams []*APIParameter `thrift:"response_params,5" form:"response_params" json:"response_params" query:"response_params"` ResponseStyle *ResponseStyle `thrift:"response_style,6" form:"response_style" json:"response_style" query:"response_style"` - // 本期暂时不支持 + // This issue is temporarily not supported. AsyncConf *AsyncConf `thrift:"async_conf,7,optional" form:"async_conf" json:"async_conf,omitempty" query:"async_conf"` IsDraft bool `thrift:"is_draft,8" form:"is_draft" json:"is_draft" query:"is_draft"` PluginVersion string `thrift:"plugin_version,9" form:"plugin_version" json:"plugin_version" query:"plugin_version"` @@ -52507,7 +52507,7 @@ type FCWorkflowSetting struct { RequestParams []*APIParameter `thrift:"request_params,3" form:"request_params" json:"request_params" query:"request_params"` ResponseParams []*APIParameter `thrift:"response_params,4" form:"response_params" json:"response_params" query:"response_params"` ResponseStyle *ResponseStyle `thrift:"response_style,5" form:"response_style" json:"response_style" query:"response_style"` - // 本期暂时不支持 + // This issue is temporarily not supported. AsyncConf *AsyncConf `thrift:"async_conf,6,optional" form:"async_conf" json:"async_conf,omitempty" query:"async_conf"` IsDraft bool `thrift:"is_draft,7" form:"is_draft" json:"is_draft" query:"is_draft"` WorkflowVersion string `thrift:"workflow_version,8" form:"workflow_version" json:"workflow_version" query:"workflow_version"` @@ -55800,7 +55800,7 @@ func (p *PluginDetail) String() string { } type APIDetail struct { - // api的id + // API ID ID string `thrift:"id,1" form:"id" json:"id" query:"id"` Name string `thrift:"name,2" form:"name" json:"name" query:"name"` Description string `thrift:"description,3" form:"description" json:"description" query:"description"` @@ -58839,7 +58839,7 @@ func (p *UpdateProjectConversationDefResponse) String() string { type DeleteProjectConversationDefRequest struct { ProjectID string `thrift:"project_id,1,required" form:"project_id,required" json:"project_id,required" query:"project_id,required"` UniqueID string `thrift:"unique_id,2,required" form:"unique_id,required" json:"unique_id,required" query:"unique_id,required"` - // 替换表,每个 wf 草稿分别替换成哪个, 未替换的情况下 success =false,replace 会返回待替换列表 + // Replace the table, which one to replace each wf draft with. If not replaced, success = false, replace will return the list to be replaced. Replace map[string]string `thrift:"replace,3" form:"replace" json:"replace" query:"replace"` CheckOnly bool `thrift:"check_only,4" form:"check_only" json:"check_only" query:"check_only"` SpaceID string `thrift:"space_id,5,required" form:"space_id,required" json:"space_id,required" query:"space_id,required"` @@ -59262,7 +59262,7 @@ func (p *DeleteProjectConversationDefRequest) String() string { type DeleteProjectConversationDefResponse struct { Success bool `thrift:"success,1" form:"success" json:"success" query:"success"` - // 如果未传递 replacemap, 会失败,返回需要替换的 wf + // If no replacemap is passed, it will fail, returning the wf that needs to be replaced NeedReplace []*Workflow `thrift:"need_replace,2" form:"need_replace" json:"need_replace" query:"need_replace"` 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"` @@ -59630,20 +59630,20 @@ func (p *DeleteProjectConversationDefResponse) String() string { type ListProjectConversationRequest struct { ProjectID string `thrift:"project_id,1,required" form:"project_id,required" json:"project_id,required" query:"project_id,required"` - // 0=在project 创建(静态会话),1=通过 wf 节点创建(动态会话) + // 0 = created in project (static session), 1 = created through wf node (dynamic session) CreateMethod CreateMethod `thrift:"create_method,2" form:"create_method" json:"create_method" query:"create_method"` - // 0=wf 节点试运行创建的 1=wf 节点发布后运行的 + // 0 = wf node practice run created 1 = wf node run after release CreateEnv CreateEnv `thrift:"create_env,3" form:"create_env" json:"create_env" query:"create_env"` - // 分页偏移,不传从第一条开始 + // Paging offset, do not pass from the first item Cursor string `thrift:"cursor,4" form:"cursor" json:"cursor" query:"cursor"` - // 一次拉取数量 + // number of pulls at one time Limit int64 `thrift:"limit,5" form:"limit" json:"limit" query:"limit"` SpaceID string `thrift:"space_id,6,required" form:"space_id,required" json:"space_id,required" query:"space_id,required"` - // conversationName 模糊搜索 + // conversationName fuzzy search NameLike string `thrift:"nameLike,7" form:"nameLike" json:"nameLike" query:"nameLike"` - // create_env=1 时传递,传对应的渠道 id,当前默认 1024(openapi) + // create_env = 1, pass the corresponding channel id, the current default 1024 (openapi) ConnectorID string `thrift:"connector_id,8" form:"connector_id" json:"connector_id" query:"connector_id"` - // project版本 + // Project version ProjectVersion *string `thrift:"project_version,9,optional" form:"project_version" json:"project_version,omitempty" query:"project_version"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -60216,7 +60216,7 @@ func (p *ListProjectConversationRequest) String() string { type ProjectConversation struct { UniqueID string `thrift:"unique_id,1" form:"unique_id" json:"unique_id" query:"unique_id"` ConversationName string `thrift:"conversation_name,2" form:"conversation_name" json:"conversation_name" query:"conversation_name"` - // 对于自己在 coze 渠道的 conversationid + // For your own conversationid in the coze channel ConversationID string `thrift:"conversation_id,3" form:"conversation_id" json:"conversation_id" query:"conversation_id"` ReleaseConversationName string `thrift:"release_conversation_name,4" form:"release_conversation_name" json:"release_conversation_name" query:"release_conversation_name"` } @@ -60490,7 +60490,7 @@ func (p *ProjectConversation) String() string { type ListProjectConversationResponse struct { Data []*ProjectConversation `thrift:"data,1" form:"data" json:"data" query:"data"` - // 游标,为空表示没有下一页了, 翻页时带上这个字段 + // Cursor, empty means there is no next page, bring this field when turning the page Cursor string `thrift:"cursor,2" form:"cursor" json:"cursor" query:"cursor"` 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"` @@ -60858,9 +60858,9 @@ func (p *ListProjectConversationResponse) String() string { // suggest type SuggestReplyInfo struct { - // 对应 Coze Auto-Suggestion + // Coze Auto-Suggestion SuggestReplyMode *SuggestReplyInfoMode `thrift:"SuggestReplyMode,1,optional" json:"suggest_reply_mode" form:"SuggestReplyMode" query:"SuggestReplyMode"` - // 用户自定义建议问题 + // user-defined suggestion questions CustomizedSuggestPrompt *string `thrift:"CustomizedSuggestPrompt,2,optional" json:"customized_suggest_prompt" form:"CustomizedSuggestPrompt" query:"CustomizedSuggestPrompt"` } @@ -61067,11 +61067,11 @@ func (p *SuggestReplyInfo) String() string { } type OnboardingInfo struct { - // markdown 格式 + // Markdown format Prologue string `thrift:"Prologue,1" json:"prologue" form:"Prologue" query:"Prologue"` - // 问题列表 + // List of questions SuggestedQuestions []string `thrift:"SuggestedQuestions,2,optional" json:"suggested_questions" form:"SuggestedQuestions" query:"SuggestedQuestions"` - // 是否显示所有建议问题 + // Whether to display all suggested questions DisplayAllSuggestions *bool `thrift:"DisplayAllSuggestions,3,optional" json:"display_all_suggestions" form:"DisplayAllSuggestions" query:"DisplayAllSuggestions"` } @@ -61342,7 +61342,7 @@ func (p *OnboardingInfo) String() string { type VoiceConfig struct { VoiceName string `thrift:"VoiceName,1" json:"voice_name" form:"VoiceName" query:"VoiceName"` - // 音色ID + // timbre ID VoiceID string `thrift:"VoiceID,2" json:"voice_id" form:"VoiceID" query:"VoiceID"` } @@ -61526,11 +61526,11 @@ func (p *VoiceConfig) String() string { } type AudioConfig struct { - //key为语言 "zh", "en" "ja" "es" "id" "pt" + //Key for language "zh", "en" "ja" "es" "id" "pt" VoiceConfigMap map[string]*VoiceConfig `thrift:"VoiceConfigMap,1,optional" json:"voice_config_map" form:"VoiceConfigMap" query:"VoiceConfigMap"` - // 文本转语音开关 + // Text to speech switch IsTextToVoiceEnable bool `thrift:"IsTextToVoiceEnable,3" json:"is_text_to_voice_enable" form:"IsTextToVoiceEnable" query:"IsTextToVoiceEnable"` - // 智能体消息形式 + // agent message form AgentMessageType InputMode `thrift:"AgentMessageType,4" json:"agent_message_type" form:"AgentMessageType" query:"AgentMessageType"` } @@ -61798,9 +61798,9 @@ func (p *AudioConfig) String() string { } type UserInputConfig struct { - // 默认输入方式 + // Default input method DefaultInputMode InputMode `thrift:"DefaultInputMode,1" json:"default_input_mode" form:"DefaultInputMode" query:"DefaultInputMode"` - // 用户语音消息发送形式 + // User voice message sending form SendVoiceMode SendVoiceMode `thrift:"SendVoiceMode,2" json:"send_voice_mode" form:"SendVoiceMode" query:"SendVoiceMode"` } @@ -62508,16 +62508,16 @@ func (p *CanvasPosition) String() string { } type BackgroundImageDetail struct { - // 原始图片 + // original image OriginImageUri *string `thrift:"OriginImageUri,1,optional" json:"origin_image_uri" form:"OriginImageUri" query:"OriginImageUri"` OriginImageUrl *string `thrift:"OriginImageUrl,2,optional" json:"origin_image_url" form:"OriginImageUrl" query:"OriginImageUrl"` - // 实际使用图片 + // Actual use of pictures ImageUri *string `thrift:"ImageUri,3,optional" json:"image_uri" form:"ImageUri" query:"ImageUri"` ImageUrl *string `thrift:"ImageUrl,4,optional" json:"image_url" form:"ImageUrl" query:"ImageUrl"` ThemeColor *string `thrift:"ThemeColor,5,optional" json:"theme_color" form:"ThemeColor" query:"ThemeColor"` - // 渐变位置 + // Gradual change of position GradientPosition *GradientPosition `thrift:"GradientPosition,6,optional" json:"gradient_position" form:"GradientPosition" query:"GradientPosition"` - // 裁剪画布位置 + // Crop canvas position CanvasPosition *CanvasPosition `thrift:"CanvasPosition,7,optional" json:"canvas_position" form:"CanvasPosition" query:"CanvasPosition"` } @@ -62992,9 +62992,9 @@ func (p *BackgroundImageDetail) String() string { } type BackgroundImageInfo struct { - // web端背景图 + // Web background cover WebBackgroundImage *BackgroundImageDetail `thrift:"WebBackgroundImage,1,optional" json:"web_background_image" form:"WebBackgroundImage" query:"WebBackgroundImage"` - // 移动端背景图 + // Mobile end background cover MobileBackgroundImage *BackgroundImageDetail `thrift:"MobileBackgroundImage,2,optional" json:"mobile_background_image" form:"MobileBackgroundImage" query:"MobileBackgroundImage"` } @@ -63380,25 +63380,25 @@ func (p *AvatarConfig) String() string { type ChatFlowRole struct { ID string `thrift:"ID,1" json:"id" form:"ID" query:"ID"` WorkflowID string `thrift:"WorkflowID,2" json:"workflow_id" form:"WorkflowID" query:"WorkflowID"` - // 渠道ID + // Channel ID ConnectorID string `thrift:"ConnectorID,3" json:"connector_id" form:"ConnectorID" query:"ConnectorID"` - // 角色头像 + // avatar Avatar *AvatarConfig `thrift:"Avatar,4,optional" json:"avatar" form:"Avatar" query:"Avatar"` - // 角色描述 + // Role Description Description *string `thrift:"Description,5,optional" json:"description" form:"Description" query:"Description"` - // 开场白 + // opening statement OnboardingInfo *OnboardingInfo `thrift:"OnboardingInfo,6,optional" json:"onboarding_info" form:"OnboardingInfo" query:"OnboardingInfo"` - // 角色名称 + // role name Name *string `thrift:"Name,7,optional" json:"name" form:"Name" query:"Name"` - // 用户问题建议 + // User Question Suggestions SuggestReplyInfo *SuggestReplyInfo `thrift:"SuggestReplyInfo,8,optional" json:"suggest_reply_info" form:"SuggestReplyInfo" query:"SuggestReplyInfo"` - // 背景图 + // background cover BackgroundImageInfo *BackgroundImageInfo `thrift:"BackgroundImageInfo,9,optional" json:"background_image_info" form:"BackgroundImageInfo" query:"BackgroundImageInfo"` - // 语音配置:音色、电话等 + // Voice configuration: tone, phone, etc AudioConfig *AudioConfig `thrift:"AudioConfig,10,optional" json:"audio_config" form:"AudioConfig" query:"AudioConfig"` - // 用户输入方式 + // user input method UserInputConfig *UserInputConfig `thrift:"UserInputConfig,11,optional" json:"user_input_config" form:"UserInputConfig" query:"UserInputConfig"` - // 项目版本 + // project version ProjectVersion *string `thrift:"ProjectVersion,12,optional" json:"project_version" form:"ProjectVersion" query:"ProjectVersion"` } @@ -64301,7 +64301,7 @@ func (p *CreateChatFlowRoleRequest) String() string { } type CreateChatFlowRoleResponse struct { - // 数据库中ID + // ID in the database ID string `thrift:"ID,1" form:"ID" json:"ID" query:"ID"` BaseResp *base.BaseResp `thrift:"BaseResp,255,required" form:"BaseResp,required" json:"BaseResp,required" query:"BaseResp,required"` } @@ -64502,7 +64502,7 @@ func (p *CreateChatFlowRoleResponse) String() string { type DeleteChatFlowRoleRequest struct { WorkflowID string `thrift:"WorkflowID,1" form:"WorkflowID" json:"WorkflowID" query:"WorkflowID"` ConnectorID string `thrift:"ConnectorID,2" form:"ConnectorID" json:"ConnectorID" query:"ConnectorID"` - // 数据库中ID + // ID in the database ID string `thrift:"ID,4" form:"ID" json:"ID" query:"ID"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -65510,15 +65510,15 @@ func (p *GetChatFlowRoleResponse) String() string { } type NodePanelSearchRequest struct { - // 搜索的数据类型,传空、不传或者传All表示搜索所有类型 + // The data type of the search, pass empty, do not pass, or pass All means search for all types SearchType NodePanelSearchType `thrift:"search_type,1" form:"search_type" json:"search_type" query:"search_type"` SpaceID string `thrift:"space_id,2" form:"space_id" json:"space_id" query:"space_id"` ProjectID *string `thrift:"project_id,3,optional" form:"project_id" json:"project_id,omitempty" query:"project_id"` SearchKey string `thrift:"search_key,4" form:"search_key" json:"search_key" query:"search_key"` - // 首次请求时值为"", 底层实现时根据数据源的分页模式转换成page or cursor + // The value is "" on the first request, and the underlying implementation is converted to a page or cursor according to the paging mode of the data source PageOrCursor string `thrift:"page_or_cursor,5" form:"page_or_cursor" json:"page_or_cursor" query:"page_or_cursor"` PageSize int32 `thrift:"page_size,6" form:"page_size" json:"page_size" query:"page_size"` - // 排除的workflow_id,用于搜索workflow时排除当前workflow的id + // Excluded workflow_id, used to exclude the id of the current workflow when searching for workflow ExcludeWorkflowID string `thrift:"exclude_workflow_id,7" form:"exclude_workflow_id" json:"exclude_workflow_id" query:"exclude_workflow_id"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -65987,7 +65987,7 @@ func (p *NodePanelSearchRequest) String() string { type NodePanelWorkflowData struct { WorkflowList []*Workflow `thrift:"workflow_list,1" form:"workflow_list" json:"workflow_list" query:"workflow_list"` - // 由于workflow的查询使用都是page+size,这里返回 page+1 + // Since the query of workflow is all page + size, page + 1 is returned here. NextPageOrCursor string `thrift:"next_page_or_cursor,2" form:"next_page_or_cursor" json:"next_page_or_cursor" query:"next_page_or_cursor"` HasMore bool `thrift:"has_more,3" form:"has_more" json:"has_more" query:"has_more"` } @@ -66850,7 +66850,7 @@ func (p *NodePanelPlugin) String() string { type NodePanelPluginData struct { PluginList []*NodePanelPlugin `thrift:"plugin_list,1" form:"plugin_list" json:"plugin_list" query:"plugin_list"` - // 数据源为page+size的,这里返回 page+1;数据源为cursor模式的,这里返回数据源返回的cursor + // If the data source is page + size, return page + 1 here; if the data source is cursor mode, return the cursor returned by the data source here NextPageOrCursor string `thrift:"next_page_or_cursor,2" form:"next_page_or_cursor" json:"next_page_or_cursor" query:"next_page_or_cursor"` HasMore bool `thrift:"has_more,3" form:"has_more" json:"has_more" query:"has_more"` } @@ -67820,9 +67820,9 @@ func (p *NodePanelSearchResponse) String() string { type ListPublishWorkflowRequest struct { SpaceID int64 `thrift:"space_id,2,required" form:"space_id,required" json:"space_id,string,required" query:"space_id,required"` - //筛选项 + //filter OwnerID *int64 `thrift:"owner_id,3,optional" form:"owner_id" json:"owner_id,string,omitempty" query:"owner_id"` - //搜索项:智能体or作者name + //Search term: agent or author name Name *string `thrift:"name,4,optional" form:"name" json:"name,omitempty" query:"name"` OrderLastPublishTime *OrderByType `thrift:"order_last_publish_time,5,optional" form:"order_last_publish_time" json:"order_last_publish_time,omitempty" query:"order_last_publish_time"` OrderTotalToken *OrderByType `thrift:"order_total_token,6,optional" form:"order_total_token" json:"order_total_token,omitempty" query:"order_total_token"` @@ -68431,12 +68431,12 @@ func (p *ListPublishWorkflowRequest) String() string { } type PublishBasicWorkflowData struct { - //最近发布项目的信息 + //Information on recently released projects BasicInfo *WorkflowBasicInfo `thrift:"basic_info,1" form:"basic_info" json:"basic_info" query:"basic_info"` UserInfo *UserInfo `thrift:"user_info,2" form:"user_info" json:"user_info" query:"user_info"` - //已发布渠道聚合 + //Published channel aggregation Connectors []*ConnectorInfo `thrift:"connectors,3" form:"connectors" json:"connectors" query:"connectors"` - //截止昨天总token消耗 + //Total token consumption as of yesterday TotalToken string `thrift:"total_token,4" form:"total_token" json:"total_token" query:"total_token"` } @@ -71063,15 +71063,15 @@ type OpenAPIRunFlowRequest struct { Ext map[string]string `thrift:"Ext,3" json:"ext" form:"Ext" query:"Ext"` BotID *string `thrift:"BotID,4,optional" json:"bot_id" form:"BotID" query:"BotID"` IsAsync *bool `thrift:"IsAsync,5,optional" json:"is_async" form:"IsAsync" query:"IsAsync"` - // 默认为正式运行,试运行需要传入"DEBUG" + // Default to official run, practice run needs to pass in "DEBUG" ExecuteMode *string `thrift:"ExecuteMode,6,optional" json:"execute_mode" form:"ExecuteMode" query:"ExecuteMode"` - // 版本号,可能是workflow版本或者project版本 + // Version number, maybe workflow version or project version Version *string `thrift:"Version,7,optional" json:"version" form:"Version" query:"Version"` - // 渠道ID,比如ui builder、template、商店等 + // Channel ID, such as ui builder, template, store, etc ConnectorID *string `thrift:"ConnectorID,8,optional" json:"connector_id" form:"ConnectorID" query:"ConnectorID"` - // 引用workflow 的应用ID + // App ID referencing workflow AppID *string `thrift:"AppID,9,optional" json:"app_id" form:"AppID" query:"AppID"` - // 项目ID,为了兼容ui builder + // Project ID, for compatibility with UI builder ProjectID *string `thrift:"ProjectID,10,optional" json:"project_id" form:"ProjectID" query:"ProjectID"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -71777,16 +71777,16 @@ func (p *OpenAPIRunFlowRequest) String() string { } type OpenAPIRunFlowResponse struct { - // 通用字段 + // generic field Code int64 `thrift:"Code,1,required" json:"code" form:"Code,required" query:"Code,required"` - // 成功为success, 失败为简单的错误信息、 + // Success for success, failure for simple error messages, Msg *string `thrift:"Msg,2,optional" json:"msg" form:"Msg" query:"Msg"` - // 同步返回字段 + // Synchronized return field Data *string `thrift:"Data,3,optional" json:"data" form:"Data" query:"Data"` Token *int64 `thrift:"Token,4,optional" json:"token" form:"Token" query:"Token"` Cost *string `thrift:"Cost,5,optional" json:"cost" form:"Cost" query:"Cost"` DebugUrl *string `thrift:"DebugUrl,6,optional" json:"debug_url" form:"DebugUrl" query:"DebugUrl"` - // 异步返回字段 + // asynchronous return field ExecuteID *string `thrift:"ExecuteID,50,optional" json:"execute_id" form:"ExecuteID" query:"ExecuteID"` BaseResp *base.BaseResp `thrift:"BaseResp,255,required" form:"BaseResp,required" json:"BaseResp,required" query:"BaseResp,required"` } @@ -72551,32 +72551,32 @@ func (p *Interrupt) String() string { } type OpenAPIStreamRunFlowResponse struct { - // 绝对序号 + // absolute serial number ID string `thrift:"id,1" form:"id" json:"id" query:"id"` - // 事件类型:message,done,error + // Event type: message, done, error Event string `thrift:"Event,2" json:"event" form:"Event" query:"Event"` - // 节点信息 + // Node information NodeSeqID *string `thrift:"NodeSeqID,50,optional" json:"node_seq_id" form:"NodeSeqID" query:"NodeSeqID"` - // 节点名称 + // Node name NodeTitle *string `thrift:"NodeTitle,52,optional" json:"node_title" form:"NodeTitle" query:"NodeTitle"` - // ContentType为Text时的返回 + // Return when ContentType is Text Content *string `thrift:"Content,54,optional" json:"content" form:"Content" query:"Content"` - // 节点是否执行完成 + // Has the node completed execution? NodeIsFinish *bool `thrift:"NodeIsFinish,55,optional" json:"node_is_finish" form:"NodeIsFinish" query:"NodeIsFinish"` - //content type为interrupt时传输,中断协议 + //Transmission when content type is interrupt, interrupt protocol InterruptData *Interrupt `thrift:"InterruptData,56,optional" json:"interrupt_data" form:"InterruptData" query:"InterruptData"` - // 返回的数据类型 + // Data type returned ContentType *string `thrift:"ContentType,57,optional" json:"content_type" form:"ContentType" query:"ContentType"` - // Content Type为Card时返回的卡片内容 + // Card Content Returned when Content Type is Card CardBody *string `thrift:"CardBody,58,optional" json:"card_body" form:"CardBody" query:"CardBody"` - // 节点类型 + // Node type NodeType *string `thrift:"NodeType,59,optional" json:"node_type" form:"NodeType" query:"NodeType"` NodeID *string `thrift:"NodeID,60,optional" json:"node_id" form:"NodeID" query:"NodeID"` - // 成功时最后一条消息 + // Last message on success Ext map[string]string `thrift:"Ext,100,optional" json:"ext" form:"Ext" query:"Ext"` Token *int64 `thrift:"Token,101,optional" json:"token" form:"Token" query:"Token"` Cost *string `thrift:"Cost,102,optional" json:"cost" form:"Cost" query:"Cost"` - // 错误信息 + // error message ErrorCode *int64 `thrift:"ErrorCode,151,optional" json:"error_code" form:"ErrorCode" query:"ErrorCode"` ErrorMessage *string `thrift:"ErrorMessage,152,optional" json:"error_message" form:"ErrorMessage" query:"ErrorMessage"` DebugUrl *string `thrift:"DebugUrl,153,optional" json:"debug_url" form:"DebugUrl" query:"DebugUrl"` @@ -73677,7 +73677,7 @@ type OpenAPIStreamResumeFlowRequest struct { ResumeData string `thrift:"ResumeData,3" json:"resume_data" form:"ResumeData" query:"ResumeData"` Ext map[string]string `thrift:"Ext,4" json:"ext" form:"Ext" query:"Ext"` WorkflowID string `thrift:"WorkflowID,5" json:"workflow_id" form:"WorkflowID" query:"WorkflowID"` - // 渠道ID,比如ui builder、template、商店等 + // Channel ID, such as ui builder, template, store, etc ConnectorID *string `thrift:"ConnectorID,6,optional" json:"connector_id" form:"ConnectorID" query:"ConnectorID"` Base *base.Base `thrift:"Base,255" form:"Base" json:"Base" query:"Base"` } @@ -74394,14 +74394,14 @@ type WorkflowExecuteHistory struct { CreateTime *int64 `thrift:"CreateTime,8,optional" json:"create_time" form:"CreateTime" query:"CreateTime"` UpdateTime *int64 `thrift:"UpdateTime,9,optional" json:"update_time" form:"UpdateTime" query:"UpdateTime"` DebugUrl *string `thrift:"DebugUrl,10,optional" json:"debug_url" form:"DebugUrl" query:"DebugUrl"` - // 执行成功 + // successful execution Input *string `thrift:"Input,51,optional" json:"input" form:"Input" query:"Input"` Output *string `thrift:"Output,52,optional" json:"output" form:"Output" query:"Output"` Token *int64 `thrift:"Token,53,optional" json:"token" form:"Token" query:"Token"` Cost *string `thrift:"Cost,54,optional" json:"cost" form:"Cost" query:"Cost"` CostUnit *string `thrift:"CostUnit,55,optional" json:"cost_unit" form:"CostUnit" query:"CostUnit"` Ext map[string]string `thrift:"Ext,56,optional" json:"ext" form:"Ext" query:"Ext"` - // 执行失败 + // execution failed ErrorCode *string `thrift:"ErrorCode,101,optional" json:"error_code" form:"ErrorCode" query:"ErrorCode"` ErrorMsg *string `thrift:"ErrorMsg,102,optional" json:"error_msg" form:"ErrorMsg" query:"ErrorMsg"` } @@ -75860,7 +75860,7 @@ func (p *GetWorkflowRunHistoryResponse) String() string { type EnterMessage struct { Role string `thrift:"Role,1,required" json:"role" form:"Role,required" query:"Role,required"` - // 内容 + // content Content string `thrift:"Content,2" json:"content" form:"Content" query:"Content"` MetaData map[string]string `thrift:"MetaData,3" json:"meta_data" form:"MetaData" query:"MetaData"` //text/card/object_string @@ -76221,20 +76221,20 @@ type ChatFlowRunRequest struct { Parameters *string `thrift:"Parameters,2,optional" json:"parameters" form:"Parameters" query:"Parameters"` Ext map[string]string `thrift:"Ext,3" json:"ext" form:"Ext" query:"Ext"` BotID *string `thrift:"BotID,4,optional" json:"bot_id" form:"BotID" query:"BotID"` - // 默认为正式运行,试运行需要传入"DEBUG" + // Default to official run, practice run needs to pass in "DEBUG" ExecuteMode *string `thrift:"ExecuteMode,6,optional" json:"execute_mode" form:"ExecuteMode" query:"ExecuteMode"` - // 版本号,可能是workflow版本或者project版本 + // Version number, maybe workflow version or project version Version *string `thrift:"Version,7,optional" json:"version" form:"Version" query:"Version"` - // 渠道ID,比如ui builder、template、商店等 + // Channel ID, such as ui builder, template, store, etc ConnectorID *string `thrift:"ConnectorID,8,optional" json:"connector_id" form:"ConnectorID" query:"ConnectorID"` AppID *string `thrift:"AppID,9,optional" json:"app_id" form:"AppID" query:"AppID"` - // 会话ID + // Session ID ConversationID *string `thrift:"ConversationID,10,optional" json:"conversation_id" form:"ConversationID" query:"ConversationID"` - // 用户希望先写入的消息 + // The message that the user wants to write first AdditionalMessages []*EnterMessage `thrift:"AdditionalMessages,11,optional" json:"additional_messages" form:"additional_messages" ` - // 项目ID,为了兼容ui builder + // Project ID, for compatibility with UI builder ProjectID *string `thrift:"ProjectID,12,optional" json:"project_id" form:"ProjectID" query:"ProjectID"` - // 建议回复信息 + // Suggested reply message SuggestReplyInfo *SuggestReplyInfo `thrift:"SuggestReplyInfo,13,optional" json:"suggest_reply_info" form:"suggest_reply_info" ` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -77067,14 +77067,14 @@ func (p *ChatFlowRunRequest) String() string { } type ChatFlowRunResponse struct { - // 事件类型 + // event type Event string `thrift:"Event,1" json:"event" form:"Event" query:"Event"` - // msg、error等数据,为了对齐不同的消息类型,使用json序列化 + // Msg, error and other data, in order to align different message types, use json serialization Data string `thrift:"Data,2" json:"data" form:"Data" query:"Data"` - // 2: optional ChatFlowMessageDetail MessageData (api.body = "message_data") // 消息内容 - // 3: optional ChatFlowChatDetail ChatData (api.body = "chat_data") // 对话内容 - // 4: optional LastError ErrorData (api.body = "error_data") // 错误信息 - // 5:optional string DoneMsg (api.body = "done_msg") // 结束信息 + // 2: optional ChatFlowMessageDetail MessageData (api.body = "message_data")//Message content + // 3: optional ChatFlowChatDetail ChatData (api.body = "chat_data")//dialogue content + // 4: optional LastError ErrorData (api.body = "error_data")//Error message + // 5: optional string DoneMsg (api.body = "done_msg")//end information BaseResp *base.BaseResp `thrift:"BaseResp,255,required" form:"BaseResp,required" json:"BaseResp,required" query:"BaseResp,required"` } @@ -77802,7 +77802,7 @@ func (p *WorkflowInfo) String() string { } type OpenAPIGetWorkflowInfoResponse struct { - // 适配api + // API adaptation Code *int32 `thrift:"Code,1,optional" form:"code" json:"code,omitempty"` Msg *string `thrift:"Msg,2,optional" form:"msg" json:"msg,omitempty"` WorkflowInfo *WorkflowInfo `thrift:"WorkflowInfo,3,optional" form:"data" json:"data,omitempty"` diff --git a/backend/api/model/passport/passport.go b/backend/api/model/passport/passport.go index 25db9a30..3da683bd 100644 --- a/backend/api/model/passport/passport.go +++ b/backend/api/model/passport/passport.go @@ -156,7 +156,7 @@ func (p *AppUserInfo) String() string { } type User struct { - // 与原接口字段名对齐 + // Align with the original interface field name UserIDStr int64 `thrift:"user_id_str,1,required" form:"user_id_str,required" json:"user_id_str,string,required" query:"user_id_str,required"` Name string `thrift:"name,2,required" form:"name,required" json:"name,required" query:"name,required"` UserUniqueName string `thrift:"user_unique_name,3,required" form:"user_unique_name,required" json:"user_unique_name,required" query:"user_unique_name,required"` @@ -3848,15 +3848,15 @@ func (p *UserUpdateProfileResponse) String() string { } type PassportService interface { - // 邮箱密码注册 + // Email password registration PassportWebEmailRegisterV2Post(ctx context.Context, req *PassportWebEmailRegisterV2PostRequest) (r *PassportWebEmailRegisterV2PostResponse, err error) - // 退出登录 + // log out PassportWebLogoutGet(ctx context.Context, req *PassportWebLogoutGetRequest) (r *PassportWebLogoutGetResponse, err error) - // 邮箱帐密登录 + // Email account password login PassportWebEmailLoginPost(ctx context.Context, req *PassportWebEmailLoginPostRequest) (r *PassportWebEmailLoginPostResponse, err error) - // 通过邮箱重置密码 + // Reset password via email PassportWebEmailPasswordResetGet(ctx context.Context, req *PassportWebEmailPasswordResetGetRequest) (r *PassportWebEmailPasswordResetGetResponse, err error) - // 账号信息 + // account information PassportAccountInfoV2(ctx context.Context, req *PassportAccountInfoV2Request) (r *PassportAccountInfoV2Response, err error) UserUpdateAvatar(ctx context.Context, req *UserUpdateAvatarRequest) (r *UserUpdateAvatarResponse, err error) diff --git a/backend/api/model/permission/openapiauth/openapiauth.go b/backend/api/model/permission/openapiauth/openapiauth.go index 10e5c292..a970f15e 100644 --- a/backend/api/model/permission/openapiauth/openapiauth.go +++ b/backend/api/model/permission/openapiauth/openapiauth.go @@ -26,11 +26,11 @@ type PatSearchOption = string type UserStatus = string type CreatePersonalAccessTokenAndPermissionRequest struct { - // PAT名称 + // PAT name Name string `thrift:"name,1,required" form:"name,required" json:"name,required" query:"name,required"` - // PAT自定义过期时间 + // PAT custom expiration time ExpireAt int64 `thrift:"expire_at,2" form:"expire_at" json:"expire_at" query:"expire_at"` - // PAT用户枚举过期时间 1、30、60、90、180、365、permanent + // PAT user enumeration expiration time 1, 30, 60, 90, 180, 365, permanent DurationDay string `thrift:"duration_day,3" form:"duration_day" json:"duration_day" query:"duration_day"` // organization id OrganizationID string `thrift:"organization_id,4" form:"organization_id" json:"organization_id" query:"organization_id"` @@ -316,9 +316,9 @@ type PersonalAccessToken struct { Name string `thrift:"name,2,required" form:"name,required" json:"name,required" query:"name,required"` CreatedAt int64 `thrift:"created_at,3,required" form:"created_at,required" json:"created_at,required" query:"created_at,required"` UpdatedAt int64 `thrift:"updated_at,4,required" form:"updated_at,required" json:"updated_at,required" query:"updated_at,required"` - // -1 表示未使用 + // -1 means unused LastUsedAt int64 `thrift:"last_used_at,5,required" form:"last_used_at,required" json:"last_used_at,required" query:"last_used_at,required"` - // -1 表示无限期 + // -1 means indefinite ExpireAt int64 `thrift:"expire_at,6,required" form:"expire_at,required" json:"expire_at,required" query:"expire_at,required"` } @@ -722,7 +722,7 @@ func (p *PersonalAccessToken) String() string { type CreatePersonalAccessTokenAndPermissionResponseData struct { PersonalAccessToken *PersonalAccessToken `thrift:"personal_access_token,1,required" form:"personal_access_token,required" json:"personal_access_token,required" query:"personal_access_token,required"` - // PAT token 明文 + // PAT token plaintext Token string `thrift:"token,2,required" form:"token,required" json:"token,required" query:"token,required"` } @@ -1510,9 +1510,9 @@ type PersonalAccessTokenWithCreatorInfo struct { Name string `thrift:"name,2,required" form:"name,required" json:"name,required" query:"name,required"` CreatedAt int64 `thrift:"created_at,3,required" form:"created_at,required" json:"created_at,required" query:"created_at,required"` UpdatedAt int64 `thrift:"updated_at,4,required" form:"updated_at,required" json:"updated_at,required" query:"updated_at,required"` - // -1 表示未使用 + // -1 means unused LastUsedAt int64 `thrift:"last_used_at,5,required" form:"last_used_at,required" json:"last_used_at,required" query:"last_used_at,required"` - // -1 表示无限期 + // -1 means indefinite ExpireAt int64 `thrift:"expire_at,6,required" form:"expire_at,required" json:"expire_at,required" query:"expire_at,required"` CreatorName string `thrift:"creator_name,7" form:"creator_name" json:"creator_name" query:"creator_name"` CreatorUniqueName string `thrift:"creator_unique_name,8" form:"creator_unique_name" json:"creator_unique_name" query:"creator_unique_name"` @@ -2442,9 +2442,9 @@ func (p *ListPersonalAccessTokensResponse) String() string { } type ListPersonalAccessTokensResponseData struct { - // PAT 列表 + // PAT list PersonalAccessTokens []*PersonalAccessTokenWithCreatorInfo `thrift:"personal_access_tokens,1,required" form:"personal_access_tokens,required" json:"personal_access_tokens,required" query:"personal_access_tokens,required"` - // 是否还有更多数据 + // Is there any more data? HasMore bool `thrift:"has_more,2" form:"has_more" json:"has_more" query:"has_more"` } @@ -3563,7 +3563,7 @@ func (p *GetPersonalAccessTokenAndPermissionResponse) String() string { type UpdatePersonalAccessTokenAndPermissionRequest struct { // PAT Id ID int64 `thrift:"id,1,required" form:"id,required" json:"id,string,required" query:"id,required"` - // PAT 名称 + // PAT name Name string `thrift:"name,2" form:"name" json:"name" query:"name"` } diff --git a/backend/api/model/plugin_develop_common/plugin_develop_common.go b/backend/api/model/plugin_develop_common/plugin_develop_common.go index 88d327ad..13cb180a 100644 --- a/backend/api/model/plugin_develop_common/plugin_develop_common.go +++ b/backend/api/model/plugin_develop_common/plugin_develop_common.go @@ -150,7 +150,7 @@ func (p *ParameterLocation) Value() (driver.Value, error) { return int64(*p), nil } -// plugin枚举值 +// plugin enumeration value type PluginParamTypeFormat int64 const ( @@ -394,13 +394,13 @@ func (p *ParameterType) Value() (driver.Value, error) { return int64(*p), nil } -// 默认入参的设置来源 +// Default imported parameter settings source type DefaultParamSource int64 const ( - // 默认用户输入 + // default user input DefaultParamSource_Input DefaultParamSource = 0 - // 引用变量 + // reference variable DefaultParamSource_Variable DefaultParamSource = 1 ) @@ -439,7 +439,7 @@ func (p *DefaultParamSource) Value() (driver.Value, error) { return int64(*p), nil } -// 针对File类型参数的细分类型 +// Subdivision types for File type parameters type AssistParameterType int64 const ( @@ -453,7 +453,7 @@ const ( AssistParameterType_AUDIO AssistParameterType = 8 AssistParameterType_ZIP AssistParameterType = 9 AssistParameterType_VIDEO AssistParameterType = 10 - // 语音 + // voice AssistParameterType_VOICE AssistParameterType = 12 ) @@ -531,11 +531,11 @@ func (p *AssistParameterType) Value() (driver.Value, error) { type PluginToolAuthType int64 const ( - // 强授权 + // strong authorization PluginToolAuthType_Required PluginToolAuthType = 0 - // 半匿名授权 + // semi-anonymous authorization PluginToolAuthType_Supported PluginToolAuthType = 1 - // 不授权 + // not authorized PluginToolAuthType_Disable PluginToolAuthType = 2 ) @@ -582,9 +582,9 @@ type PluginCardStatus int64 const ( PluginCardStatus_Latest PluginCardStatus = 1 - // 主卡片版本有升级 + // The main card version has been upgraded. PluginCardStatus_NeedUpdate PluginCardStatus = 2 - // 插件工具出参不匹配 + // Plugin tool exported parameters do not match PluginCardStatus_ParamMisMatch PluginCardStatus = 3 ) @@ -697,9 +697,9 @@ const ( PluginStatus_PREPARED PluginStatus = 3 PluginStatus_PUBLISHED PluginStatus = 4 PluginStatus_OFFLINE PluginStatus = 5 - // 默认值 + // default value PluginStatus_Draft PluginStatus = 0 - // 禁用 + // disable PluginStatus_BANNED PluginStatus = 6 ) @@ -934,13 +934,13 @@ func (p *APIListOrderBy) Value() (driver.Value, error) { type SpaceRoleType int64 const ( - // 默认 + // default SpaceRoleType_Default SpaceRoleType = 0 // owner SpaceRoleType_Owner SpaceRoleType = 1 - // 管理员 + // administrator SpaceRoleType_Admin SpaceRoleType = 2 - // 普通成员 + // ordinary member SpaceRoleType_Member SpaceRoleType = 3 ) @@ -1224,9 +1224,9 @@ func (p *PluginReferrerScene) Value() (driver.Value, error) { type WorkflowResponseMode int64 const ( - // 模型总结 + // model summary WorkflowResponseMode_UseLLM WorkflowResponseMode = 0 - // 不使用模型总结 + // Do not use model summaries WorkflowResponseMode_SkipLLM WorkflowResponseMode = 1 ) @@ -1265,7 +1265,7 @@ func (p *WorkflowResponseMode) Value() (driver.Value, error) { return int64(*p), nil } -// 授权状态 +// authorization status type OAuthStatus int64 const ( @@ -1311,9 +1311,9 @@ func (p *OAuthStatus) Value() (driver.Value, error) { type DebugOperation int64 const ( - // 调试,会保存调试状态,会校验返回值 + // Debugging, the debugging state will be saved, and the return value will be checked. DebugOperation_Debug DebugOperation = 1 - // 仅解析返回值结构 + // Parse only the return value structure DebugOperation_Parse DebugOperation = 2 ) @@ -1355,9 +1355,9 @@ func (p *DebugOperation) Value() (driver.Value, error) { type ScopeType int64 const ( - // 所有 + // all ScopeType_All ScopeType = 0 - // 自己 + // self ScopeType_Self ScopeType = 1 ) @@ -1451,11 +1451,11 @@ func (p *OrderBy) Value() (driver.Value, error) { type PluginTypeForFilter int64 const ( - // 包含PLUGIN和APP + // Includes PLUGIN and APP. PluginTypeForFilter_CloudPlugin PluginTypeForFilter = 1 - // 包含LOCAL + // Include LOCAL PluginTypeForFilter_LocalPlugin PluginTypeForFilter = 2 - // 包含WORKFLOW和IMAGEFLOW + // Includes WORKFLOW and IMAGEFLOW PluginTypeForFilter_WorkflowPlugin PluginTypeForFilter = 3 ) @@ -2514,31 +2514,31 @@ func (p *UserLabel) String() string { } type PluginMetaInfo struct { - // 插件名 + // plugin name Name string `thrift:"name,1" form:"name" json:"name" query:"name"` - // 插件描述 + // Plugin description Desc string `thrift:"desc,2" form:"desc" json:"desc" query:"desc"` - // 插件服务地址前缀 + // Plugin service address prefix URL string `thrift:"url,3" form:"url" json:"url" query:"url"` - // 插件图标 + // plugin icon Icon *PluginIcon `thrift:"icon,4" form:"icon" json:"icon" query:"icon"` - // 插件授权类型,0:无授权,1:service,3:oauth + // Plugin authorization type, 0: no authorization, 1: service, 3: oauth AuthType []AuthorizationType `thrift:"auth_type,5" form:"auth_type" json:"auth_type" query:"auth_type"` - // 子授权类型为api/token时,token参数位置 + // When the sub-authorization type is api/token, the token parameter position Location *AuthorizationServiceLocation `thrift:"location,6,optional" form:"location" json:"location,omitempty" query:"location"` - // 子授权类型为api/token时,token参数key + // When the sub-authorization type is api/token, the token parameter key Key *string `thrift:"key,7,optional" form:"key" json:"key,omitempty" query:"key"` - // 子授权类型为api/token时,token参数值 + // When the sub-authorization type is api/token, the token parameter value ServiceToken *string `thrift:"service_token,8,optional" form:"service_token" json:"service_token,omitempty" query:"service_token"` - // 子授权类型为oauth时,oauth信息 + // When the sub-authorization type is oauth, the oauth information OauthInfo *string `thrift:"oauth_info,9,optional" form:"oauth_info" json:"oauth_info,omitempty" query:"oauth_info"` - // 插件公共参数,key为参数位置,value为参数列表 + // Plugin public parameters, key is the parameter position, value is the parameter list CommonParams map[ParameterLocation][]*CommonParamSchema `thrift:"common_params,10,optional" form:"common_params" json:"common_params,omitempty" query:"common_params"` - // 子授权类型,0: api/token of service, 10: client credentials of oauth + // Sub-authorization type, 0: api/token of service, 10: client credentials of oauth SubAuthType *int32 `thrift:"sub_auth_type,11,optional" form:"sub_auth_type" json:"sub_auth_type,omitempty" query:"sub_auth_type"` - // 可忽略 + // negligible AuthPayload *string `thrift:"auth_payload,12,optional" form:"auth_payload" json:"auth_payload,omitempty" query:"auth_payload"` - // 可忽略 + // negligible FixedExportIP bool `thrift:"fixed_export_ip,13" form:"fixed_export_ip" json:"fixed_export_ip" query:"fixed_export_ip"` } @@ -3759,34 +3759,34 @@ type PluginInfoForPlayground struct { ClientID string `thrift:"client_id,10" form:"client_id" json:"client_id" query:"client_id"` ClientSecret string `thrift:"client_secret,11" form:"client_secret" json:"client_secret" query:"client_secret"` PluginApis []*PluginApi `thrift:"plugin_apis,15" form:"plugin_apis" json:"plugin_apis" query:"plugin_apis"` - // 插件标签 + // plugin tag Tag int64 `thrift:"tag,16" form:"tag" json:"tag" query:"tag"` CreateTime string `thrift:"create_time,17" form:"create_time" json:"create_time" query:"create_time"` UpdateTime string `thrift:"update_time,18" form:"update_time" json:"update_time" query:"update_time"` - // 创建人信息 + // creator information Creator *Creator `thrift:"creator,22" form:"creator" json:"creator" query:"creator"` - // 空间id + // Space ID SpaceID string `thrift:"space_id,23" form:"space_id" json:"space_id" query:"space_id"` - // 插件统计数据 + // plugin statistics StatisticData *PluginStatisticData `thrift:"statistic_data,24" form:"statistic_data" json:"statistic_data" query:"statistic_data"` CommonParams map[ParameterLocation][]*CommonParamSchema `thrift:"common_params,25,optional" form:"common_params" json:"common_params,omitempty" query:"common_params"` - // plugin的商品状态 + // Product status of the plugin PluginProductStatus ProductStatus `thrift:"plugin_product_status,26" form:"plugin_product_status" json:"plugin_product_status" query:"plugin_product_status"` - // plugin商品下架类型 + // Plugin product removal type PluginProductUnlistType ProductUnlistType `thrift:"plugin_product_unlist_type,27" form:"plugin_product_unlist_type" json:"plugin_product_unlist_type" query:"plugin_product_unlist_type"` - // 素材id + // Material ID MaterialID string `thrift:"material_id,28" form:"material_id" json:"material_id" query:"material_id"` - // 渠道id + // Channel ID ChannelID int32 `thrift:"channel_id,29" form:"channel_id" json:"channel_id" query:"channel_id"` - // 插件创建方式 + // Plugin creation method CreationMethod CreationMethod `thrift:"creation_method,30" form:"creation_method" json:"creation_method" query:"creation_method"` - // 是否为官方插件 + // Is it an official plugin? IsOfficial bool `thrift:"is_official,31" form:"is_official" json:"is_official" query:"is_official"` - // 项目id + // Project ID ProjectID string `thrift:"project_id,32" form:"project_id" json:"project_id" query:"project_id"` - // 版本号,毫秒时间戳 + // Version number, millisecond timestamp VersionTs string `thrift:"version_ts,33" form:"version_ts" json:"version_ts" query:"version_ts"` - // 版本名称 + // version name VersionName string `thrift:"version_name,34" form:"version_name" json:"version_name" query:"version_name"` } @@ -5125,15 +5125,15 @@ type PluginApi struct { Parameters []*PluginParameter `thrift:"parameters,3" form:"parameters" json:"parameters" query:"parameters"` PluginID string `thrift:"plugin_id,4" form:"plugin_id" json:"plugin_id" query:"plugin_id"` PluginName string `thrift:"plugin_name,5" form:"plugin_name" json:"plugin_name" query:"plugin_name"` - // 序号和playground保持一致 + // The serial number is the same as the playground APIID string `thrift:"api_id,7" form:"api_id" json:"api_id" query:"api_id"` RecordID string `thrift:"record_id,8" form:"record_id" json:"record_id" query:"record_id"` - // 卡片绑定信息,未绑定则为nil + // Card binding information, nil if not bound. CardBindingInfo *PresetCardBindingInfo `thrift:"card_binding_info,9,optional" form:"card_binding_info" json:"card_binding_info,omitempty" query:"card_binding_info"` - // 调试api示例 + // Debug API example DebugExample *DebugExample `thrift:"debug_example,10,optional" form:"debug_example" json:"debug_example,omitempty" query:"debug_example"` FunctionName *string `thrift:"function_name,11,optional" form:"function_name" json:"function_name,omitempty" query:"function_name"` - // 运行模式 + // operating mode RunMode RunMode `thrift:"run_mode,12" form:"run_mode" json:"run_mode" query:"run_mode"` } @@ -5763,12 +5763,12 @@ type Creator struct { ID string `thrift:"id,1" form:"id" json:"id" query:"id"` Name string `thrift:"name,2" form:"name" json:"name" query:"name"` AvatarURL string `thrift:"avatar_url,3" form:"avatar_url" json:"avatar_url" query:"avatar_url"` - // 是否是自己创建的 + // Did you create it yourself? Self bool `thrift:"self,4" form:"self" json:"self" query:"self"` SpaceRolyType SpaceRoleType `thrift:"space_roly_type,5" form:"space_roly_type" json:"space_roly_type" query:"space_roly_type"` - // 用户名 + // user name UserUniqueName string `thrift:"user_unique_name,6" form:"user_unique_name" json:"user_unique_name" query:"user_unique_name"` - // 用户标签 + // user tag UserLabel *UserLabel `thrift:"user_label,7" form:"user_label" json:"user_label" query:"user_label"` } @@ -6367,15 +6367,15 @@ type PluginParameter struct { Required bool `thrift:"required,3" form:"required" json:"required" query:"required"` Type string `thrift:"type,4" form:"type" json:"type" query:"type"` SubParameters []*PluginParameter `thrift:"sub_parameters,5" form:"sub_parameters" json:"sub_parameters" query:"sub_parameters"` - // 如果Type是数组,则有subtype + // If Type is an array, there is a subtype SubType string `thrift:"sub_type,6" form:"sub_type" json:"sub_type" query:"sub_type"` - // 如果入参的值是引用的则有fromNodeId + // fromNodeId if the value of the imported parameter is a reference FromNodeID *string `thrift:"from_node_id,7,optional" form:"from_node_id" json:"from_node_id,omitempty" query:"from_node_id"` - // 具体引用哪个节点的key + // Which node's key is specifically referenced? FromOutput []string `thrift:"from_output,8,optional" form:"from_output" json:"from_output,omitempty" query:"from_output"` - // 如果入参是用户手输 就放这里 + // If the imported parameter is the user's hand input, put it here Value *string `thrift:"value,9,optional" form:"value" json:"value,omitempty" query:"value"` - // 格式化参数 + // Format parameter Format *PluginParamTypeFormat `thrift:"format,10,optional" form:"format" json:"format,omitempty" query:"format"` } @@ -7016,9 +7016,9 @@ type PluginAPIInfo struct { APIExtend *APIExtend `thrift:"api_extend,14" form:"api_extend" json:"api_extend" query:"api_extend"` // ignore CardBindingInfo *PresetCardBindingInfo `thrift:"card_binding_info,15,optional" form:"card_binding_info" json:"card_binding_info,omitempty" query:"card_binding_info"` - // 调试示例 + // Debugging example DebugExample *DebugExample `thrift:"debug_example,16,optional" form:"debug_example" json:"debug_example,omitempty" query:"debug_example"` - // 调试示例状态 + // Debug sample state DebugExampleStatus DebugExampleStatus `thrift:"debug_example_status,17" form:"debug_example_status" json:"debug_example_status" query:"debug_example_status"` // ignore FunctionName string `thrift:"function_name,18" form:"function_name" json:"function_name" query:"function_name"` @@ -7976,7 +7976,7 @@ func (p *PluginAPIInfo) String() string { } type APIParameter struct { - // for前端,无实际意义 + // For the front end, no practical significance ID string `thrift:"id,1" form:"id" json:"id" query:"id"` // parameter name Name string `thrift:"name,2" form:"name" json:"name" query:"name"` @@ -7984,27 +7984,27 @@ type APIParameter struct { Desc string `thrift:"desc,3" form:"desc" json:"desc" query:"desc"` // parameter type Type ParameterType `thrift:"type,4" form:"type" json:"type" query:"type"` - // 可忽略 + // negligible SubType *ParameterType `thrift:"sub_type,5,optional" form:"sub_type" json:"sub_type,omitempty" query:"sub_type"` - // 参数位置 + // parameter location Location ParameterLocation `thrift:"location,6" form:"location" json:"location" query:"location"` - // 是否必填 + // Is it required? IsRequired bool `thrift:"is_required,7" form:"is_required" json:"is_required" query:"is_required"` - // 子参数 + // sub-parameter SubParameters []*APIParameter `thrift:"sub_parameters,8" form:"sub_parameters" json:"sub_parameters" query:"sub_parameters"` - // 全局默认值 + // global default GlobalDefault *string `thrift:"global_default,9,optional" form:"global_default" json:"global_default,omitempty" query:"global_default"` - // 全局是否启用 + // Is it enabled globally? GlobalDisable bool `thrift:"global_disable,10" form:"global_disable" json:"global_disable" query:"global_disable"` - // 智能体内设置的默认值 + // Default value set in the smart body LocalDefault *string `thrift:"local_default,11,optional" form:"local_default" json:"local_default,omitempty" query:"local_default"` - // 智能体内是否启用 + // Is it enabled in the smart body? LocalDisable bool `thrift:"local_disable,12" form:"local_disable" json:"local_disable" query:"local_disable"` - // 可忽略 + // negligible DefaultParamSource *DefaultParamSource `thrift:"default_param_source,13,optional" form:"default_param_source" json:"default_param_source,omitempty" query:"default_param_source"` - // 引用variable的key + // Reference variable key VariableRef *string `thrift:"variable_ref,14,optional" form:"variable_ref" json:"variable_ref,omitempty" query:"variable_ref"` - // 多模态辅助参数类型 + // Multimodal auxiliary parameter types AssistType *AssistParameterType `thrift:"assist_type,15,optional" form:"assist_type" json:"assist_type,omitempty" query:"assist_type"` } @@ -8849,7 +8849,7 @@ func (p *APIParameter) String() string { } type PluginStatisticData struct { - // 为空就不展示 + // If it is empty, it will not be displayed. BotQuote *int32 `thrift:"bot_quote,1,optional" form:"bot_quote" json:"bot_quote,omitempty" query:"bot_quote"` } @@ -9000,7 +9000,7 @@ func (p *PluginStatisticData) String() string { } type APIExtend struct { - // tool维度授权类型 + // Tool dimension authorization type AuthMode PluginToolAuthType `thrift:"auth_mode,1" form:"auth_mode" json:"auth_mode" query:"auth_mode"` } @@ -9139,12 +9139,12 @@ func (p *APIExtend) String() string { } -// 插件预置卡片绑定信息 +// Plugin preset card binding information type PresetCardBindingInfo struct { CardID string `thrift:"card_id,1" form:"card_id" json:"card_id" query:"card_id"` CardVersionNum string `thrift:"card_version_num,2" form:"card_version_num" json:"card_version_num" query:"card_version_num"` Status PluginCardStatus `thrift:"status,3" form:"status" json:"status" query:"status"` - // 缩略图 + // thumbnail Thumbnail string `thrift:"thumbnail,4" form:"thumbnail" json:"thumbnail" query:"thumbnail"` } @@ -10150,11 +10150,11 @@ func (p *GetUserAuthorityData) String() string { } type CheckAndLockPluginEditData struct { - // 是否已被占用 + // Is it occupied? Occupied bool `thrift:"Occupied,1" form:"Occupied" json:"Occupied" query:"Occupied"` - // 如果已经被占用了,返回用户ID + // If it is already occupied, return the user ID. User *Creator `thrift:"user,2" form:"user" json:"user" query:"user"` - // 是否强占成功 + // Was it successful? Seized bool `thrift:"Seized,3" form:"Seized" json:"Seized" query:"Seized"` } @@ -10388,13 +10388,13 @@ func (p *CheckAndLockPluginEditData) String() string { } type PluginPublishInfo struct { - // 发布人 + // publisher PublisherID int64 `thrift:"publisher_id,1" form:"publisher_id" json:"publisher_id,string" query:"publisher_id"` - // 版本,毫秒时间戳 + // Version, millisecond timestamp VersionTs int64 `thrift:"version_ts,2" form:"version_ts" json:"version_ts" query:"version_ts"` - // 版本名称 + // version name VersionName string `thrift:"version_name,3" form:"version_name" json:"version_name" query:"version_name"` - // 版本描述 + // version description VersionDesc string `thrift:"version_desc,4" form:"version_desc" json:"version_desc" query:"version_desc"` } diff --git a/backend/api/model/project/project.go b/backend/api/model/project/project.go index c9071874..b973e3ae 100644 --- a/backend/api/model/project/project.go +++ b/backend/api/model/project/project.go @@ -3,10 +3,10 @@ package project import ( - "github.com/coze-dev/coze-studio/backend/api/model/base" - "github.com/coze-dev/coze-studio/backend/api/model/intelligence/common" "fmt" "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-studio/backend/api/model/base" + "github.com/coze-dev/coze-studio/backend/api/model/intelligence/common" ) type DraftProjectCreateRequest struct { @@ -15,7 +15,7 @@ type DraftProjectCreateRequest struct { Description string `thrift:"description,3" form:"description" json:"description" query:"description"` IconURI string `thrift:"icon_uri,4" form:"icon_uri" json:"icon_uri" query:"icon_uri"` MonetizationConf *MonetizationConf `thrift:"monetization_conf,5,optional" form:"monetization_conf" json:"monetization_conf,omitempty" query:"monetization_conf"` - // 创建来源 navi:导航栏 space:空间 + // Create source navi: navbar space: space CreateFrom *string `thrift:"create_from,6,optional" form:"create_from" json:"create_from,omitempty" query:"create_from"` Base *base.Base `thrift:"Base,255,optional" form:"-" json:"-" query:"-"` } diff --git a/backend/api/model/project_memory/project_memory.go b/backend/api/model/project_memory/project_memory.go index a732f087..4472f267 100644 --- a/backend/api/model/project_memory/project_memory.go +++ b/backend/api/model/project_memory/project_memory.go @@ -3,11 +3,11 @@ package project_memory 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 VariableType int64 @@ -59,7 +59,7 @@ const ( VariableChannel_System VariableChannel = 2 VariableChannel_Location VariableChannel = 3 VariableChannel_Feishu VariableChannel = 4 - // 项目变量 + // project variable VariableChannel_APP VariableChannel = 5 ) @@ -159,9 +159,9 @@ type Variable struct { Channel VariableChannel `thrift:"Channel,4" form:"Channel" json:"Channel" query:"Channel"` Description string `thrift:"Description,5" form:"Description" json:"Description" query:"Description"` Enable bool `thrift:"Enable,6" form:"Enable" json:"Enable" query:"Enable"` - //生效渠道 + //effective channel EffectiveChannelList []string `thrift:"EffectiveChannelList,7,optional" form:"EffectiveChannelList" json:"EffectiveChannelList,omitempty" query:"EffectiveChannelList"` - //新老数据都会有schema,除项目变量外其他默认为string + //New and old data will have schemas, except for project variables, the default is string. Schema string `thrift:"Schema,8" form:"Schema" json:"Schema" query:"Schema"` IsReadOnly bool `thrift:"IsReadOnly,9" form:"IsReadOnly" json:"IsReadOnly" query:"IsReadOnly"` } @@ -2711,7 +2711,7 @@ func (p *GetMemoryVariableMetaReq) String() string { } -// 应该是给workflow用的rpc接口,不需要鉴权,VariableChannel +// It should be the rpc interface for workflow, no authentication is required, VariableChannel type GetMemoryVariableMetaResp struct { VariableMap map[VariableChannel][]*Variable `thrift:"VariableMap,1" form:"VariableMap" json:"VariableMap" query:"VariableMap"` Code int64 `thrift:"code,253,required" form:"code,required" json:"code,required" query:"code,required"` diff --git a/backend/api/model/publish/publish.go b/backend/api/model/publish/publish.go index 9569814f..c9a963e0 100644 --- a/backend/api/model/publish/publish.go +++ b/backend/api/model/publish/publish.go @@ -3,26 +3,26 @@ package publish import ( - "github.com/coze-dev/coze-studio/backend/api/model/base" - "github.com/coze-dev/coze-studio/backend/api/model/intelligence/common" "database/sql" "database/sql/driver" "fmt" "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-studio/backend/api/model/base" + "github.com/coze-dev/coze-studio/backend/api/model/intelligence/common" ) type ConnectorClassification int64 const ( - // api或sdk + // API or SDK ConnectorClassification_APIOrSDK ConnectorClassification = 1 - // 社交平台 + // social platform ConnectorClassification_SocialPlatform ConnectorClassification = 2 - // Coze商店/模板 + // Coze Shop/Template ConnectorClassification_Coze ConnectorClassification = 3 - // 小程序 + // Mini Program ConnectorClassification_MiniProgram ConnectorClassification = 4 - // MCP扩展库 + // MCP Extension Library ConnectorClassification_CozeSpaceExtensionLibrary ConnectorClassification = 5 ) @@ -76,15 +76,15 @@ func (p *ConnectorClassification) Value() (driver.Value, error) { type ConnectorConfigStatus int64 const ( - // 已配置 + // Configured ConnectorConfigStatus_Configured ConnectorConfigStatus = 1 - // 未配置 + // Not configured ConnectorConfigStatus_NotConfigured ConnectorConfigStatus = 2 - // Token发生变化 + // Token changes ConnectorConfigStatus_Disconnected ConnectorConfigStatus = 3 - // 配置中,授权中 + // Configuring, authorizing ConnectorConfigStatus_Configuring ConnectorConfigStatus = 4 - // 需要重新配置 + // Need to reconfigure ConnectorConfigStatus_NeedReconfiguring ConnectorConfigStatus = 5 ) @@ -138,11 +138,11 @@ func (p *ConnectorConfigStatus) Value() (driver.Value, error) { type ConnectorStatus int64 const ( - // 正常 + // Normal ConnectorStatus_Normal ConnectorStatus = 0 - // 审核中 + // Under review. ConnectorStatus_InReview ConnectorStatus = 1 - // 已下线 + // offline ConnectorStatus_Offline ConnectorStatus = 2 ) @@ -188,21 +188,21 @@ func (p *ConnectorStatus) Value() (driver.Value, error) { type ConnectorBindType int64 const ( - // 无需绑定 + // No binding required ConnectorBindType_NoBindRequired ConnectorBindType = 1 - // Auth绑定 + // Auth binding ConnectorBindType_AuthBind ConnectorBindType = 2 - // Kv绑定 + // Kv binding ConnectorBindType_KvBind ConnectorBindType = 3 - // Kv并Auth授权 + // Kv and Auth authorization ConnectorBindType_KvAuthBind ConnectorBindType = 4 - // api渠道绑定 + // API channel binding ConnectorBindType_ApiBind ConnectorBindType = 5 ConnectorBindType_WebSDKBind ConnectorBindType = 6 ConnectorBindType_StoreBind ConnectorBindType = 7 - // 授权和配置各一个按钮 + // One button each for authorization and configuration ConnectorBindType_AuthAndConfig ConnectorBindType = 8 - // 模板渠道绑定 + // template channel binding ConnectorBindType_TemplateBind ConnectorBindType = 9 ) @@ -272,11 +272,11 @@ func (p *ConnectorBindType) Value() (driver.Value, error) { type UserAuthStatus int64 const ( - // 已授权 + // Authorized UserAuthStatus_Authorized UserAuthStatus = 1 - // 未授权 + // unauthorized UserAuthStatus_UnAuthorized UserAuthStatus = 2 - // 授权中 + // Authorizing UserAuthStatus_Authorizing UserAuthStatus = 3 ) @@ -322,17 +322,17 @@ func (p *UserAuthStatus) Value() (driver.Value, error) { type PublishRecordStatus int64 const ( - // 打包中 + // Packing PublishRecordStatus_Packing PublishRecordStatus = 0 - // 打包失败 + // Packaging failed PublishRecordStatus_PackFailed PublishRecordStatus = 1 - // 审核中 + // Under review. PublishRecordStatus_Auditing PublishRecordStatus = 2 - // 审核未通过 + // review disapproved PublishRecordStatus_AuditNotPass PublishRecordStatus = 3 - // 渠道发布中 + // Channel is being released. PublishRecordStatus_ConnectorPublishing PublishRecordStatus = 4 - // 发布完成 + // release complete PublishRecordStatus_PublishDone PublishRecordStatus = 5 ) @@ -391,15 +391,15 @@ func (p *PublishRecordStatus) Value() (driver.Value, error) { type ConnectorPublishStatus int64 const ( - // 发布中 + // In release ConnectorPublishStatus_Default ConnectorPublishStatus = 0 - // 审核中 + // Under review. ConnectorPublishStatus_Auditing ConnectorPublishStatus = 1 - // 成功 + // success ConnectorPublishStatus_Success ConnectorPublishStatus = 2 - // 失败 + // fail ConnectorPublishStatus_Failed ConnectorPublishStatus = 3 - //禁用 + //disable ConnectorPublishStatus_Disable ConnectorPublishStatus = 4 ) @@ -1443,7 +1443,7 @@ func (p *PublishConnectorListResponse) String() string { type PublishConnectorListData struct { ConnectorList []*PublishConnectorInfo `thrift:"connector_list,1" form:"connector_list" json:"connector_list" query:"connector_list"` LastPublishInfo *LastPublishInfo `thrift:"last_publish_info,2" form:"last_publish_info" json:"last_publish_info" query:"last_publish_info"` - // 渠道集合信息,key是connector_union_id + // Channel collection information, the key is connector_union_id ConnectorUnionInfoMap map[int64]*ConnectorUnionInfo `thrift:"connector_union_info_map,3" form:"connector_union_info_map" json:"connector_union_info_map" query:"connector_union_info_map"` } @@ -1729,47 +1729,47 @@ type PublishConnectorInfo struct { ID int64 `thrift:"id,1,required" form:"id,required" json:"id,string,required" query:"id,required"` Name string `thrift:"name,2,required" form:"name,required" json:"name,required" query:"name,required"` IconURL string `thrift:"icon_url,3,required" form:"icon_url,required" json:"icon_url,required" query:"icon_url,required"` - // 描述 + // describe Description string `thrift:"description,4,required" form:"description,required" json:"description,required" query:"description,required"` - // 描述扩展 + // description extension DescriptionExtra string `thrift:"description_extra,5" form:"description_extra" json:"description_extra" query:"description_extra"` - // 渠道类型 + // channel type ConnectorClassification ConnectorClassification `thrift:"connector_classification,6,required" form:"connector_classification,required" json:"connector_classification,required" query:"connector_classification,required"` - // 配置状态 + // configuration status ConfigStatus ConnectorConfigStatus `thrift:"config_status,7,required" form:"config_status,required" json:"config_status,required" query:"config_status,required"` - // 渠道状态 + // channel status ConnectorStatus ConnectorStatus `thrift:"connector_status,8" form:"connector_status" json:"connector_status" query:"connector_status"` - // 绑定类型 + // binding type BindType ConnectorBindType `thrift:"bind_type,9,required" form:"bind_type,required" json:"bind_type,required" query:"bind_type,required"` - // 绑定信息 key字段名 value是值 + // Binding information key field name value is value BindInfo map[string]string `thrift:"bind_info,10,required" form:"bind_info,required" json:"bind_info,required" query:"bind_info,required"` - // 绑定id信息,用于解绑使用 + // Bind id information for unbinding and use BindID *string `thrift:"bind_id,11,optional" form:"bind_id" json:"bind_id,omitempty" query:"bind_id"` - // 用户授权登陆信息 + // user authorization login information AuthLoginInfo *AuthLoginInfo `thrift:"auth_login_info,12,optional" form:"auth_login_info" json:"auth_login_info,omitempty" query:"auth_login_info"` - // 隐私政策 + // Privacy Policy PrivacyPolicy string `thrift:"privacy_policy,13" form:"privacy_policy" json:"privacy_policy" query:"privacy_policy"` - // 用户协议 + // User Agreement UserAgreement string `thrift:"user_agreement,14" form:"user_agreement" json:"user_agreement" query:"user_agreement"` - // 是否允许发布 + // Whether to allow publishing AllowPublish bool `thrift:"allow_publish,15" form:"allow_publish" json:"allow_publish" query:"allow_publish"` - // 不允许发布的原因 + // Reasons for not allowing publishing NotAllowPublishReason *string `thrift:"not_allow_publish_reason,16,optional" form:"not_allow_publish_reason" json:"not_allow_publish_reason,omitempty" query:"not_allow_publish_reason"` - // 渠道集合id,表示需要聚合展示的渠道 + // Channel collection id, indicating the channel that needs to be aggregated and displayed. ConnectorUnionID *int64 `thrift:"connector_union_id,17,optional" form:"connector_union_id" json:"connector_union_id,string,omitempty" query:"connector_union_id"` - // UI选项 + // UI Options UIOptions []*UIOption `thrift:"UIOptions,18,optional" form:"UIOptions" json:"UIOptions,omitempty" query:"UIOptions"` - // 支持商业化 + // Support commercialization SupportMonetization *bool `thrift:"support_monetization,19,optional" form:"support_monetization" json:"support_monetization,omitempty" query:"support_monetization"` - // 安装指引 + // Installation Guidelines InstallationGuide *string `thrift:"installation_guide,20,optional" form:"installation_guide" json:"installation_guide,omitempty" query:"installation_guide"` - // 目前仅 bind_type == 8 时这个字段才有 + // Currently this field is only available bind_type == 8 AuthStatus *UserAuthStatus `thrift:"auth_status,21,optional" form:"auth_status" json:"auth_status,omitempty" query:"auth_status"` - // 配置状态toast + // Configuration status toast ConfigStatusToast *string `thrift:"config_status_toast,22,optional" form:"config_status_toast" json:"config_status_toast,omitempty" query:"config_status_toast"` - // connector_status为审核中时补全信息按钮的url + // connector_status the URL of the Complete Info button while under review ToCompleteInfoURL *string `thrift:"to_complete_info_url,23,optional" form:"to_complete_info_url" json:"to_complete_info_url,omitempty" query:"to_complete_info_url"` - // 渠道发布提示 + // Channel release tips ConnectorTips *string `thrift:"connector_tips,24,optional" form:"connector_tips" json:"connector_tips,omitempty" query:"connector_tips"` } @@ -3148,7 +3148,7 @@ func (p *PublishConnectorInfo) String() string { type LastPublishInfo struct { VersionNumber string `thrift:"version_number,1" form:"version_number" json:"version_number" query:"version_number"` ConnectorIds []int64 `thrift:"connector_ids,2" form:"connector_ids" json:"connector_ids,string" query:"connector_ids"` - // 渠道发布配置 + // channel release configuration ConnectorPublishConfig map[int64]*ConnectorPublishConfig `thrift:"connector_publish_config,3" form:"connector_publish_config" json:"connector_publish_config" query:"connector_publish_config"` } @@ -4254,11 +4254,11 @@ func (p *AuthLoginInfo) String() string { } type UIOption struct { - // UIChannel选项 + // UIChannel Options UIChannel int64 `thrift:"ui_channel,1" form:"ui_channel" json:"ui_channel,string" query:"ui_channel"` - // 是否可选 + // Is it optional Available bool `thrift:"available,2" form:"available" json:"available" query:"available"` - // 不可选原因 + // unselectable reason UnavailableReason string `thrift:"unavailable_reason,3" form:"unavailable_reason" json:"unavailable_reason" query:"unavailable_reason"` } @@ -4486,7 +4486,7 @@ func (p *UIOption) String() string { } type ConnectorPublishConfig struct { - // 发布渠道选择的Workflow/ChatFlow + // Workflow/ChatFlow selected by publishing channel SelectedWorkflows []*SelectedWorkflow `thrift:"selected_workflows,1" form:"selected_workflows" json:"selected_workflows" query:"selected_workflows"` } @@ -4646,9 +4646,9 @@ func (p *ConnectorPublishConfig) String() string { } type ConnectorUnionInfoOption struct { - // 渠道 ID + // Channel ID ConnectorID int64 `thrift:"connector_id,1,required" form:"connector_id,required" json:"connector_id,string,required" query:"connector_id,required"` - // 展示名,如:托管发布、下载代码 + // Display name, such as: hosted release, download code ShowName string `thrift:"show_name,2,required" form:"show_name,required" json:"show_name,required" query:"show_name,required"` } @@ -5711,13 +5711,13 @@ func (p *CheckProjectVersionNumberData) String() string { type PublishProjectRequest struct { ProjectID int64 `thrift:"project_id,1,required" form:"project_id,required" json:"project_id,string,required" query:"project_id,required"` - // 版本号 + // version number VersionNumber string `thrift:"version_number,2,required" form:"version_number,required" json:"version_number,required" query:"version_number,required"` - // 描述 + // describe Description *string `thrift:"description,3,optional" form:"description" json:"description,omitempty" query:"description"` - // key代表connector_id,value是渠道发布的参数 + // The key represents connector_id, and the value is the parameter published by the channel Connectors map[int64]map[string]string `thrift:"connectors,4,optional" form:"connectors" json:"connectors,omitempty" query:"connectors"` - // 渠道发布配置,key代表connector_id + // Channel release configuration, key represents connector_id ConnectorPublishConfig map[int64]*ConnectorPublishConfig `thrift:"connector_publish_config,5,optional" form:"connector_publish_config" json:"connector_publish_config,omitempty" query:"connector_publish_config"` Base *base.Base `thrift:"Base,255,optional" form:"-" json:"-" query:"-"` } @@ -6509,9 +6509,9 @@ func (p *PublishProjectResponse) String() string { } type PublishProjectData struct { - // 发布记录ID用于前端轮询 + // Publish record ID for front-end polling PublishRecordID int64 `thrift:"publish_record_id,1" form:"publish_record_id" json:"publish_record_id,string" query:"publish_record_id"` - // 收费配置发布结果,海外环境才有 + // The charging configuration is released, and the overseas environment is only available. PublishMonetizationResult *bool `thrift:"publish_monetization_result,2,optional" form:"publish_monetization_result" json:"publish_monetization_result,omitempty" query:"publish_monetization_result"` } @@ -7210,13 +7210,13 @@ func (p *GetPublishRecordListResponse) String() string { type PublishRecordDetail struct { PublishRecordID int64 `thrift:"publish_record_id,1" form:"publish_record_id" json:"publish_record_id,string" query:"publish_record_id"` VersionNumber string `thrift:"version_number,2" form:"version_number" json:"version_number" query:"version_number"` - // 发布状态 + // release status PublishStatus PublishRecordStatus `thrift:"publish_status,3" form:"publish_status" json:"publish_status" query:"publish_status"` - // 该字段废弃,请使用publish_status_detail + // This field is deprecated, please use publish_status_detail PublishStatusMsg string `thrift:"publish_status_msg,4" form:"publish_status_msg" json:"publish_status_msg" query:"publish_status_msg"` - // 渠道发布结果 + // Channel release results ConnectorPublishResult []*ConnectorPublishResult `thrift:"connector_publish_result,5,optional" form:"connector_publish_result" json:"connector_publish_result,omitempty" query:"connector_publish_result"` - // 发布状态补充信息 + // Release status Supplementary information PublishStatusDetail *PublishRecordStatusDetail `thrift:"publish_status_detail,6,optional" form:"publish_status_detail" json:"publish_status_detail,omitempty" query:"publish_status_detail"` } @@ -7618,17 +7618,17 @@ type ConnectorPublishResult struct { ConnectorID int64 `thrift:"connector_id,1" form:"connector_id" json:"connector_id,string" query:"connector_id"` ConnectorName string `thrift:"connector_name,2" form:"connector_name" json:"connector_name" query:"connector_name"` ConnectorIconURL string `thrift:"connector_icon_url,3" form:"connector_icon_url" json:"connector_icon_url" query:"connector_icon_url"` - // 渠道发布状态 + // channel release status ConnectorPublishStatus ConnectorPublishStatus `thrift:"connector_publish_status,4" form:"connector_publish_status" json:"connector_publish_status" query:"connector_publish_status"` - // 渠道发布状态补充信息 + // Channel Release Status Supplementary Information ConnectorPublishStatusMsg string `thrift:"connector_publish_status_msg,5" form:"connector_publish_status_msg" json:"connector_publish_status_msg" query:"connector_publish_status_msg"` - // OpenIn链接 + // OpenIn Link ShareLink *string `thrift:"share_link,6,optional" form:"share_link" json:"share_link,omitempty" query:"share_link"` - // 小程序渠道下载链接 + // Mini Program Channel Download Link DownloadLink *string `thrift:"download_link,7,optional" form:"download_link" json:"download_link,omitempty" query:"download_link"` - // 渠道发布配置 + // channel release configuration ConnectorPublishConfig *ConnectorPublishConfig `thrift:"connector_publish_config,8,optional" form:"connector_publish_config" json:"connector_publish_config,omitempty" query:"connector_publish_config"` - // 渠道绑定信息 key字段名 value是值 + // Channel binding information key field name value is value ConnectorBindInfo map[string]string `thrift:"connector_bind_info,9,optional" form:"connector_bind_info" json:"connector_bind_info,omitempty" query:"connector_bind_info"` } @@ -8190,7 +8190,7 @@ func (p *ConnectorPublishResult) String() string { } type PublishRecordStatusDetail struct { - // 打包失败详情 + // Packaging failure details PackFailedDetail []*PackFailedDetail `thrift:"pack_failed_detail,1,optional" form:"pack_failed_detail" json:"pack_failed_detail,omitempty" query:"pack_failed_detail"` } @@ -8591,7 +8591,7 @@ func (p *PackFailedDetail) String() string { type GetPublishRecordDetailRequest struct { ProjectID int64 `thrift:"project_id,1,required" form:"project_id,required" json:"project_id,string,required" query:"project_id,required"` - // 不传则获取最近一次发布记录 + // If you don't upload it, get the last release record. PublishRecordID *int64 `thrift:"publish_record_id,2,optional" form:"publish_record_id" json:"publish_record_id,string,omitempty" query:"publish_record_id"` Base *base.Base `thrift:"Base,255,optional" form:"-" json:"-" query:"-"` } diff --git a/backend/api/model/resource/common/resource_common.go b/backend/api/model/resource/common/resource_common.go index 66013776..9d87dbaf 100644 --- a/backend/api/model/resource/common/resource_common.go +++ b/backend/api/model/resource/common/resource_common.go @@ -89,9 +89,9 @@ func (p *ResType) Value() (driver.Value, error) { type PublishStatus int64 const ( - // 未发布 + // unpublished PublishStatus_UnPublished PublishStatus = 1 - // 已发布 + // Published PublishStatus_Published PublishStatus = 2 ) @@ -133,19 +133,19 @@ func (p *PublishStatus) Value() (driver.Value, error) { type ActionKey int64 const ( - // 复制 + // copy ActionKey_Copy ActionKey = 1 - // 删除 + // delete ActionKey_Delete ActionKey = 2 - // 启用/禁用 + // enable/disable ActionKey_EnableSwitch ActionKey = 3 - // 编辑 + // edit ActionKey_Edit ActionKey = 4 - // 切换成funcflow + // Switch to funcflow ActionKey_SwitchToFuncflow ActionKey = 8 - // 切换成chatflow + // Switch to chatflow ActionKey_SwitchToChatflow ActionKey = 9 - // 跨空间复制 + // Cross-space copy ActionKey_CrossSpaceCopy ActionKey = 10 ) @@ -207,25 +207,25 @@ func (p *ActionKey) Value() (driver.Value, error) { type ProjectResourceActionKey int64 const ( - //重命名 + //rename ProjectResourceActionKey_Rename ProjectResourceActionKey = 1 - //创建副本/复制到当前项目 + //Create a copy/copy to the current project ProjectResourceActionKey_Copy ProjectResourceActionKey = 2 - //复制到资源库 + //Copy to Library ProjectResourceActionKey_CopyToLibrary ProjectResourceActionKey = 3 - //移动到资源库 + //Move to Library ProjectResourceActionKey_MoveToLibrary ProjectResourceActionKey = 4 - //删除 + //delete ProjectResourceActionKey_Delete ProjectResourceActionKey = 5 - //启用 + //enable ProjectResourceActionKey_Enable ProjectResourceActionKey = 6 - //禁用 + //disable ProjectResourceActionKey_Disable ProjectResourceActionKey = 7 - // 切换成funcflow + // Switch to funcflow ProjectResourceActionKey_SwitchToFuncflow ProjectResourceActionKey = 8 - // 切换成chatflow + // Switch to chatflow ProjectResourceActionKey_SwitchToChatflow ProjectResourceActionKey = 9 - // 修改描述 + // Modify description ProjectResourceActionKey_UpdateDesc ProjectResourceActionKey = 10 ) @@ -346,31 +346,31 @@ func (p *ProjectResourceGroupType) Value() (driver.Value, error) { type ResourceCopyScene int64 const ( - //复制项目内的资源,浅拷贝 + //Copy resources within the project, shallow copy ResourceCopyScene_CopyProjectResource ResourceCopyScene = 1 - //复制项目资源到Library,复制后要发布 + //Copy the project resources to the Library, and publish after copying ResourceCopyScene_CopyResourceToLibrary ResourceCopyScene = 2 - //移动项目资源到Library,复制后要发布,后置要删除项目资源 + //Move project resources to Library, copy to publish, and delete project resources later ResourceCopyScene_MoveResourceToLibrary ResourceCopyScene = 3 - //复制Library资源到项目 + //Copy Library Resources to Project ResourceCopyScene_CopyResourceFromLibrary ResourceCopyScene = 4 - //复制项目,连带资源要复制。复制当前草稿。 + //Copy the project, along with the resources. Copy the current draft. ResourceCopyScene_CopyProject ResourceCopyScene = 5 - //项目发布到渠道,连带资源需要发布(含商店)。以当前草稿发布。 + //The project is published to the channel, and the associated resources need to be published (including the store). Publish with the current draft. ResourceCopyScene_PublishProject ResourceCopyScene = 6 - // 复制项目模板。 + // Copy the project template. ResourceCopyScene_CopyProjectTemplate ResourceCopyScene = 7 - // 项目发布到模板,以项目的指定版本发布成临时模板。 + // The project is published to a template, and the specified version of the project is published as a temporary template. ResourceCopyScene_PublishProjectTemplate ResourceCopyScene = 8 - // 模板审核通过,上架,根据临时模板复制正式模板。 + // The template is approved, put on the shelves, and the official template is copied according to the temporary template. ResourceCopyScene_LaunchTemplate ResourceCopyScene = 9 - // 草稿版本存档 + // Draft version archive ResourceCopyScene_ArchiveProject ResourceCopyScene = 10 - // 线上版本加载到草稿,草稿版本加载到草稿 + // Online version loaded into draft, draft version loaded into draft ResourceCopyScene_RollbackProject ResourceCopyScene = 11 - // 单个资源跨空间复制 + // Cross-space copy of a single resource ResourceCopyScene_CrossSpaceCopy ResourceCopyScene = 12 - // 项目跨空间复制 + // item cross-space copy ResourceCopyScene_CrossSpaceCopyProject ResourceCopyScene = 13 ) @@ -505,11 +505,11 @@ func (p *TaskStatus) Value() (driver.Value, error) { return int64(*p), nil } -// Library资源操作 +// Library Resource Operations type ResourceAction struct { - // 一个操作对应一个唯一的key,key由资源侧约束 + // An operation corresponds to a unique key, and the key is constrained by the resource side Key ActionKey `thrift:"Key,1,required" json:"key" form:"Key,required" query:"Key,required"` - //ture=可以操作该Action,false=置灰 + //ture = can operate this Action, false = grey out Enable bool `thrift:"Enable,2,required" json:"enable" form:"Enable,required" query:"Enable,required"` } @@ -707,46 +707,46 @@ func (p *ResourceAction) String() string { } -// 前端用 +// front end type ResourceInfo struct { - // 资源id + // Resource ID ResID *int64 `thrift:"ResID,1,optional" form:"res_id" json:"res_id,string,omitempty"` - // 资源类型 + // resource type ResType *ResType `thrift:"ResType,2,optional" json:"res_type" form:"ResType" query:"ResType"` - // 资源子类型,由资源实现方定义。 + // Resource subtype, defined by the resource implementer. // Plugin:1-Http; 2-App; 6-Local;Knowledge:0-text; 1-table; 2-image;UI:1-Card ResSubType *int32 `thrift:"ResSubType,3,optional" json:"res_sub_type" form:"ResSubType" query:"ResSubType"` - // 资源名称 + // resource name Name *string `thrift:"Name,4,optional" json:"name" form:"Name" query:"Name"` - // 资源描述 + // resource description Desc *string `thrift:"Desc,5,optional" json:"desc" form:"Desc" query:"Desc"` - // 资源Icon,完整url + // Resource Icon, full url Icon *string `thrift:"Icon,6,optional" json:"icon" form:"Icon" query:"Icon"` - // 资源创建者 + // Resource creator CreatorID *int64 `thrift:"CreatorID,7,optional" form:"creator_id" json:"creator_id,string,omitempty"` - // 资源创建者 + // Resource creator CreatorAvatar *string `thrift:"CreatorAvatar,8,optional" json:"creator_avatar" form:"CreatorAvatar" query:"CreatorAvatar"` - // 资源创建者 + // Resource creator CreatorName *string `thrift:"CreatorName,9,optional" json:"creator_name" form:"CreatorName" query:"CreatorName"` - // 资源创建者 + // Resource creator UserName *string `thrift:"UserName,10,optional" json:"user_name" form:"UserName" query:"UserName"` - // 资源发布状态,1-未发布,2-已发布 + // Resource release status, 1 - unpublished, 2 - published PublishStatus *PublishStatus `thrift:"PublishStatus,11,optional" json:"publish_status" form:"PublishStatus" query:"PublishStatus"` - // 资源状态,各类型资源自身定义 + // Resource status, each type of resource defines itself BizResStatus *int32 `thrift:"BizResStatus,12,optional" json:"biz_res_status" form:"BizResStatus" query:"BizResStatus"` - // 是否开启多人编辑 + // Whether to enable multi-person editing CollaborationEnable *bool `thrift:"CollaborationEnable,13,optional" json:"collaboration_enable" form:"CollaborationEnable" query:"CollaborationEnable"` - // 最近编辑时间, unix秒级时间戳 + // Last edited, unix timestamp EditTime *int64 `thrift:"EditTime,14,optional" form:"edit_time" json:"edit_time,string,omitempty"` - // 资源所属空间ID + // Resource Ownership Space ID SpaceID *int64 `thrift:"SpaceID,15,optional" form:"space_id" json:"space_id,string,omitempty"` - // 业务携带的扩展信息,以res_type区分,每个res_type定义的schema和含义不一样,使用前需要判断res_type + // Business carry extended information to res_type distinguish, each res_type defined schema and meaning is not the same, need to judge before use res_type BizExtend map[string]string `thrift:"BizExtend,16,optional" json:"biz_extend" form:"BizExtend" query:"BizExtend"` - // 不同类型的不同操作按钮,由资源实现方和前端约定。返回则展示,要隐藏某个按钮,则不要返回; + // Different types of different operation buttons are agreed upon by the resource implementer and the front end. Return is displayed, if you want to hide a button, do not return; Actions []*ResourceAction `thrift:"Actions,17,optional" json:"actions" form:"Actions" query:"Actions"` - // 是否禁止进详情页 + // Whether to ban entering the details page DetailDisable *bool `thrift:"DetailDisable,18,optional" json:"detail_disable" form:"DetailDisable" query:"DetailDisable"` - // [数据延迟优化]删除标识符,true-已删除-前端隐藏该item,false-正常 + // [Data delay optimization] Delete identifier, true-deleted-frontend hides the item, false-normal DelFlag *bool `thrift:"DelFlag,19,optional" json:"del_flag" form:"DelFlag" query:"DelFlag"` } @@ -1938,11 +1938,11 @@ func (p *ResourceInfo) String() string { } type ProjectResourceAction struct { - // 一个操作对应一个唯一的key,key由资源侧约束 + // An operation corresponds to a unique key, and the key is constrained by the resource side Key ProjectResourceActionKey `thrift:"Key,1,required" json:"key" form:"Key,required" query:"Key,required"` - //ture=可以操作该Action,false=置灰 + //ture = can operate this Action, false = grey out Enable bool `thrift:"Enable,2,required" json:"enable" form:"Enable,required" query:"Enable,required"` - // enable=false时,提示文案。后端返回Starling Key,注意放在同一个space下。 + // When enable = false, prompt the copywriter. The backend returns the Starling Key, be careful to put it under the same space. Hint *string `thrift:"Hint,3,optional" json:"hint" form:"Hint" query:"Hint"` } @@ -2195,25 +2195,25 @@ func (p *ProjectResourceAction) String() string { } -// 实现方提供展示信息 +// The implementer provides display information type ProjectResourceInfo struct { - // 资源id + // Resource ID ResID int64 `thrift:"ResID,1" form:"res_id" json:"res_id,string"` - // 资源名称 + // resource name Name string `thrift:"Name,2" json:"name" form:"Name" query:"Name"` - // 不同类型的不同操作按钮,由资源实现方和前端约定。返回则展示,要隐藏某个按钮,则不要返回; + // Different types of different operation buttons are agreed upon by the resource implementer and the front end. Return is displayed, if you want to hide a button, do not return; Actions []*ProjectResourceAction `thrift:"Actions,3" json:"actions" form:"Actions" query:"Actions"` - // 该用户是否对资源只读 + // Is the user read-only to the resource? // 4: bool ReadOnly (go.tag = "json:\"read_only\"", agw.key = "read_only") - // 资源类型 + // resource type ResType ResType `thrift:"ResType,5" json:"res_type" form:"ResType" query:"ResType"` - // 资源子类型,由资源实现方定义。Plugin:1-Http; 2-App; 6-Local;Knowledge:0-text; 1-table; 2-image;UI:1-Card + // Resource subtype, defined by the resource implementer. Plugin: 1-Http; 2-App; 6-Local; Knowledge: 0-text; 1-table; 2-image; UI: 1-Card ResSubType *int32 `thrift:"ResSubType,6,optional" json:"res_sub_type" form:"ResSubType" query:"ResSubType"` - // 业务携带的扩展信息,以res_type区分,每个res_type定义的schema和含义不一样,使用前需要判断res_type + // Business carry extended information to res_type distinguish, each res_type defined schema and meaning is not the same, need to judge before use res_type BizExtend map[string]string `thrift:"BizExtend,7,optional" json:"biz_extend" form:"BizExtend" query:"BizExtend"` - // 资源状态,各类型资源自身定义。前端与各资源方约定。 + // Resource status, each type of resource defines itself. The front end agrees with each resource party. BizResStatus *int32 `thrift:"BizResStatus,8,optional" json:"biz_res_status" form:"BizResStatus" query:"BizResStatus"` - // 当前资源的编辑态版本 + // The edited version of the current resource VersionStr *string `thrift:"VersionStr,9,optional" json:"version_str" form:"VersionStr" query:"VersionStr"` } @@ -2754,7 +2754,7 @@ func (p *ProjectResourceInfo) String() string { } type ProjectResourceGroup struct { - // 资源分组 + // resource grouping GroupType ProjectResourceGroupType `thrift:"GroupType,1" json:"group_type" form:"GroupType" query:"GroupType"` ResourceList []*ProjectResourceInfo `thrift:"ResourceList,2,optional" json:"resource_list" form:"ResourceList" query:"ResourceList"` } @@ -2974,9 +2974,9 @@ type ResourceCopyFailedReason struct { ResType ResType `thrift:"ResType,2" json:"res_type" form:"ResType" query:"ResType"` ResName string `thrift:"ResName,3" json:"res_name" form:"ResName" query:"ResName"` Reason string `thrift:"Reason,4" json:"reason" form:"Reason" query:"Reason"` - // 废弃 + // abandoned PublishVersion *int64 `thrift:"PublishVersion,5,optional" json:"publish_version" form:"PublishVersion" query:"PublishVersion"` - // 资源的当前版本,为nil或空字符串都看作是最新版本。项目发布版本或Library发布版本。 + // The current version of the resource, either nil or empty string, is considered the latest version. Project release or Library release. PublishVersionStr *string `thrift:"PublishVersionStr,6,optional" json:"publish_version_str" form:"PublishVersionStr" query:"PublishVersionStr"` } @@ -3359,13 +3359,13 @@ func (p *ResourceCopyFailedReason) String() string { type ResourceCopyTaskDetail struct { TaskID string `thrift:"task_id,1" form:"task_id" json:"task_id" query:"task_id"` - // 任务状态 + // task status Status TaskStatus `thrift:"status,2" form:"status" json:"status" query:"status"` - // 复制后的资源id + // Replicated resource id ResID int64 `thrift:"res_id,3" form:"res_id" json:"res_id,string" query:"res_id"` ResType ResType `thrift:"res_type,4" form:"res_type" json:"res_type" query:"res_type"` Scene ResourceCopyScene `thrift:"scene,5" form:"scene" json:"scene" query:"scene"` - // 复制前的资源名称 + // Resource name before copy ResName *string `thrift:"res_name,6,optional" form:"res_name" json:"res_name,omitempty" query:"res_name"` } diff --git a/backend/api/model/resource/resource.go b/backend/api/model/resource/resource.go index f1da7258..23d58ed7 100644 --- a/backend/api/model/resource/resource.go +++ b/backend/api/model/resource/resource.go @@ -3,31 +3,31 @@ package resource import ( - "github.com/coze-dev/coze-studio/backend/api/model/base" - "github.com/coze-dev/coze-studio/backend/api/model/resource/common" "context" "fmt" "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-studio/backend/api/model/base" + "github.com/coze-dev/coze-studio/backend/api/model/resource/common" ) type LibraryResourceListRequest struct { - // 是否由当前用户创建,0-不筛选,1-当前用户 + // Whether created by the current user, 0 - unfiltered, 1 - current user UserFilter *int32 `thrift:"user_filter,1,optional" form:"user_filter" json:"user_filter,omitempty" query:"user_filter"` - // [4,1] 0代表不筛选 + // [4,1] 0 means do not filter ResTypeFilter []common.ResType `thrift:"res_type_filter,2,optional" form:"res_type_filter" json:"res_type_filter,omitempty" query:"res_type_filter"` - // 名称 + // name Name *string `thrift:"name,3,optional" form:"name" json:"name,omitempty" query:"name"` - // 发布状态,0-不筛选,1-未发布,2-已发布 + // Published status, 0 - unfiltered, 1 - unpublished, 2 - published PublishStatusFilter *common.PublishStatus `thrift:"publish_status_filter,4,optional" form:"publish_status_filter" json:"publish_status_filter,omitempty" query:"publish_status_filter"` - // 用户所在空间ID + // User's space ID SpaceID int64 `thrift:"space_id,5,required" form:"space_id,required" json:"space_id,string,required" query:"space_id,required"` - // 一次读取的数据条数,默认10,最大100. + // The number of data bars read at one time, the default is 10, and the maximum is 100. Size *int32 `thrift:"size,7,optional" form:"size" json:"size,omitempty" query:"size"` - // 游标,用于分页,默认0,第一次请求可以不传,后续请求需要带上上次返回的cursor + // Cursor, used for paging, default 0, the first request can not be passed, subsequent requests need to bring the last returned cursor Cursor *string `thrift:"cursor,9,optional" form:"cursor" json:"cursor,omitempty" query:"cursor"` - // 用来指定自定义搜索的字段 不填默认只name匹配,eg []string{name,自定} 匹配name和自定义字段full_text + // The field used to specify the custom search, do not fill in the default only name matches, eg [] string {name, custom} matches the name and custom fields full_text SearchKeys []string `thrift:"search_keys,10,optional" form:"search_keys" json:"search_keys,omitempty" query:"search_keys"` - // 当res_type_filter为[2 workflow]时,是否需要返回图片流 + // Do you need to return image review when the res_type_filter is [2 workflow] IsGetImageflow *bool `thrift:"is_get_imageflow,11,optional" form:"is_get_imageflow" json:"is_get_imageflow,omitempty" query:"is_get_imageflow"` Base *base.Base `thrift:"Base,255" form:"Base" json:"Base" query:"Base"` } @@ -710,9 +710,9 @@ type LibraryResourceListResponse struct { Code int64 `thrift:"code,1" form:"code" json:"code" query:"code"` Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` ResourceList []*common.ResourceInfo `thrift:"resource_list,3" form:"resource_list" json:"resource_list" query:"resource_list"` - // 游标,用于下次请求的cursor + // Cursor, the cursor for the next request Cursor *string `thrift:"cursor,5,optional" form:"cursor" json:"cursor,omitempty" query:"cursor"` - // 是否还有数据待拉取 + // Is there still data to be pulled? HasMore bool `thrift:"has_more,6" form:"has_more" json:"has_more" query:"has_more"` BaseResp *base.BaseResp `thrift:"BaseResp,255,required" form:"BaseResp,required" json:"BaseResp,required" query:"BaseResp,required"` } @@ -1118,11 +1118,11 @@ func (p *LibraryResourceListResponse) String() string { } type ProjectResourceListRequest struct { - // 项目ID + // Project ID ProjectID int64 `thrift:"project_id,1,required" form:"project_id,required" json:"project_id,string,required" query:"project_id,required"` - // 用户所在space id + // User space id SpaceID int64 `thrift:"space_id,2" form:"space_id" json:"space_id,string" query:"space_id"` - // 指定获取某个版本的project的资源 + // Specify the resources to obtain a version of the project ProjectVersion *string `thrift:"project_version,3,optional" form:"project_version" json:"project_version,omitempty" query:"project_version"` Base *base.Base `thrift:"Base,255" form:"Base" json:"Base" query:"Base"` } @@ -1728,15 +1728,15 @@ func (p *ProjectResourceListResponse) String() string { } type ResourceCopyDispatchRequest struct { - // 场景,只支持单资源的操作 + // Scenario, only supports the operation of a single resource Scene common.ResourceCopyScene `thrift:"scene,1" form:"scene" json:"scene" query:"scene"` - // 被用户选择复制/移动的资源ID + // The resource ID selected by the user to copy/move ResID int64 `thrift:"res_id,2" form:"res_id" json:"res_id,string"` ResType common.ResType `thrift:"res_type,3" form:"res_type" json:"res_type" query:"res_type"` - // 所在项目ID + // Project ID ProjectID *int64 `thrift:"project_id,4,optional" form:"project_id" json:"project_id,string,omitempty"` ResName *string `thrift:"res_name,5,optional" form:"res_name" json:"res_name,omitempty" query:"res_name"` - // 跨空间复制的目标space id + // Target space id for cross-space copy TargetSpaceID *int64 `thrift:"target_space_id,6,optional" form:"target_space_id" json:"target_space_id,string,omitempty"` Base *base.Base `thrift:"Base,255" form:"Base" json:"Base" query:"Base"` } @@ -2182,9 +2182,9 @@ func (p *ResourceCopyDispatchRequest) String() string { type ResourceCopyDispatchResponse struct { Code int64 `thrift:"code,1" form:"code" json:"code" query:"code"` Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` - // 复制任务id, 用于查询任务状态或取消、重试任务 + // Copy task ID, used to query task status or cancel or retry tasks TaskID *string `thrift:"task_id,3,optional" form:"task_id" json:"task_id,omitempty" query:"task_id"` - // 不可以进行操作的原因,返回多语言文本 + // The reason why the operation cannot be performed is to return multilingual text FailedReasons []*common.ResourceCopyFailedReason `thrift:"failed_reasons,4,optional" form:"failed_reasons" json:"failed_reasons,omitempty" query:"failed_reasons"` BaseResp *base.BaseResp `thrift:"BaseResp,255,required" form:"BaseResp,required" json:"BaseResp,required" query:"BaseResp,required"` } @@ -2557,7 +2557,7 @@ func (p *ResourceCopyDispatchResponse) String() string { } type ResourceCopyDetailRequest struct { - // 复制任务id, 用于查询任务状态或取消、重试任务 + // Copy task ID, used to query task status or cancel or retry tasks TaskID string `thrift:"task_id,1" form:"task_id" json:"task_id" query:"task_id"` Base *base.Base `thrift:"Base,255" form:"Base" json:"Base" query:"Base"` } @@ -3044,7 +3044,7 @@ func (p *ResourceCopyDetailResponse) String() string { } type ResourceCopyRetryRequest struct { - // 复制任务id, 用于查询任务状态或取消、重试任务 + // Copy task ID, used to query task status or cancel or retry tasks TaskID string `thrift:"task_id,1" form:"task_id" json:"task_id" query:"task_id"` Base *base.Base `thrift:"Base,255" form:"Base" json:"Base" query:"Base"` } @@ -3237,7 +3237,7 @@ func (p *ResourceCopyRetryRequest) String() string { type ResourceCopyRetryResponse struct { Code int64 `thrift:"code,1" form:"code" json:"code" query:"code"` Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` - // 不可以进行操作的原因,返回多语言文本 + // The reason why the operation cannot be performed is to return multilingual text FailedReasons []*common.ResourceCopyFailedReason `thrift:"failed_reasons,4,optional" form:"failed_reasons" json:"failed_reasons,omitempty" query:"failed_reasons"` BaseResp *base.BaseResp `thrift:"BaseResp,255,required" form:"BaseResp,required" json:"BaseResp,required" query:"BaseResp,required"` } @@ -3555,7 +3555,7 @@ func (p *ResourceCopyRetryResponse) String() string { } type ResourceCopyCancelRequest struct { - // 复制任务id, 用于查询任务状态或取消、重试任务 + // Copy task ID, used to query task status or cancel or retry tasks TaskID string `thrift:"task_id,1" form:"task_id" json:"task_id" query:"task_id"` Base *base.Base `thrift:"Base,255" form:"Base" json:"Base" query:"Base"` } @@ -3992,7 +3992,7 @@ type ResourceService interface { LibraryResourceList(ctx context.Context, request *LibraryResourceListRequest) (r *LibraryResourceListResponse, err error) ProjectResourceList(ctx context.Context, request *ProjectResourceListRequest) (r *ProjectResourceListResponse, err error) - // 复制Library资源到项目、复制项目资源到Library、移动项目资源到Library、项目内单复制资源 + // Copy Library resources to projects, copy project resources to libraries, move project resources to libraries, and copy resources within projects ResourceCopyDispatch(ctx context.Context, req *ResourceCopyDispatchRequest) (r *ResourceCopyDispatchResponse, err error) ResourceCopyDetail(ctx context.Context, req *ResourceCopyDetailRequest) (r *ResourceCopyDetailResponse, err error) diff --git a/backend/api/model/table/table.go b/backend/api/model/table/table.go index a174ef71..1f3888dd 100644 --- a/backend/api/model/table/table.go +++ b/backend/api/model/table/table.go @@ -3,11 +3,11 @@ package table 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 RefType int64 @@ -60,9 +60,9 @@ func (p *RefType) Value() (driver.Value, error) { type BotTableStatus int64 const ( - // 已上线 + // online BotTableStatus_Online BotTableStatus = 1 - // 删除 + // delete BotTableStatus_Delete BotTableStatus = 2 ) @@ -104,11 +104,11 @@ func (p *BotTableStatus) Value() (driver.Value, error) { type FieldItemType int64 const ( - // 文本 + // Text FieldItemType_Text FieldItemType = 1 - // 数字 + // number FieldItemType_Number FieldItemType = 2 - // 时间 + // time FieldItemType_Date FieldItemType = 3 // float FieldItemType_Float FieldItemType = 4 @@ -166,13 +166,13 @@ func (p *FieldItemType) Value() (driver.Value, error) { type BotTableRWMode int64 const ( - // 单用户模式 + // single user mode BotTableRWMode_LimitedReadWrite BotTableRWMode = 1 - // 只读模式 + // read-only mode BotTableRWMode_ReadOnly BotTableRWMode = 2 - // 多用户模式 + // multi-user mode BotTableRWMode_UnlimitedReadWrite BotTableRWMode = 3 - // Max 边界值 + // Max boundary value BotTableRWMode_RWModeMax BotTableRWMode = 4 ) @@ -264,9 +264,9 @@ func (p *SortDirection) Value() (driver.Value, error) { type TableType int64 const ( - // 草稿 + // draft TableType_DraftTable TableType = 1 - // 线上 + // online TableType_OnlineTable TableType = 2 ) @@ -308,9 +308,9 @@ func (p *TableType) Value() (driver.Value, error) { type SceneType int64 const ( - // bot 个性描述 + // bot personality description SceneType_BotPersona SceneType = 1 - // 开发者给的模型文本描述 + // Text description of the model given by the developer SceneType_ModelDesc SceneType = 2 ) @@ -352,15 +352,15 @@ func (p *SceneType) Value() (driver.Value, error) { type ActionKey int64 const ( - //复制 + //copy ActionKey_Copy ActionKey = 1 - //删除 + //delete ActionKey_Delete ActionKey = 2 - //启用/禁用 + //enable/disable ActionKey_EnableSwitch ActionKey = 3 - //编辑 + //edit ActionKey_Edit ActionKey = 4 - // 跨空间复制 + // Cross-space copy ActionKey_CrossSpaceCopy ActionKey = 10 ) @@ -414,9 +414,9 @@ func (p *ActionKey) Value() (driver.Value, error) { type PublishStatus int64 const ( - //未发布 + //unpublished PublishStatus_UnPublished PublishStatus = 1 - //已发布 + //Published PublishStatus_Published PublishStatus = 2 ) @@ -512,7 +512,7 @@ type Operation int64 const ( // "=" Operation_EQUAL Operation = 1 - // "<>" 或 "!=" + // "< >" or "! =" Operation_NOT_EQUAL Operation = 2 // ">" Operation_GREATER_THAN Operation = 3 @@ -530,9 +530,9 @@ const ( Operation_IS_NULL Operation = 9 // "IS NOT NULL" Operation_IS_NOT_NULL Operation = 10 - // "LIKE" 模糊匹配字符串 + // "LIKE" fuzzy match string Operation_LIKE Operation = 11 - // "NOT LIKE" 反向模糊匹配 + // "NOT LIKE" inverse fuzzy match Operation_NOT_LIKE Operation = 12 ) @@ -614,11 +614,11 @@ func (p *Operation) 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 ) @@ -665,17 +665,17 @@ 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 ) @@ -741,9 +741,9 @@ func NewGetDatabaseTemplateRequest() *GetDatabaseTemplateRequest { } type RefInfo struct { - // 引用类型 + // reference type RefType RefType `thrift:"ref_type,1" form:"ref_type" json:"ref_type" query:"ref_type"` - // 引用 id + // reference id RefID string `thrift:"ref_id,2" form:"ref_id" json:"ref_id" query:"ref_id"` } @@ -931,11 +931,11 @@ type FieldItem struct { Desc string `thrift:"desc,2" form:"desc" json:"desc" query:"desc"` Type FieldItemType `thrift:"type,3" form:"type" json:"type" query:"type"` MustRequired bool `thrift:"must_required,4" form:"must_required" json:"must_required" query:"must_required"` - // 该字段只用来判断是否发布,不为 0 就是已发布的,前端对已发布的字段不能修改字段类型 + // This field is only used to determine whether it is published. If it is not 0, it is published. The front end cannot modify the field type for the published field. ID int64 `thrift:"id,5" form:"id" json:"id" query:"id"` - // 修改字段时(alter、publish)用来判断增删改,0 表示新增,非 0 表示修改或删除 + // When modifying a field (alter, publish), it is used to judge additions and deletions. 0 means new additions, and non-0 means modification or deletion. AlterId int64 `thrift:"alterId,6" form:"alterId" json:"alterId" query:"alterId"` - // 是否是系统字段 + // Is it a system field? IsSystemField bool `thrift:"is_system_field,7" form:"is_system_field" json:"is_system_field" query:"is_system_field"` } @@ -1727,25 +1727,25 @@ func (p *Criterion) String() string { } type ListDatabaseRequest struct { - // 获取创建者为某个用户的的数据库 + // Get a database created by a user CreatorID *int64 `thrift:"creator_id,1,optional" form:"creator_id" json:"creator_id,string,omitempty" query:"creator_id"` - // 获取project下的数据库 + // Get the database under the project ProjectID *int64 `thrift:"project_id,2,optional" form:"project_id" json:"project_id,string,omitempty" query:"project_id"` - //获取空间下的可见数据库 + //Get the visible database under space SpaceID *int64 `thrift:"space_id,3,optional" form:"space_id" json:"space_id,string,omitempty" query:"space_id"` - //对bot_id进行过滤,过滤掉已经添加到bot中的database + //Filter bot_id to filter out databases that have been added to the bot BotID *int64 `thrift:"bot_id,4,optional" form:"bot_id" json:"bot_id,string,omitempty" query:"bot_id"` - // 表格名称,模糊搜索 + // Table name, fuzzy search TableName *string `thrift:"table_name,5,optional" form:"table_name" json:"table_name,omitempty" query:"table_name"` - // 查草稿态database + // Draft database TableType TableType `thrift:"table_type,6,required" form:"table_type,required" json:"table_type,required" query:"table_type,required"` - // 排序 + // sort OrderBy []*OrderBy `thrift:"order_by,7,optional" form:"order_by" json:"order_by,omitempty" query:"order_by"` Offset *int32 `thrift:"offset,8,optional" form:"offset" json:"offset,omitempty" query:"offset"` Limit *int32 `thrift:"limit,9,optional" form:"limit" json:"limit,omitempty" query:"limit"` - //筛选条件 + //filter criteria FilterCriterion *Criterion `thrift:"filter_criterion,10,optional" form:"filter_criterion" json:"filter_criterion,omitempty" query:"filter_criterion"` - //排序条件 + //sort condition OrderByList []*OrderBy `thrift:"order_by_list,11,optional" form:"order_by_list" json:"order_by_list,omitempty" query:"order_by_list"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -2533,47 +2533,47 @@ func (p *ListDatabaseRequest) String() string { } type DatabaseInfo struct { - // online_database_info的主键id + // online_database_info primary key id ID int64 `thrift:"id,1" form:"id" json:"id,string" query:"id"` - // 空间的id + // ID of space SpaceID int64 `thrift:"space_id,2" form:"space_id" json:"space_id,string" query:"space_id"` // project id ProjectID int64 `thrift:"project_id,3" form:"project_id" json:"project_id,string" query:"project_id"` - // datamodel侧的表id + // Table ID on the datamodel side DatamodelTableID string `thrift:"datamodel_table_id,4" form:"datamodel_table_id" json:"datamodel_table_id" query:"datamodel_table_id"` - // 头像url + // avatar url IconURL string `thrift:"icon_url,5" form:"icon_url" json:"icon_url" query:"icon_url"` - // 头像url + // avatar url IconURI string `thrift:"icon_uri,6" form:"icon_uri" json:"icon_uri" query:"icon_uri"` - // 表名 + // table name TableName string `thrift:"table_name,7" form:"table_name" json:"table_name" query:"table_name"` - // 表描述 + // table description TableDesc string `thrift:"table_desc,8" form:"table_desc" json:"table_desc" query:"table_desc"` - // 状态 + // status Status BotTableStatus `thrift:"status,9" form:"status" json:"status" query:"status"` - // 创建者id + // creator id CreatorID int64 `thrift:"creator_id,10" form:"creator_id" json:"creator_id,string" query:"creator_id"` - // 创建时间 + // create_time CreateTime int64 `thrift:"create_time,11" form:"create_time" json:"create_time" query:"create_time"` - // 更新时间 + // update time UpdateTime int64 `thrift:"update_time,12" form:"update_time" json:"update_time" query:"update_time"` - // 字段信息 + // Field information FieldList []*FieldItem `thrift:"field_list,13" form:"field_list" json:"field_list" query:"field_list"` - // 数据表实际名称 + // Data table actual name ActualTableName string `thrift:"actual_table_name,14" form:"actual_table_name" json:"actual_table_name" query:"actual_table_name"` - // 读写模式 + // read and write mode RwMode BotTableRWMode `thrift:"rw_mode,15" form:"rw_mode" json:"rw_mode" query:"rw_mode"` - // 是否支持prompt调用 + // Whether to support prompt calls PromptDisabled bool `thrift:"prompt_disabled,16" form:"prompt_disabled" json:"prompt_disabled" query:"prompt_disabled"` - // 是否可见 + // Is it visible? IsVisible bool `thrift:"is_visible,17" form:"is_visible" json:"is_visible" query:"is_visible"` - // 对应草稿态的id + // ID corresponding to draft state DraftID *int64 `thrift:"draft_id,18,optional" form:"draft_id" json:"draft_id,string,omitempty" query:"draft_id"` - // 相关id. bot_id,老的有,新的没有 + // Related id. bot_id, the old one is available, the new one is not. BotID *int64 `thrift:"bot_id,19,optional" form:"bot_id" json:"bot_id,string,omitempty" query:"bot_id"` - // 扩展信息 + // extended information ExtraInfo map[string]string `thrift:"extra_info,20,optional" form:"extra_info" json:"extra_info,omitempty" query:"extra_info"` - // 是否已经添加到bot中 + // Has it been added to the bot? IsAddedToBot *bool `thrift:"is_added_to_bot,21,optional" form:"is_added_to_bot" json:"is_added_to_bot,omitempty" query:"is_added_to_bot"` } @@ -4098,13 +4098,13 @@ func (p *ListDatabaseResponse) String() string { } type SingleDatabaseRequest struct { - // database_info的主键id + // database_info primary key id ID int64 `thrift:"id,1" form:"id" json:"id,string" query:"id"` - //传入的是否是草稿态数据,默认是false + //Whether the incoming data is in draft form, the default is false. IsDraft bool `thrift:"is_draft,2" form:"is_draft" json:"is_draft" query:"is_draft"` - //是否需要系统字段 + //Do you need system fields? NeedSysFields bool `thrift:"need_sys_fields,3" form:"need_sys_fields" json:"need_sys_fields" query:"need_sys_fields"` - // 版本号,不传默认是最新的 + // The version number is not passed on, and the default is the latest. Version int64 `thrift:"version,4" form:"version" json:"version,string" query:"version"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -4737,25 +4737,25 @@ func (p *SingleDatabaseResponse) String() string { } type AddDatabaseRequest struct { - // 创建者id + // creator id CreatorID int64 `thrift:"creator_id,1" form:"creator_id" json:"creator_id,string" query:"creator_id"` - // 空间的id + // ID of space SpaceID int64 `thrift:"space_id,2" form:"space_id" json:"space_id,string" query:"space_id"` // project id ProjectID int64 `thrift:"project_id,3" form:"project_id" json:"project_id,string" query:"project_id"` - // 头像url + // avatar url IconURI string `thrift:"icon_uri,4" form:"icon_uri" json:"icon_uri" query:"icon_uri"` - // 表名 + // table name TableName string `thrift:"table_name,5" form:"table_name" json:"table_name" query:"table_name"` - // 表描述 + // table description TableDesc string `thrift:"table_desc,6" form:"table_desc" json:"table_desc" query:"table_desc"` - // 字段信息 + // Field information FieldList []*FieldItem `thrift:"field_list,7" form:"field_list" json:"field_list" query:"field_list"` - // 读写模式,单用户模式/多用户模式 + // Read and write mode, single user mode/multi-user mode RwMode BotTableRWMode `thrift:"rw_mode,8" form:"rw_mode" json:"rw_mode" query:"rw_mode"` - // 是否支持prompt调用 + // Whether to support prompt calls PromptDisabled bool `thrift:"prompt_disabled,9" form:"prompt_disabled" json:"prompt_disabled" query:"prompt_disabled"` - // 扩展信息 + // extended information ExtraInfo map[string]string `thrift:"extra_info,10,optional" form:"extra_info" json:"extra_info,omitempty" query:"extra_info"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -5404,21 +5404,21 @@ func (p *AddDatabaseRequest) String() string { } type UpdateDatabaseRequest struct { - // database_info的主键id + // database_info primary key id ID int64 `thrift:"id,1" form:"id" json:"id,string" query:"id"` - // 头像url + // avatar url IconURI string `thrift:"icon_uri,2" form:"icon_uri" json:"icon_uri" query:"icon_uri"` - // 表名 + // table name TableName string `thrift:"table_name,3" form:"table_name" json:"table_name" query:"table_name"` - // 表描述 + // table description TableDesc string `thrift:"table_desc,5" form:"table_desc" json:"table_desc" query:"table_desc"` - // 字段信息 + // Field information FieldList []*FieldItem `thrift:"field_list,6" form:"field_list" json:"field_list" query:"field_list"` - // 读写模式,单用户模式/多用户模式 + // Read and write mode, single user mode/multi-user mode RwMode BotTableRWMode `thrift:"rw_mode,7" form:"rw_mode" json:"rw_mode" query:"rw_mode"` - // 是否支持prompt调用 + // Whether to support prompt calls PromptDisabled bool `thrift:"prompt_disabled,8" form:"prompt_disabled" json:"prompt_disabled" query:"prompt_disabled"` - // 扩展信息 + // extended information ExtraInfo map[string]string `thrift:"extra_info,9,optional" form:"extra_info" json:"extra_info,omitempty" query:"extra_info"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -5979,7 +5979,7 @@ func (p *UpdateDatabaseRequest) String() string { } type DeleteDatabaseRequest struct { - // database_info的主键id + // database_info primary key id ID int64 `thrift:"id,1" form:"id" json:"id,string" query:"id"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -6424,7 +6424,7 @@ func (p *DeleteDatabaseResponse) String() string { } type BindDatabaseToBotRequest struct { - // 草稿态数据database表主键id,注意是草稿态哈 + // Draft data database table primary key id, note that it is draft state DatabaseID int64 `thrift:"database_id,1" form:"database_id" json:"database_id,string" query:"database_id"` // bot_id BotID int64 `thrift:"bot_id,2" form:"bot_id" json:"bot_id,string" query:"bot_id"` @@ -6917,25 +6917,25 @@ func (p *BindDatabaseToBotResponse) String() string { type ListDatabaseRecordsRequest struct { // database_id DatabaseID int64 `thrift:"database_id,1,required" form:"database_id,required" json:"database_id,string,required" query:"database_id,required"` - // bot id,这里是查找bot关联的草稿态数据的时候填这个 + // bot id, here is to fill in this when looking for the draft state data associated with the bot BotID *int64 `thrift:"bot_id,2,optional" form:"bot_id" json:"bot_id,string,omitempty" query:"bot_id"` - // workflow_id,,这里是查找wk_flow关联的草稿态表的时候填这个 + // workflow_id,, here is to fill in this when looking up wk_flow associated draft status sheet WorkflowID *int64 `thrift:"workflow_id,3,optional" form:"workflow_id" json:"workflow_id,string,omitempty" query:"workflow_id"` - // 为true不根据user_id进行过滤Records + // Is true does not filter by user_id Records NotFilterByUserID *bool `thrift:"not_filter_by_user_id,4,optional" form:"not_filter_by_user_id" json:"not_filter_by_user_id,omitempty" query:"not_filter_by_user_id"` - // 为true不根据ConnectorID进行过滤Records + // Records not filtered by ConnectorID NotFilterByConnectorID *bool `thrift:"not_filter_by_connector_id,5,optional" form:"not_filter_by_connector_id" json:"not_filter_by_connector_id,omitempty" query:"not_filter_by_connector_id"` - // 要查的是草稿态还是线上态 + // Do you want to check the draft state or the online state? TableType TableType `thrift:"table_type,6" form:"table_type" json:"table_type" query:"table_type"` - // 别超过100,建议50 + // Do not exceed 100, 50 is recommended. Limit int64 `thrift:"limit,7" form:"limit" json:"limit" query:"limit"` - // 偏移量 + // Offset Offset int64 `thrift:"offset,8" form:"offset" json:"offset" query:"offset"` - // 同个project下数据不隔离 + // Data is not isolated under the same project ProjectID *int64 `thrift:"project_id,9,optional" form:"project_id" json:"project_id,string,omitempty" query:"project_id"` - //筛选条件 + //filter criteria FilterCriterion *ComplexCondition `thrift:"filter_criterion,10,optional" form:"filter_criterion" json:"filter_criterion,omitempty" query:"filter_criterion"` - //排序条件 + //sort condition OrderByList []*OrderBy `thrift:"order_by_list,11,optional" form:"order_by_list" json:"order_by_list,omitempty" query:"order_by_list"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -7672,13 +7672,13 @@ func (p *ListDatabaseRecordsRequest) String() string { type ListDatabaseRecordsRequestRPC struct { // database_id DatabaseID int64 `thrift:"database_id,1,required" form:"database_id,required" json:"database_id,string,required" query:"database_id,required"` - // 要查的是草稿态还是线上态 + // Do you want to check the draft state or the online state? TableType TableType `thrift:"table_type,2" form:"table_type" json:"table_type" query:"table_type"` - // 别超过100,建议50 + // Do not exceed 100, 50 is recommended. Limit int64 `thrift:"limit,3" form:"limit" json:"limit" query:"limit"` - // 偏移量 + // Offset Offset int64 `thrift:"offset,4" form:"offset" json:"offset" query:"offset"` - // 用户id + // user id UserID string `thrift:"user_id,5" form:"user_id" json:"user_id" query:"user_id"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -8058,7 +8058,7 @@ type ListDatabaseRecordsResponseRPC struct { Data []map[string]string `thrift:"data,1,required" form:"data,required" json:"data,required" query:"data,required"` HasMore bool `thrift:"HasMore,2,required" form:"HasMore,required" json:"HasMore,required" query:"HasMore,required"` TotalNum int32 `thrift:"TotalNum,3,required" form:"TotalNum,required" json:"TotalNum,required" query:"TotalNum,required"` - // 字段信息 + // Field information FieldList []*FieldItem `thrift:"field_list,4" form:"field_list" json:"field_list" query:"field_list"` BaseResp *base.BaseResp `thrift:"BaseResp,255,required" form:"BaseResp,required" json:"BaseResp,required" query:"BaseResp,required"` } @@ -8486,7 +8486,7 @@ type ListDatabaseRecordsResponse struct { Data []map[string]string `thrift:"data,1,required" form:"data,required" json:"data,required" query:"data,required"` HasMore bool `thrift:"HasMore,2,required" form:"HasMore,required" json:"HasMore,required" query:"HasMore,required"` TotalNum int32 `thrift:"TotalNum,3,required" form:"TotalNum,required" json:"TotalNum,required" query:"TotalNum,required"` - // 字段信息 + // Field information FieldList []*FieldItem `thrift:"field_list,4,optional" form:"field_list" json:"field_list,omitempty" query:"field_list"` 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"` @@ -9028,15 +9028,15 @@ func (p *ListDatabaseRecordsResponse) String() string { type UpdateDatabaseRecordsRequest struct { // database_id DatabaseID int64 `thrift:"database_id,1,required" form:"database_id,required" json:"database_id,string,required" query:"database_id,required"` - // 新增的 + // new RecordDataAdd []map[string]string `thrift:"record_data_add,2,optional" form:"record_data_add" json:"record_data_add,omitempty" query:"record_data_add"` - // 修改的 + // modified RecordDataAlter []map[string]string `thrift:"record_data_alter,3,optional" form:"record_data_alter" json:"record_data_alter,omitempty" query:"record_data_alter"` - // 删除的 + // deleted RecordDataDelete []map[string]string `thrift:"record_data_delete,4,optional" form:"record_data_delete" json:"record_data_delete,omitempty" query:"record_data_delete"` - // 要更新的的是草稿态还是线上态 + // Is the draft state or online state to be updated? TableType *TableType `thrift:"table_type,5,optional" form:"table_type" json:"table_type,omitempty" query:"table_type"` - // 更新时需穿入connector id + // The connector id needs to be inserted when updating. OriConnectorID *string `thrift:"ori_connector_id,6,optional" form:"ori_connector_id" json:"ori_connector_id,omitempty" query:"ori_connector_id"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -10018,7 +10018,7 @@ func (p *UpdateDatabaseRecordsResponse) String() string { } type GetOnlineDatabaseIdRequest struct { - // draft 的database_id + // The draft database_id ID int64 `thrift:"id,1,required" form:"id,required" json:"id,string,required" query:"id,required"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -10219,7 +10219,7 @@ func (p *GetOnlineDatabaseIdRequest) String() string { } type GetOnlineDatabaseIdResponse struct { - // 根据草稿的id查询线上的id + // Check the online id according to the id of the draft. ID *int64 `thrift:"id,1,optional" form:"id" json:"id,string,omitempty" query:"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"` @@ -10533,31 +10533,31 @@ func (p *GetOnlineDatabaseIdResponse) String() string { } type BotTable struct { - // 自增id,table id + // Autoincrement id, table id ID int64 `thrift:"id,1" form:"id" json:"id,string" query:"id"` - // 相关id. bot_id + // Related id bot_id BotID int64 `thrift:"bot_id,2" form:"bot_id" json:"bot_id,string" query:"bot_id"` // table_id TableID string `thrift:"table_id,3" form:"table_id" json:"table_id" query:"table_id"` - // 表名 + // table name TableName string `thrift:"table_name,4" form:"table_name" json:"table_name" query:"table_name"` - // 表描述 + // table description TableDesc string `thrift:"table_desc,5" form:"table_desc" json:"table_desc" query:"table_desc"` - // 状态 + // status Status BotTableStatus `thrift:"status,6" form:"status" json:"status" query:"status"` - // 创建着id + // Creating the ID. CreatorID int64 `thrift:"creator_id,7" form:"creator_id" json:"creator_id" query:"creator_id"` - // 创建时间 + // create_time CreateTime int64 `thrift:"create_time,8" form:"create_time" json:"create_time" query:"create_time"` - // 更新时间 + // update time UpdateTime int64 `thrift:"update_time,9" form:"update_time" json:"update_time" query:"update_time"` - // 字段信息 + // Field information FieldList []*FieldItem `thrift:"field_list,10" form:"field_list" json:"field_list" query:"field_list"` - // 数据表实际名称 + // Data table actual name ActualTableName string `thrift:"actual_table_name,11" form:"actual_table_name" json:"actual_table_name" query:"actual_table_name"` - // 读写模式 + // read and write mode RwMode BotTableRWMode `thrift:"rw_mode,12" form:"rw_mode" json:"rw_mode" query:"rw_mode"` - // 扩展信息 + // extended information ExtraInfo map[string]string `thrift:"extra_info,13,optional" form:"extra_info" json:"extra_info,omitempty" query:"extra_info"` } @@ -11285,7 +11285,7 @@ func (p *BotTable) String() string { } type InsertBotTableRequest struct { - // 保存表信息 + // Save table information BotTable *BotTable `thrift:"bot_table,1" form:"bot_table" json:"bot_table" query:"bot_table"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -11683,7 +11683,7 @@ func (p *InsertBotTableResponse) String() string { } type AlterBotTableRequest struct { - // 修改表信息 + // Modify table information BotTable *BotTable `thrift:"bot_table,1" form:"bot_table" json:"bot_table" query:"bot_table"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -13298,9 +13298,9 @@ func (p *GetBotTableResponse) String() string { } type CopyDatabaseRequest struct { - //ID生成器生成 + //ID generator generation IdempotentId string `thrift:"IdempotentId,1,required" form:"IdempotentId,required" json:"IdempotentId,required" query:"IdempotentId,required"` - //原来的tableId + //Original tableId TableIds []int64 `thrift:"TableIds,2,required" form:"TableIds,required" json:"TableIds,required" query:"TableIds,required"` ToSpaceId int64 `thrift:"ToSpaceId,3,required" form:"ToSpaceId,required" json:"ToSpaceId,required" query:"ToSpaceId,required"` ToUserId int64 `thrift:"ToUserId,4,required" form:"ToUserId,required" json:"ToUserId,required" query:"ToUserId,required"` @@ -14014,9 +14014,9 @@ func (p *CopyDatabaseResponse) String() string { } type CopyDatabaseRollbackRequest struct { - // ID生成器生成 + // ID generator generation IdempotentId string `thrift:"IdempotentId,1,required" form:"IdempotentId,required" json:"IdempotentId,required" query:"IdempotentId,required"` - // CopyDatabaseResponse返回的参数 + // Parameters returned CopyDatabaseResponse TableIdsMapping map[int64]int64 `thrift:"TableIdsMapping,2,required" form:"TableIdsMapping,required" json:"TableIdsMapping,required" query:"TableIdsMapping,required"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -14502,17 +14502,17 @@ func (p *CopyDatabaseRollbackResponce) String() string { } type GetNL2SQLRequest struct { - // 数据库请求的自然语言描述 + // Natural language description of database requests Text string `thrift:"text,1,required" form:"text,required" json:"text,required" query:"text,required"` // bot id BotID int64 `thrift:"bot_id,2,required" form:"bot_id,required" json:"bot_id,required" query:"bot_id,required"` - // 业务线id + // line of business id ConnectorID *int64 `thrift:"connector_id,3,optional" form:"connector_id" json:"connector_id,omitempty" query:"connector_id"` - // 业务线用户id + // line of business user id ConnectorUID *string `thrift:"connector_uid,4,optional" form:"connector_uid" json:"connector_uid,omitempty" query:"connector_uid"` - // table类型,分 draft 和 online 两种 + // Table types, draft and online TableType TableType `thrift:"table_type,5,required" form:"table_type,required" json:"table_type,required" query:"table_type,required"` - // 数据库id + // Database ID DatabaseID *int64 `thrift:"database_id,6,optional" form:"database_id" json:"database_id,string,omitempty" query:"database_id"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -15357,9 +15357,9 @@ func (p *GetNL2SQLResponse) String() string { type GetModeConfigRequest struct { // bot id BotID int64 `thrift:"bot_id,1,required" form:"bot_id,required" json:"bot_id,required" query:"bot_id,required"` - // 业务线id + // line of business id ConnectorID *int64 `thrift:"connector_id,2,optional" form:"connector_id" json:"connector_id,omitempty" query:"connector_id"` - // 业务线用户id + // line of business user id ConnectorUID *string `thrift:"connector_uid,3,optional" form:"connector_uid" json:"connector_uid,omitempty" query:"connector_uid"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -16181,15 +16181,15 @@ type ResetBotTableRequest struct { BotID *int64 `thrift:"bot_id,2,optional" form:"bot_id" json:"bot_id,string,omitempty" query:"bot_id"` TableID *int64 `thrift:"table_id,3,optional" form:"table_id" json:"table_id,string,omitempty" query:"table_id"` TableType TableType `thrift:"table_type,4,required" form:"table_type,required" json:"table_type,required" query:"table_type,required"` - // 业务线id + // line of business id ConnectorID *int64 `thrift:"connector_id,5,optional" form:"connector_id" json:"connector_id,omitempty" query:"connector_id"` - // 业务线用户id + // line of business user id ConnectorUID *string `thrift:"connector_uid,6,optional" form:"connector_uid" json:"connector_uid,omitempty" query:"connector_uid"` - // 工作流id + // Workflow ID WorkflowID *int64 `thrift:"workflow_id,7,optional" form:"workflow_id" json:"workflow_id,string,omitempty" query:"workflow_id"` - // 用户id + // user id DatabaseInfoID *int64 `thrift:"database_info_id,8,optional" form:"database_info_id" json:"database_info_id,string,omitempty" query:"database_info_id"` - // 项目id + // Project ID ProjectID *int64 `thrift:"project_id,9,optional" form:"project_id" json:"project_id,string,omitempty" query:"project_id"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -17097,13 +17097,13 @@ func (p *ResetBotTableResponse) String() string { /******** bot_table end ********/ /******** Bytedoc bot_table_info start ********/ type BatchInsertBotTableInfoRequest struct { - // 数据库名称 + // database name DbName string `thrift:"db_name,1" form:"db_name" json:"db_name" query:"db_name"` - // 集合名 + // collection name CollectionName string `thrift:"collection_name,2" form:"collection_name" json:"collection_name" query:"collection_name"` - // 保存数据 + // save data Data []map[string]string `thrift:"data,3" form:"data" json:"data" query:"data"` - // 用户id + // user id UserID int64 `thrift:"user_id,4" form:"user_id" json:"user_id" query:"user_id"` // bot id BotID int64 `thrift:"bot_id,5" form:"bot_id" json:"bot_id" query:"bot_id"` @@ -17676,13 +17676,13 @@ func (p *BatchInsertBotTableInfoResponse) String() string { } type UpdateBotTableInfoRequest struct { - // 数据库名称 + // database name DbName string `thrift:"db_name,1" form:"db_name" json:"db_name" query:"db_name"` - // 集合名 + // collection name CollectionName string `thrift:"collection_name,2" form:"collection_name" json:"collection_name" query:"collection_name"` - // 更新数据 + // update data DataList []map[string]string `thrift:"data_list,3" form:"data_list" json:"data_list" query:"data_list"` - // 用户id + // user id UserID int64 `thrift:"user_id,4" form:"user_id" json:"user_id" query:"user_id"` // bot id BotID int64 `thrift:"bot_id,5" form:"bot_id" json:"bot_id" query:"bot_id"` @@ -18255,13 +18255,13 @@ func (p *UpdateBotTableInfoResponse) String() string { } type DeleteBotTableInfoRequest struct { - // 数据库名称 + // database name DbName string `thrift:"db_name,1" form:"db_name" json:"db_name" query:"db_name"` - // 集合名 + // collection name CollectionName string `thrift:"collection_name,2" form:"collection_name" json:"collection_name" query:"collection_name"` - // 删除id 列表 + // Delete id list Ids []string `thrift:"ids,3" form:"ids" json:"ids" query:"ids"` - // 用户id + // user id UserID int64 `thrift:"user_id,4" form:"user_id" json:"user_id" query:"user_id"` // bot id BotID int64 `thrift:"bot_id,5" form:"bot_id" json:"bot_id" query:"bot_id"` @@ -18805,19 +18805,19 @@ func (p *DeleteBotTableInfoResponse) String() string { } type SearchBotTableInfoRequest struct { - // 搜素词,目前忽略 + // Search term, currently ignored KeyWord string `thrift:"key_word,1" form:"key_word" json:"key_word" query:"key_word"` Limit int64 `thrift:"limit,2" form:"limit" json:"limit" query:"limit"` Offset int64 `thrift:"offset,3" form:"offset" json:"offset" query:"offset"` - // 用户id + // user id ConnectorUID string `thrift:"connector_uid,4" form:"connector_uid" json:"connector_uid" query:"connector_uid"` ConnectorID int64 `thrift:"connector_id,5" form:"connector_id" json:"connector_id" query:"connector_id"` // bot id BotID int64 `thrift:"bot_id,6" form:"bot_id" json:"bot_id,string" query:"bot_id"` - // 目前忽略 + // Currently ignored TableName string `thrift:"table_name,7" form:"table_name" json:"table_name" query:"table_name"` TableID int64 `thrift:"table_id,8" form:"table_id" json:"table_id,string" query:"table_id"` - // 引用信息 + // citation information RefInfo *RefInfo `thrift:"ref_info,9,optional" form:"ref_info" json:"ref_info,omitempty" query:"ref_info"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -19732,27 +19732,27 @@ func (p *SearchBotTableInfoResponse) String() string { } type ExecuteSqlRequest struct { - // RunCommand 能执行的sql + // SQL that RunCommand can execute SQL string `thrift:"sql,1" form:"sql" json:"sql" query:"sql"` // bot id BotID int64 `thrift:"bot_id,2" form:"bot_id" json:"bot_id" query:"bot_id"` - // 业务线id + // line of business id ConnectorID int64 `thrift:"connector_id,3" form:"connector_id" json:"connector_id" query:"connector_id"` - // 业务线用户id + // line of business user id ConnectorUID string `thrift:"connector_uid,4" form:"connector_uid" json:"connector_uid" query:"connector_uid"` - // table类型 + // Table type TableType TableType `thrift:"table_type,5" form:"table_type" json:"table_type" query:"table_type"` - // workflow test run 标识 + // Workflow test run identification WftestID string `thrift:"wftest_id,6" form:"wftest_id" json:"wftest_id" query:"wftest_id"` - // 引用信息 + // citation information RefInfo *RefInfo `thrift:"ref_info,7,optional" form:"ref_info" json:"ref_info,omitempty" query:"ref_info"` // SQL params SqlParams []*SqlParamVal `thrift:"SqlParams,8,optional" form:"SqlParams" json:"SqlParams,omitempty" query:"SqlParams"` - // database info 的id + // Database info id DatabaseInfoID int64 `thrift:"database_info_id,9" form:"database_info_id" json:"database_info_id" query:"database_info_id"` // workflow id WorkflowID int64 `thrift:"workflow_id,10" form:"workflow_id" json:"workflow_id" query:"workflow_id"` - // 项目id + // Project ID ProjectID int64 `thrift:"project_id,11" form:"project_id" json:"project_id" query:"project_id"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -20990,9 +20990,9 @@ func (p *ExecuteSqlResponse) String() string { type BotTablePublishReq struct { BotID int64 `thrift:"bot_id,1,required" form:"bot_id,required" json:"bot_id,required" query:"bot_id,required"` - // 业务线id + // line of business id ConnectorID *int64 `thrift:"connector_id,2,optional" form:"connector_id" json:"connector_id,omitempty" query:"connector_id"` - // 业务线用户id + // line of business user id ConnectorUID *string `thrift:"connector_uid,3,optional" form:"connector_uid" json:"connector_uid,omitempty" query:"connector_uid"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -21303,9 +21303,9 @@ func (p *BotTablePublishReq) String() string { } type BotTablePublishResp struct { - // 执行状态: 0-执行成功 1-执行全部失败 2-执行部分失败 + // Execution status: 0-successful execution 1-failed execution all 2-failed execution part Status int64 `thrift:"status,1" form:"status" json:"status" query:"status"` - // 错误信息 + // error message Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"` } @@ -21542,15 +21542,15 @@ func (p *BotTablePublishResp) String() string { } type NL2SQLRequest struct { - // 数据库请求的自然语言描述 + // Natural language description of database requests Text string `thrift:"text,1,required" form:"text,required" json:"text,required" query:"text,required"` // bot id BotID int64 `thrift:"bot_id,2,required" form:"bot_id,required" json:"bot_id,required" query:"bot_id,required"` - // 业务线id + // line of business id ConnectorID *int64 `thrift:"connector_id,3,optional" form:"connector_id" json:"connector_id,omitempty" query:"connector_id"` - // 业务线用户id + // line of business user id ConnectorUID *string `thrift:"connector_uid,4,optional" form:"connector_uid" json:"connector_uid,omitempty" query:"connector_uid"` - // table类型,分 draft 和 online 两种 + // Table types, draft and online TableType TableType `thrift:"table_type,5,required" form:"table_type,required" json:"table_type,required" query:"table_type,required"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -22248,19 +22248,19 @@ func (p *NL2SQLResponse) String() string { } type QueryTableByNLRequest struct { - // 数据库请求的自然语言描述 + // Natural language description of database requests Text string `thrift:"text,1,required" form:"text,required" json:"text,required" query:"text,required"` // bot id BotID int64 `thrift:"bot_id,2,required" form:"bot_id,required" json:"bot_id,required" query:"bot_id,required"` - // 业务线id + // line of business id ConnectorID int64 `thrift:"connector_id,3,required" form:"connector_id,required" json:"connector_id,required" query:"connector_id,required"` - // 业务线用户id + // line of business user id ConnectorUID string `thrift:"connector_uid,4,required" form:"connector_uid,required" json:"connector_uid,required" query:"connector_uid,required"` - // table类型,分 draft 和 online 两种 + // Table types, draft and online TableType TableType `thrift:"table_type,5,required" form:"table_type,required" json:"table_type,required" query:"table_type,required"` - // chat history 透传到 nl2query 服务,由 nl2query 进行解析 + // The chat history is passed to the nl2query service, which is parsed by nl2query XAipluginTakoBotHistory *string `thrift:"x_aiplugin_tako_bot_history,6,optional" form:"x_aiplugin_tako_bot_history" json:"x_aiplugin_tako_bot_history,omitempty" query:"x_aiplugin_tako_bot_history"` - // bot_system_message 透传到 nl2query 服务,由 nl2query 进行解析 + // bot_system_message passed to the nl2query service, which is parsed by nl2query XAipluginBotSystemMessage *string `thrift:"x_aiplugin_bot_system_message,7,optional" form:"x_aiplugin_bot_system_message" json:"x_aiplugin_bot_system_message,omitempty" query:"x_aiplugin_bot_system_message"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -24544,11 +24544,11 @@ func (p *MigrateDatabaseResponse) String() string { } type MigrateOldDataRequest struct { - // 迁移哪个表 + // Which table to migrate BotType TableType `thrift:"bot_type,1" form:"bot_type" json:"bot_type" query:"bot_type"` - // 迁移哪个bot + // Which bot to migrate? BotID int64 `thrift:"bot_id,2" form:"bot_id" json:"bot_id,string" query:"bot_id"` - // 失败重试 + // Failed retry TableIds []int64 `thrift:"table_ids,3" form:"table_ids" json:"table_ids,string" query:"table_ids"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -25106,9 +25106,9 @@ func (p *MigrateOldDataResponse) String() string { } type MGetDisplayResourceInfoRequest struct { - // 最大传一页的数量,实现方可以限制最大100个 + // The maximum number of one page can be transferred, and the implementer can limit the maximum to 100. ResIDs []int64 `thrift:"ResIDs,1" form:"ResIDs" json:"ResIDs" query:"ResIDs"` - // 当前的用户,实现方用于判断权限 + // The current user, the implementation is used to determine the authority CurrentUserID int64 `thrift:"CurrentUserID,2" form:"CurrentUserID" json:"CurrentUserID" query:"CurrentUserID"` Base *base.Base `thrift:"Base,255" form:"Base" json:"Base" query:"Base"` } @@ -25580,11 +25580,11 @@ func (p *MGetDisplayResourceInfoResponse) String() string { } -// Library资源操作 +// Library Resource Operations type ResourceAction struct { - // 一个操作对应一个唯一的key,key由资源侧约束 + // An operation corresponds to a unique key, and the key is constrained by the resource side Key ActionKey `thrift:"Key,1,required" json:"key" form:"Key,required" query:"Key,required"` - //ture=可以操作该Action,false=置灰 + //ture = can operate this Action, false = grey out Enable bool `thrift:"Enable,2,required" json:"enable" form:"Enable,required" query:"Enable,required"` } @@ -25782,29 +25782,29 @@ func (p *ResourceAction) String() string { } -// 展示用,实现方提供展示信息 +// For display, the implementer provides display information type DisplayResourceInfo struct { - // 资源id + // Resource ID ResID *int64 `thrift:"ResID,1,optional" form:"ResID" json:"ResID,omitempty" query:"ResID"` - // 资源描述 + // resource description Desc *string `thrift:"Desc,5,optional" form:"Desc" json:"Desc,omitempty" query:"Desc"` - // 资源Icon,完整url + // Resource Icon, full url Icon *string `thrift:"Icon,6,optional" form:"Icon" json:"Icon,omitempty" query:"Icon"` - // 资源状态,各类型资源自身定义 + // Resource status, each type of resource defines itself BizResStatus *int32 `thrift:"BizResStatus,12,optional" form:"BizResStatus" json:"BizResStatus,omitempty" query:"BizResStatus"` - // 是否开启多人编辑 + // Whether to enable multi-person editing CollaborationEnable *bool `thrift:"CollaborationEnable,13,optional" form:"CollaborationEnable" json:"CollaborationEnable,omitempty" query:"CollaborationEnable"` - // 业务携带的扩展信息,以res_type区分,每个res_type定义的schema和含义不一样,使用前需要判断res_type + // Business carry extended information to res_type distinguish, each res_type defined schema and meaning is not the same, need to judge before use res_type BizExtend map[string]string `thrift:"BizExtend,16,optional" form:"BizExtend" json:"BizExtend,omitempty" query:"BizExtend"` - // 不同类型的不同操作按钮,由资源实现方和前端约定。返回则展示,要隐藏某个按钮,则不要返回; + // Different types of different operation buttons are agreed upon by the resource implementer and the front end. Return is displayed, if you want to hide a button, do not return; Actions []*ResourceAction `thrift:"Actions,17,optional" form:"Actions" json:"Actions,omitempty" query:"Actions"` - // 是否禁止进详情页 + // Whether to ban entering the details page DetailDisable *bool `thrift:"DetailDisable,18,optional" form:"DetailDisable" json:"DetailDisable,omitempty" query:"DetailDisable"` - // 资源名称 + // resource name Name *string `thrift:"Name,19,optional" form:"Name" json:"Name,omitempty" query:"Name"` - // 资源发布状态,1-未发布,2-已发布 + // Resource release status, 1 - unpublished, 2 - published PublishStatus *PublishStatus `thrift:"PublishStatus,20,optional" form:"PublishStatus" json:"PublishStatus,omitempty" query:"PublishStatus"` - // 最近编辑时间, unix秒级时间戳 + // Last edited, unix timestamp EditTime *int64 `thrift:"EditTime,21,optional" form:"EditTime" json:"EditTime,omitempty" query:"EditTime"` } @@ -26774,10 +26774,10 @@ func (p *SelectFieldList) String() string { } type Condition struct { - // 左值填字段名 + // Lvalue field name Left string `thrift:"left,1,required" form:"left,required" json:"left,required" query:"left,required"` Operation Operation `thrift:"operation,2,required" form:"operation,required" json:"operation,required" query:"operation,required"` - // 右值 + // rvalue Right string `thrift:"right,3,required" form:"right,required" json:"right,required" query:"right,required"` } @@ -27028,9 +27028,9 @@ func (p *Condition) String() string { type ComplexCondition struct { Conditions []*Condition `thrift:"conditions,1,optional" form:"conditions" json:"conditions,omitempty" query:"conditions"` - // 为了拓展,先不用 + // In order to expand, we don't need to NestedConditions *ComplexCondition `thrift:"nestedConditions,2,optional" form:"nestedConditions" json:"nestedConditions,omitempty" query:"nestedConditions"` - // "AND" 或 "OR" + // "AND" or "OR" Logic string `thrift:"logic,3,required" form:"logic,required" json:"logic,required" query:"logic,required"` } @@ -27648,39 +27648,39 @@ func (p *Row) String() string { } type CRUDDatabaseRequest struct { - // database的id + // Database id DatabaseInfoID int64 `thrift:"database_info_id,1,required" form:"database_info_id,required" json:"database_info_id,required" query:"database_info_id,required"` - // workflow id,wk flow纬度数据隔离 + // Workflow id, wk flow latitude data isolation WorkflowID int64 `thrift:"workflow_id,2" form:"workflow_id" json:"workflow_id" query:"workflow_id"` - // 项目id,同project下不隔离 + // Project id, not isolated under the same project ProjectID int64 `thrift:"project_id,3" form:"project_id" json:"project_id" query:"project_id"` // bot id BotID int64 `thrift:"bot_id,4" form:"bot_id" json:"bot_id" query:"bot_id"` - // 业务线id + // line of business id ConnectorID int64 `thrift:"connector_id,5" form:"connector_id" json:"connector_id" query:"connector_id"` - // 业务线用户id + // line of business user id ConnectorUID string `thrift:"connector_uid,6" form:"connector_uid" json:"connector_uid" query:"connector_uid"` - // table类型 + // Table type TableType TableType `thrift:"table_type,7,required" form:"table_type,required" json:"table_type,required" query:"table_type,required"` - // workflow test run 标识 + // Workflow test run identification WftestID string `thrift:"wftest_id,8" form:"wftest_id" json:"wftest_id" query:"wftest_id"` - // 引用信息 + // citation information RefInfo *RefInfo `thrift:"ref_info,9,optional" form:"ref_info" json:"ref_info,omitempty" query:"ref_info"` // SQL params SQLParams []*SqlParamVal `thrift:"sql_params,10,optional" form:"sql_params" json:"sql_params,omitempty" query:"sql_params"` - // 操作类型 + // operation type OperateType OperateType `thrift:"operate_type,11,required" form:"operate_type,required" json:"operate_type,required" query:"operate_type,required"` - // select时要查询的字段列表 + // List of fields to query when selected FieldList *SelectFieldList `thrift:"field_list,12,optional" form:"field_list" json:"field_list,omitempty" query:"field_list"` - // order by 字段列表 + // Order by field list OrderByList []*OrderBy `thrift:"order_by_list,13,optional" form:"order_by_list" json:"order_by_list,omitempty" query:"order_by_list"` // limit Limit *int64 `thrift:"limit,14,optional" form:"limit" json:"limit,omitempty" query:"limit"` // offset Offset *int64 `thrift:"offset,15,optional" form:"offset" json:"offset,omitempty" query:"offset"` - // 查询条件 + // query condition Condition *ComplexCondition `thrift:"condition,16,optional" form:"condition" json:"condition,omitempty" query:"condition"` - // 需要upsert的数据 + // Data to upsert Rows []*Row `thrift:"rows,17,optional" form:"rows" json:"rows,omitempty" query:"rows"` } @@ -28685,9 +28685,9 @@ func (p *CRUDDatabaseRequest) String() string { } type SourceInfo struct { - // 本地文件上传的 tos 地址 + // TOS address for local file upload TosURI *string `thrift:"tos_uri,1,optional" form:"tos_uri" json:"tos_uri,omitempty" query:"tos_uri"` - // 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,2,optional" form:"imagex_uri" json:"imagex_uri,omitempty" query:"imagex_uri"` } @@ -28895,7 +28895,7 @@ func (p *SourceInfo) String() string { type ValidateTableSchemaRequest struct { SpaceID int64 `thrift:"space_id,1" form:"space_id" json:"space_id,string" query:"space_id"` DatabaseID int64 `thrift:"database_id,2" form:"database_id" json:"database_id,string" query:"database_id"` - // source file 的信息 + // Information from the source file SourceInfo *SourceInfo `thrift:"source_info,3" form:"source_file" json:"source_file"` TableSheet *TableSheet `thrift:"table_sheet,4" form:"table_sheet" json:"table_sheet" query:"table_sheet"` TableType TableType `thrift:"table_type,5" form:"table_type" json:"table_type" query:"table_type"` @@ -29278,11 +29278,11 @@ func (p *ValidateTableSchemaRequest) String() string { } type TableSheet struct { - // 用户选择的 sheet id + // User selected sheet id SheetID int64 `thrift:"sheet_id,1" form:"sheet_id" json:"sheet_id,string" query:"sheet_id"` - // 用户选择的表头行数,从 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" query:"header_line_idx"` - // 用户选择的起始行号,从 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" query:"start_line_idx"` } @@ -29511,7 +29511,7 @@ func (p *TableSheet) String() string { type ValidateTableSchemaResponse struct { SchemaValidResult map[string]string `thrift:"SchemaValidResult,1,optional" form:"SchemaValidResult" json:"SchemaValidResult,omitempty" query:"SchemaValidResult"` - // 如果失败会返回错误码 + // 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:"-"` @@ -29848,13 +29848,13 @@ func (p *ValidateTableSchemaResponse) String() string { } type GetTableSchemaRequest struct { - // 表格解析信息, 默认初始值0,0,1 + // Table parsing information, default initial value 0, 0, 1 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 DatabaseID *int64 `thrift:"database_id,3,optional" form:"database_id" json:"database_id,string,omitempty" query:"database_id"` - // 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"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -30218,11 +30218,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"` } @@ -30450,16 +30450,16 @@ func (p *DocTableSheet) String() string { } type TableColumn struct { - // 列 id + // Column ID ID int64 `thrift:"id,1" form:"id" json:"id,string" query:"id"` - // 列名 + // column_name ColumnName string `thrift:"column_name,2" form:"column_name" json:"column_name" query:"column_name"` - // 列原本在 excel 的序号 + // List the serial number originally in excel Sequence int64 `thrift:"sequence,3" form:"sequence" json:"sequence,string" query:"sequence"` - // 列类型 + // column type ColumnType *ColumnType `thrift:"column_type,4,optional" form:"column_type" json:"column_type,omitempty" query:"column_type"` ContainsEmptyValue *bool `thrift:"contains_empty_value,5,optional" form:"contains_empty_value" json:"contains_empty_value,omitempty" query:"contains_empty_value"` - // 描述 + // describe Desc *string `thrift:"desc,6,optional" form:"desc" json:"desc,omitempty" query:"desc"` } @@ -30854,7 +30854,7 @@ func (p *TableColumn) String() string { type GetDatabaseFileProgressRequest struct { DatabaseID int64 `thrift:"database_id,1" form:"database_id" json:"database_id,string" query:"database_id"` - // table类型 + // Table type TableType TableType `thrift:"table_type,2,required" form:"table_type,required" json:"table_type,required" query:"table_type,required"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -31404,7 +31404,7 @@ func (p *GetDatabaseFileProgressResponse) String() string { type DatabaseFileProgressData struct { FileName string `thrift:"file_name,1" form:"file_name" json:"file_name" query:"file_name"` Progress int32 `thrift:"progress,2" form:"progress" json:"progress" query:"progress"` - //描述信息,如果有代表文件处理失败 + //Describe the information if there is a representative file processing failure StatusDescript *string `thrift:"status_descript,3,optional" form:"status_descript" json:"status_descript,omitempty" query:"status_descript"` } @@ -31645,10 +31645,10 @@ func (p *DatabaseFileProgressData) String() string { type SubmitDatabaseInsertRequest struct { DatabaseID int64 `thrift:"database_id,1" form:"database_id" json:"database_id,string" query:"database_id"` FileURI string `thrift:"file_uri,2" form:"file_uri" json:"file_uri" query:"file_uri"` - // table类型,要往草稿表插入还是线上表插入 + // Table type, do you want to insert into the draft table or the online table? TableType TableType `thrift:"table_type,3" form:"table_type" json:"table_type" query:"table_type"` TableSheet *TableSheet `thrift:"table_sheet,4,optional" form:"table_sheet" json:"table_sheet,omitempty" query:"table_sheet"` - // 要写入的渠道id + // Channel ID to write to ConnectorID *int64 `thrift:"connector_id,5,optional" form:"connector_id" json:"connector_id,string,omitempty" query:"connector_id"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -33602,7 +33602,7 @@ func (p *ConnectorInfo) String() string { } type GetDatabaseTemplateResponse struct { - // 下载地址 + // Download address TosUrl string `thrift:"TosUrl,1" form:"TosUrl" json:"TosUrl" query:"TosUrl"` 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"` @@ -33902,7 +33902,7 @@ func (p *GetDatabaseTemplateResponse) String() string { type UpdateDatabaseBotSwitchRequest struct { BotID int64 `thrift:"bot_id,1,required" form:"bot_id,required" json:"bot_id,string,required" query:"bot_id,required"` DatabaseID int64 `thrift:"database_id,2,required" form:"database_id,required" json:"database_id,string,required" query:"database_id,required"` - // 是否禁用prompt + // Whether to disable prompt PromptDisable bool `thrift:"prompt_disable,3,required" form:"prompt_disable,required" json:"prompt_disable,required" query:"prompt_disable,required"` Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"` } diff --git a/backend/api/model/task/task.go b/backend/api/model/task/task.go index a06ed42d..2899cf8e 100644 --- a/backend/api/model/task/task.go +++ b/backend/api/model/task/task.go @@ -3,10 +3,10 @@ package task import ( - "github.com/coze-dev/coze-studio/backend/api/model/base" - "github.com/coze-dev/coze-studio/backend/api/model/task_struct" "fmt" "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-studio/backend/api/model/base" + "github.com/coze-dev/coze-studio/backend/api/model/task_struct" ) type DraftProjectInnerTaskListRequest struct { diff --git a/backend/api/model/task_struct/task_struct.go b/backend/api/model/task_struct/task_struct.go index ed719d97..c19c1fd9 100644 --- a/backend/api/model/task_struct/task_struct.go +++ b/backend/api/model/task_struct/task_struct.go @@ -8,7 +8,7 @@ import ( ) type ProjectInnerTaskInfo struct { - // 任务id + // Task ID TaskID int64 `thrift:"task_id,1" form:"task_id" json:"task_id,string" query:"task_id"` } diff --git a/backend/application/app/app.go b/backend/application/app/app.go index 5d2ee215..16848239 100644 --- a/backend/application/app/app.go +++ b/backend/application/app/app.go @@ -1014,7 +1014,7 @@ func (a *APPApplicationService) ResourceCopyDetail(ctx context.Context, req *res } if !exist { - return resp, nil // 默认返回处理中 + return resp, nil // Default return processing } detail.Status = resourceCommon.TaskStatus(result.CopyStatus) diff --git a/backend/application/conversation/agent_run.go b/backend/application/conversation/agent_run.go index 959ae79b..f0482ee7 100644 --- a/backend/application/conversation/agent_run.go +++ b/backend/application/conversation/agent_run.go @@ -348,7 +348,7 @@ func (c *ConversationApplicationService) buildTools(ctx context.Context, tools [ } arguments[key] = parametersStruct.Value - // uri需要转换成url + // URI needs to be converted to url. if parametersStruct.ResourceType == consts.ShortcutCommandResourceType { resourceInfo, err := c.appContext.ImageX.GetResourceURL(ctx, parametersStruct.Value) diff --git a/backend/application/knowledge/convertor.go b/backend/application/knowledge/convertor.go index 59f1fb9d..0b184bfe 100644 --- a/backend/application/knowledge/convertor.go +++ b/backend/application/knowledge/convertor.go @@ -64,7 +64,7 @@ func assertValAs(typ document.TableColumnType, val string) (*document.ColumnData }, nil case document.TableColumnTypeTime: - // 支持时间戳和时间字符串 + // Supports timestamp and time string i, err := strconv.ParseInt(val, 10, 64) if err == nil { t := time.Unix(i, 0) diff --git a/backend/application/memory/database.go b/backend/application/memory/database.go index a974a928..3aa5f43f 100644 --- a/backend/application/memory/database.go +++ b/backend/application/memory/database.go @@ -658,7 +658,7 @@ func (d *DatabaseApplicationService) GetDatabaseTableSchema(ctx context.Context, HeaderLineIdx: req.GetTableSheet().GetHeaderLineIdx(), StartLineIdx: req.GetTableSheet().GetStartLineIdx(), }, - // 不传默认返回所有数据 + // All data is returned by default without passing it on. TableDataType: tableType, }) if err != nil { diff --git a/backend/application/modelmgr/modelmgr.go b/backend/application/modelmgr/modelmgr.go index b56dc586..8d85c66f 100644 --- a/backend/application/modelmgr/modelmgr.go +++ b/backend/application/modelmgr/modelmgr.go @@ -39,7 +39,7 @@ var ModelmgrApplicationSVC = &ModelmgrApplicationService{} func (m *ModelmgrApplicationService) GetModelList(ctx context.Context, _ *developer_api.GetTypeListRequest) ( resp *developer_api.GetTypeListResponse, err error, ) { - // 一般不太可能同时配置这么多模型 + // It is generally not possible to configure so many models simultaneously const modelMaxLimit = 300 modelResp, err := m.Mgr.ListModel(ctx, &modelmgr.ListModelRequest{ @@ -121,7 +121,7 @@ func modelDo2To(model *modelmgr.Model, locale i18n.Locale) (*developer_api.Model ModelTagList: nil, IsUpRequired: nil, ModelBriefDesc: model.Description.Read(locale), - ModelSeries: &developer_api.ModelSeriesInfo{ // TODO: 替换为真实配置 + ModelSeries: &developer_api.ModelSeriesInfo{ // TODO: Replace with real configuration SeriesName: "热门模型", }, ModelStatusDetails: nil, diff --git a/backend/application/plugin/plugin.go b/backend/application/plugin/plugin.go index 25c8da05..99adb619 100644 --- a/backend/application/plugin/plugin.go +++ b/backend/application/plugin/plugin.go @@ -217,7 +217,7 @@ func (p *PluginApplicationService) toPluginInfoForPlayground(ctx context.Context UpdateTime: strconv.FormatInt(pl.UpdatedAt/1000, 10), ProjectID: strconv.FormatInt(pl.GetAPPID(), 10), VersionName: pl.GetVersion(), - VersionTs: pl.GetVersion(), // 兼容前端逻辑,理论上应该使用 VersionName + VersionTs: pl.GetVersion(), // Compatible with front-end logic, in theory VersionName should be used PluginApis: pluginAPIs, } @@ -1237,7 +1237,7 @@ func (p *PluginApplicationService) PublicGetProductList(ctx context.Context, req resp = &productAPI.GetProductListResponse{ Data: &productAPI.GetProductListData{ Products: products, - HasMore: false, // 一次性拉完 + HasMore: false, // Finish at one time Total: int32(res.Total), }, } diff --git a/backend/application/search/resource_search.go b/backend/application/search/resource_search.go index 449e6d1e..d79a8e89 100644 --- a/backend/application/search/resource_search.go +++ b/backend/application/search/resource_search.go @@ -73,7 +73,7 @@ func (s *SearchApplicationService) LibraryResourceList(ctx context.Context, req Limit: req.GetSize(), } - // 设置用户过滤 + // Set up user filtering if req.IsSetUserFilter() && req.GetUserFilter() > 0 { searchReq.OwnerID = ptr.From(userID) } diff --git a/backend/application/singleagent/get.go b/backend/application/singleagent/get.go index 88c6a84d..a7e0369e 100644 --- a/backend/application/singleagent/get.go +++ b/backend/application/singleagent/get.go @@ -444,7 +444,7 @@ func parametersDo2Vo(op *plugin.Openapi3Operation) []*playground.PluginParameter } } - break // 只取一种 MIME + break // Take only one MIME. } return params diff --git a/backend/application/singleagent/single_agent.go b/backend/application/singleagent/single_agent.go index d8dd650a..c0b69924 100644 --- a/backend/application/singleagent/single_agent.go +++ b/backend/application/singleagent/single_agent.go @@ -156,7 +156,7 @@ func (s *SingleAgentApplicationService) UpdatePromptDisable(ctx context.Context, } if len(draft.Database) == 0 { - return nil, fmt.Errorf("agent %d has no database", agentID) // TODO(@fanlv): 错误码 + return nil, fmt.Errorf("agent %d has no database", agentID) // TODO (@fanlv): error code } dbInfos := draft.Database @@ -170,7 +170,7 @@ func (s *SingleAgentApplicationService) UpdatePromptDisable(ctx context.Context, } if !found { - return nil, fmt.Errorf("database %d not found in agent %d", req.GetDatabaseID(), agentID) // TODO(@fanlv): 错误码 + return nil, fmt.Errorf("database %d not found in agent %d", req.GetDatabaseID(), agentID) // TODO (@fanlv): error code } draft.Database = dbInfos @@ -606,7 +606,7 @@ func (s *SingleAgentApplicationService) ListAgentPublishHistory(ctx context.Cont Name: creator.Name, AvatarURL: creator.IconURL, Self: uid == v.CreatorID, - // UserUniqueName: creator.UserUniqueName, // TODO(@fanlv) : user domain 补完以后再改 + // UserUniqueName: creator. UserUniqueName,//TODO (@fanlv): Change the user domain after it is completed // UserLabel TODO }, PublishID: &v.PublishID, diff --git a/backend/application/upload/icon.go b/backend/application/upload/icon.go index 6dac214a..a0ac89d5 100644 --- a/backend/application/upload/icon.go +++ b/backend/application/upload/icon.go @@ -486,7 +486,7 @@ func isImageUri(uri string) bool { "ico": true, } - // 检查扩展名是否在图片扩展名列表中 + // Check if the extension is in the picture extension list return imageExtensions[ext] } func (u *UploadService) GetObjInfoBySessionKey(ctx context.Context, sessionKey string) (*GetObjInfoBySessionKey, error) { @@ -534,7 +534,7 @@ type SVG struct { ViewBox string `xml:"viewBox,attr"` } -// 获取 SVG 尺寸 +// Get SVG size func getSVGDimensions(content []byte) (width, height int32, err error) { decoder := xml.NewDecoder(bytes.NewReader(content)) @@ -543,7 +543,7 @@ func getSVGDimensions(content []byte) (width, height int32, err error) { return 100, 100, nil } - // 尝试从width属性获取 + // Try to get from the width property if svg.Width != "" { w, err := parseDimension(svg.Width) if err == nil { @@ -551,7 +551,7 @@ func getSVGDimensions(content []byte) (width, height int32, err error) { } } - // 尝试从height属性获取 + // Try to get from the height property if svg.Height != "" { h, err := parseDimension(svg.Height) if err == nil { @@ -559,7 +559,7 @@ func getSVGDimensions(content []byte) (width, height int32, err error) { } } - // 如果width或height未设置,尝试从viewBox获取 + // If width or height is not set, try getting it from the viewBox if width == 0 || height == 0 { if svg.ViewBox != "" { parts := strings.Fields(svg.ViewBox) @@ -587,19 +587,19 @@ func getSVGDimensions(content []byte) (width, height int32, err error) { return width, height, nil } func parseDimension(dim string) (int32, error) { - // 去除单位(px, pt, em, %等)和空格 + // Remove units (px, pt, em,%, etc.) and spaces dim = strings.TrimSpace(dim) dim = strings.TrimRightFunc(dim, func(r rune) bool { return (r < '0' || r > '9') && r != '.' && r != '-' && r != '+' }) - // 解析为float64 + // Resolve to float64 value, err := strconv.ParseFloat(dim, 64) if err != nil { return 0, err } - // 四舍五入转换为int32 + // Rounding converts to int32 if value > math.MaxInt32 { return math.MaxInt32, nil } diff --git a/backend/application/user/user.go b/backend/application/user/user.go index a05678bf..029577d3 100644 --- a/backend/application/user/user.go +++ b/backend/application/user/user.go @@ -45,9 +45,9 @@ type UserApplicationService struct { DomainSVC user.User } -// 添加一个简单的 email 验证函数 +// Add a simple email verification function func isValidEmail(email string) bool { - // 如果 email 字符串格式不正确,它会返回一个 error + // If the email string is not in the correct format, it will return an error. _, err := mail.ParseAddress(email) return err == nil } @@ -55,7 +55,7 @@ func isValidEmail(email string) bool { func (u *UserApplicationService) PassportWebEmailRegisterV2(ctx context.Context, locale string, req *passport.PassportWebEmailRegisterV2PostRequest) ( resp *passport.PassportWebEmailRegisterV2PostResponse, sessionKey string, err error, ) { - // 验证 email 格式是否合法 + // Verify that the email format is legitimate if !isValidEmail(req.GetEmail()) { return nil, "", errorx.New(errno.ErrUserInvalidParamCode, errorx.KV("msg", "Invalid email")) } @@ -100,7 +100,7 @@ func (u *UserApplicationService) allowRegisterChecker(email string) bool { return slices.Contains(strings.Split(allowedEmails, ","), strings.ToLower(email)) } -// PassportWebLogoutGet 处理用户登出请求 +// PassportWebLogoutGet handle user logout requests func (u *UserApplicationService) PassportWebLogoutGet(ctx context.Context, req *passport.PassportWebLogoutGetRequest) ( resp *passport.PassportWebLogoutGetResponse, err error, ) { @@ -116,7 +116,7 @@ func (u *UserApplicationService) PassportWebLogoutGet(ctx context.Context, req * }, nil } -// PassportWebEmailLoginPost 处理用户邮箱登录请求 +// PassportWebEmailLoginPost handle user email login requests func (u *UserApplicationService) PassportWebEmailLoginPost(ctx context.Context, req *passport.PassportWebEmailLoginPostRequest) ( resp *passport.PassportWebEmailLoginPostResponse, sessionKey string, err error, ) { @@ -160,11 +160,11 @@ func (u *UserApplicationService) PassportAccountInfoV2(ctx context.Context, req }, nil } -// UserUpdateAvatar 更新用户头像 +// UserUpdateAvatar Update user avatar func (u *UserApplicationService) UserUpdateAvatar(ctx context.Context, mimeType string, req *passport.UserUpdateAvatarRequest) ( resp *passport.UserUpdateAvatarResponse, err error, ) { - // 根据 MIME type 获取文件后缀 + // Get file suffix by MIME type var ext string switch mimeType { case "image/jpeg", "image/jpg": @@ -195,7 +195,7 @@ func (u *UserApplicationService) UserUpdateAvatar(ctx context.Context, mimeType }, nil } -// UserUpdateProfile 更新用户资料 +// UserUpdateProfile Update user profile func (u *UserApplicationService) UserUpdateProfile(ctx context.Context, req *passport.UserUpdateProfileRequest) ( resp *passport.UserUpdateProfileResponse, err error, ) { diff --git a/backend/conf/plugin/pluginproduct/lark_sheet.yaml b/backend/conf/plugin/pluginproduct/lark_sheet.yaml index 60dc034a..84dbbb9b 100644 --- a/backend/conf/plugin/pluginproduct/lark_sheet.yaml +++ b/backend/conf/plugin/pluginproduct/lark_sheet.yaml @@ -432,7 +432,7 @@ paths: type: object type: array resource_type: - description: 工作表类型,sheet:工作表,bitable:多维表格,#UNSUPPORTED_TYPE:不支持的类型 + description: 工作表类型,sheet:工作表,bitable:多维表格,#UNSUPPORTED_TYPE: Unsupported types type: string sheet_id: description: 工作表 ID diff --git a/backend/crossdomain/contract/crossworkflow/crossworkflow.go b/backend/crossdomain/contract/crossworkflow/crossworkflow.go index 339b2e45..50156392 100644 --- a/backend/crossdomain/contract/crossworkflow/crossworkflow.go +++ b/backend/crossdomain/contract/crossworkflow/crossworkflow.go @@ -26,7 +26,7 @@ import ( "github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo" ) -// TODO(@fanlv): 参数引用需要修改。 +// TODO (@fanlv): Parameter references need to be modified. type Workflow interface { WorkflowAsModelTool(ctx context.Context, policies []*vo.GetPolicy) ([]workflow.ToolFromWorkflow, error) DeleteWorkflow(ctx context.Context, id int64) error diff --git a/backend/domain/agent/singleagent/internal/agentflow/agent_flow_builder_test.go b/backend/domain/agent/singleagent/internal/agentflow/agent_flow_builder_test.go index fd0e2c3b..789a2e9c 100644 --- a/backend/domain/agent/singleagent/internal/agentflow/agent_flow_builder_test.go +++ b/backend/domain/agent/singleagent/internal/agentflow/agent_flow_builder_test.go @@ -70,7 +70,7 @@ func TestBuildAgent(t *testing.T) { // PluginID: 999, // Operation: &pluginEntity.Openapi3Operation{ // OperationID: "get_user_salary", - // Summary: "了解用户的月收入情况", + // Summary: "Understand the monthly income of users", // Parameters: openapi3.Parameters{ // { // Value: &openapi3.Parameter{ @@ -126,7 +126,7 @@ func TestBuildAgent(t *testing.T) { // RawContent: []*knowledgeEntity.SliceContent{ // { // Type: knowledgeEntity.SliceContentTypeText, - // Text: ptr.Of("learn computer science, become software developer, 月薪 2W 左右"), + // Text: ptr. Of ("learn computer science, become software developer, monthly salary is about 2W"), // }, // }, // }, @@ -168,7 +168,7 @@ func TestBuildAgent(t *testing.T) { // KnowledgeInfo: []*bot_common.KnowledgeInfo{ // { // Id: ptr.Of("777"), - // Name: ptr.Of("赚钱指南:根据你的个人兴趣、个人条件规划职业发展路径,达成所需的赚钱目标"), + // Name: ptr. Of ("Making Money Guide: Plan a career development path according to your personal interests and personal conditions to achieve the desired earning goals"), // }, // }, // }, diff --git a/backend/domain/agent/singleagent/internal/agentflow/node_prompt_variables.go b/backend/domain/agent/singleagent/internal/agentflow/node_prompt_variables.go index c308e61c..ee12e5f0 100644 --- a/backend/domain/agent/singleagent/internal/agentflow/node_prompt_variables.go +++ b/backend/domain/agent/singleagent/internal/agentflow/node_prompt_variables.go @@ -46,9 +46,9 @@ func (p *promptVariables) AssemblePromptVariables(ctx context.Context, req *Agen variables[placeholderOfUserInput] = []*schema.Message{req.Input} } - // 处理对话历史 + // Handling conversation history if len(req.History) > 0 { - // 将历史消息添加到变量中 + // Add chat history to variable variables[placeholderOfChatHistory] = req.History } diff --git a/backend/domain/agent/singleagent/internal/agentflow/node_tool_knowledge.go b/backend/domain/agent/singleagent/internal/agentflow/node_tool_knowledge.go index 2c9a2a22..f811d6ce 100644 --- a/backend/domain/agent/singleagent/internal/agentflow/node_tool_knowledge.go +++ b/backend/domain/agent/singleagent/internal/agentflow/node_tool_knowledge.go @@ -71,7 +71,7 @@ func newKnowledgeTool(ctx context.Context, conf *knowledgeConfig) (tool.Invokabl Type: openapi3.TypeInteger, }, } - // 设置字段描述和枚举值 + // Set field descriptions and enumeration values schema.Description = desc schema.Enum = make([]interface{}, 0, len(conf.knowledgeInfos)) for _, k := range conf.knowledgeInfos { diff --git a/backend/domain/agent/singleagent/internal/dal/model/single_agent_draft.gen.go b/backend/domain/agent/singleagent/internal/dal/model/single_agent_draft.gen.go index 205003cd..8e552ae1 100644 --- a/backend/domain/agent/singleagent/internal/dal/model/single_agent_draft.gen.go +++ b/backend/domain/agent/singleagent/internal/dal/model/single_agent_draft.gen.go @@ -23,7 +23,7 @@ type SingleAgentDraft struct { CreatedAt int64 `gorm:"column:created_at;not null;autoCreateTime:milli;comment:Create Time in Milliseconds" json:"created_at"` // Create Time in Milliseconds UpdatedAt int64 `gorm:"column:updated_at;not null;autoUpdateTime:milli;comment:Update Time in Milliseconds" json:"updated_at"` // Update Time in Milliseconds DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;comment:delete time in millisecond" json:"deleted_at"` // delete time in millisecond - VariablesMetaID *int64 `gorm:"column:variables_meta_id;comment:variables meta 表 ID" json:"variables_meta_id"` // variables meta 表 ID + VariablesMetaID *int64 `gorm:"column:variables_meta_id;comment:variables meta table ID" json:"variables_meta_id"` // variables meta table ID ModelInfo *bot_common.ModelInfo `gorm:"column:model_info;comment:Model Configuration Information;serializer:json" json:"model_info"` // Model Configuration Information OnboardingInfo *bot_common.OnboardingInfo `gorm:"column:onboarding_info;comment:Onboarding Information;serializer:json" json:"onboarding_info"` // Onboarding Information Prompt *bot_common.PromptInfo `gorm:"column:prompt;comment:Agent Prompt Configuration;serializer:json" json:"prompt"` // Agent Prompt Configuration diff --git a/backend/domain/agent/singleagent/internal/dal/model/single_agent_publish.gen.go b/backend/domain/agent/singleagent/internal/dal/model/single_agent_publish.gen.go index ae1862ec..14c75188 100644 --- a/backend/domain/agent/singleagent/internal/dal/model/single_agent_publish.gen.go +++ b/backend/domain/agent/singleagent/internal/dal/model/single_agent_publish.gen.go @@ -6,20 +6,20 @@ package model const TableNameSingleAgentPublish = "single_agent_publish" -// SingleAgentPublish bot 渠道和发布版本流水表 +// SingleAgentPublish Bot connector and release version info type SingleAgentPublish struct { - ID int64 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键id" json:"id"` // 主键id + ID int64 `gorm:"column:id;primaryKey;autoIncrement:true;comment:id" json:"id"` // id AgentID int64 `gorm:"column:agent_id;not null;comment:agent_id" json:"agent_id"` // agent_id - PublishID string `gorm:"column:publish_id;not null;comment:发布 id" json:"publish_id"` // 发布 id - ConnectorIds []int64 `gorm:"column:connector_ids;comment:发布的 connector_ids;serializer:json" json:"connector_ids"` // 发布的 connector_ids + PublishID string `gorm:"column:publish_id;not null;comment:publish id" json:"publish_id"` // publish id + ConnectorIds []int64 `gorm:"column:connector_ids;comment:connector_ids;serializer:json" json:"connector_ids"` // connector_ids Version string `gorm:"column:version;not null;comment:Agent Version" json:"version"` // Agent Version - PublishInfo *string `gorm:"column:publish_info;comment:发布信息" json:"publish_info"` // 发布信息 - PublishTime int64 `gorm:"column:publish_time;not null;comment:发布时间" json:"publish_time"` // 发布时间 + PublishInfo *string `gorm:"column:publish_info;comment:publish info" json:"publish_info"` // publish info + PublishTime int64 `gorm:"column:publish_time;not null;comment:publish time" json:"publish_time"` // publish time CreatedAt int64 `gorm:"column:created_at;not null;autoCreateTime:milli;comment:Create Time in Milliseconds" json:"created_at"` // Create Time in Milliseconds UpdatedAt int64 `gorm:"column:updated_at;not null;autoUpdateTime:milli;comment:Update Time in Milliseconds" json:"updated_at"` // Update Time in Milliseconds - CreatorID int64 `gorm:"column:creator_id;not null;comment:发布人 user_id" json:"creator_id"` // 发布人 user_id - Status int32 `gorm:"column:status;not null;comment:状态 0:使用中 1:删除 3:禁用" json:"status"` // 状态 0:使用中 1:删除 3:禁用 - Extra *string `gorm:"column:extra;comment:扩展字段" json:"extra"` // 扩展字段 + CreatorID int64 `gorm:"column:creator_id;not null;comment:creator id" json:"creator_id"` // creator id + Status int32 `gorm:"column:status;not null;comment:Status 0: In use 1: Delete 3: Disabled" json:"status"` // Status 0: In use 1: Delete 3: Disabled + Extra *string `gorm:"column:extra;comment:extra" json:"extra"` // extra } // TableName SingleAgentPublish's table name diff --git a/backend/domain/agent/singleagent/internal/dal/model/single_agent_version.gen.go b/backend/domain/agent/singleagent/internal/dal/model/single_agent_version.gen.go index f0680d77..4de3ed86 100644 --- a/backend/domain/agent/singleagent/internal/dal/model/single_agent_version.gen.go +++ b/backend/domain/agent/singleagent/internal/dal/model/single_agent_version.gen.go @@ -23,7 +23,7 @@ type SingleAgentVersion struct { CreatedAt int64 `gorm:"column:created_at;not null;autoCreateTime:milli;comment:Create Time in Milliseconds" json:"created_at"` // Create Time in Milliseconds UpdatedAt int64 `gorm:"column:updated_at;not null;autoUpdateTime:milli;comment:Update Time in Milliseconds" json:"updated_at"` // Update Time in Milliseconds DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;comment:delete time in millisecond" json:"deleted_at"` // delete time in millisecond - VariablesMetaID *int64 `gorm:"column:variables_meta_id;comment:variables meta 表 ID" json:"variables_meta_id"` // variables meta 表 ID + VariablesMetaID *int64 `gorm:"column:variables_meta_id;comment:variables meta table ID" json:"variables_meta_id"` // variables meta table ID ModelInfo *bot_common.ModelInfo `gorm:"column:model_info;comment:Model Configuration Information;serializer:json" json:"model_info"` // Model Configuration Information OnboardingInfo *bot_common.OnboardingInfo `gorm:"column:onboarding_info;comment:Onboarding Information;serializer:json" json:"onboarding_info"` // Onboarding Information Prompt *bot_common.PromptInfo `gorm:"column:prompt;comment:Agent Prompt Configuration;serializer:json" json:"prompt"` // Agent Prompt Configuration diff --git a/backend/domain/agent/singleagent/internal/dal/query/single_agent_draft.gen.go b/backend/domain/agent/singleagent/internal/dal/query/single_agent_draft.gen.go index 14bd1c89..0047e133 100644 --- a/backend/domain/agent/singleagent/internal/dal/query/single_agent_draft.gen.go +++ b/backend/domain/agent/singleagent/internal/dal/query/single_agent_draft.gen.go @@ -70,7 +70,7 @@ type singleAgentDraft struct { CreatedAt field.Int64 // Create Time in Milliseconds UpdatedAt field.Int64 // Update Time in Milliseconds DeletedAt field.Field // delete time in millisecond - VariablesMetaID field.Int64 // variables meta 表 ID + VariablesMetaID field.Int64 // variables meta table ID ModelInfo field.Field // Model Configuration Information OnboardingInfo field.Field // Onboarding Information Prompt field.Field // Agent Prompt Configuration diff --git a/backend/domain/agent/singleagent/internal/dal/query/single_agent_publish.gen.go b/backend/domain/agent/singleagent/internal/dal/query/single_agent_publish.gen.go index 813d9c95..a31276ad 100644 --- a/backend/domain/agent/singleagent/internal/dal/query/single_agent_publish.gen.go +++ b/backend/domain/agent/singleagent/internal/dal/query/single_agent_publish.gen.go @@ -45,23 +45,23 @@ func newSingleAgentPublish(db *gorm.DB, opts ...gen.DOOption) singleAgentPublish return _singleAgentPublish } -// singleAgentPublish bot 渠道和发布版本流水表 +// singleAgentPublish Bot connector and release version info type singleAgentPublish struct { singleAgentPublishDo ALL field.Asterisk - ID field.Int64 // 主键id + ID field.Int64 // id AgentID field.Int64 // agent_id - PublishID field.String // 发布 id - ConnectorIds field.Field // 发布的 connector_ids + PublishID field.String // publish id + ConnectorIds field.Field // connector_ids Version field.String // Agent Version - PublishInfo field.String // 发布信息 - PublishTime field.Int64 // 发布时间 + PublishInfo field.String // publish info + PublishTime field.Int64 // publish time CreatedAt field.Int64 // Create Time in Milliseconds UpdatedAt field.Int64 // Update Time in Milliseconds - CreatorID field.Int64 // 发布人 user_id - Status field.Int32 // 状态 0:使用中 1:删除 3:禁用 - Extra field.String // 扩展字段 + CreatorID field.Int64 // creator id + Status field.Int32 // Status 0: In use 1: Delete 3: Disabled + Extra field.String // extra fieldMap map[string]field.Expr } diff --git a/backend/domain/agent/singleagent/internal/dal/query/single_agent_version.gen.go b/backend/domain/agent/singleagent/internal/dal/query/single_agent_version.gen.go index e85e7d5b..ee2869a8 100644 --- a/backend/domain/agent/singleagent/internal/dal/query/single_agent_version.gen.go +++ b/backend/domain/agent/singleagent/internal/dal/query/single_agent_version.gen.go @@ -72,7 +72,7 @@ type singleAgentVersion struct { CreatedAt field.Int64 // Create Time in Milliseconds UpdatedAt field.Int64 // Update Time in Milliseconds DeletedAt field.Field // delete time in millisecond - VariablesMetaID field.Int64 // variables meta 表 ID + VariablesMetaID field.Int64 // variables meta table ID ModelInfo field.Field // Model Configuration Information OnboardingInfo field.Field // Onboarding Information Prompt field.Field // Agent Prompt Configuration diff --git a/backend/domain/agent/singleagent/internal/dal/single_agent_publish.go b/backend/domain/agent/singleagent/internal/dal/single_agent_publish.go index 7c304373..839db6de 100644 --- a/backend/domain/agent/singleagent/internal/dal/single_agent_publish.go +++ b/backend/domain/agent/singleagent/internal/dal/single_agent_publish.go @@ -20,7 +20,7 @@ import ( "context" "time" - // 添加这个导入以解决 gen.Expr 未定义的问题 + // Add this import to fix the undefined issue with gen. Expr "github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/entity" "github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/internal/dal/model" @@ -29,7 +29,7 @@ import ( "github.com/coze-dev/coze-studio/backend/types/errno" ) -// List 方法:分页查询发布记录 pageIndex 从1开始 +// List method: paging query publishing records pageIndex starts at 1 func (dao *SingleAgentVersionDAO) List(ctx context.Context, agentID int64, pageIndex, pageSize int32) ([]*entity.SingleAgentPublish, error) { sap := dao.dbQuery.SingleAgentPublish offset := (pageIndex - 1) * pageSize diff --git a/backend/domain/agent/singleagent/service/publish.go b/backend/domain/agent/singleagent/service/publish.go index 10340d54..252d077c 100644 --- a/backend/domain/agent/singleagent/service/publish.go +++ b/backend/domain/agent/singleagent/service/publish.go @@ -126,7 +126,7 @@ func (s *singleAgentImpl) GetPublishConnectorList(ctx context.Context, agentID i } else if v.ID == consts.APIConnectorID { c.BindType = developer_api.BindType_ApiBind // c.BindInfo = map[string]string{ - // "sdk_version": "1.2.0-beta.6", // TODO(@fanlv): 确认版本在哪读取? + // "sdk_version": "1.2.0 -beta.6",//TODO (@fanlv): Where to check the version? // } c.AuthLoginInfo = &developer_api.AuthLoginInfo{} } diff --git a/backend/domain/agent/singleagent/service/single_agent_impl.go b/backend/domain/agent/singleagent/service/single_agent_impl.go index 6735f93e..29196068 100644 --- a/backend/domain/agent/singleagent/service/single_agent_impl.go +++ b/backend/domain/agent/singleagent/service/single_agent_impl.go @@ -288,7 +288,7 @@ func (s *singleAgentImpl) ListAgentPublishHistory(ctx context.Context, agentID i maxCount = pageSize * pageIndex ) - // 全量拉取符合条件的记录 + // Pull all eligible records for { pageData, err := s.AgentVersionRepo.List(ctx, agentID, currentPage, 50) if err != nil { @@ -298,7 +298,7 @@ func (s *singleAgentImpl) ListAgentPublishHistory(ctx context.Context, agentID i break } - // 过滤当前页数据 + // Filter current page data for _, item := range pageData { for _, cID := range item.ConnectorIds { if cID == *connectorID { diff --git a/backend/domain/conversation/agentrun/internal/dal/model/run_record.gen.go b/backend/domain/conversation/agentrun/internal/dal/model/run_record.gen.go index f582cf00..47236348 100644 --- a/backend/domain/conversation/agentrun/internal/dal/model/run_record.gen.go +++ b/backend/domain/conversation/agentrun/internal/dal/model/run_record.gen.go @@ -8,24 +8,24 @@ import "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/agentrun" const TableNameRunRecord = "run_record" -// RunRecord 执行记录表 +// RunRecord run record type RunRecord struct { - ID int64 `gorm:"column:id;primaryKey;comment:主键ID" json:"id"` // 主键ID - ConversationID int64 `gorm:"column:conversation_id;not null;comment:会话 ID" json:"conversation_id"` // 会话 ID - SectionID int64 `gorm:"column:section_id;not null;comment:section ID" json:"section_id"` // section ID - AgentID int64 `gorm:"column:agent_id;not null;comment:agent_id" json:"agent_id"` // agent_id - UserID string `gorm:"column:user_id;not null;comment:user id" json:"user_id"` // user id - Source int32 `gorm:"column:source;not null;comment:执行来源 0 API," json:"source"` // 执行来源 0 API, - Status string `gorm:"column:status;not null;comment:状态,0 Unknown, 1-Created,2-InProgress,3-Completed,4-Failed,5-Expired,6-Cancelled,7-RequiresAction" json:"status"` // 状态,0 Unknown, 1-Created,2-InProgress,3-Completed,4-Failed,5-Expired,6-Cancelled,7-RequiresAction - CreatorID int64 `gorm:"column:creator_id;not null;comment:创建者标识" json:"creator_id"` // 创建者标识 - CreatedAt int64 `gorm:"column:created_at;not null;autoCreateTime:milli;comment:创建时间" json:"created_at"` // 创建时间 - UpdatedAt int64 `gorm:"column:updated_at;not null;autoUpdateTime:milli;comment:更新时间" json:"updated_at"` // 更新时间 - FailedAt int64 `gorm:"column:failed_at;not null;comment:失败时间" json:"failed_at"` // 失败时间 - LastError string `gorm:"column:last_error;comment:error message" json:"last_error"` // error message - CompletedAt int64 `gorm:"column:completed_at;not null;comment:结束时间" json:"completed_at"` // 结束时间 - ChatRequest string `gorm:"column:chat_request;comment:保存原始请求的部分字段" json:"chat_request"` // 保存原始请求的部分字段 - Ext string `gorm:"column:ext;comment:扩展字段" json:"ext"` // 扩展字段 - Usage *agentrun.Usage `gorm:"column:usage;comment:usage;serializer:json" json:"usage"` // usage + ID int64 `gorm:"column:id;primaryKey;comment:id" json:"id"` // id + ConversationID int64 `gorm:"column:conversation_id;not null;comment:conversation id" json:"conversation_id"` // conversation id + SectionID int64 `gorm:"column:section_id;not null;comment:section ID" json:"section_id"` // section ID + AgentID int64 `gorm:"column:agent_id;not null;comment:agent_id" json:"agent_id"` // agent_id + UserID string `gorm:"column:user_id;not null;comment:user id" json:"user_id"` // user id + Source int32 `gorm:"column:source;not null;comment:Execute source 0 API" json:"source"` // Execute source 0 API + Status string `gorm:"column:status;not null;comment:status,0 Unknown, 1-Created,2-InProgress,3-Completed,4-Failed,5-Expired,6-Cancelled,7-RequiresAction" json:"status"` // status,0 Unknown, 1-Created,2-InProgress,3-Completed,4-Failed,5-Expired,6-Cancelled,7-RequiresAction + CreatorID int64 `gorm:"column:creator_id;not null;comment:creator id" json:"creator_id"` // creator id + CreatedAt int64 `gorm:"column:created_at;not null;autoCreateTime:milli;comment:Create Time in Milliseconds" json:"created_at"` // Create Time in Milliseconds + UpdatedAt int64 `gorm:"column:updated_at;not null;autoUpdateTime:milli;comment:Update Time in Milliseconds" json:"updated_at"` // Update Time in Milliseconds + FailedAt int64 `gorm:"column:failed_at;not null;comment:Fail Time in Milliseconds" json:"failed_at"` // Fail Time in Milliseconds + LastError string `gorm:"column:last_error;comment:error message" json:"last_error"` // error message + CompletedAt int64 `gorm:"column:completed_at;not null;comment:Finish Time in Milliseconds" json:"completed_at"` // Finish Time in Milliseconds + ChatRequest string `gorm:"column:chat_request;comment:Original request field" json:"chat_request"` // Original request field + Ext string `gorm:"column:ext;comment:ext" json:"ext"` // ext + Usage *agentrun.Usage `gorm:"column:usage;comment:usage;serializer:json" json:"usage"` // usage } // TableName RunRecord's table name diff --git a/backend/domain/conversation/agentrun/internal/dal/query/run_record.gen.go b/backend/domain/conversation/agentrun/internal/dal/query/run_record.gen.go index c47f6354..816638a3 100644 --- a/backend/domain/conversation/agentrun/internal/dal/query/run_record.gen.go +++ b/backend/domain/conversation/agentrun/internal/dal/query/run_record.gen.go @@ -49,26 +49,26 @@ func newRunRecord(db *gorm.DB, opts ...gen.DOOption) runRecord { return _runRecord } -// runRecord 执行记录表 +// runRecord run record type runRecord struct { runRecordDo ALL field.Asterisk - ID field.Int64 // 主键ID - ConversationID field.Int64 // 会话 ID + ID field.Int64 // id + ConversationID field.Int64 // conversation id SectionID field.Int64 // section ID AgentID field.Int64 // agent_id UserID field.String // user id - Source field.Int32 // 执行来源 0 API, - Status field.String // 状态,0 Unknown, 1-Created,2-InProgress,3-Completed,4-Failed,5-Expired,6-Cancelled,7-RequiresAction - CreatorID field.Int64 // 创建者标识 - CreatedAt field.Int64 // 创建时间 - UpdatedAt field.Int64 // 更新时间 - FailedAt field.Int64 // 失败时间 + Source field.Int32 // Execute source 0 API + Status field.String // status,0 Unknown, 1-Created,2-InProgress,3-Completed,4-Failed,5-Expired,6-Cancelled,7-RequiresAction + CreatorID field.Int64 // creator id + CreatedAt field.Int64 // Create Time in Milliseconds + UpdatedAt field.Int64 // Update Time in Milliseconds + FailedAt field.Int64 // Fail Time in Milliseconds LastError field.String // error message - CompletedAt field.Int64 // 结束时间 - ChatRequest field.String // 保存原始请求的部分字段 - Ext field.String // 扩展字段 + CompletedAt field.Int64 // Finish Time in Milliseconds + ChatRequest field.String // Original request field + Ext field.String // ext Usage field.Field // usage fieldMap map[string]field.Expr diff --git a/backend/domain/conversation/agentrun/service/agent_run_impl.go b/backend/domain/conversation/agentrun/service/agent_run_impl.go index e041b82d..b0506edc 100644 --- a/backend/domain/conversation/agentrun/service/agent_run_impl.go +++ b/backend/domain/conversation/agentrun/service/agent_run_impl.go @@ -326,7 +326,7 @@ func (c *runImpl) buildAgentMessage2Create(ctx context.Context, chunk *entity.Ag afcMarshal, _ := json.Marshal(afc) msg.Content = string(afcMarshal) - // 添加 ext 用于保存到 context_message + // Add ext to save to context_message interruptByte, err := json.Marshal(chunk.Interrupt) if err == nil { buildExt[string(msgEntity.ExtKeyResumeInfo)] = string(interruptByte) diff --git a/backend/domain/conversation/agentrun/service/agent_run_test.go b/backend/domain/conversation/agentrun/service/agent_run_test.go index ae717011..ce414f56 100644 --- a/backend/domain/conversation/agentrun/service/agent_run_test.go +++ b/backend/domain/conversation/agentrun/service/agent_run_test.go @@ -54,7 +54,7 @@ func TestAgentRun(t *testing.T) { // content := []*entity.InputMetaData{ // { // Type: entity.InputTypeText, - // Text: "你是谁", + // Text: "Who are you", // }, // { // Type: entity.InputTypeImage, diff --git a/backend/domain/conversation/conversation/internal/dal/model/conversation.gen.go b/backend/domain/conversation/conversation/internal/dal/model/conversation.gen.go index e43b1e77..e72ffcc1 100644 --- a/backend/domain/conversation/conversation/internal/dal/model/conversation.gen.go +++ b/backend/domain/conversation/conversation/internal/dal/model/conversation.gen.go @@ -6,18 +6,18 @@ package model const TableNameConversation = "conversation" -// Conversation 会话信息表 +// Conversation conversation info record type Conversation struct { - ID int64 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键ID" json:"id"` // 主键ID - ConnectorID int64 `gorm:"column:connector_id;not null;comment:业务线 ID" json:"connector_id"` // 业务线 ID - AgentID int64 `gorm:"column:agent_id;not null;comment:agent_id" json:"agent_id"` // agent_id - Scene int32 `gorm:"column:scene;not null;comment:会话场景" json:"scene"` // 会话场景 - SectionID int64 `gorm:"column:section_id;not null;comment:最新section_id" json:"section_id"` // 最新section_id - CreatorID int64 `gorm:"column:creator_id;comment:创建者id" json:"creator_id"` // 创建者id - Ext string `gorm:"column:ext;comment:扩展字段" json:"ext"` // 扩展字段 - Status int32 `gorm:"column:status;not null;default:1;comment:status: 1-normal 2-deleted" json:"status"` // status: 1-normal 2-deleted - CreatedAt int64 `gorm:"column:created_at;not null;autoCreateTime:milli;comment:创建时间" json:"created_at"` // 创建时间 - UpdatedAt int64 `gorm:"column:updated_at;not null;autoUpdateTime:milli;comment:更新时间" json:"updated_at"` // 更新时间 + ID int64 `gorm:"column:id;primaryKey;autoIncrement:true;comment:id" json:"id"` // id + ConnectorID int64 `gorm:"column:connector_id;not null;comment:Publish Connector ID" json:"connector_id"` // Publish Connector ID + AgentID int64 `gorm:"column:agent_id;not null;comment:agent_id" json:"agent_id"` // agent_id + Scene int32 `gorm:"column:scene;not null;comment:conversation scene" json:"scene"` // conversation scene + SectionID int64 `gorm:"column:section_id;not null;comment:section_id" json:"section_id"` // section_id + CreatorID int64 `gorm:"column:creator_id;comment:creator_id" json:"creator_id"` // creator_id + Ext string `gorm:"column:ext;comment:ext" json:"ext"` // ext + Status int32 `gorm:"column:status;not null;default:1;comment:status: 1-normal 2-deleted" json:"status"` // status: 1-normal 2-deleted + CreatedAt int64 `gorm:"column:created_at;not null;autoCreateTime:milli;comment:Create Time in Milliseconds" json:"created_at"` // Create Time in Milliseconds + UpdatedAt int64 `gorm:"column:updated_at;not null;autoUpdateTime:milli;comment:Update Time in Milliseconds" json:"updated_at"` // Update Time in Milliseconds } // TableName Conversation's table name diff --git a/backend/domain/conversation/conversation/internal/dal/query/conversation.gen.go b/backend/domain/conversation/conversation/internal/dal/query/conversation.gen.go index 13e25ebb..f4772674 100644 --- a/backend/domain/conversation/conversation/internal/dal/query/conversation.gen.go +++ b/backend/domain/conversation/conversation/internal/dal/query/conversation.gen.go @@ -43,21 +43,21 @@ func newConversation(db *gorm.DB, opts ...gen.DOOption) conversation { return _conversation } -// conversation 会话信息表 +// conversation conversation info record type conversation struct { conversationDo ALL field.Asterisk - ID field.Int64 // 主键ID - ConnectorID field.Int64 // 业务线 ID + ID field.Int64 // id + ConnectorID field.Int64 // Publish Connector ID AgentID field.Int64 // agent_id - Scene field.Int32 // 会话场景 - SectionID field.Int64 // 最新section_id - CreatorID field.Int64 // 创建者id - Ext field.String // 扩展字段 + Scene field.Int32 // conversation scene + SectionID field.Int64 // section_id + CreatorID field.Int64 // creator_id + Ext field.String // ext Status field.Int32 // status: 1-normal 2-deleted - CreatedAt field.Int64 // 创建时间 - UpdatedAt field.Int64 // 更新时间 + CreatedAt field.Int64 // Create Time in Milliseconds + UpdatedAt field.Int64 // Update Time in Milliseconds fieldMap map[string]field.Expr } diff --git a/backend/domain/conversation/message/internal/dal/model/message.gen.go b/backend/domain/conversation/message/internal/dal/model/message.gen.go index f0a0b204..2f2e28bd 100644 --- a/backend/domain/conversation/message/internal/dal/model/message.gen.go +++ b/backend/domain/conversation/message/internal/dal/model/message.gen.go @@ -6,27 +6,27 @@ package model const TableNameMessage = "message" -// Message 消息表 +// Message message record type Message struct { - ID int64 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键ID" json:"id"` // 主键ID - RunID int64 `gorm:"column:run_id;not null;comment:对应的run_id" json:"run_id"` // 对应的run_id - ConversationID int64 `gorm:"column:conversation_id;not null;comment:conversation id" json:"conversation_id"` // conversation id - UserID string `gorm:"column:user_id;not null;comment:user id" json:"user_id"` // user id - AgentID int64 `gorm:"column:agent_id;not null;comment:agent_id" json:"agent_id"` // agent_id - Role string `gorm:"column:role;not null;comment:角色: user、assistant、system" json:"role"` // 角色: user、assistant、system - ContentType string `gorm:"column:content_type;not null;comment:内容类型 1 text" json:"content_type"` // 内容类型 1 text - Content string `gorm:"column:content;comment:内容" json:"content"` // 内容 - MessageType string `gorm:"column:message_type;not null;comment:消息类型:" json:"message_type"` // 消息类型: - DisplayContent string `gorm:"column:display_content;comment:展示内容" json:"display_content"` // 展示内容 - Ext string `gorm:"column:ext;comment:message 扩展字段" json:"ext"` // message 扩展字段 - SectionID int64 `gorm:"column:section_id;comment:段落id" json:"section_id"` // 段落id - BrokenPosition int32 `gorm:"column:broken_position;default:-1;comment:打断位置" json:"broken_position"` // 打断位置 - Status int32 `gorm:"column:status;not null;comment:消息状态 1 Available 2 Deleted 3 Replaced 4 Broken 5 Failed 6 Streaming 7 Pending" json:"status"` // 消息状态 1 Available 2 Deleted 3 Replaced 4 Broken 5 Failed 6 Streaming 7 Pending - ModelContent string `gorm:"column:model_content;comment:模型输入内容" json:"model_content"` // 模型输入内容 - MetaInfo string `gorm:"column:meta_info;comment:引用、高亮等文本标记信息" json:"meta_info"` // 引用、高亮等文本标记信息 - ReasoningContent string `gorm:"column:reasoning_content;comment:思考内容" json:"reasoning_content"` // 思考内容 - CreatedAt int64 `gorm:"column:created_at;not null;autoCreateTime:milli;comment:创建时间" json:"created_at"` // 创建时间 - UpdatedAt int64 `gorm:"column:updated_at;not null;autoUpdateTime:milli;comment:更新时间" json:"updated_at"` // 更新时间 + ID int64 `gorm:"column:id;primaryKey;autoIncrement:true;comment:id" json:"id"` // id + RunID int64 `gorm:"column:run_id;not null;comment:run_id" json:"run_id"` // run_id + ConversationID int64 `gorm:"column:conversation_id;not null;comment:conversation id" json:"conversation_id"` // conversation id + UserID string `gorm:"column:user_id;not null;comment:user id" json:"user_id"` // user id + AgentID int64 `gorm:"column:agent_id;not null;comment:agent_id" json:"agent_id"` // agent_id + Role string `gorm:"column:role;not null;comment:role: user、assistant、system" json:"role"` // role: user、assistant、system + ContentType string `gorm:"column:content_type;not null;comment:content type 1 text" json:"content_type"` // content type 1 text + Content string `gorm:"column:content;comment:content" json:"content"` // content + MessageType string `gorm:"column:message_type;not null;comment:message_type" json:"message_type"` // message_type + DisplayContent string `gorm:"column:display_content;comment:display content" json:"display_content"` // display content + Ext string `gorm:"column:ext;comment:message ext" json:"ext"` // message ext + SectionID int64 `gorm:"column:section_id;comment:section_id" json:"section_id"` // section_id + BrokenPosition int32 `gorm:"column:broken_position;default:-1;comment:broken position" json:"broken_position"` // broken position + Status int32 `gorm:"column:status;not null;comment:message status: 1 Available 2 Deleted 3 Replaced 4 Broken 5 Failed 6 Streaming 7 Pending" json:"status"` // message status: 1 Available 2 Deleted 3 Replaced 4 Broken 5 Failed 6 Streaming 7 Pending + ModelContent string `gorm:"column:model_content;comment:model content" json:"model_content"` // model content + MetaInfo string `gorm:"column:meta_info;comment:text tagging information such as citation and highlighting" json:"meta_info"` // text tagging information such as citation and highlighting + ReasoningContent string `gorm:"column:reasoning_content;comment:reasoning content" json:"reasoning_content"` // reasoning content + CreatedAt int64 `gorm:"column:created_at;not null;autoCreateTime:milli;comment:Create Time in Milliseconds" json:"created_at"` // Create Time in Milliseconds + UpdatedAt int64 `gorm:"column:updated_at;not null;autoUpdateTime:milli;comment:Update Time in Milliseconds" json:"updated_at"` // Update Time in Milliseconds } // TableName Message's table name diff --git a/backend/domain/conversation/message/internal/dal/query/message.gen.go b/backend/domain/conversation/message/internal/dal/query/message.gen.go index 2c39308a..79a1642d 100644 --- a/backend/domain/conversation/message/internal/dal/query/message.gen.go +++ b/backend/domain/conversation/message/internal/dal/query/message.gen.go @@ -52,30 +52,30 @@ func newMessage(db *gorm.DB, opts ...gen.DOOption) message { return _message } -// message 消息表 +// message message record type message struct { messageDo ALL field.Asterisk - ID field.Int64 // 主键ID - RunID field.Int64 // 对应的run_id + ID field.Int64 // id + RunID field.Int64 // run_id ConversationID field.Int64 // conversation id UserID field.String // user id AgentID field.Int64 // agent_id - Role field.String // 角色: user、assistant、system - ContentType field.String // 内容类型 1 text - Content field.String // 内容 - MessageType field.String // 消息类型: - DisplayContent field.String // 展示内容 - Ext field.String // message 扩展字段 - SectionID field.Int64 // 段落id - BrokenPosition field.Int32 // 打断位置 - Status field.Int32 // 消息状态 1 Available 2 Deleted 3 Replaced 4 Broken 5 Failed 6 Streaming 7 Pending - ModelContent field.String // 模型输入内容 - MetaInfo field.String // 引用、高亮等文本标记信息 - ReasoningContent field.String // 思考内容 - CreatedAt field.Int64 // 创建时间 - UpdatedAt field.Int64 // 更新时间 + Role field.String // role: user、assistant、system + ContentType field.String // content type 1 text + Content field.String // content + MessageType field.String // message_type + DisplayContent field.String // display content + Ext field.String // message ext + SectionID field.Int64 // section_id + BrokenPosition field.Int32 // broken position + Status field.Int32 // message status: 1 Available 2 Deleted 3 Replaced 4 Broken 5 Failed 6 Streaming 7 Pending + ModelContent field.String // model content + MetaInfo field.String // text tagging information such as citation and highlighting + ReasoningContent field.String // reasoning content + CreatedAt field.Int64 // Create Time in Milliseconds + UpdatedAt field.Int64 // Update Time in Milliseconds fieldMap map[string]field.Expr } diff --git a/backend/domain/datacopy/entity/entity.go b/backend/domain/datacopy/entity/entity.go index c3800bd8..a14d4b61 100644 --- a/backend/domain/datacopy/entity/entity.go +++ b/backend/domain/datacopy/entity/entity.go @@ -17,7 +17,7 @@ package entity type CopyDataTask struct { - TaskUniqKey string // 复制任务的唯一标志 + TaskUniqKey string // Unique sign of a replication task OriginDataID int64 TargetDataID int64 OriginSpaceID int64 @@ -28,10 +28,10 @@ type CopyDataTask struct { TargetAppID int64 Status DataCopyTaskStatus DataType DataType - StartTime int64 // 任务开始时间ms - FinishTime int64 // 任务结束时间ms + StartTime int64 // Task start time ms + FinishTime int64 // Task end time ms ExtInfo string - ErrorMsg string // 复制失败的错误信息 + ErrorMsg string // Copy failed error message } type DataCopyTaskStatus int diff --git a/backend/domain/datacopy/internal/dal/model/data_copy_task.gen.go b/backend/domain/datacopy/internal/dal/model/data_copy_task.gen.go index ab7374f2..b837da2d 100644 --- a/backend/domain/datacopy/internal/dal/model/data_copy_task.gen.go +++ b/backend/domain/datacopy/internal/dal/model/data_copy_task.gen.go @@ -6,24 +6,24 @@ package model const TableNameDataCopyTask = "data_copy_task" -// DataCopyTask data方向复制任务记录表 +// DataCopyTask data copy task record type DataCopyTask struct { - MasterTaskID string `gorm:"column:master_task_id;not null;comment:复制任务ID" json:"master_task_id"` // 复制任务ID - OriginDataID int64 `gorm:"column:origin_data_id;not null;comment:源id" json:"origin_data_id"` // 源id - TargetDataID int64 `gorm:"column:target_data_id;not null;comment:目标id" json:"target_data_id"` // 目标id - OriginSpaceID int64 `gorm:"column:origin_space_id;not null;comment:源团队空间" json:"origin_space_id"` // 源团队空间 - TargetSpaceID int64 `gorm:"column:target_space_id;not null;comment:目标团队空间" json:"target_space_id"` // 目标团队空间 - OriginUserID int64 `gorm:"column:origin_user_id;not null;comment:源用户ID" json:"origin_user_id"` // 源用户ID - TargetUserID int64 `gorm:"column:target_user_id;not null;comment:目标用户ID" json:"target_user_id"` // 目标用户ID - OriginAppID int64 `gorm:"column:origin_app_id;not null;comment:源AppID" json:"origin_app_id"` // 源AppID - TargetAppID int64 `gorm:"column:target_app_id;not null;comment:目标AppID" json:"target_app_id"` // 目标AppID - DataType int32 `gorm:"column:data_type;not null;comment:数据类型 1:knowledge, 2:database" json:"data_type"` // 数据类型 1:knowledge, 2:database - ExtInfo string `gorm:"column:ext_info;not null;comment:存储额外信息" json:"ext_info"` // 存储额外信息 - StartTime int64 `gorm:"column:start_time;not null;comment:任务开始时间" json:"start_time"` // 任务开始时间 - FinishTime int64 `gorm:"column:finish_time;comment:任务结束时间" json:"finish_time"` // 任务结束时间 - Status int32 `gorm:"column:status;not null;default:1;comment:1:创建 2:执行中 3:成功 4:失败" json:"status"` // 1:创建 2:执行中 3:成功 4:失败 - ErrorMsg string `gorm:"column:error_msg;comment:错误信息" json:"error_msg"` // 错误信息 - ID int64 `gorm:"column:id;primaryKey;autoIncrement:true;comment:ID" json:"id"` // ID + MasterTaskID string `gorm:"column:master_task_id;comment:task id" json:"master_task_id"` // task id + OriginDataID int64 `gorm:"column:origin_data_id;not null;comment:origin data id" json:"origin_data_id"` // origin data id + TargetDataID int64 `gorm:"column:target_data_id;not null;comment:target data id" json:"target_data_id"` // target data id + OriginSpaceID int64 `gorm:"column:origin_space_id;not null;comment:origin space id" json:"origin_space_id"` // origin space id + TargetSpaceID int64 `gorm:"column:target_space_id;not null;comment:target space id" json:"target_space_id"` // target space id + OriginUserID int64 `gorm:"column:origin_user_id;not null;comment:origin user id" json:"origin_user_id"` // origin user id + TargetUserID int64 `gorm:"column:target_user_id;comment:target user id" json:"target_user_id"` // target user id + OriginAppID int64 `gorm:"column:origin_app_id;not null;comment:origin app id" json:"origin_app_id"` // origin app id + TargetAppID int64 `gorm:"column:target_app_id;not null;comment:target app id" json:"target_app_id"` // target app id + DataType int32 `gorm:"column:data_type;not null;comment:data type 1:knowledge, 2:database" json:"data_type"` // data type 1:knowledge, 2:database + ExtInfo string `gorm:"column:ext_info;not null;comment:ext" json:"ext_info"` // ext + StartTime int64 `gorm:"column:start_time;comment:task start time" json:"start_time"` // task start time + FinishTime int64 `gorm:"column:finish_time;comment:task finish time" json:"finish_time"` // task finish time + Status int32 `gorm:"column:status;not null;default:1;comment:1: Create 2: Running 3: Success 4: Failure" json:"status"` // 1: Create 2: Running 3: Success 4: Failure + ErrorMsg string `gorm:"column:error_msg;comment:error msg" json:"error_msg"` // error msg + ID int64 `gorm:"column:id;primaryKey;autoIncrement:true;comment:ID" json:"id"` // ID } // TableName DataCopyTask's table name diff --git a/backend/domain/datacopy/internal/dal/query/data_copy_task.gen.go b/backend/domain/datacopy/internal/dal/query/data_copy_task.gen.go index b2b46aff..0b0a9f71 100644 --- a/backend/domain/datacopy/internal/dal/query/data_copy_task.gen.go +++ b/backend/domain/datacopy/internal/dal/query/data_copy_task.gen.go @@ -49,26 +49,26 @@ func newDataCopyTask(db *gorm.DB, opts ...gen.DOOption) dataCopyTask { return _dataCopyTask } -// dataCopyTask data方向复制任务记录表 +// dataCopyTask data copy task record type dataCopyTask struct { dataCopyTaskDo ALL field.Asterisk - MasterTaskID field.String // 复制任务ID - OriginDataID field.Int64 // 源id - TargetDataID field.Int64 // 目标id - OriginSpaceID field.Int64 // 源团队空间 - TargetSpaceID field.Int64 // 目标团队空间 - OriginUserID field.Int64 // 源用户ID - TargetUserID field.Int64 // 目标用户ID - OriginAppID field.Int64 // 源AppID - TargetAppID field.Int64 // 目标AppID - DataType field.Int32 // 数据类型 1:knowledge, 2:database - ExtInfo field.String // 存储额外信息 - StartTime field.Int64 // 任务开始时间 - FinishTime field.Int64 // 任务结束时间 - Status field.Int32 // 1:创建 2:执行中 3:成功 4:失败 - ErrorMsg field.String // 错误信息 + MasterTaskID field.String // task id + OriginDataID field.Int64 // origin data id + TargetDataID field.Int64 // target data id + OriginSpaceID field.Int64 // origin space id + TargetSpaceID field.Int64 // target space id + OriginUserID field.Int64 // origin user id + TargetUserID field.Int64 // target user id + OriginAppID field.Int64 // origin app id + TargetAppID field.Int64 // target app id + DataType field.Int32 // data type 1:knowledge, 2:database + ExtInfo field.String // ext + StartTime field.Int64 // task start time + FinishTime field.Int64 // task finish time + Status field.Int32 // 1: Create 2: Running 3: Success 4: Failure + ErrorMsg field.String // error msg ID field.Int64 // ID fieldMap map[string]field.Expr diff --git a/backend/domain/datacopy/service/datacopy.go b/backend/domain/datacopy/service/datacopy.go index d6053f4d..761fea08 100644 --- a/backend/domain/datacopy/service/datacopy.go +++ b/backend/domain/datacopy/service/datacopy.go @@ -59,7 +59,7 @@ func (svc *dataCopySVC) CheckAndGenCopyTask(ctx context.Context, req *datacopy.C } var err error resp := datacopy.CheckAndGenCopyTaskResp{} - // 检查是否已经存在任务 + // Check if a task already exists task, err := svc.dataCopyTaskRepo.GetCopyTask(ctx, req.Task.TaskUniqKey, req.Task.OriginDataID, int32(req.Task.DataType)) if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) { return nil, err diff --git a/backend/domain/knowledge/entity/const.go b/backend/domain/knowledge/entity/const.go index 12e6a6b8..7197ddc7 100644 --- a/backend/domain/knowledge/entity/const.go +++ b/backend/domain/knowledge/entity/const.go @@ -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 ) diff --git a/backend/domain/knowledge/entity/document.go b/backend/domain/knowledge/entity/document.go index b66521ca..df388cf4 100644 --- a/backend/domain/knowledge/entity/document.go +++ b/backend/domain/knowledge/entity/document.go @@ -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 { diff --git a/backend/domain/knowledge/entity/event.go b/backend/domain/knowledge/entity/event.go index e9440e4f..a90ebffa 100644 --- a/backend/domain/knowledge/entity/event.go +++ b/backend/domain/knowledge/entity/event.go @@ -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" diff --git a/backend/domain/knowledge/entity/knowledge.go b/backend/domain/knowledge/entity/knowledge.go index aa103ecc..33996ee6 100644 --- a/backend/domain/knowledge/entity/knowledge.go +++ b/backend/domain/knowledge/entity/knowledge.go @@ -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 diff --git a/backend/domain/knowledge/entity/strategy.go b/backend/domain/knowledge/entity/strategy.go index 049dcaf8..3451d148 100644 --- a/backend/domain/knowledge/entity/strategy.go +++ b/backend/domain/knowledge/entity/strategy.go @@ -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 } diff --git a/backend/domain/knowledge/internal/dal/dao/knowledge_document.go b/backend/domain/knowledge/internal/dal/dao/knowledge_document.go index f4a911d3..d3bbc06c 100644 --- a/backend/domain/knowledge/internal/dal/dao/knowledge_document.go +++ b/backend/domain/knowledge/internal/dal/dao/knowledge_document.go @@ -132,12 +132,12 @@ func (dao *KnowledgeDocumentDAO) DeleteDocuments(ctx context.Context, ids []int6 tx.Commit() } }() - // 删除document + // Delete document err = tx.WithContext(ctx).Model(&model.KnowledgeDocument{}).Where("id in ?", ids).Delete(&model.KnowledgeDocument{}).Error if err != nil { return err } - // 删除document_slice + // Delete document_slice err = tx.WithContext(ctx).Model(&model.KnowledgeDocumentSlice{}).Where("document_id in?", ids).Delete(&model.KnowledgeDocumentSlice{}).Error if err != nil { return err diff --git a/backend/domain/knowledge/internal/dal/dao/knowledge_document_slice.go b/backend/domain/knowledge/internal/dal/dao/knowledge_document_slice.go index aaca1a0c..7ee252bd 100644 --- a/backend/domain/knowledge/internal/dal/dao/knowledge_document_slice.go +++ b/backend/domain/knowledge/internal/dal/dao/knowledge_document_slice.go @@ -120,7 +120,7 @@ func (dao *KnowledgeDocumentSliceDAO) listBatch(ctx context.Context, knowledgeID pos []*model.KnowledgeDocumentSlice, hasMore bool, err error) { if batchSize <= 0 { - batchSize = 100 // 默认批量大小 + batchSize = 100 // Default batch size } do, err := dao.listDo(ctx, knowledgeID, documentID) @@ -161,7 +161,7 @@ func (dao *KnowledgeDocumentSliceDAO) GetDocumentSliceIDs(ctx context.Context, d if len(docIDs) == 0 { return nil, errors.New("empty document ids") } - // doc可能会有很多slice,所以批量处理 + // Doc may have many slices, so batch processing sliceIDs = make([]int64, 0) var mu sync.Mutex errGroup, ctx := errgroup.WithContext(ctx) diff --git a/backend/domain/knowledge/internal/dal/model/knowledge.gen.go b/backend/domain/knowledge/internal/dal/model/knowledge.gen.go index 4589b95f..bbd73433 100644 --- a/backend/domain/knowledge/internal/dal/model/knowledge.gen.go +++ b/backend/domain/knowledge/internal/dal/model/knowledge.gen.go @@ -10,20 +10,20 @@ import ( const TableNameKnowledge = "knowledge" -// Knowledge 知识库表 +// Knowledge knowledge tabke type Knowledge struct { - ID int64 `gorm:"column:id;primaryKey;comment:主键ID" json:"id"` // 主键ID - Name string `gorm:"column:name;not null;comment:名称" json:"name"` // 名称 - AppID int64 `gorm:"column:app_id;not null;comment:项目ID,标识该资源是否是项目独有" json:"app_id"` // 项目ID,标识该资源是否是项目独有 - CreatorID int64 `gorm:"column:creator_id;not null;comment:ID" json:"creator_id"` // ID - SpaceID int64 `gorm:"column:space_id;not null;comment:空间ID" json:"space_id"` // 空间ID - CreatedAt int64 `gorm:"column:created_at;not null;comment:Create Time in Milliseconds" json:"created_at"` // Create Time in Milliseconds - UpdatedAt int64 `gorm:"column:updated_at;not null;comment:Update Time in Milliseconds" json:"updated_at"` // Update Time in Milliseconds - DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;comment:Delete Time in Milliseconds" json:"deleted_at"` // Delete Time in Milliseconds - Status int32 `gorm:"column:status;not null;default:1;comment:0 初始化, 1 生效 2 失效" json:"status"` // 0 初始化, 1 生效 2 失效 - Description string `gorm:"column:description;comment:描述" json:"description"` // 描述 - IconURI string `gorm:"column:icon_uri;comment:头像uri" json:"icon_uri"` // 头像uri - FormatType int32 `gorm:"column:format_type;not null;comment:0:文本 1:表格 2:图片" json:"format_type"` // 0:文本 1:表格 2:图片 + ID int64 `gorm:"column:id;primaryKey;comment:id" json:"id"` // id + Name string `gorm:"column:name;not null;comment:knowledge's name" json:"name"` // knowledge's name + AppID int64 `gorm:"column:app_id;not null;comment:app id" json:"app_id"` // app id + CreatorID int64 `gorm:"column:creator_id;not null;comment:creator id" json:"creator_id"` // creator id + SpaceID int64 `gorm:"column:space_id;not null;comment:space id" json:"space_id"` // space id + CreatedAt int64 `gorm:"column:created_at;not null;comment:Create Time in Milliseconds" json:"created_at"` // Create Time in Milliseconds + UpdatedAt int64 `gorm:"column:updated_at;not null;comment:Update Time in Milliseconds" json:"updated_at"` // Update Time in Milliseconds + DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;comment:Delete Time" json:"deleted_at"` // Delete Time + Status int32 `gorm:"column:status;not null;default:1;comment:0 initialization, 1 effective, 2 invalid" json:"status"` // 0 initialization, 1 effective, 2 invalid + Description string `gorm:"column:description;comment:description" json:"description"` // description + IconURI string `gorm:"column:icon_uri;comment:icon uri" json:"icon_uri"` // icon uri + FormatType int32 `gorm:"column:format_type;not null;comment:0: Text 1: Table 2: Images" json:"format_type"` // 0: Text 1: Table 2: Images } // TableName Knowledge's table name diff --git a/backend/domain/knowledge/internal/dal/model/knowledge_document.gen.go b/backend/domain/knowledge/internal/dal/model/knowledge_document.gen.go index 157b41b0..f81eec80 100644 --- a/backend/domain/knowledge/internal/dal/model/knowledge_document.gen.go +++ b/backend/domain/knowledge/internal/dal/model/knowledge_document.gen.go @@ -11,27 +11,27 @@ import ( const TableNameKnowledgeDocument = "knowledge_document" -// KnowledgeDocument 知识库文档表 +// KnowledgeDocument knowledge document info type KnowledgeDocument struct { - ID int64 `gorm:"column:id;primaryKey;comment:主键ID" json:"id"` // 主键ID - KnowledgeID int64 `gorm:"column:knowledge_id;not null;comment:所属knowledge的ID" json:"knowledge_id"` // 所属knowledge的ID - Name string `gorm:"column:name;not null;comment:文档名称" json:"name"` // 文档名称 - FileExtension string `gorm:"column:file_extension;not null;default:0;comment:文档类型, txt/pdf/csv/..." json:"file_extension"` // 文档类型, txt/pdf/csv/... - DocumentType int32 `gorm:"column:document_type;not null;comment:文档类型: 0:文本 1:表格 2:图片" json:"document_type"` // 文档类型: 0:文本 1:表格 2:图片 - URI string `gorm:"column:uri;comment:资源uri" json:"uri"` // 资源uri - Size int64 `gorm:"column:size;not null;comment:文档大小" json:"size"` // 文档大小 - SliceCount int64 `gorm:"column:slice_count;not null;comment:分片数量" json:"slice_count"` // 分片数量 - CharCount int64 `gorm:"column:char_count;not null;comment:字符数" json:"char_count"` // 字符数 - CreatorID int64 `gorm:"column:creator_id;not null;comment:创建者ID" json:"creator_id"` // 创建者ID - SpaceID int64 `gorm:"column:space_id;not null;comment:空间id" json:"space_id"` // 空间id - CreatedAt int64 `gorm:"column:created_at;not null;comment:Create Time in Milliseconds" json:"created_at"` // Create Time in Milliseconds - UpdatedAt int64 `gorm:"column:updated_at;not null;comment:Update Time in Milliseconds" json:"updated_at"` // Update Time in Milliseconds - DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;comment:Delete Time in Milliseconds" json:"deleted_at"` // Delete Time in Milliseconds - SourceType int32 `gorm:"column:source_type;not null;comment:0:本地文件上传, 2:自定义文本" json:"source_type"` // 0:本地文件上传, 2:自定义文本 - Status int32 `gorm:"column:status;not null;comment:状态" json:"status"` // 状态 - FailReason string `gorm:"column:fail_reason;comment:失败原因" json:"fail_reason"` // 失败原因 - ParseRule *DocumentParseRule `gorm:"column:parse_rule;comment:解析+切片规则;serializer:json" json:"parse_rule"` // 解析+切片规则 - TableInfo *entity.TableInfo `gorm:"column:table_info;comment:表格信息;serializer:json" json:"table_info"` // 表格信息 + ID int64 `gorm:"column:id;primaryKey;comment:id" json:"id"` // id + KnowledgeID int64 `gorm:"column:knowledge_id;not null;comment:knowledge id" json:"knowledge_id"` // knowledge id + Name string `gorm:"column:name;not null;comment:document name" json:"name"` // document name + FileExtension string `gorm:"column:file_extension;not null;default:0;comment:Document type, txt/pdf/csv etc.." json:"file_extension"` // Document type, txt/pdf/csv etc.. + DocumentType int32 `gorm:"column:document_type;not null;comment:Document type: 0: Text 1: Table 2: Image" json:"document_type"` // Document type: 0: Text 1: Table 2: Image + URI string `gorm:"column:uri;comment:uri" json:"uri"` // uri + Size int64 `gorm:"column:size;not null;comment:document size" json:"size"` // document size + SliceCount int64 `gorm:"column:slice_count;not null;comment:slice count" json:"slice_count"` // slice count + CharCount int64 `gorm:"column:char_count;not null;comment:number of characters" json:"char_count"` // number of characters + CreatorID int64 `gorm:"column:creator_id;not null;comment:creator id" json:"creator_id"` // creator id + SpaceID int64 `gorm:"column:space_id;not null;comment:space id" json:"space_id"` // space id + CreatedAt int64 `gorm:"column:created_at;not null;comment:Create Time in Milliseconds" json:"created_at"` // Create Time in Milliseconds + UpdatedAt int64 `gorm:"column:updated_at;not null;comment:Update Time in Milliseconds" json:"updated_at"` // Update Time in Milliseconds + DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;comment:Delete Time" json:"deleted_at"` // Delete Time + SourceType int32 `gorm:"column:source_type;comment:0: Local file upload, 2: Custom text, 103: Feishu 104: Lark" json:"source_type"` // 0: Local file upload, 2: Custom text, 103: Feishu 104: Lark + Status int32 `gorm:"column:status;not null;comment:status" json:"status"` // status + FailReason string `gorm:"column:fail_reason;comment:fail reason" json:"fail_reason"` // fail reason + ParseRule *DocumentParseRule `gorm:"column:parse_rule;comment:parse rule;serializer:json" json:"parse_rule"` // parse rule + TableInfo *entity.TableInfo `gorm:"column:table_info;comment:table info;serializer:json" json:"table_info"` // table info } // TableName KnowledgeDocument's table name diff --git a/backend/domain/knowledge/internal/dal/model/knowledge_document_review.gen.go b/backend/domain/knowledge/internal/dal/model/knowledge_document_review.gen.go index 6a043a97..18671e4b 100644 --- a/backend/domain/knowledge/internal/dal/model/knowledge_document_review.gen.go +++ b/backend/domain/knowledge/internal/dal/model/knowledge_document_review.gen.go @@ -10,21 +10,21 @@ import ( const TableNameKnowledgeDocumentReview = "knowledge_document_review" -// KnowledgeDocumentReview 文档审阅表 +// KnowledgeDocumentReview Document slice preview info type KnowledgeDocumentReview struct { - ID int64 `gorm:"column:id;primaryKey;comment:主键ID" json:"id"` // 主键ID - KnowledgeID int64 `gorm:"column:knowledge_id;not null;comment:knowledge id" json:"knowledge_id"` // knowledge id - SpaceID int64 `gorm:"column:space_id;not null;comment:空间id" json:"space_id"` // 空间id - Name string `gorm:"column:name;not null;comment:文档名称" json:"name"` // 文档名称 - Type string `gorm:"column:type;not null;default:0;comment:文档类型" json:"type"` // 文档类型 - URI string `gorm:"column:uri;comment:资源标识" json:"uri"` // 资源标识 - FormatType int32 `gorm:"column:format_type;not null;comment:0 文本, 1 表格, 2 图片" json:"format_type"` // 0 文本, 1 表格, 2 图片 - Status int32 `gorm:"column:status;not null;comment:0 处理中,1 已完成,2 失败,3 失效" json:"status"` // 0 处理中,1 已完成,2 失败,3 失效 - ChunkRespURI string `gorm:"column:chunk_resp_uri;comment:预切片tos资源标识" json:"chunk_resp_uri"` // 预切片tos资源标识 - DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;comment:Delete Time in Milliseconds" json:"deleted_at"` // Delete Time in Milliseconds - CreatedAt int64 `gorm:"column:created_at;not null;comment:Create Time in Milliseconds" json:"created_at"` // Create Time in Milliseconds - UpdatedAt int64 `gorm:"column:updated_at;not null;comment:Update Time in Milliseconds" json:"updated_at"` // Update Time in Milliseconds - CreatorID int64 `gorm:"column:creator_id;not null;comment:创建者ID" json:"creator_id"` // 创建者ID + ID int64 `gorm:"column:id;primaryKey;comment:id" json:"id"` // id + KnowledgeID int64 `gorm:"column:knowledge_id;not null;comment:knowledge id" json:"knowledge_id"` // knowledge id + SpaceID int64 `gorm:"column:space_id;not null;comment:space id" json:"space_id"` // space id + Name string `gorm:"column:name;not null;comment:name" json:"name"` // name + Type string `gorm:"column:type;not null;default:0;comment:document type" json:"type"` // document type + URI string `gorm:"column:uri;comment:uri" json:"uri"` // uri + FormatType int32 `gorm:"column:format_type;not null;comment:0 text, 1 table, 2 images" json:"format_type"` // 0 text, 1 table, 2 images + Status int32 `gorm:"column:status;not null;comment:0 Processing 1 Completed 2 Failed 3 Expired" json:"status"` // 0 Processing 1 Completed 2 Failed 3 Expired + ChunkRespURI string `gorm:"column:chunk_resp_uri;comment:pre-sliced uri" json:"chunk_resp_uri"` // pre-sliced uri + DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;comment:Delete Time" json:"deleted_at"` // Delete Time + CreatedAt int64 `gorm:"column:created_at;not null;comment:Create Time in Milliseconds" json:"created_at"` // Create Time in Milliseconds + UpdatedAt int64 `gorm:"column:updated_at;not null;comment:Update Time in Milliseconds" json:"updated_at"` // Update Time in Milliseconds + CreatorID int64 `gorm:"column:creator_id;not null;comment:creator id" json:"creator_id"` // creator id } // TableName KnowledgeDocumentReview's table name diff --git a/backend/domain/knowledge/internal/dal/model/knowledge_document_slice.gen.go b/backend/domain/knowledge/internal/dal/model/knowledge_document_slice.gen.go index cf535e90..4fe9ac6c 100644 --- a/backend/domain/knowledge/internal/dal/model/knowledge_document_slice.gen.go +++ b/backend/domain/knowledge/internal/dal/model/knowledge_document_slice.gen.go @@ -10,21 +10,21 @@ import ( const TableNameKnowledgeDocumentSlice = "knowledge_document_slice" -// KnowledgeDocumentSlice 知识库文件切片表 +// KnowledgeDocumentSlice knowledge document slice type KnowledgeDocumentSlice struct { - ID int64 `gorm:"column:id;primaryKey;comment:主键ID" json:"id"` // 主键ID - KnowledgeID int64 `gorm:"column:knowledge_id;not null;comment:knowledge id" json:"knowledge_id"` // knowledge id - DocumentID int64 `gorm:"column:document_id;not null;comment:document id" json:"document_id"` // document id - Content string `gorm:"column:content;comment:切片内容" json:"content"` // 切片内容 - Sequence float64 `gorm:"column:sequence;not null;type:decimal(20,5);comment:切片顺序号, 从1开始" json:"sequence"` // 切片顺序号, 从1开始 - CreatedAt int64 `gorm:"column:created_at;not null;comment:Create Time in Milliseconds" json:"created_at"` // Create Time in Milliseconds - UpdatedAt int64 `gorm:"column:updated_at;not null;comment:Update Time in Milliseconds" json:"updated_at"` // Update Time in Milliseconds - DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;comment:Delete Time in Milliseconds" json:"deleted_at"` // Delete Time in Milliseconds - CreatorID int64 `gorm:"column:creator_id;not null;comment:创建者ID" json:"creator_id"` // 创建者ID - SpaceID int64 `gorm:"column:space_id;not null;comment:空间ID" json:"space_id"` // 空间ID - Status int32 `gorm:"column:status;not null;comment:状态" json:"status"` // 状态 - FailReason string `gorm:"column:fail_reason;comment:失败原因" json:"fail_reason"` // 失败原因 - Hit int64 `gorm:"column:hit;not null;comment:命中次数" json:"hit"` // 命中次数 + ID int64 `gorm:"column:id;primaryKey;comment:id" json:"id"` // id + KnowledgeID int64 `gorm:"column:knowledge_id;not null;comment:knowledge id" json:"knowledge_id"` // knowledge id + DocumentID int64 `gorm:"column:document_id;not null;comment:document_id" json:"document_id"` // document_id + Content string `gorm:"column:content;comment:content" json:"content"` // content + Sequence float64 `gorm:"column:sequence;not null;comment:slice sequence number, starting from 1" json:"sequence"` // slice sequence number, starting from 1 + CreatedAt int64 `gorm:"column:created_at;not null;comment:Create Time in Milliseconds" json:"created_at"` // Create Time in Milliseconds + UpdatedAt int64 `gorm:"column:updated_at;not null;comment:Update Time in Milliseconds" json:"updated_at"` // Update Time in Milliseconds + DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;comment:Delete Time" json:"deleted_at"` // Delete Time + CreatorID int64 `gorm:"column:creator_id;not null;comment:creator id" json:"creator_id"` // creator id + SpaceID int64 `gorm:"column:space_id;not null;comment:space id" json:"space_id"` // space id + Status int32 `gorm:"column:status;not null;comment:status" json:"status"` // status + FailReason string `gorm:"column:fail_reason;comment:fail reason" json:"fail_reason"` // fail reason + Hit int64 `gorm:"column:hit;not null;comment:hit counts" json:"hit"` // hit counts } // TableName KnowledgeDocumentSlice's table name diff --git a/backend/domain/knowledge/internal/dal/query/knowledge.gen.go b/backend/domain/knowledge/internal/dal/query/knowledge.gen.go index d311c4b6..d1e2148e 100644 --- a/backend/domain/knowledge/internal/dal/query/knowledge.gen.go +++ b/backend/domain/knowledge/internal/dal/query/knowledge.gen.go @@ -45,23 +45,23 @@ func newKnowledge(db *gorm.DB, opts ...gen.DOOption) knowledge { return _knowledge } -// knowledge 知识库表 +// knowledge knowledge tabke type knowledge struct { knowledgeDo ALL field.Asterisk - ID field.Int64 // 主键ID - Name field.String // 名称 - AppID field.Int64 // 项目ID,标识该资源是否是项目独有 - CreatorID field.Int64 // ID - SpaceID field.Int64 // 空间ID + ID field.Int64 // id + Name field.String // knowledge's name + AppID field.Int64 // app id + CreatorID field.Int64 // creator id + SpaceID field.Int64 // space id CreatedAt field.Int64 // Create Time in Milliseconds UpdatedAt field.Int64 // Update Time in Milliseconds - DeletedAt field.Field // Delete Time in Milliseconds - Status field.Int32 // 0 初始化, 1 生效 2 失效 - Description field.String // 描述 - IconURI field.String // 头像uri - FormatType field.Int32 // 0:文本 1:表格 2:图片 + DeletedAt field.Field // Delete Time + Status field.Int32 // 0 initialization, 1 effective, 2 invalid + Description field.String // description + IconURI field.String // icon uri + FormatType field.Int32 // 0: Text 1: Table 2: Images fieldMap map[string]field.Expr } diff --git a/backend/domain/knowledge/internal/dal/query/knowledge_document.gen.go b/backend/domain/knowledge/internal/dal/query/knowledge_document.gen.go index c9688fb9..89e5d885 100644 --- a/backend/domain/knowledge/internal/dal/query/knowledge_document.gen.go +++ b/backend/domain/knowledge/internal/dal/query/knowledge_document.gen.go @@ -52,30 +52,30 @@ func newKnowledgeDocument(db *gorm.DB, opts ...gen.DOOption) knowledgeDocument { return _knowledgeDocument } -// knowledgeDocument 知识库文档表 +// knowledgeDocument knowledge document info type knowledgeDocument struct { knowledgeDocumentDo ALL field.Asterisk - ID field.Int64 // 主键ID - KnowledgeID field.Int64 // 所属knowledge的ID - Name field.String // 文档名称 - FileExtension field.String // 文档类型, txt/pdf/csv/... - DocumentType field.Int32 // 文档类型: 0:文本 1:表格 2:图片 - URI field.String // 资源uri - Size field.Int64 // 文档大小 - SliceCount field.Int64 // 分片数量 - CharCount field.Int64 // 字符数 - CreatorID field.Int64 // 创建者ID - SpaceID field.Int64 // 空间id + ID field.Int64 // id + KnowledgeID field.Int64 // knowledge id + Name field.String // document name + FileExtension field.String // Document type, txt/pdf/csv etc.. + DocumentType field.Int32 // Document type: 0: Text 1: Table 2: Image + URI field.String // uri + Size field.Int64 // document size + SliceCount field.Int64 // slice count + CharCount field.Int64 // number of characters + CreatorID field.Int64 // creator id + SpaceID field.Int64 // space id CreatedAt field.Int64 // Create Time in Milliseconds UpdatedAt field.Int64 // Update Time in Milliseconds - DeletedAt field.Field // Delete Time in Milliseconds - SourceType field.Int32 // 0:本地文件上传, 2:自定义文本 - Status field.Int32 // 状态 - FailReason field.String // 失败原因 - ParseRule field.Field // 解析+切片规则 - TableInfo field.Field // 表格信息 + DeletedAt field.Field // Delete Time + SourceType field.Int32 // 0: Local file upload, 2: Custom text, 103: Feishu 104: Lark + Status field.Int32 // status + FailReason field.String // fail reason + ParseRule field.Field // parse rule + TableInfo field.Field // table info fieldMap map[string]field.Expr } diff --git a/backend/domain/knowledge/internal/dal/query/knowledge_document_review.gen.go b/backend/domain/knowledge/internal/dal/query/knowledge_document_review.gen.go index 26bc4f44..ff755307 100644 --- a/backend/domain/knowledge/internal/dal/query/knowledge_document_review.gen.go +++ b/backend/domain/knowledge/internal/dal/query/knowledge_document_review.gen.go @@ -46,24 +46,24 @@ func newKnowledgeDocumentReview(db *gorm.DB, opts ...gen.DOOption) knowledgeDocu return _knowledgeDocumentReview } -// knowledgeDocumentReview 文档审阅表 +// knowledgeDocumentReview Document slice preview info type knowledgeDocumentReview struct { knowledgeDocumentReviewDo ALL field.Asterisk - ID field.Int64 // 主键ID + ID field.Int64 // id KnowledgeID field.Int64 // knowledge id - SpaceID field.Int64 // 空间id - Name field.String // 文档名称 - Type field.String // 文档类型 - URI field.String // 资源标识 - FormatType field.Int32 // 0 文本, 1 表格, 2 图片 - Status field.Int32 // 0 处理中,1 已完成,2 失败,3 失效 - ChunkRespURI field.String // 预切片tos资源标识 - DeletedAt field.Field // Delete Time in Milliseconds + SpaceID field.Int64 // space id + Name field.String // name + Type field.String // document type + URI field.String // uri + FormatType field.Int32 // 0 text, 1 table, 2 images + Status field.Int32 // 0 Processing 1 Completed 2 Failed 3 Expired + ChunkRespURI field.String // pre-sliced uri + DeletedAt field.Field // Delete Time CreatedAt field.Int64 // Create Time in Milliseconds UpdatedAt field.Int64 // Update Time in Milliseconds - CreatorID field.Int64 // 创建者ID + CreatorID field.Int64 // creator id fieldMap map[string]field.Expr } diff --git a/backend/domain/knowledge/internal/dal/query/knowledge_document_slice.gen.go b/backend/domain/knowledge/internal/dal/query/knowledge_document_slice.gen.go index 2c2b4e6e..be2710d5 100644 --- a/backend/domain/knowledge/internal/dal/query/knowledge_document_slice.gen.go +++ b/backend/domain/knowledge/internal/dal/query/knowledge_document_slice.gen.go @@ -46,24 +46,24 @@ func newKnowledgeDocumentSlice(db *gorm.DB, opts ...gen.DOOption) knowledgeDocum return _knowledgeDocumentSlice } -// knowledgeDocumentSlice 知识库文件切片表 +// knowledgeDocumentSlice knowledge document slice type knowledgeDocumentSlice struct { knowledgeDocumentSliceDo ALL field.Asterisk - ID field.Int64 // 主键ID + ID field.Int64 // id KnowledgeID field.Int64 // knowledge id - DocumentID field.Int64 // document id - Content field.String // 切片内容 - Sequence field.Float64 // 切片顺序号, 从1开始 + DocumentID field.Int64 // document_id + Content field.String // content + Sequence field.Float64 // slice sequence number, starting from 1 CreatedAt field.Int64 // Create Time in Milliseconds UpdatedAt field.Int64 // Update Time in Milliseconds - DeletedAt field.Field // Delete Time in Milliseconds - CreatorID field.Int64 // 创建者ID - SpaceID field.Int64 // 空间ID - Status field.Int32 // 状态 - FailReason field.String // 失败原因 - Hit field.Int64 // 命中次数 + DeletedAt field.Field // Delete Time + CreatorID field.Int64 // creator id + SpaceID field.Int64 // space id + Status field.Int32 // status + FailReason field.String // fail reason + Hit field.Int64 // hit counts fieldMap map[string]field.Expr } diff --git a/backend/domain/knowledge/processor/impl/base.go b/backend/domain/knowledge/processor/impl/base.go index 5220fabe..1a7bc56d 100644 --- a/backend/domain/knowledge/processor/impl/base.go +++ b/backend/domain/knowledge/processor/impl/base.go @@ -48,7 +48,7 @@ type baseDocProcessor struct { Documents []*entity.Document documentSource *entity.DocumentSource - // 落DB 的 model + // Drop DB model TableName string docModels []*model.KnowledgeDocument @@ -63,7 +63,7 @@ type baseDocProcessor struct { } func (p *baseDocProcessor) BeforeCreate() error { - // 从数据源拉取数据 + // Pull data from a data source return nil } @@ -154,7 +154,7 @@ func (p *baseDocProcessor) InsertDBModel() (err error) { func (p *baseDocProcessor) createTable() error { if len(p.Documents) == 1 && p.Documents[0].Type == knowledge.DocumentTypeTable { - // 表格型知识库,创建表 + // Tabular knowledge base, creating tables rdbColumns := []*rdbEntity.Column{} tableColumns := p.Documents[0].TableInfo.Columns columnIDs, err := p.idgen.GenMultiIDs(p.ctx, len(tableColumns)+1) @@ -178,13 +178,13 @@ func (p *baseDocProcessor) createTable() error { Indexing: false, Sequence: -1, }) - // 为每个表格增加个主键ID + // Add a primary key ID to each table rdbColumns = append(rdbColumns, &rdbEntity.Column{ Name: consts.RDBFieldID, DataType: rdbEntity.TypeBigInt, NotNull: true, }) - // 创建一个数据表 + // Create a data table resp, err := p.rdb.CreateTable(p.ctx, &rdb.CreateTableRequest{ Table: &rdbEntity.Table{ Columns: rdbColumns, diff --git a/backend/domain/knowledge/processor/impl/custom_doc.go b/backend/domain/knowledge/processor/impl/custom_doc.go index 8dfcf639..3044877a 100644 --- a/backend/domain/knowledge/processor/impl/custom_doc.go +++ b/backend/domain/knowledge/processor/impl/custom_doc.go @@ -18,7 +18,7 @@ package impl import "github.com/coze-dev/coze-studio/backend/pkg/logs" -// 用户输入自定义内容后创建文档 +// Create a document after the user enters custom content type customDocProcessor struct { baseDocProcessor } diff --git a/backend/domain/knowledge/processor/impl/custom_table.go b/backend/domain/knowledge/processor/impl/custom_table.go index 3faa1f5c..d98a2cfa 100644 --- a/backend/domain/knowledge/processor/impl/custom_table.go +++ b/backend/domain/knowledge/processor/impl/custom_table.go @@ -24,7 +24,7 @@ import ( "github.com/coze-dev/coze-studio/backend/types/errno" ) -// 用户自定义表格创建文档 +// User-defined form creation document type customTableProcessor struct { baseDocProcessor } @@ -46,7 +46,7 @@ func (c *customTableProcessor) BeforeCreate() error { return errorx.New(errno.ErrKnowledgeTableInfoNotExistCode, errorx.KVf("msg", "table info not found, doc_id: %d", tableDoc[0].ID)) } c.Documents[0].TableInfo = *tableDoc[0].TableInfo - // 追加场景 + // append scene if c.Documents[0].RawContent != "" { c.Documents[0].FileExtension = getFormatType(c.Documents[0].Type) uri := getTosUri(c.UserID, string(c.Documents[0].FileExtension)) @@ -65,14 +65,14 @@ func (c *customTableProcessor) BuildDBModel() error { if len(c.Documents) > 0 && c.Documents[0].Type == knowledge.DocumentTypeTable { if c.Documents[0].IsAppend { - // 追加场景,不需要创建表了 - // 一是用户自定义一些数据、二是再上传一个表格,把表格里的数据追加到表格中 + // Append the scene, no need to create a table + // First, the user customizes some data, and second, uploads another form and appends the data in the form to the form } else { err := c.baseDocProcessor.BuildDBModel() if err != nil { return err } - // 因为这种创建方式不带数据,所以直接设置状态为可用 + // Since this method of creation does not carry any data, the state is set to available directly for i := range c.docModels { c.docModels[i].DocumentType = 1 c.docModels[i].Status = int32(entity.DocumentStatusInit) @@ -84,7 +84,7 @@ func (c *customTableProcessor) BuildDBModel() error { func (c *customTableProcessor) InsertDBModel() error { if isTableAppend(c.Documents) { - // 追加场景,设置文档为处理中状态 + // Append the scene and set the document to the processing state err := c.documentRepo.SetStatus(c.ctx, c.Documents[0].ID, int32(entity.DocumentStatusUploading), "") if err != nil { logs.CtxErrorf(c.ctx, "document set status err:%v", err) diff --git a/backend/domain/knowledge/processor/impl/local_table.go b/backend/domain/knowledge/processor/impl/local_table.go index ff9a0ec9..10682524 100644 --- a/backend/domain/knowledge/processor/impl/local_table.go +++ b/backend/domain/knowledge/processor/impl/local_table.go @@ -65,7 +65,7 @@ func (l *localTableProcessor) BuildDBModel() error { func (l *localTableProcessor) InsertDBModel() error { if isTableAppend(l.Documents) { - // 追加场景,设置文档为处理中状态 + // Append the scene and set the document to the processing state err := l.documentRepo.SetStatus(l.ctx, l.Documents[0].ID, int32(entity.DocumentStatusUploading), "") if err != nil { logs.CtxErrorf(l.ctx, "document set status err:%v", err) diff --git a/backend/domain/knowledge/processor/interface.go b/backend/domain/knowledge/processor/interface.go index 1d65d518..d39723f4 100644 --- a/backend/domain/knowledge/processor/interface.go +++ b/backend/domain/knowledge/processor/interface.go @@ -19,10 +19,10 @@ package processor import "github.com/coze-dev/coze-studio/backend/domain/knowledge/entity" type DocProcessor interface { - BeforeCreate() error // 获取数据源 - BuildDBModel() error // 构建Doc记录 - InsertDBModel() error // 向数据库中插入一条Doc记录 - Indexing() error // 发起索引任务 - GetResp() []*entity.Document // 返回处理后的文档信息 + BeforeCreate() error // Get data source + BuildDBModel() error // Build Doc Record + InsertDBModel() error // Insert a Doc record into the database + Indexing() error // Initiate indexing task + GetResp() []*entity.Document // Return the processed document information //GetColumnName() } diff --git a/backend/domain/knowledge/service/convert.go b/backend/domain/knowledge/service/convert.go index 3b3c293e..16162a90 100644 --- a/backend/domain/knowledge/service/convert.go +++ b/backend/domain/knowledge/service/convert.go @@ -247,7 +247,7 @@ var d2sMapping = map[knowledge.DocumentType]document2SliceFn{ return slice, nil }, knowledge.DocumentTypeTable: func(doc *schema.Document, knowledgeID, documentID, creatorID int64) (*entity.Slice, error) { - // NOTICE: table 类型的原始数据需要去 rdb 里查 + // NOTICE: The original data source of table type needs to be checked in rdb slice := &entity.Slice{ Info: knowledge.Info{}, KnowledgeID: knowledgeID, diff --git a/backend/domain/knowledge/service/datacopy.go b/backend/domain/knowledge/service/datacopy.go index a5391ee6..5264b6de 100644 --- a/backend/domain/knowledge/service/datacopy.go +++ b/backend/domain/knowledge/service/datacopy.go @@ -200,7 +200,7 @@ func (k *knowledgeSVC) copyKnowledge(ctx context.Context, copyCtx *knowledgeCopy } func (k *knowledgeSVC) copyKnowledgeDocuments(ctx context.Context, copyCtx *knowledgeCopyCtx) (err error) { - // 查询document信息(仅处理完成的文档) + // Query document information (only processed documents) documents, _, err := k.documentRepo.FindDocumentByCondition(ctx, &entity.WhereDocumentOpt{ KnowledgeIDs: []int64{copyCtx.OriginData.ID}, StatusIn: []int32{int32(entity.DocumentStatusEnable), int32(entity.DocumentStatusInit)}, @@ -248,7 +248,7 @@ func (k *knowledgeSVC) copyKnowledgeDocuments(ctx context.Context, copyCtx *know return errorx.New(errno.ErrKnowledgeDBCode, errorx.KV("msg", err.Error())) } } - // 表格类复制 + // table copy eg := errgroup.Group{} eg.SetLimit(10) mu := sync.Mutex{} @@ -286,7 +286,7 @@ func (k *knowledgeSVC) copyKnowledgeDocuments(ctx context.Context, copyCtx *know } func (k *knowledgeSVC) copyDocument(ctx context.Context, copyCtx *knowledgeCopyCtx, doc *model.KnowledgeDocument, newDocID int64) (err error) { - // 表格类文档复制 + // tabular document replication newDoc := model.KnowledgeDocument{ ID: newDocID, KnowledgeID: copyCtx.CopyTask.TargetDataID, @@ -307,7 +307,7 @@ func (k *knowledgeSVC) copyDocument(ctx context.Context, copyCtx *knowledgeCopyC ParseRule: doc.ParseRule, } columnMap := map[int64]int64{} - // 如果是表格型知识库->创建新的表格 + // If it is a tabular knowledge base - > create a new table if doc.DocumentType == int32(knowledgeModel.DocumentTypeTable) { if doc.TableInfo != nil { newTableInfo := entity.TableInfo{} @@ -472,7 +472,7 @@ func (k *knowledgeSVC) copyDocument(ctx context.Context, copyCtx *knowledgeCopyC return nil } func (k *knowledgeSVC) createTable(ctx context.Context, doc *model.KnowledgeDocument) error { - // 表格型知识库,创建表 + // Tabular knowledge base, creating tables rdbColumns := []*rdbEntity.Column{} tableColumns := doc.TableInfo.Columns columnIDs, err := k.genMultiIDs(ctx, len(tableColumns)+1) @@ -495,13 +495,13 @@ func (k *knowledgeSVC) createTable(ctx context.Context, doc *model.KnowledgeDocu Indexing: false, Sequence: -1, }) - // 为每个表格增加个主键ID + // Add a primary key ID to each table rdbColumns = append(rdbColumns, &rdbEntity.Column{ Name: consts.RDBFieldID, DataType: rdbEntity.TypeBigInt, NotNull: true, }) - // 创建一个数据表 + // Create a data table resp, err := k.rdb.CreateTable(ctx, &rdb.CreateTableRequest{ Table: &rdbEntity.Table{ Columns: rdbColumns, diff --git a/backend/domain/knowledge/service/event_handle.go b/backend/domain/knowledge/service/event_handle.go index 7aad7846..de71dbf6 100644 --- a/backend/domain/knowledge/service/event_handle.go +++ b/backend/domain/knowledge/service/event_handle.go @@ -97,7 +97,7 @@ func (k *knowledgeSVC) HandleMessage(ctx context.Context, msg *eventbus.Message) } func (k *knowledgeSVC) deleteKnowledgeDataEventHandler(ctx context.Context, event *entity.Event) error { - // 删除知识库在各个存储里的数据 + // Delete the data in each store of the knowledge base for _, manager := range k.searchStoreManagers { s, err := manager.GetSearchStore(ctx, getCollectionName(event.KnowledgeID)) if err != nil { @@ -145,8 +145,8 @@ func (k *knowledgeSVC) indexDocument(ctx context.Context, event *entity.Event) ( return errorx.New(errno.ErrKnowledgeNonRetryableCode, errorx.KV("reason", "[indexDocument] document not provided")) } - // 1. retry 队列和普通队列中对同一文档的 index 操作并发,同一个文档数据写入两份(在后端 bugfix 上线时产生) - // 2. rebalance 重复消费同一条消息 + // 1. The index operations on the same document in the retry queue and the ordinary queue are concurrent, and the same document data is written twice (generated when the backend bugfix is online) + // 2. rebalance repeated consumption of the same message // check knowledge and document status if valid, err := k.isWritableKnowledgeAndDocument(ctx, doc.KnowledgeID, doc.ID); err != nil { @@ -281,7 +281,7 @@ func (k *knowledgeSVC) indexDocument(ctx context.Context, event *entity.Event) ( // save slices if doc.Type == knowledge.DocumentTypeTable { - // 表格类型,将数据插入到数据库中 + // Table type to insert data into a database err = k.upsertDataToTable(ctx, &doc.TableInfo, sliceEntities) if err != nil { logs.CtxErrorf(ctx, "[indexDocument] insert data to table failed, err: %v", err) @@ -360,7 +360,7 @@ func (k *knowledgeSVC) indexDocument(ctx context.Context, event *entity.Event) ( }); err != nil { return errorx.New(errno.ErrKnowledgeSearchStoreCode, errorx.KV("msg", fmt.Sprintf("create search store failed, err: %v", err))) } - // 图片型知识库kn:doc:slice = 1:n:n,可能content为空,不需要写入 + // Picture knowledge base kn: doc: slice = 1: n: n, maybe the content is empty, no need to write if doc.Type == knowledge.DocumentTypeImage && len(ssDocs) == 1 && len(ssDocs[0].Content) == 0 { continue } diff --git a/backend/domain/knowledge/service/interface.go b/backend/domain/knowledge/service/interface.go index 9fb265ee..f2c9364f 100644 --- a/backend/domain/knowledge/service/interface.go +++ b/backend/domain/knowledge/service/interface.go @@ -203,16 +203,16 @@ type RetrieveRequest = knowledge.RetrieveRequest type RetrieveContext struct { Ctx context.Context - OriginQuery string // 原始 query - RewrittenQuery *string // 改写后的 query, 如果没有改写,就是 nil, 会在执行过程中添加上去 - ChatHistory []*schema.Message // 如果没有对话历史或者不需要历史,则为 nil - KnowledgeIDs sets.Set[int64] // 本次检索涉及的知识库id - KnowledgeInfoMap map[int64]*KnowledgeInfo // 知识库id到文档id的映射 - // 召回策略 + OriginQuery string // Original query + RewrittenQuery *string // The rewritten query, if not rewritten, is nil, which will be added during execution + ChatHistory []*schema.Message // Nil if there is no dialogue history or no history is required + KnowledgeIDs sets.Set[int64] // The knowledge base ID involved in this search + KnowledgeInfoMap map[int64]*KnowledgeInfo // Mapping of Knowledge Base IDs to Document IDs + // recall strategy Strategy *entity.RetrievalStrategy - // 检索涉及的 document 信息 + // Retrieve the document information involved Documents []*model.KnowledgeDocument - // 用于 nl2sql 和 message to query 的 chat model + // A chat model for nl2sql and message to query ChatModel chatmodel.BaseChatModel } @@ -254,9 +254,9 @@ type TableSchemaResponse struct { type TableDataType int32 const ( - AllData TableDataType = 0 // schema sheets 和 preview data - OnlySchema TableDataType = 1 // 只需要 schema 结构 & Sheets - OnlyPreview TableDataType = 2 // 只需要 preview data + AllData TableDataType = 0 // Schema sheets and preview data + OnlySchema TableDataType = 1 // Only need schema structure & Sheets + OnlyPreview TableDataType = 2 // Just preview the data ) type GetDocumentTableInfoRequest struct { diff --git a/backend/domain/knowledge/service/knowledge.go b/backend/domain/knowledge/service/knowledge.go index 181fa5ca..c98b42f6 100644 --- a/backend/domain/knowledge/service/knowledge.go +++ b/backend/domain/knowledge/service/knowledge.go @@ -103,19 +103,19 @@ func NewKnowledgeSVC(config *KnowledgeSVCConfig) (Knowledge, eventbus.ConsumerHa type KnowledgeSVCConfig struct { DB *gorm.DB // required IDGen idgen.IDGenerator // required - RDB rdb.RDB // required: 表格存储 - Producer eventbus.Producer // required: 文档 indexing 过程走 mq 异步处理 - SearchStoreManagers []searchstore.Manager // required: 向量 / 全文 - ParseManager parser.Manager // optional: 文档切分与处理能力, default builtin parser + RDB rdb.RDB // Required: Form storage + Producer eventbus.Producer // Required: Document indexing process goes through mq asynchronous processing + SearchStoreManagers []searchstore.Manager // Required: Vector/Full Text + ParseManager parser.Manager // Optional: document segmentation and processing capability, default builtin parser Storage storage.Storage // required: oss - ModelFactory chatmodel.Factory // required: 模型 factory - Rewriter messages2query.MessagesToQuery // optional: 未配置时不改写 - Reranker rerank.Reranker // optional: 未配置时默认 rrf - NL2Sql nl2sql.NL2SQL // optional: 未配置时默认不支持 - EnableCompactTable *bool // optional: 表格数据压缩,默认 true - OCR ocr.OCR // optional: ocr, 未提供时 ocr 功能不可用 - CacheCli cache.Cmdable // optional: 缓存实现 - IsAutoAnnotationSupported bool // 是否支持了图片自动标注 + ModelFactory chatmodel.Factory // Required: Model factory + Rewriter messages2query.MessagesToQuery // Optional: Do not overwrite when not configured + Reranker rerank.Reranker // Optional: default rrf when not configured + NL2Sql nl2sql.NL2SQL // Optional: Not supported by default when not configured + EnableCompactTable *bool // Optional: Table data compression, default true + OCR ocr.OCR // Optional: ocr, ocr function is not available when not provided + CacheCli cache.Cmdable // Optional: cache implementation + IsAutoAnnotationSupported bool // Does it support automatic image labeling? } type knowledgeSVC struct { @@ -135,8 +135,8 @@ type knowledgeSVC struct { storage storage.Storage nl2Sql nl2sql.NL2SQL cacheCli cache.Cmdable - enableCompactTable bool // 表格数据压缩 - isAutoAnnotationSupported bool // 是否支持了图片自动标注 + enableCompactTable bool // Table data compression + isAutoAnnotationSupported bool // Does it support automatic image labeling? } func (k *knowledgeSVC) CreateKnowledge(ctx context.Context, request *CreateKnowledgeRequest) (response *CreateKnowledgeResponse, err error) { @@ -163,7 +163,7 @@ func (k *knowledgeSVC) CreateKnowledge(ctx context.Context, request *CreateKnowl SpaceID: request.SpaceID, CreatedAt: now, UpdatedAt: now, - Status: int32(knowledgeModel.KnowledgeStatusEnable), // 目前向量库的初始化由文档触发,知识库无 init 过程 + Status: int32(knowledgeModel.KnowledgeStatusEnable), // At present, the initialization of the vector library is triggered by the document, and the knowledge base has no init process Description: request.Description, IconURI: request.IconUri, FormatType: int32(request.FormatType), @@ -217,7 +217,7 @@ func (k *knowledgeSVC) UpdateKnowledge(ctx context.Context, request *UpdateKnowl } func (k *knowledgeSVC) DeleteKnowledge(ctx context.Context, request *DeleteKnowledgeRequest) error { - // 先获取一下knowledge的信息 + // Get some knowledge first knModel, err := k.knowledgeRepo.GetByID(ctx, request.KnowledgeID) if err != nil { return errorx.New(errno.ErrKnowledgeDBCode, errorx.KV("msg", err.Error())) @@ -357,27 +357,27 @@ func (k *knowledgeSVC) CreateDocument(ctx context.Context, request *CreateDocume Storage: k.storage, Rdb: k.rdb, }) - // 1. 前置的动作,上传 tos 等 + // 1. Front action, upload tos, etc err = docProcessor.BeforeCreate() if err != nil { return nil, err } - // 2. 构建 落库 + // 2. Build, drop library err = docProcessor.BuildDBModel() if err != nil { return nil, err } - // 3. 插入数据库 + // 3. Insert into the database err = docProcessor.InsertDBModel() if err != nil { return nil, err } - // 4. 发起索引任务 + // 4. Initiate the indexing task err = docProcessor.Indexing() if err != nil { return nil, err } - // 5. 返回处理后的文档信息 + // 5. Return the processed document information docs := docProcessor.GetResp() return &CreateDocumentResponse{ Documents: docs, @@ -397,7 +397,7 @@ func (k *knowledgeSVC) UpdateDocument(ctx context.Context, request *UpdateDocume } if doc.DocumentType == int32(knowledgeModel.DocumentTypeTable) { - // 如果是表格类型,可能是要改table的meta + // If it is a table type, it may be necessary to change the meta of the table. if doc.TableInfo != nil { finalColumns, err := k.alterTableSchema(ctx, doc.TableInfo.Columns, request.TableInfo.Columns, doc.TableInfo.PhysicalTableName) if err != nil { @@ -673,7 +673,7 @@ func (k *knowledgeSVC) CreateSlice(ctx context.Context, request *CreateSliceRequ } if len(slices) == 1 { if request.Position == 1 || request.Position == 0 { - // 插入到最前面 + // Insert to the front sliceInfo.Sequence = slices[0].Sequence - 1 } else { sliceInfo.Sequence = slices[0].Sequence + 1 @@ -759,7 +759,7 @@ func (k *knowledgeSVC) UpdateSlice(ctx context.Context, request *UpdateSliceRequ if docInfo == nil || docInfo.ID == 0 { return errorx.New(errno.ErrKnowledgeDocumentNotExistCode) } - // 更新数据库中的存储 + // Update storage in the database if docInfo.DocumentType == int32(knowledgeModel.DocumentTypeText) || docInfo.DocumentType == int32(knowledgeModel.DocumentTypeTable) { sliceEntity := entity.Slice{RawContent: request.RawContent} @@ -851,7 +851,7 @@ func (k *knowledgeSVC) DeleteSlice(ctx context.Context, request *DeleteSliceRequ return errorx.New(errno.ErrKnowledgeCrossDomainCode, errorx.KV("msg", err.Error())) } } - // 删除数据库中的存储 + // Delete storage in the database err = k.sliceRepo.Delete(ctx, &model.KnowledgeDocumentSlice{ID: request.SliceID}) if err != nil { logs.CtxErrorf(ctx, "delete slice failed, err: %v", err) @@ -905,9 +905,9 @@ func (k *knowledgeSVC) ListSlice(ctx context.Context, request *ListSliceRequest) } resp.Total = int(total) var sliceMap map[int64]*entity.Slice - // 如果是表格类型,那么去table中取一下原始数据 + // If it is a table type, then go to the table to get the original data source if doc.DocumentType == int32(knowledgeModel.DocumentTypeTable) { - // 从数据库中查询原始数据 + // Query original data source from database sliceMap, err = k.selectTableData(ctx, doc.TableInfo, slices) if err != nil { logs.CtxErrorf(ctx, "select table data failed, err: %v", err) @@ -1010,7 +1010,7 @@ func (k *knowledgeSVC) CreateDocumentReview(ctx context.Context, request *Create } reviews = append(reviews, review) } - // STEP 1. 生成ID + // STEP 1. Generate ID reviewIDs, err := k.genMultiIDs(ctx, len(request.Reviews)) if err != nil { return nil, errorx.New(errno.ErrKnowledgeIDGenCode) diff --git a/backend/domain/knowledge/service/knowledge_test.go b/backend/domain/knowledge/service/knowledge_test.go index 88f6f725..a73b139b 100644 --- a/backend/domain/knowledge/service/knowledge_test.go +++ b/backend/domain/knowledge/service/knowledge_test.go @@ -190,7 +190,7 @@ func TestKnowledgeSVC_CreateDocument(t *testing.T) { // IconURI: "icon.png", // }, // KnowledgeID: 666, - // RawContent: "测试测试测试测试", + // RawContent: "Test Test Test", // Source: entity.DocumentSourceCustom, // FileExtension: "txt", // } @@ -274,25 +274,25 @@ func TestKnowledgeSVC_CreateDocument(t *testing.T) { // VirtualTableName: "test", // Columns: []*entity.TableColumn{ // { - // Name: "第一列", + // Name: "First Column", // Type: entity.TableColumnTypeBoolean, // Indexing: true, // Sequence: 0, // }, // { - // Name: "第二列", + // Name: "Second column", // Type: entity.TableColumnTypeTime, // Indexing: false, // Sequence: 1, // }, // { - // Name: "第三列", + // Name: "Third Column", // Type: entity.TableColumnTypeString, // Indexing: false, // Sequence: 2, // }, // { - // Name: "第四列", + // Name: "Fourth column", // Type: entity.TableColumnTypeNumber, // Indexing: true, // Sequence: 3, @@ -384,25 +384,25 @@ func TestKnowledgeSVC_DeleteDocument(t *testing.T) { // VirtualTableName: "test", // Columns: []*entity.TableColumn{ // { -// Name: "第一列", +// Name: "First Column", // Type: entity.TableColumnTypeBoolean, // Indexing: true, // Sequence: 0, // }, // { -// Name: "第二列", +// Name: "Second column", // Type: entity.TableColumnTypeTime, // Indexing: false, // Sequence: 1, // }, // { -// Name: "第三列", +// Name: "Third Column", // Type: entity.TableColumnTypeString, // Indexing: false, // Sequence: 2, // }, // { -// Name: "第四列", +// Name: "Fourth column", // Type: entity.TableColumnTypeNumber, // Indexing: true, // Sequence: 3, @@ -415,14 +415,14 @@ func TestKnowledgeSVC_DeleteDocument(t *testing.T) { // assert.Equal(t, 1, len(doc)) // time.Sleep(time.Second * 5) // doc[0].Name = "new_name" -// doc[0].TableInfo.Columns[0].Name = "第一列_changeName" -// doc[0].TableInfo.Columns[1].Name = "第二列_changeSeq" +// Doc [0]. TableInfo. Columns [0]. Name = "First column _changeName" +// Doc [0]. TableInfo. Columns [1]. Name = "Second column _changeSeq" // doc[0].TableInfo.Columns[1].Sequence = 2 -// doc[0].TableInfo.Columns[2].Name = "第三列_changeType" +// Doc [0]. TableInfo. Columns [2]. Name = "Third column _changeType" // doc[0].TableInfo.Columns[2].Type = entity.TableColumnTypeInteger // doc[0].TableInfo.Columns[2].Sequence = 1 -// // 删除原来的第四列并新建第四列 -// doc[0].TableInfo.Columns[3].Name = "第五列_create" +// Delete the original fourth column and create a new fourth column +// Doc [0]. TableInfo. Columns [3]. Name = "Fifth column _create" // doc[0].TableInfo.Columns[3].Type = entity.TableColumnTypeNumber // doc[0].TableInfo.Columns[3].Sequence = 3 // doc[0].TableInfo.Columns[3].ID = 0 @@ -479,25 +479,25 @@ func TestKnowledgeSVC_ListDocument(t *testing.T) { // VirtualTableName: "test", // Columns: []*entity.TableColumn{ // { -// Name: "第一列", +// Name: "First Column", // Type: entity.TableColumnTypeBoolean, // Indexing: true, // Sequence: 0, // }, // { -// Name: "第二列", +// Name: "Second column", // Type: entity.TableColumnTypeTime, // Indexing: false, // Sequence: 1, // }, // { -// Name: "第三列", +// Name: "Third Column", // Type: entity.TableColumnTypeString, // Indexing: false, // Sequence: 2, // }, // { -// Name: "第四列", +// Name: "Fourth column", // Type: entity.TableColumnTypeNumber, // Indexing: true, // Sequence: 3, @@ -781,25 +781,25 @@ func TestKnowledgeSVC_ListDocument(t *testing.T) { // VirtualTableName: "test", // Columns: []*entity.TableColumn{ // { -// Name: "第一列", +// Name: "First Column", // Type: entity.TableColumnTypeBoolean, // Indexing: true, // Sequence: 0, // }, // { -// Name: "第二列", +// Name: "Second column", // Type: entity.TableColumnTypeTime, // Indexing: false, // Sequence: 1, // }, // { -// Name: "第三列", +// Name: "Third Column", // Type: entity.TableColumnTypeString, // Indexing: false, // Sequence: 2, // }, // { -// Name: "第四列", +// Name: "Fourth column", // Type: entity.TableColumnTypeNumber, // Indexing: true, // Sequence: 3, @@ -979,7 +979,7 @@ func TestKnowledgeSVC_Retrieve(t *testing.T) { //svc := MockKnowledgeSVC(t) //mockey.PatchConvey("test retrieve", t, func() { // res, err := svc.Retrieve(ctx, &knowledge.RetrieveRequest{ - // Query: "查找第三列为gogogo的数据", + // Query: "Find the data of the third column gogogo", // KnowledgeIDs: []int64{1745810102455734000, 1745810094197395000}, // Strategy: &entity.RetrievalStrategy{ // TopK: ptr.Of(int64(2)), diff --git a/backend/domain/knowledge/service/rdb.go b/backend/domain/knowledge/service/rdb.go index 4ee1f424..6b52e862 100644 --- a/backend/domain/knowledge/service/rdb.go +++ b/backend/domain/knowledge/service/rdb.go @@ -116,7 +116,7 @@ func (k *knowledgeSVC) alterTableSchema(ctx context.Context, beforeColumns []*en continue } if targetColumns[i].ID == 0 { - // 要新增的列 + // Columns to be added columnID, err := k.idgen.GenID(ctx) if err != nil { logs.CtxErrorf(ctx, "gen id failed, err: %v", err) @@ -132,7 +132,7 @@ func (k *knowledgeSVC) alterTableSchema(ctx context.Context, beforeColumns []*en }) } else { if checkColumnExist(targetColumns[i].ID, beforeColumns) { - // 要修改的列 + // Column to modify alterRequest.Operations = append(alterRequest.Operations, &rdb.AlterTableOperation{ Action: rdbEntity.ModifyColumn, Column: &rdbEntity.Column{ @@ -153,7 +153,7 @@ func (k *knowledgeSVC) alterTableSchema(ctx context.Context, beforeColumns []*en continue } if !checkColumnExist(beforeColumns[i].ID, targetColumns) { - // 要删除的列 + // Column to delete alterRequest.Operations = append(alterRequest.Operations, &rdb.AlterTableOperation{ Action: rdbEntity.DropColumn, Column: &rdbEntity.Column{ diff --git a/backend/domain/knowledge/service/retrieve.go b/backend/domain/knowledge/service/retrieve.go index 042073bc..f653d38e 100644 --- a/backend/domain/knowledge/service/retrieve.go +++ b/backend/domain/knowledge/service/retrieve.go @@ -69,17 +69,17 @@ func (k *knowledgeSVC) Retrieve(ctx context.Context, request *RetrieveRequest) ( } chain := compose.NewChain[*RetrieveContext, []*knowledgeModel.RetrieveSlice]() rewriteNode := compose.InvokableLambda(k.queryRewriteNode) - // 向量化召回 + // vectorized recall vectorRetrieveNode := compose.InvokableLambda(k.vectorRetrieveNode) - // ES召回 + // ES recall EsRetrieveNode := compose.InvokableLambda(k.esRetrieveNode) - // Nl2Sql召回 + // Nl2Sql recall Nl2SqlRetrieveNode := compose.InvokableLambda(k.nl2SqlRetrieveNode) // pass user query Node passRequestContextNode := compose.InvokableLambda(k.passRequestContext) // reRank Node reRankNode := compose.InvokableLambda(k.reRankNode) - // pack Result接口 + // Pack Result Interface packResult := compose.InvokableLambda(k.packResults) parallelNode := compose.NewParallel(). AddLambda("vectorRetrieveNode", vectorRetrieveNode). @@ -190,11 +190,11 @@ func (k *knowledgeSVC) prepareRAGDocuments(ctx context.Context, documentIDs []in func (k *knowledgeSVC) queryRewriteNode(ctx context.Context, req *RetrieveContext) (newRetrieveContext *RetrieveContext, err error) { if len(req.ChatHistory) == 0 { - // 没有上下文不需要改写 + // No context, no rewriting. return req, nil } if !req.Strategy.EnableQueryRewrite || k.rewriter == nil { - // 未开启rewrite功能,不需要上下文改写 + // Rewrite function is not enabled, no context rewrite is required return req, nil } var opts []messages2query.Option @@ -206,7 +206,7 @@ func (k *knowledgeSVC) queryRewriteNode(ctx context.Context, req *RetrieveContex logs.CtxErrorf(ctx, "rewrite query failed: %v", err) return req, nil } - // 改写完成 + // Rewrite completed req.RewrittenQuery = &rewrittenQuery return req, nil } @@ -373,7 +373,7 @@ func (k *knowledgeSVC) nl2SqlExec(ctx context.Context, doc *model.KnowledgeDocum return nil, err } sql = addSliceIdColumn(sql) - // 执行sql + // Execute sql replaceMap := map[string]sqlparsercontract.TableColumn{} replaceMap[doc.Name] = sqlparsercontract.TableColumn{ NewTableName: ptr.Of(doc.TableInfo.PhysicalTableName), @@ -395,7 +395,7 @@ func (k *knowledgeSVC) nl2SqlExec(ctx context.Context, doc *model.KnowledgeDocum logs.CtxErrorf(ctx, "parse sql failed: %v", err) return nil, err } - // 执行sql + // Execute sql resp, err := k.rdb.ExecuteSQL(ctx, &rdb.ExecuteSQLRequest{ SQL: parsedSQL, }) @@ -428,7 +428,7 @@ func addSliceIdColumn(originalSql string) string { if selectIndex == -1 { return originalSql } - result := originalSql[:selectIndex+len("select ")] // 保留 select 部分 + result := originalSql[:selectIndex+len("select ")] // Keep selected part remainder := originalSql[selectIndex+len("select "):] lowerRemainder := strings.ToLower(remainder) @@ -474,25 +474,25 @@ func (k *knowledgeSVC) passRequestContext(ctx context.Context, req *RetrieveCont } func (k *knowledgeSVC) reRankNode(ctx context.Context, resultMap map[string]any) (retrieveResult []*schema.Document, err error) { - // 首先获取下retrieve上下文 + // First retrieve the context retrieveCtx, ok := resultMap["passRequestContext"].(*RetrieveContext) if !ok { logs.CtxErrorf(ctx, "retrieve context is not found") return nil, errorx.New(errno.ErrKnowledgeSystemCode, errorx.KV("msg", "retrieve context is not found")) } - // 获取下向量化召回的接口 + // Get the interface for the downvectorized recall vectorRetrieveResult, ok := resultMap["vectorRetrieveNode"].([]*schema.Document) if !ok { logs.CtxErrorf(ctx, "vector retrieve result is not found") vectorRetrieveResult = []*schema.Document{} } - // 获取下es召回的接口 + // Get the interface of the es recall. esRetrieveResult, ok := resultMap["esRetrieveNode"].([]*schema.Document) if !ok { logs.CtxErrorf(ctx, "es retrieve result is not found") esRetrieveResult = []*schema.Document{} } - // 获取下nl2sql召回的接口 + // Get the interface recalled under nl2sql nl2SqlRetrieveResult, ok := resultMap["nl2SqlRetrieveNode"].([]*schema.Document) if !ok { logs.CtxErrorf(ctx, "nl2sql retrieve result is not found") @@ -508,10 +508,10 @@ func (k *knowledgeSVC) reRankNode(ctx context.Context, resultMap map[string]any) return data } - // 根据召回策略从不同渠道获取召回结果 + // Obtain recall results from different channels according to the recall strategy var retrieveResultArr [][]*rerank.Data if retrieveCtx.Strategy.EnableNL2SQL { - // nl2sql结果 + // Nl2sql results retrieveResultArr = append(retrieveResultArr, docs2RerankData(nl2SqlRetrieveResult)) } switch retrieveCtx.Strategy.SearchType { @@ -739,18 +739,18 @@ func (i *ImageContent) SetKV(k string, v string) { func (k *knowledgeSVC) ParseFrontEndImageContent(ctx context.Context, s string) []*ImageContent { res := make([]*ImageContent, 0) imgRe := regexp.MustCompile(`]*>`) - // 查找所有匹配项 + // Find all matches matches := imgRe.FindAllSubmatchIndex([]byte(s), -1) - // 遍历匹配项并输出src和data-tos-key字段 - // 遍历每个匹配项的索引 + // Traverse matches and output the src and data-tos-key fields + // Iterate the index of each match for _, match := range matches { - // 输出每个匹配项整个正则在文本中的开始和结束位置 + // Outputs the beginning and end positions of the entire regular for each match in the text matchStart := match[0] matchEnd := match[1] all := s[match[0]:match[1]] re := regexp.MustCompile(`]+)>`) - // 初始化map存储kv信息,把多余信息去掉 + // Initialize map to store kv information and remove redundant information m := make(map[string]string) l := make([]string, 0) match := re.FindStringSubmatch(all) @@ -758,13 +758,13 @@ func (k *knowledgeSVC) ParseFrontEndImageContent(ctx context.Context, s string) continue } attributes := match[1] - // 定义正则表达式模式,用于提取属性键值对 + // Defines a regular expression pattern for extracting attribute key-value pairs attrRe := regexp.MustCompile(`(\S+)=(?:"([^"]*)"|'([^']*)')`) - // 查找所有属性键值对 + // Find all attribute key-value pairs attrMatches := attrRe.FindAllStringSubmatch(attributes, -1) - // 提取并存储kv信息 + // Extract and store kv information for _, attrMatch := range attrMatches { key := attrMatch[1] value := attrMatch[2] diff --git a/backend/domain/knowledge/service/sheet.go b/backend/domain/knowledge/service/sheet.go index 2839c13b..9ac6852a 100644 --- a/backend/domain/knowledge/service/sheet.go +++ b/backend/domain/knowledge/service/sheet.go @@ -271,11 +271,11 @@ func (k *knowledgeSVC) ValidateTableSchema(ctx context.Context, request *Validat dst := doc.TableInfo result := make(map[string]string) - // validate 通过条件: - // 1. 表头名称对齐(不要求顺序一致) - // 2. indexing 列必须有值, 其余列可以为空 - // 3. 值类型可转换 - // 4. 已有表表头字段全包含 + // Validate the conditions: + // 1. Header name alignment (consistent order is not required) + // 2. The indexing column must have a value, and the remaining columns can be empty + // 3. Value types are convertible + // 4. All existing table header fields are included dstMapping := make(map[string]*entity.TableColumn) for _, col := range dst.Columns { dstCol := col @@ -395,7 +395,7 @@ func (k *knowledgeSVC) GetDocumentTableInfo(ctx context.Context, request *GetDoc }, nil } -// GetDocumentTableInfoByID 先不作为接口,有需要再改 +// GetDocumentTableInfoByID not as an interface first, and then change it if necessary func (k *knowledgeSVC) GetDocumentTableInfoByID(ctx context.Context, documentID int64, needData bool) (*TableSchemaResponse, error) { docs, err := k.documentRepo.MGetByID(ctx, []int64{documentID}) if err != nil { diff --git a/backend/domain/memory/database/entity/database.go b/backend/domain/memory/database/entity/database.go index 88ac2809..b0da5798 100644 --- a/backend/domain/memory/database/entity/database.go +++ b/backend/domain/memory/database/entity/database.go @@ -25,7 +25,7 @@ import ( type Database = database.Database -// DatabaseFilter 数据库过滤条件 +// DatabaseFilter Database filter criteria type DatabaseFilter struct { CreatorID *int64 SpaceID *int64 @@ -64,19 +64,19 @@ type TableReaderSheetData struct { type ExcelExtraInfo struct { Sheets []*common.DocTableSheet - ExtensionName string // 扩展名 - FileSize int64 // 文件大小 + ExtensionName string // extension + FileSize int64 // file size SourceFileID int64 TosURI string } type LocalTableMeta struct { - ExcelFile *excelize.File // xlsx格式文件 - RawLines [][]string // csv|xls 的全部内容 + ExcelFile *excelize.File // XLSX format file + RawLines [][]string // All content of csv | xls SheetsNameList []string SheetsRowCount []int - ExtensionName string // 扩展名 - FileSize int64 // 文件大小 + ExtensionName string // extension + FileSize int64 // file size } type ColumnInfo struct { diff --git a/backend/domain/memory/database/internal/convertor/types.go b/backend/domain/memory/database/internal/convertor/types.go index e999bb29..486d586d 100644 --- a/backend/domain/memory/database/internal/convertor/types.go +++ b/backend/domain/memory/database/internal/convertor/types.go @@ -43,7 +43,7 @@ func SwitchToDataType(itemType table.FieldItemType) entity.DataType { case table.FieldItemType_Boolean: return entity.TypeBoolean default: - // 默认使用 VARCHAR + // VARCHAR is used by default return entity.TypeVarchar } } @@ -167,7 +167,7 @@ func ConvertSystemFieldToString(fieldName string, value interface{}) string { case time.Time: return v.Format(TimeFormat) case []uint8: - // 尝试解析字符串表示的时间 + // Attempt to parse the time represented by a string return string(v) } } @@ -182,7 +182,7 @@ func ConvertLogicOperator(logic database.Logic) entity.LogicalOperator { case database.Logic_Or: return entity.OR default: - return entity.AND // 默认使用AND + return entity.AND // Default use AND } } diff --git a/backend/domain/memory/database/internal/dal/draft_database_info.go b/backend/domain/memory/database/internal/dal/draft_database_info.go index 71c9e9fb..f5488b82 100644 --- a/backend/domain/memory/database/internal/dal/draft_database_info.go +++ b/backend/domain/memory/database/internal/dal/draft_database_info.go @@ -66,7 +66,7 @@ func (d *DraftImpl) CreateWithTX(ctx context.Context, tx *query.QueryTx, databas AppID: database.AppID, SpaceID: database.SpaceID, RelatedOnlineID: onlineID, - IsVisible: 1, // 默认可见 + IsVisible: 1, // visible by default PromptDisabled: func() int32 { if database.PromptDisabled { return 1 @@ -98,7 +98,7 @@ func (d *DraftImpl) CreateWithTX(ctx context.Context, tx *query.QueryTx, databas return database, nil } -// Get 获取草稿数据库信息 +// Get draft database information func (d *DraftImpl) Get(ctx context.Context, id int64) (*entity.Database, error) { res := d.query.DraftDatabaseInfo @@ -110,7 +110,7 @@ func (d *DraftImpl) Get(ctx context.Context, id int64) (*entity.Database, error) return nil, fmt.Errorf("query draft database failed: %v", err) } - // 构建返回的数据库对象 + // Build the returned database object db := &entity.Database{ ID: info.ID, SpaceID: info.SpaceID, @@ -178,7 +178,7 @@ func (d *DraftImpl) MGet(ctx context.Context, ids []int64) ([]*entity.Database, return databases, nil } -// UpdateWithTX 使用事务更新草稿数据库信息 +// UpdateWithTX updates draft database information using transactions func (d *DraftImpl) UpdateWithTX(ctx context.Context, tx *query.QueryTx, database *entity.Database) (*entity.Database, error) { fieldJson, err := json.Marshal(database.FieldList) if err != nil { @@ -204,7 +204,7 @@ func (d *DraftImpl) UpdateWithTX(ctx context.Context, tx *query.QueryTx, databas "updated_at": now, } - // 执行更新 + // execute update res := tx.DraftDatabaseInfo _, err = res.WithContext(ctx).Where(res.ID.Eq(database.ID)).Updates(updates) if err != nil { @@ -228,13 +228,13 @@ func (d *DraftImpl) DeleteWithTX(ctx context.Context, tx *query.QueryTx, id int6 return nil } -// List 列出符合条件的数据库信息 +// List eligible database information func (d *DraftImpl) List(ctx context.Context, filter *entity.DatabaseFilter, page *entity.Pagination, orderBy []*database.OrderBy) ([]*entity.Database, int64, error) { res := d.query.DraftDatabaseInfo q := res.WithContext(ctx) - // 添加过滤条件 + // Add filter criteria if filter != nil { if filter.CreatorID != nil { q = q.Where(res.CreatorID.Eq(*filter.CreatorID)) diff --git a/backend/domain/memory/database/internal/dal/online_database_info.go b/backend/domain/memory/database/internal/dal/online_database_info.go index 39158992..ccfd7fda 100644 --- a/backend/domain/memory/database/internal/dal/online_database_info.go +++ b/backend/domain/memory/database/internal/dal/online_database_info.go @@ -65,7 +65,7 @@ func (o *OlineImpl) CreateWithTX(ctx context.Context, tx *query.QueryTx, databas AppID: database.AppID, SpaceID: database.SpaceID, RelatedDraftID: draftID, - IsVisible: 1, // 默认可见 + IsVisible: 1, // visible by default PromptDisabled: func() int32 { if database.PromptDisabled { return 1 @@ -97,7 +97,7 @@ func (o *OlineImpl) CreateWithTX(ctx context.Context, tx *query.QueryTx, databas return database, nil } -// Get 获取线上数据库信息 +// Get online database information func (o *OlineImpl) Get(ctx context.Context, id int64) (*entity.Database, error) { res := o.query.OnlineDatabaseInfo @@ -131,7 +131,7 @@ func (o *OlineImpl) Get(ctx context.Context, id int64) (*entity.Database, error) return db, nil } -// UpdateWithTX 使用事务更新线上数据库信息 +// UpdateWithTX updates online database information using transactions func (o *OlineImpl) UpdateWithTX(ctx context.Context, tx *query.QueryTx, database *entity.Database) (*entity.Database, error) { fieldJson, err := json.Marshal(database.FieldList) if err != nil { @@ -141,7 +141,7 @@ func (o *OlineImpl) UpdateWithTX(ctx context.Context, tx *query.QueryTx, databas fieldJsonStr := string(fieldJson) now := time.Now().UnixMilli() - // 构建更新内容 + // Build update content updates := map[string]interface{}{ "app_id": database.AppID, "table_name": database.TableName, @@ -158,7 +158,7 @@ func (o *OlineImpl) UpdateWithTX(ctx context.Context, tx *query.QueryTx, databas "updated_at": now, } - // 执行更新 + // execute update res := tx.OnlineDatabaseInfo _, err = res.WithContext(ctx).Where(res.ID.Eq(database.ID)).Updates(updates) if err != nil { @@ -184,7 +184,7 @@ func (o *OlineImpl) DeleteWithTX(ctx context.Context, tx *query.QueryTx, id int6 return nil } -// MGet 批量获取在线数据库信息 +// MGet batch acquisition of online database information func (o *OlineImpl) MGet(ctx context.Context, ids []int64) ([]*entity.Database, error) { if len(ids) == 0 { return []*entity.Database{}, nil @@ -192,7 +192,7 @@ func (o *OlineImpl) MGet(ctx context.Context, ids []int64) ([]*entity.Database, res := o.query.OnlineDatabaseInfo - // 查询未删除的、ID在给定列表中的记录 + // Query undeleted records with IDs in the given list records, err := res.WithContext(ctx). Where(res.ID.In(ids...)). Find() @@ -200,7 +200,7 @@ func (o *OlineImpl) MGet(ctx context.Context, ids []int64) ([]*entity.Database, return nil, fmt.Errorf("batch query online database failed: %v", err) } - // 构建返回结果 + // Build returns results databases := make([]*entity.Database, 0, len(records)) for _, info := range records { db := &entity.Database{ @@ -231,14 +231,14 @@ func (o *OlineImpl) MGet(ctx context.Context, ids []int64) ([]*entity.Database, return databases, nil } -// List 列出符合条件的数据库信息 +// List eligible database information func (o *OlineImpl) List(ctx context.Context, filter *entity.DatabaseFilter, page *entity.Pagination, orderBy []*database.OrderBy) ([]*entity.Database, int64, error) { res := o.query.OnlineDatabaseInfo - // 构建基础查询 + // Build basic query q := res.WithContext(ctx) - // 添加过滤条件 + // Add filter criteria if filter != nil { if filter.CreatorID != nil { q = q.Where(res.CreatorID.Eq(*filter.CreatorID)) @@ -274,7 +274,7 @@ func (o *OlineImpl) List(ctx context.Context, filter *entity.DatabaseFilter, pag offset = page.Offset } - // 处理排序 + // processing sort if len(orderBy) > 0 { for _, order := range orderBy { switch order.Field { diff --git a/backend/domain/memory/database/internal/physicaltable/physical.go b/backend/domain/memory/database/internal/physicaltable/physical.go index 9be9a91f..6bfcd371 100644 --- a/backend/domain/memory/database/internal/physicaltable/physical.go +++ b/backend/domain/memory/database/internal/physicaltable/physical.go @@ -180,18 +180,18 @@ func UpdateFieldInfo(newFieldItems []*database.FieldItem, existingFieldItems []* return updatedFieldItems, updatedColumns, droppedColumns, nil } -// UpdatePhysicalTableWithDrops 更新物理表结构,包括显式指定要删除的列 +// UpdatePhysicalTableWithDrops update the physical table structure, including explicitly specifying columns to drop func UpdatePhysicalTableWithDrops(ctx context.Context, db rdb.RDB, existingTable *entity3.Table, newColumns []*entity3.Column, droppedColumns []string, tableName string) error { - // 创建列名到列的映射 + // Create a column name-to-column mapping existingColumnMap := make(map[string]*entity3.Column) for _, col := range existingTable.Columns { existingColumnMap[col.Name] = col } - // 收集要添加和修改的列 + // Collect columns to add and modify var columnsToAdd, columnsToModify []*entity3.Column - // 查找要添加和修改的列 + // Find columns to add and modify for _, newCol := range newColumns { if _, exists := existingColumnMap[newCol.Name]; exists { columnsToModify = append(columnsToModify, newCol) @@ -200,7 +200,7 @@ func UpdatePhysicalTableWithDrops(ctx context.Context, db rdb.RDB, existingTable } } - // 应用变更到物理表 + // Apply changes to physical tables if len(columnsToAdd) > 0 || len(columnsToModify) > 0 || len(droppedColumns) > 0 { // build AlterTableRequest alterReq := &rdb.AlterTableRequest{ @@ -208,7 +208,7 @@ func UpdatePhysicalTableWithDrops(ctx context.Context, db rdb.RDB, existingTable Operations: getOperation(columnsToAdd, columnsToModify, droppedColumns), } - // 执行表结构变更 + // Perform table structure changes _, err := db.AlterTable(ctx, alterReq) if err != nil { return err @@ -218,11 +218,11 @@ func UpdatePhysicalTableWithDrops(ctx context.Context, db rdb.RDB, existingTable return nil } -// getOperation 将列的添加、修改和删除操作转换为 AlterTableOperation 数组 +// getOperation converts column add, modify, and delete operations into an AlterTableOperation array func getOperation(columnsToAdd, columnsToModify []*entity3.Column, droppedColumns []string) []*rdb.AlterTableOperation { operations := make([]*rdb.AlterTableOperation, 0) - // 处理添加列操作 + // Handle add column operations for _, column := range columnsToAdd { operations = append(operations, &rdb.AlterTableOperation{ Action: entity3.AddColumn, @@ -230,7 +230,7 @@ func getOperation(columnsToAdd, columnsToModify []*entity3.Column, droppedColumn }) } - // 处理修改列操作 + // Handle modify column operations for _, column := range columnsToModify { operations = append(operations, &rdb.AlterTableOperation{ Action: entity3.ModifyColumn, @@ -238,7 +238,7 @@ func getOperation(columnsToAdd, columnsToModify []*entity3.Column, droppedColumn }) } - // 处理删除列操作 + // Handle delete column operations for _, columnName := range droppedColumns { operations = append(operations, &rdb.AlterTableOperation{ Action: entity3.DropColumn, diff --git a/backend/domain/memory/database/internal/sheet/sheet.go b/backend/domain/memory/database/internal/sheet/sheet.go index aad103e8..f421e84e 100644 --- a/backend/domain/memory/database/internal/sheet/sheet.go +++ b/backend/domain/memory/database/internal/sheet/sheet.go @@ -118,7 +118,7 @@ func (t *TosTableParser) getLocalSheetMeta(ctx context.Context, maxLine int64) ( } reader := bytes.NewReader(object) - if documentExtension == "csv" { // 处理 csv 文件 + if documentExtension == "csv" { // Processing csv files records, err := csv.NewReader(reader).ReadAll() if err != nil { return nil, err @@ -457,7 +457,7 @@ func getXlsLocalSheetMetaWithTmpFileCallback(ctx context.Context, tmpFile string func (t *TosTableParser) PredictColumnType(columns []*common.DocTableColumn, sampleData [][]string, sheetIdx, startLineIdx int64) ([]*common.DocTableColumn, error) { if len(sampleData) == 0 { for _, column := range columns { - column.ColumnType = common.ColumnTypePtr(common.ColumnType_Text) // 兜底展示 + column.ColumnType = common.ColumnTypePtr(common.ColumnType_Text) // bottom line display column.ContainsEmptyValue = ptr.Of(true) } return columns, nil diff --git a/backend/domain/memory/database/service/database_impl.go b/backend/domain/memory/database/service/database_impl.go index 30d727c6..c2d4dd64 100644 --- a/backend/domain/memory/database/service/database_impl.go +++ b/backend/domain/memory/database/service/database_impl.go @@ -804,7 +804,7 @@ func (d databaseService) ListDatabaseRecord(ctx context.Context, req *ListDataba selectResp, err := d.rdb.SelectData(ctx, &rdb.SelectDataRequest{ TableName: physicalTableName, - Fields: []string{}, // 空表示查询所有字段 + Fields: []string{}, // Null means query all fields Where: complexCondition, OrderBy: orderBy, Limit: &limit, diff --git a/backend/domain/memory/variables/entity/sys_variables.go b/backend/domain/memory/variables/entity/sys_variables.go index 70c0fcea..68bacf9e 100644 --- a/backend/domain/memory/variables/entity/sys_variables.go +++ b/backend/domain/memory/variables/entity/sys_variables.go @@ -61,7 +61,7 @@ func (v SysConfVariables) GroupByName() []*kvmemory.GroupVariableInfo { groupName := variable.GroupName if groupName == "" { - groupName = "未分组" // 处理空分组名 + groupName = "未分组" // Handling empty group names } if _, ok := groups[groupName]; !ok { @@ -75,13 +75,13 @@ func (v SysConfVariables) GroupByName() []*kvmemory.GroupVariableInfo { groups[groupName].VarInfoList = append(groups[groupName].VarInfoList, variable) } - // 转换为切片并按组名排序 + // Convert to slices and sort by group name result := make([]*kvmemory.GroupVariableInfo, 0, len(groups)) for _, group := range groups { result = append(result, group) } - // 可选:按组名排序 + // Optional: sort by group name sort.Slice(result, func(i, j int) bool { return result[i].GroupName < result[j].GroupName }) diff --git a/backend/domain/memory/variables/entity/variable_instance.go b/backend/domain/memory/variables/entity/variable_instance.go index 65dd83de..d7ce33a9 100644 --- a/backend/domain/memory/variables/entity/variable_instance.go +++ b/backend/domain/memory/variables/entity/variable_instance.go @@ -60,7 +60,7 @@ const ( ) func (v *UserVariableMeta) GenSystemKV(ctx context.Context, keyword string) (*kvmemory.KVItem, error) { - if keyword != sysUUIDKey { // 外场暂时只支持这一个变量 + if keyword != sysUUIDKey { // The outfield only supports this one variable for the time being return nil, nil } @@ -94,7 +94,7 @@ func (v *UserVariableMeta) genUUID(ctx context.Context) (*kvmemory.KVItem, error } func (v *UserVariableMeta) encryptSysUUIDKey(ctx context.Context) string { - // 拼接四个字段,中间用特殊分隔符(如 | ) + // Combine four fields with a special delimiter (e.g. |) plain := fmt.Sprintf("%d|%s|%s|%d", v.BizType, v.BizID, v.ConnectorUID, v.ConnectorID) return base64.StdEncoding.EncodeToString([]byte(plain)) } diff --git a/backend/domain/memory/variables/entity/variable_meta_schema.go b/backend/domain/memory/variables/entity/variable_meta_schema.go index f43d6d62..5bae1d0b 100644 --- a/backend/domain/memory/variables/entity/variable_meta_schema.go +++ b/backend/domain/memory/variables/entity/variable_meta_schema.go @@ -169,7 +169,7 @@ func (v *VariableMetaSchema) nameValidate() bool { return false } - // 检查是否符合后面的部分正则规则 + // Check if some of the following regular rules are met pattern := `^[a-zA-Z_][a-zA-Z_$0-9]*$` match, _ := regexp.MatchString(pattern, identifier) diff --git a/backend/domain/memory/variables/internal/dal/model/variable_instance.gen.go b/backend/domain/memory/variables/internal/dal/model/variable_instance.gen.go index 2bd1af06..2614d79f 100644 --- a/backend/domain/memory/variables/internal/dal/model/variable_instance.gen.go +++ b/backend/domain/memory/variables/internal/dal/model/variable_instance.gen.go @@ -8,17 +8,17 @@ const TableNameVariableInstance = "variable_instance" // VariableInstance KV Memory type VariableInstance struct { - ID int64 `gorm:"column:id;primaryKey;comment:主键ID" json:"id"` // 主键ID - BizType int32 `gorm:"column:biz_type;not null;comment:1 for agent,2 for app" json:"biz_type"` // 1 for agent,2 for app - BizID string `gorm:"column:biz_id;not null;comment:1 for agent_id,2 for app_id" json:"biz_id"` // 1 for agent_id,2 for app_id - Version string `gorm:"column:version;not null;comment:agent or project 版本,为空代表草稿态" json:"version"` // agent or project 版本,为空代表草稿态 - Keyword string `gorm:"column:keyword;not null;comment:记忆的KEY" json:"keyword"` // 记忆的KEY - Type int32 `gorm:"column:type;not null;comment:记忆类型 1 KV 2 list" json:"type"` // 记忆类型 1 KV 2 list - Content string `gorm:"column:content;comment:记忆内容" json:"content"` // 记忆内容 - ConnectorUID string `gorm:"column:connector_uid;not null;comment:二方用户ID" json:"connector_uid"` // 二方用户ID - ConnectorID int64 `gorm:"column:connector_id;not null;comment:二方id, e.g. coze = 10000010" json:"connector_id"` // 二方id, e.g. coze = 10000010 - CreatedAt int64 `gorm:"column:created_at;not null;autoCreateTime:milli;comment:创建时间" json:"created_at"` // 创建时间 - UpdatedAt int64 `gorm:"column:updated_at;not null;autoUpdateTime:milli;comment:更新时间" json:"updated_at"` // 更新时间 + ID int64 `gorm:"column:id;primaryKey;comment:id" json:"id"` // id + BizType int32 `gorm:"column:biz_type;not null;comment:1 for agent,2 for app" json:"biz_type"` // 1 for agent,2 for app + BizID string `gorm:"column:biz_id;not null;comment:1 for agent_id,2 for app_id" json:"biz_id"` // 1 for agent_id,2 for app_id + Version string `gorm:"column:version;not null;comment:agent or project version empty represents draft status" json:"version"` // agent or project version empty represents draft status + Keyword string `gorm:"column:keyword;not null;comment:Keyword to Memory" json:"keyword"` // Keyword to Memory + Type int32 `gorm:"column:type;not null;comment:Memory type 1 KV 2 list" json:"type"` // Memory type 1 KV 2 list + Content string `gorm:"column:content;comment:content" json:"content"` // content + ConnectorUID string `gorm:"column:connector_uid;not null;comment:connector_uid" json:"connector_uid"` // connector_uid + ConnectorID int64 `gorm:"column:connector_id;not null;comment:connector_id, e.g. coze = 10000010" json:"connector_id"` // connector_id, e.g. coze = 10000010 + CreatedAt int64 `gorm:"column:created_at;not null;autoCreateTime:milli;comment:Create Time in Milliseconds" json:"created_at"` // Create Time in Milliseconds + UpdatedAt int64 `gorm:"column:updated_at;not null;autoUpdateTime:milli;comment:Update Time in Milliseconds" json:"updated_at"` // Update Time in Milliseconds } // TableName VariableInstance's table name diff --git a/backend/domain/memory/variables/internal/dal/model/variables_meta.gen.go b/backend/domain/memory/variables/internal/dal/model/variables_meta.gen.go index d26af30f..fd53225b 100644 --- a/backend/domain/memory/variables/internal/dal/model/variables_meta.gen.go +++ b/backend/domain/memory/variables/internal/dal/model/variables_meta.gen.go @@ -10,14 +10,14 @@ const TableNameVariablesMeta = "variables_meta" // VariablesMeta KV Memory meta type VariablesMeta struct { - ID int64 `gorm:"column:id;primaryKey;comment:主键ID" json:"id"` // 主键ID - CreatorID int64 `gorm:"column:creator_id;not null;comment:创建者ID" json:"creator_id"` // 创建者ID - BizType int32 `gorm:"column:biz_type;not null;comment:1 for agent,2 for app" json:"biz_type"` // 1 for agent,2 for app - BizID string `gorm:"column:biz_id;not null;comment:1 for agent_id,2 for app_id" json:"biz_id"` // 1 for agent_id,2 for app_id - VariableList []*entity.VariableMeta `gorm:"column:variable_list;comment:变量配置的json数据;serializer:json" json:"variable_list"` // 变量配置的json数据 - CreatedAt int64 `gorm:"column:created_at;not null;autoCreateTime:milli;comment:create time" json:"created_at"` // create time - UpdatedAt int64 `gorm:"column:updated_at;not null;autoUpdateTime:milli;comment:update time" json:"updated_at"` // update time - Version string `gorm:"column:version;not null;comment:project版本,为空代表草稿态" json:"version"` // project版本,为空代表草稿态 + ID int64 `gorm:"column:id;primaryKey;comment:id" json:"id"` // id + CreatorID int64 `gorm:"column:creator_id;not null;comment:creator id" json:"creator_id"` // creator id + BizType int32 `gorm:"column:biz_type;not null;comment:1 for agent,2 for app" json:"biz_type"` // 1 for agent,2 for app + BizID string `gorm:"column:biz_id;not null;comment:1 for agent_id,2 for app_id" json:"biz_id"` // 1 for agent_id,2 for app_id + VariableList []*entity.VariableMeta `gorm:"column:variable_list;comment:JSON data for variable configuration;serializer:json" json:"variable_list"` // JSON data for variable configuration + CreatedAt int64 `gorm:"column:created_at;not null;autoCreateTime:milli;comment:Create Time in Milliseconds" json:"created_at"` // Create Time in Milliseconds + UpdatedAt int64 `gorm:"column:updated_at;not null;autoUpdateTime:milli;comment:Update Time in Milliseconds" json:"updated_at"` // Update Time in Milliseconds + Version string `gorm:"column:version;not null;comment:Project version, empty represents draft status" json:"version"` // Project version, empty represents draft status } // TableName VariablesMeta's table name diff --git a/backend/domain/memory/variables/internal/dal/query/variable_instance.gen.go b/backend/domain/memory/variables/internal/dal/query/variable_instance.gen.go index 7a2f804f..71e358cd 100644 --- a/backend/domain/memory/variables/internal/dal/query/variable_instance.gen.go +++ b/backend/domain/memory/variables/internal/dal/query/variable_instance.gen.go @@ -49,17 +49,17 @@ type variableInstance struct { variableInstanceDo ALL field.Asterisk - ID field.Int64 // 主键ID + ID field.Int64 // id BizType field.Int32 // 1 for agent,2 for app BizID field.String // 1 for agent_id,2 for app_id - Version field.String // agent or project 版本,为空代表草稿态 - Keyword field.String // 记忆的KEY - Type field.Int32 // 记忆类型 1 KV 2 list - Content field.String // 记忆内容 - ConnectorUID field.String // 二方用户ID - ConnectorID field.Int64 // 二方id, e.g. coze = 10000010 - CreatedAt field.Int64 // 创建时间 - UpdatedAt field.Int64 // 更新时间 + Version field.String // agent or project version empty represents draft status + Keyword field.String // Keyword to Memory + Type field.Int32 // Memory type 1 KV 2 list + Content field.String // content + ConnectorUID field.String // connector_uid + ConnectorID field.Int64 // connector_id, e.g. coze = 10000010 + CreatedAt field.Int64 // Create Time in Milliseconds + UpdatedAt field.Int64 // Update Time in Milliseconds fieldMap map[string]field.Expr } diff --git a/backend/domain/memory/variables/internal/dal/query/variables_meta.gen.go b/backend/domain/memory/variables/internal/dal/query/variables_meta.gen.go index ebee1861..19ea61b5 100644 --- a/backend/domain/memory/variables/internal/dal/query/variables_meta.gen.go +++ b/backend/domain/memory/variables/internal/dal/query/variables_meta.gen.go @@ -46,14 +46,14 @@ type variablesMeta struct { variablesMetaDo ALL field.Asterisk - ID field.Int64 // 主键ID - CreatorID field.Int64 // 创建者ID + ID field.Int64 // id + CreatorID field.Int64 // creator id BizType field.Int32 // 1 for agent,2 for app BizID field.String // 1 for agent_id,2 for app_id - VariableList field.Field // 变量配置的json数据 - CreatedAt field.Int64 // create time - UpdatedAt field.Int64 // update time - Version field.String // project版本,为空代表草稿态 + VariableList field.Field // JSON data for variable configuration + CreatedAt field.Int64 // Create Time in Milliseconds + UpdatedAt field.Int64 // Update Time in Milliseconds + Version field.String // Project version, empty represents draft status fieldMap map[string]field.Expr } diff --git a/backend/domain/memory/variables/internal/dal/variables_meta.go b/backend/domain/memory/variables/internal/dal/variables_meta.go index 4e679613..8f659249 100644 --- a/backend/domain/memory/variables/internal/dal/variables_meta.go +++ b/backend/domain/memory/variables/internal/dal/variables_meta.go @@ -80,7 +80,7 @@ func (m *VariablesDAO) UpdateProjectVariable(ctx context.Context, do *entity.Var return nil } -// GetVariableMeta 获取变量元数据 , 不存在返回 nil +// GetVariableMeta Gets variable metadata, returns nil if it does not exist func (m *VariablesDAO) GetVariableMeta(ctx context.Context, bizID string, bizType project_memory.VariableConnector, version string) (*entity.VariablesMeta, error) { table := query.VariablesMeta condWhere := []gen.Condition{ @@ -103,7 +103,7 @@ func (m *VariablesDAO) GetVariableMeta(ctx context.Context, bizID string, bizTyp return do, nil } -// GetVariableMetaByID 获取变量元数据, 不存在返回 nil +// GetVariableMetaByID Gets variable metadata, returns nil if there is no such thing func (m *VariablesDAO) GetVariableMetaByID(ctx context.Context, id int64) (*entity.VariablesMeta, error) { table := query.VariablesMeta condWhere := []gen.Condition{ diff --git a/backend/domain/memory/variables/service/variables_impl.go b/backend/domain/memory/variables/service/variables_impl.go index 8cec772a..d78fa3e3 100644 --- a/backend/domain/memory/variables/service/variables_impl.go +++ b/backend/domain/memory/variables/service/variables_impl.go @@ -133,7 +133,7 @@ func (*variablesImpl) mergeVariableList(_ context.Context, sysVarsList, variable mergedMap[sysVar.Keyword] = sysVar } - // 可以覆盖 sysVar + // Can overwrite sysVar for _, variable := range variablesList { mergedMap[variable.Keyword] = variable } @@ -420,7 +420,7 @@ func (v *variablesImpl) sortKVItem(items []*kvmemory.KVItem, meta *entity.Variab i := items[ii] j := items[jj] - // 如果都是系统变量,这里不需要变换位置 + // If they are all system variables, there is no need to change positions here if i.IsSystem && !j.IsSystem { return false } diff --git a/backend/domain/plugin/internal/dal/agent_tool_version.go b/backend/domain/plugin/internal/dal/agent_tool_version.go index fc77e3bb..75639b9f 100644 --- a/backend/domain/plugin/internal/dal/agent_tool_version.go +++ b/backend/domain/plugin/internal/dal/agent_tool_version.go @@ -56,7 +56,7 @@ func (a agentToolVersionPO) ToDO() *entity.ToolInfo { } } -// TODO(@maronghong): 简化查询代码,封装查询条件 +// TODO (@maronghong): Simplify query code and encapsulate query conditions func (at *AgentToolVersionDAO) GetWithToolName(ctx context.Context, agentID int64, toolName string, agentVersion *string) (tool *entity.ToolInfo, exist bool, err error) { table := at.query.AgentToolVersion diff --git a/backend/domain/plugin/internal/openapi/convert_protocol.go b/backend/domain/plugin/internal/openapi/convert_protocol.go index f1ba5a13..bb35e34b 100644 --- a/backend/domain/plugin/internal/openapi/convert_protocol.go +++ b/backend/domain/plugin/internal/openapi/convert_protocol.go @@ -129,7 +129,7 @@ func parseCURL(_ context.Context, rawCURL string) (req *curlRequest, err error) Method: "", Header: http.Header{}, Query: url.Values{}, - Body: map[string]any{}, // TODO(@maronghong): 支持 array + Body: map[string]any{}, // TODO (@maronghong): support array dataToQuery: false, } @@ -559,7 +559,7 @@ func parseRequestToBodySchemaRef(ctx context.Context, desc string, value any) (* } func curlBodyToOpenAPI(ctx context.Context, mediaType string, bodyValue any, op *openapi3.Operation) (newOP *openapi3.Operation, err error) { - bodyValue, ok := bodyValue.(map[string]any) // TODO(@maronghong): 支持 array + bodyValue, ok := bodyValue.(map[string]any) // TODO (@maronghong): support array if !ok { return nil, errorx.New(errno.ErrPluginConvertProtocolFailed, errorx.KV(errno.PluginMsgKey, "request body only supports 'object' type")) diff --git a/backend/domain/plugin/service/exec_tool.go b/backend/domain/plugin/service/exec_tool.go index ce35a247..b02fa8a0 100644 --- a/backend/domain/plugin/service/exec_tool.go +++ b/backend/domain/plugin/service/exec_tool.go @@ -654,7 +654,7 @@ func (t *toolExecutor) preprocessArgumentsInJson(ctx context.Context, argumentsI return args, nil } - // body 限制为 object 类型 + // Body restricted to object type if bodySchema.Value.Type != openapi3.TypeObject { return nil, fmt.Errorf("[preprocessArgumentsInJson] requset body is not object, type=%s", bodySchema.Value.Type) @@ -753,7 +753,7 @@ func (t *toolExecutor) prepareArguments(_ context.Context, argumentsInJson strin decoder := sonic.ConfigDefault.NewDecoder(bytes.NewBufferString(argumentsInJson)) decoder.UseNumber() - // 假设大模型的输出都是 object 类型 + // Suppose the output of the large model is of type object input := map[string]any{} err := decoder.Decode(&input) if err != nil { @@ -1108,7 +1108,7 @@ func (t *toolExecutor) processWithInvalidRespProcessStrategyOfReturnDefault(_ co for paramName, _paramVal := range paramValMap { _paramSchema, ok := schemaVal.Properties[paramName] - if !ok || t.disabledParam(_paramSchema.Value) { // 只有 object field 才能被禁用,request 和 response 顶层必定都是 object 结构 + if !ok || t.disabledParam(_paramSchema.Value) { // Only the object field can be disabled, and the top level of request and response must be the object structure continue } newParamVal, err := processor(_paramVal, _paramSchema.Value) diff --git a/backend/domain/plugin/service/plugin_draft.go b/backend/domain/plugin/service/plugin_draft.go index 36a56e22..2bb256f1 100644 --- a/backend/domain/plugin/service/plugin_draft.go +++ b/backend/domain/plugin/service/plugin_draft.go @@ -274,7 +274,7 @@ func (p *pluginServiceImpl) UpdateDraftPluginWithCode(ctx context.Context, req * }, e }) - // 1. 删除 tool -> 关闭启用 + // 1. Delete tool - > Turn off Enable for api, oldTool := range oldDraftToolsMap { _, ok := apiSchemas[api] if !ok { @@ -286,7 +286,7 @@ func (p *pluginServiceImpl) UpdateDraftPluginWithCode(ctx context.Context, req * newDraftTools := make([]*entity.ToolInfo, 0, len(apis)) for api, newOp := range apiSchemas { oldTool, ok := oldDraftToolsMap[api] - if ok { // 2. 更新 tool -> 覆盖 + if ok { // 2. Update tool - > Overlay oldTool.ActivatedStatus = ptr.Of(model.ActivateTool) oldTool.Operation = newOp if needResetDebugStatusTool(ctx, newOp, oldTool.Operation) { @@ -295,7 +295,7 @@ func (p *pluginServiceImpl) UpdateDraftPluginWithCode(ctx context.Context, req * continue } - // 3. 新增 tool + // 3. New tools newDraftTools = append(newDraftTools, &entity.ToolInfo{ PluginID: req.PluginID, ActivatedStatus: ptr.Of(model.ActivateTool), diff --git a/backend/domain/prompt/internal/dal/model/prompt_resource.gen.go b/backend/domain/prompt/internal/dal/model/prompt_resource.gen.go index 59bc7448..e3fc4eb9 100644 --- a/backend/domain/prompt/internal/dal/model/prompt_resource.gen.go +++ b/backend/domain/prompt/internal/dal/model/prompt_resource.gen.go @@ -8,15 +8,15 @@ const TableNamePromptResource = "prompt_resource" // PromptResource prompt_resource type PromptResource struct { - ID int64 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键ID" json:"id"` // 主键ID - SpaceID int64 `gorm:"column:space_id;not null;comment:空间ID" json:"space_id"` // 空间ID - Name string `gorm:"column:name;not null;comment:名称" json:"name"` // 名称 - Description string `gorm:"column:description;not null;comment:描述" json:"description"` // 描述 - PromptText string `gorm:"column:prompt_text;comment:prompt正文" json:"prompt_text"` // prompt正文 - Status int32 `gorm:"column:status;not null;comment:状态,0无效,1有效" json:"status"` // 状态,0无效,1有效 - CreatorID int64 `gorm:"column:creator_id;not null;comment:创建者ID" json:"creator_id"` // 创建者ID - CreatedAt int64 `gorm:"column:created_at;not null;autoCreateTime:milli;comment:创建时间" json:"created_at"` // 创建时间 - UpdatedAt int64 `gorm:"column:updated_at;not null;autoUpdateTime:milli;comment:更新时间" json:"updated_at"` // 更新时间 + ID int64 `gorm:"column:id;primaryKey;autoIncrement:true;comment:id" json:"id"` // id + SpaceID int64 `gorm:"column:space_id;not null;comment:space id" json:"space_id"` // space id + Name string `gorm:"column:name;not null;comment:name" json:"name"` // name + Description string `gorm:"column:description;not null;comment:description" json:"description"` // description + PromptText string `gorm:"column:prompt_text;comment:prompt text" json:"prompt_text"` // prompt text + Status int32 `gorm:"column:status;not null;comment:status, 0 is invalid, 1 is valid" json:"status"` // status, 0 is invalid, 1 is valid + CreatorID int64 `gorm:"column:creator_id;not null;comment:creator id" json:"creator_id"` // creator id + CreatedAt int64 `gorm:"column:created_at;not null;autoCreateTime:milli;comment:Create Time in Milliseconds" json:"created_at"` // Create Time in Milliseconds + UpdatedAt int64 `gorm:"column:updated_at;not null;autoUpdateTime:milli;comment:Update Time in Milliseconds" json:"updated_at"` // Update Time in Milliseconds } // TableName PromptResource's table name diff --git a/backend/domain/prompt/internal/dal/query/prompt_resource.gen.go b/backend/domain/prompt/internal/dal/query/prompt_resource.gen.go index 30a09831..b34efbf6 100644 --- a/backend/domain/prompt/internal/dal/query/prompt_resource.gen.go +++ b/backend/domain/prompt/internal/dal/query/prompt_resource.gen.go @@ -47,15 +47,15 @@ type promptResource struct { promptResourceDo ALL field.Asterisk - ID field.Int64 // 主键ID - SpaceID field.Int64 // 空间ID - Name field.String // 名称 - Description field.String // 描述 - PromptText field.String // prompt正文 - Status field.Int32 // 状态,0无效,1有效 - CreatorID field.Int64 // 创建者ID - CreatedAt field.Int64 // 创建时间 - UpdatedAt field.Int64 // 更新时间 + ID field.Int64 // id + SpaceID field.Int64 // space id + Name field.String // name + Description field.String // description + PromptText field.String // prompt text + Status field.Int32 // status, 0 is invalid, 1 is valid + CreatorID field.Int64 // creator id + CreatedAt field.Int64 // Create Time in Milliseconds + UpdatedAt field.Int64 // Update Time in Milliseconds fieldMap map[string]field.Expr } diff --git a/backend/domain/prompt/service/prompt_impl.go b/backend/domain/prompt/service/prompt_impl.go index f0cd50c2..091eb483 100644 --- a/backend/domain/prompt/service/prompt_impl.go +++ b/backend/domain/prompt/service/prompt_impl.go @@ -87,12 +87,12 @@ func searchPromptResourceList(ctx context.Context, resource []*entity.PromptReso if promptResource == nil { continue } - // 名称匹配 + // name match if strings.Contains(strings.ToLower(promptResource.Name), strings.ToLower(keyword)) { retVal = append(retVal, promptResource) continue } - // 正文匹配 + // Body Match if strings.Contains(strings.ToLower(promptResource.PromptText), strings.ToLower(keyword)) { retVal = append(retVal, promptResource) } diff --git a/backend/domain/search/entity/resources_event.go b/backend/domain/search/entity/resources_event.go index a00a6975..1ff4ab30 100644 --- a/backend/domain/search/entity/resources_event.go +++ b/backend/domain/search/entity/resources_event.go @@ -16,7 +16,7 @@ package entity -// 复用AppDomainEvent中的DomainName和OpType +// Reuse DomainName and OpType in AppDomainEvent type ResourceDomainEvent struct { OpType OpType `json:"op_type"` diff --git a/backend/domain/search/service/search.go b/backend/domain/search/service/search.go index 8183c66b..dbf15f52 100644 --- a/backend/domain/search/service/search.go +++ b/backend/domain/search/service/search.go @@ -68,7 +68,7 @@ func (s *searchImpl) SearchProjects(ctx context.Context, req *searchEntity.Searc }, } - if req.ProjectID != 0 { // 精确搜索 + if req.ProjectID != 0 { // precise search searchReq.Query.Bool.Must = append(searchReq.Query.Bool.Must, es.NewEqualQuery(fieldOfID, conv.Int64ToStr(req.ProjectID))) } else { diff --git a/backend/domain/shortcutcmd/internal/dal/model/shortcut_command.gen.go b/backend/domain/shortcutcmd/internal/dal/model/shortcut_command.gen.go index 15112aec..d2904c43 100644 --- a/backend/domain/shortcutcmd/internal/dal/model/shortcut_command.gen.go +++ b/backend/domain/shortcutcmd/internal/dal/model/shortcut_command.gen.go @@ -8,31 +8,31 @@ import "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground const TableNameShortcutCommand = "shortcut_command" -// ShortcutCommand bot快捷指令表 +// ShortcutCommand bot shortcut command table type ShortcutCommand struct { - ID int64 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键ID" json:"id"` // 主键ID - ObjectID int64 `gorm:"column:object_id;not null;comment:实体ID,该实体可用这个指令" json:"object_id"` // 实体ID,该实体可用这个指令 - CommandID int64 `gorm:"column:command_id;not null;comment:命令ID" json:"command_id"` // 命令ID - CommandName string `gorm:"column:command_name;not null;comment:命令名称" json:"command_name"` // 命令名称 - ShortcutCommand string `gorm:"column:shortcut_command;not null;comment:快捷指令" json:"shortcut_command"` // 快捷指令 - Description string `gorm:"column:description;not null;comment:命令描述" json:"description"` // 命令描述 - SendType int32 `gorm:"column:send_type;not null;comment:发送类型 0:query 1:panel" json:"send_type"` // 发送类型 0:query 1:panel - ToolType int32 `gorm:"column:tool_type;not null;comment:使用工具的type 1:workFlow 2:插件" json:"tool_type"` // 使用工具的type 1:workFlow 2:插件 - WorkFlowID int64 `gorm:"column:work_flow_id;not null;comment:使用workFlow的id" json:"work_flow_id"` // 使用workFlow的id - PluginID int64 `gorm:"column:plugin_id;not null;comment:使用插件的id" json:"plugin_id"` // 使用插件的id - PluginToolName string `gorm:"column:plugin_tool_name;not null;comment:使用插件的api_name" json:"plugin_tool_name"` // 使用插件的api_name - TemplateQuery string `gorm:"column:template_query;comment:query模板" json:"template_query"` // query模板 - Components []*playground.Components `gorm:"column:components;comment:panel参数;serializer:json" json:"components"` // panel参数 - CardSchema string `gorm:"column:card_schema;comment:卡片schema" json:"card_schema"` // 卡片schema - ToolInfo *playground.ToolInfo `gorm:"column:tool_info;comment:工具信息 包含name+变量列表;serializer:json" json:"tool_info"` // 工具信息 包含name+变量列表 - Status int32 `gorm:"column:status;not null;comment:状态,0无效,1有效" json:"status"` // 状态,0无效,1有效 - CreatorID int64 `gorm:"column:creator_id;comment:创建者ID" json:"creator_id"` // 创建者ID - IsOnline int32 `gorm:"column:is_online;not null;comment:是否为线上信息 0草稿 1线上" json:"is_online"` // 是否为线上信息 0草稿 1线上 - CreatedAt int64 `gorm:"column:created_at;not null;autoCreateTime:milli;comment:创建时间" json:"created_at"` // 创建时间 - UpdatedAt int64 `gorm:"column:updated_at;not null;autoUpdateTime:milli;comment:更新时间" json:"updated_at"` // 更新时间 - AgentID int64 `gorm:"column:agent_id;not null;comment:multi的指令时,该指令由哪个节点执行" json:"agent_id"` // multi的指令时,该指令由哪个节点执行 - ShortcutIcon *playground.ShortcutFileInfo `gorm:"column:shortcut_icon;comment:快捷指令图标;serializer:json" json:"shortcut_icon"` // 快捷指令图标 - PluginToolID int64 `gorm:"column:plugin_tool_id;not null;comment:tool_id" json:"plugin_tool_id"` // tool_id + ID int64 `gorm:"column:id;primaryKey;autoIncrement:true;comment:id" json:"id"` // id + ObjectID int64 `gorm:"column:object_id;not null;comment:Entity ID, this command can be used for this entity" json:"object_id"` // Entity ID, this command can be used for this entity + CommandID int64 `gorm:"column:command_id;not null;comment:command id" json:"command_id"` // command id + CommandName string `gorm:"column:command_name;not null;comment:command name" json:"command_name"` // command name + ShortcutCommand string `gorm:"column:shortcut_command;not null;comment:shortcut command" json:"shortcut_command"` // shortcut command + Description string `gorm:"column:description;not null;comment:description" json:"description"` // description + SendType int32 `gorm:"column:send_type;not null;comment:send type 0:query 1:panel" json:"send_type"` // send type 0:query 1:panel + ToolType int32 `gorm:"column:tool_type;not null;comment:Type 1 of tool used: WorkFlow 2: Plugin" json:"tool_type"` // Type 1 of tool used: WorkFlow 2: Plugin + WorkFlowID int64 `gorm:"column:work_flow_id;not null;comment:workflow id" json:"work_flow_id"` // workflow id + PluginID int64 `gorm:"column:plugin_id;not null;comment:plugin id" json:"plugin_id"` // plugin id + PluginToolName string `gorm:"column:plugin_tool_name;not null;comment:plugin tool name" json:"plugin_tool_name"` // plugin tool name + TemplateQuery string `gorm:"column:template_query;comment:template query" json:"template_query"` // template query + Components []*playground.Components `gorm:"column:components;comment:Panel parameters;serializer:json" json:"components"` // Panel parameters + CardSchema string `gorm:"column:card_schema;comment:card schema" json:"card_schema"` // card schema + ToolInfo *playground.ToolInfo `gorm:"column:tool_info;comment:Tool information includes name+variable list;serializer:json" json:"tool_info"` // Tool information includes name+variable list + Status int32 `gorm:"column:status;not null;comment:Status, 0 is invalid, 1 is valid" json:"status"` // Status, 0 is invalid, 1 is valid + CreatorID int64 `gorm:"column:creator_id;comment:creator id" json:"creator_id"` // creator id + IsOnline int32 `gorm:"column:is_online;not null;comment:Is online information: 0 draft 1 online" json:"is_online"` // Is online information: 0 draft 1 online + CreatedAt int64 `gorm:"column:created_at;not null;autoCreateTime:milli;comment:Create Time in Milliseconds" json:"created_at"` // Create Time in Milliseconds + UpdatedAt int64 `gorm:"column:updated_at;not null;autoUpdateTime:milli;comment:Update Time in Milliseconds" json:"updated_at"` // Update Time in Milliseconds + AgentID int64 `gorm:"column:agent_id;not null;comment:When executing a multi instruction, which node executes the instruction" json:"agent_id"` // When executing a multi instruction, which node executes the instruction + ShortcutIcon *playground.ShortcutFileInfo `gorm:"column:shortcut_icon;comment:shortcut icon;serializer:json" json:"shortcut_icon"` // shortcut icon + PluginToolID int64 `gorm:"column:plugin_tool_id;not null;comment:tool_id" json:"plugin_tool_id"` // tool_id } // TableName ShortcutCommand's table name diff --git a/backend/domain/shortcutcmd/internal/dal/query/shortcut_command.gen.go b/backend/domain/shortcutcmd/internal/dal/query/shortcut_command.gen.go index 1a8465ba..37a501b0 100644 --- a/backend/domain/shortcutcmd/internal/dal/query/shortcut_command.gen.go +++ b/backend/domain/shortcutcmd/internal/dal/query/shortcut_command.gen.go @@ -56,33 +56,33 @@ func newShortcutCommand(db *gorm.DB, opts ...gen.DOOption) shortcutCommand { return _shortcutCommand } -// shortcutCommand bot快捷指令表 +// shortcutCommand bot shortcut command table type shortcutCommand struct { shortcutCommandDo ALL field.Asterisk - ID field.Int64 // 主键ID - ObjectID field.Int64 // 实体ID,该实体可用这个指令 - CommandID field.Int64 // 命令ID - CommandName field.String // 命令名称 - ShortcutCommand field.String // 快捷指令 - Description field.String // 命令描述 - SendType field.Int32 // 发送类型 0:query 1:panel - ToolType field.Int32 // 使用工具的type 1:workFlow 2:插件 - WorkFlowID field.Int64 // 使用workFlow的id - PluginID field.Int64 // 使用插件的id - PluginToolName field.String // 使用插件的api_name - TemplateQuery field.String // query模板 - Components field.Field // panel参数 - CardSchema field.String // 卡片schema - ToolInfo field.Field // 工具信息 包含name+变量列表 - Status field.Int32 // 状态,0无效,1有效 - CreatorID field.Int64 // 创建者ID - IsOnline field.Int32 // 是否为线上信息 0草稿 1线上 - CreatedAt field.Int64 // 创建时间 - UpdatedAt field.Int64 // 更新时间 - AgentID field.Int64 // multi的指令时,该指令由哪个节点执行 - ShortcutIcon field.Field // 快捷指令图标 + ID field.Int64 // id + ObjectID field.Int64 // Entity ID, this command can be used for this entity + CommandID field.Int64 // command id + CommandName field.String // command name + ShortcutCommand field.String // shortcut command + Description field.String // description + SendType field.Int32 // send type 0:query 1:panel + ToolType field.Int32 // Type 1 of tool used: WorkFlow 2: Plugin + WorkFlowID field.Int64 // workflow id + PluginID field.Int64 // plugin id + PluginToolName field.String // plugin tool name + TemplateQuery field.String // template query + Components field.Field // Panel parameters + CardSchema field.String // card schema + ToolInfo field.Field // Tool information includes name+variable list + Status field.Int32 // Status, 0 is invalid, 1 is valid + CreatorID field.Int64 // creator id + IsOnline field.Int32 // Is online information: 0 draft 1 online + CreatedAt field.Int64 // Create Time in Milliseconds + UpdatedAt field.Int64 // Update Time in Milliseconds + AgentID field.Int64 // When executing a multi instruction, which node executes the instruction + ShortcutIcon field.Field // shortcut icon PluginToolID field.Int64 // tool_id fieldMap map[string]field.Expr diff --git a/backend/domain/user/entity/user.go b/backend/domain/user/entity/user.go index fc8d9092..45f454de 100644 --- a/backend/domain/user/entity/user.go +++ b/backend/domain/user/entity/user.go @@ -19,16 +19,16 @@ package entity type User struct { UserID int64 - Name string // 昵称 - UniqueName string // 唯一名称 - Email string // 邮箱 - Description string // 用户描述 - IconURI string // 头像URI - IconURL string // 头像URL - UserVerified bool // 用户是否已验证 + Name string // nickname + UniqueName string // unique name + Email string // email + Description string // user description + IconURI string // avatar URI + IconURL string // avatar URL + UserVerified bool // Is the user authenticated? Locale string - SessionKey string // 会话密钥 + SessionKey string // session key - CreatedAt int64 // 创建时间 - UpdatedAt int64 // 更新时间 + CreatedAt int64 // creation time + UpdatedAt int64 // update time } diff --git a/backend/domain/user/internal/dal/user.go b/backend/domain/user/internal/dal/user.go index 83c119a7..e7ad94b0 100644 --- a/backend/domain/user/internal/dal/user.go +++ b/backend/domain/user/internal/dal/user.go @@ -134,12 +134,12 @@ func (dao *UserDAO) CheckEmailExist(ctx context.Context, email string) (bool, er return true, nil } -// CreateUser 创建新用户 +// CreateUser Create a new user func (dao *UserDAO) CreateUser(ctx context.Context, user *model.User) error { return dao.query.User.WithContext(ctx).Create(user) } -// GetUserBySessionKey 根据会话密钥查询用户 +// GetUserBySessionKey Query users based on session key func (dao *UserDAO) GetUserBySessionKey(ctx context.Context, sessionKey string) (*model.User, bool, error) { sm, err := dao.query.User.WithContext(ctx).Where( dao.query.User.SessionKey.Eq(sessionKey), @@ -154,7 +154,7 @@ func (dao *UserDAO) GetUserBySessionKey(ctx context.Context, sessionKey string) return sm, true, nil } -// GetUsersByIDs 批量查询用户信息 +// GetUsersByIDs Query user information in batches func (dao *UserDAO) GetUsersByIDs(ctx context.Context, userIDs []int64) ([]*model.User, error) { return dao.query.User.WithContext(ctx).Where( dao.query.User.ID.In(userIDs...), diff --git a/backend/domain/user/service/user_impl.go b/backend/domain/user/service/user_impl.go index efc49203..bcf6877a 100644 --- a/backend/domain/user/service/user_impl.go +++ b/backend/domain/user/service/user_impl.go @@ -74,7 +74,7 @@ func (u *userImpl) Login(ctx context.Context, email, password string) (user *use return nil, errorx.New(errno.ErrUserInfoInvalidateCode) } - // 验证密码,使用 Argon2id 算法 + // Verify the password using the Argon2id algorithm valid, err := verifyPassword(password, userModel.Password) if err != nil { return nil, err @@ -93,7 +93,7 @@ func (u *userImpl) Login(ctx context.Context, email, password string) (user *use return nil, err } - // 更新用户会话密钥 + // Update user session key err = u.UserRepo.UpdateSessionKey(ctx, userModel.ID, sessionKey) if err != nil { return nil, err @@ -119,7 +119,7 @@ func (u *userImpl) Logout(ctx context.Context, userID int64) (err error) { } func (u *userImpl) ResetPassword(ctx context.Context, email, password string) (err error) { - // 使用 Argon2id 算法对密码进行哈希处理 + // Hashing passwords using the Argon2id algorithm hashedPassword, err := hashPassword(password) if err != nil { return err @@ -269,7 +269,7 @@ func (u *userImpl) Create(ctx context.Context, req *CreateUserRequest) (user *us } } - // 使用 Argon2id 算法对密码进行哈希处理 + // Hashing passwords using the Argon2id algorithm hashedPassword, err := hashPassword(req.Password) if err != nil { return nil, err @@ -376,13 +376,13 @@ func (u *userImpl) getUniqueNameFormEmail(ctx context.Context, email string) str func (u *userImpl) ValidateSession(ctx context.Context, sessionKey string) ( session *userEntity.Session, exist bool, err error, ) { - // 验证会话密钥 + // authentication session key sessionModel, err := verifySessionKey(sessionKey) if err != nil { return nil, false, errorx.New(errno.ErrUserAuthenticationFailed, errorx.KV("reason", "access denied")) } - // 从数据库获取用户信息 + // Retrieve user information from the database userModel, exist, err := u.UserRepo.GetUserBySessionKey(ctx, sessionKey) if err != nil { return nil, false, err @@ -408,10 +408,10 @@ func (u *userImpl) MGetUserProfiles(ctx context.Context, userIDs []int64) (users users = make([]*userEntity.User, 0, len(userModels)) for _, um := range userModels { - // 获取图片URL + // Get image URL resURL, err := u.IconOSS.GetObjectUrl(ctx, um.IconURI) if err != nil { - continue // 如果获取图片URL失败,跳过该用户 + continue // If getting the image URL fails, skip the user } users = append(users, userPo2Do(um, resURL)) @@ -478,7 +478,7 @@ func spacePo2Do(space *model.Space, iconUrl string) *userEntity.Space { } } -// Argon2id 参数 +// Argon2id parameter type argon2Params struct { memory uint32 iterations uint32 @@ -487,7 +487,7 @@ type argon2Params struct { keyLength uint32 } -// 默认的 Argon2id 参数 +// Default Argon2id parameters var defaultArgon2Params = &argon2Params{ memory: 64 * 1024, // 64MB iterations: 3, @@ -496,18 +496,18 @@ var defaultArgon2Params = &argon2Params{ keyLength: 32, } -// 使用 Argon2id 算法对密码进行哈希处理 +// Hashing passwords using the Argon2id algorithm func hashPassword(password string) (string, error) { p := defaultArgon2Params - // 生成随机盐值 + // Generate random salt values salt := make([]byte, p.saltLength) _, err := rand.Read(salt) if err != nil { return "", err } - // 使用 Argon2id 算法计算哈希值 + // Calculate the hash value using the Argon2id algorithm hash := argon2.IDKey( []byte(password), salt, @@ -517,20 +517,20 @@ func hashPassword(password string) (string, error) { p.keyLength, ) - // 编码为 base64 格式 + // Encoding to base64 format b64Salt := base64.RawStdEncoding.EncodeToString(salt) b64Hash := base64.RawStdEncoding.EncodeToString(hash) - // 格式:$argon2id$v=19$m=65536,t=3,p=4$$ + // Format: $argon2id $v = 19 $m = 65536, t = 3, p = 4 $< salt > $< hash > encoded := fmt.Sprintf("$argon2id$v=19$m=%d,t=%d,p=%d$%s$%s", p.memory, p.iterations, p.parallelism, b64Salt, b64Hash) return encoded, nil } -// 验证密码是否匹配 +// Verify that the passwords match func verifyPassword(password, encodedHash string) (bool, error) { - // 解析编码后的哈希字符串 + // Parse the encoded hash string parts := strings.Split(encodedHash, "$") if len(parts) != 6 { return false, fmt.Errorf("invalid hash format") @@ -554,7 +554,7 @@ func verifyPassword(password, encodedHash string) (bool, error) { } p.keyLength = uint32(len(decodedHash)) - // 使用相同的参数和盐值计算哈希值 + // Calculate the hash value using the same parameters and salt values computedHash := argon2.IDKey( []byte(password), salt, @@ -564,65 +564,65 @@ func verifyPassword(password, encodedHash string) (bool, error) { p.keyLength, ) - // 比较计算得到的哈希值与存储的哈希值 + // Compare the calculated hash value with the stored hash value return subtle.ConstantTimeCompare(decodedHash, computedHash) == 1, nil } -// Session 结构体,包含会话信息 +// Session structure, which contains session information type Session struct { - ID int64 `json:"id"` // 会话唯一标识符 - CreatedAt time.Time `json:"created_at"` // 创建时间 - ExpiresAt time.Time `json:"expires_at"` // 过期时间 + ID int64 `json:"id"` // Session unique device identifier + CreatedAt time.Time `json:"created_at"` // creation time + ExpiresAt time.Time `json:"expires_at"` // expiration time } -// 用于签名的密钥(在实际应用中应从配置中读取或使用环境变量) +// The key used for signing (in practice you should read from the configuration or use environment variables) var hmacSecret = []byte("opencoze-session-hmac-key") -// 生成安全的会话密钥 +// Generate a secure session key func generateSessionKey(sessionID int64) (string, error) { - // 创建默认会话结构(不包含用户ID,将在Login方法中设置) + // Create the default session structure (without the user ID, which will be set in the Login method) session := Session{ ID: sessionID, CreatedAt: time.Now(), ExpiresAt: time.Now().Add(consts.DefaultSessionDuration), } - // 序列化会话数据 + // Serialize session data sessionData, err := json.Marshal(session) if err != nil { return "", err } - // 计算HMAC签名以确保完整性 + // Calculate HMAC signatures to ensure integrity h := hmac.New(sha256.New, hmacSecret) h.Write(sessionData) signature := h.Sum(nil) - // 组合会话数据和签名 + // Combining session data and signatures finalData := append(sessionData, signature...) - // Base64编码最终结果 + // Base64 encoding final result return base64.RawURLEncoding.EncodeToString(finalData), nil } -// 验证会话密钥的有效性 +// Verify the validity of the session key func verifySessionKey(sessionKey string) (*Session, error) { - // 解码会话数据 + // Decode session data data, err := base64.RawURLEncoding.DecodeString(sessionKey) if err != nil { return nil, fmt.Errorf("invalid session format: %w", err) } - // 确保数据长够长,至少包含会话数据和签名 - if len(data) < 32 { // 简单检查,实际应该更严格 + // Make sure the data is long enough to include at least session data and signatures + if len(data) < 32 { // Simple inspection should actually be more rigorous return nil, fmt.Errorf("session data too short") } - // 分离会话数据和签名 - sessionData := data[:len(data)-32] // 假设签名是32字节 + // Separating session data and signatures + sessionData := data[:len(data)-32] // Assume the signature is 32 bytes signature := data[len(data)-32:] - // 验证签名 + // verify signature h := hmac.New(sha256.New, hmacSecret) h.Write(sessionData) expectedSignature := h.Sum(nil) @@ -631,13 +631,13 @@ func verifySessionKey(sessionKey string) (*Session, error) { return nil, fmt.Errorf("invalid session signature") } - // 解析会话数据 + // Parsing session data var session Session if err := json.Unmarshal(sessionData, &session); err != nil { return nil, fmt.Errorf("invalid session data: %w", err) } - // 检查会话是否过期 + // Check if the session has expired if time.Now().After(session.ExpiresAt) { return nil, fmt.Errorf("session expired") } diff --git a/backend/domain/workflow/crossdomain/knowledge/knowledge.go b/backend/domain/workflow/crossdomain/knowledge/knowledge.go index 8d045b3f..f11a078e 100644 --- a/backend/domain/workflow/crossdomain/knowledge/knowledge.go +++ b/backend/domain/workflow/crossdomain/knowledge/knowledge.go @@ -67,9 +67,9 @@ type CreateDocumentResponse struct { type SearchType string const ( - SearchTypeSemantic SearchType = "semantic" // 语义 - SearchTypeFullText SearchType = "full_text" // 全文 - SearchTypeHybrid SearchType = "hybrid" // 混合 + SearchTypeSemantic SearchType = "semantic" // semantics + SearchTypeFullText SearchType = "full_text" // full text + SearchTypeHybrid SearchType = "hybrid" // mix ) type RetrievalStrategy struct { diff --git a/backend/domain/workflow/entity/node_type_literal.go b/backend/domain/workflow/entity/node_type_literal.go index 177df0c0..cc2d3b98 100644 --- a/backend/domain/workflow/entity/node_type_literal.go +++ b/backend/domain/workflow/entity/node_type_literal.go @@ -561,7 +561,7 @@ var NodeTypeMetas = []*NodeTypeMeta{ }, { ID: 43, - Name: "查询数据", // Corrected Name from JSON (was "插入数据") + Name: "查询数据", // Corrected Name from JSON (was "insert data") Type: NodeTypeDatabaseQuery, Category: "database", // Mapped from cate_list Desc: "从表获取数据,用户可定义查询条件、选择列等,输出符合条件的数据", // Corrected Desc from JSON @@ -616,7 +616,7 @@ var NodeTypeMetas = []*NodeTypeMeta{ }, { ID: 46, - Name: "新增数据", // Corrected Name from JSON (was "查询数据") + Name: "新增数据", // Corrected Name from JSON (was "Query Data") Type: NodeTypeDatabaseInsert, Category: "database", // Mapped from cate_list Desc: "向表添加新数据记录,用户输入数据内容后插入数据库", // Corrected Desc from JSON diff --git a/backend/domain/workflow/entity/vo/canvas.go b/backend/domain/workflow/entity/vo/canvas.go index 3fcfe0e8..936009e8 100644 --- a/backend/domain/workflow/entity/vo/canvas.go +++ b/backend/domain/workflow/entity/vo/canvas.go @@ -520,7 +520,7 @@ const ( type RefSourceType string const ( - RefSourceTypeBlockOutput RefSourceType = "block-output" // 代表引用了某个 Block 的输出隐式声明的变量 + RefSourceTypeBlockOutput RefSourceType = "block-output" // Represents an implicitly declared variable that references the output of a block RefSourceTypeGlobalApp RefSourceType = "global_variable_app" RefSourceTypeGlobalSystem RefSourceType = "global_variable_system" RefSourceTypeGlobalUser RefSourceType = "global_variable_user" diff --git a/backend/domain/workflow/entity/vo/node_test.go b/backend/domain/workflow/entity/vo/node_test.go index b3d91660..e4fed0b0 100644 --- a/backend/domain/workflow/entity/vo/node_test.go +++ b/backend/domain/workflow/entity/vo/node_test.go @@ -45,23 +45,23 @@ func TestTypeInfoToJSONSchema(t *testing.T) { props := schemaObj["properties"].(map[string]any) - // 验证字符串字段 + // Validate string field stringProp := props["stringField"].(map[string]any) assert.Equal(t, "string", stringProp["type"]) - // 验证整数字段 + // Validate integer fields intProp := props["intField"].(map[string]any) assert.Equal(t, "integer", intProp["type"]) - // 验证数字字段 + // Validate numeric field numProp := props["numField"].(map[string]any) assert.Equal(t, "number", numProp["type"]) - // 验证布尔字段 + // Validate Boolean fields boolProp := props["boolField"].(map[string]any) assert.Equal(t, "boolean", boolProp["type"]) - // 验证时间字段 + // validation time field timeProp := props["timeField"].(map[string]any) assert.Equal(t, "string", timeProp["type"]) assert.Equal(t, "date-time", timeProp["format"]) @@ -87,17 +87,17 @@ func TestTypeInfoToJSONSchema(t *testing.T) { props := schemaObj["properties"].(map[string]any) - // 验证对象字段 + // Validation Object Field objProp := props["objectField"].(map[string]any) assert.Equal(t, "object", objProp["type"]) - // 验证数组字段 + // Validate array fields arrProp := props["arrayField"].(map[string]any) assert.Equal(t, "array", arrProp["type"]) items := arrProp["items"].(map[string]any) assert.Equal(t, "string", items["type"]) - // 验证文件字段 + // Validate file field fileProp := props["fileField"].(map[string]any) assert.Equal(t, "string", fileProp["type"]) assert.Equal(t, "image", fileProp["contentMediaType"]) @@ -118,7 +118,7 @@ func TestTypeInfoToJSONSchema(t *testing.T) { props := schemaObj["properties"].(map[string]any) - // 验证嵌套数组字段 + // Validate nested array fields arrProp := props["nestedArray"].(map[string]any) assert.Equal(t, "array", arrProp["type"]) items := arrProp["items"].(map[string]any) @@ -136,12 +136,12 @@ func TestTypeInfoToJSONSchema(t *testing.T) { } } -// 辅助函数,用于创建 DataType 指针 +// Helper functions for creating DataType pointers func stringPtr(dt DataType) *DataType { return &dt } -// 辅助函数,用于创建 FileSubType 指针 +// Helper function for creating a FileSubType pointer func fileSubTypePtr(fst FileSubType) *FileSubType { return &fst } diff --git a/backend/domain/workflow/internal/canvas/adaptor/canvas_test.go b/backend/domain/workflow/internal/canvas/adaptor/canvas_test.go index 21e03390..4f0e2e78 100644 --- a/backend/domain/workflow/internal/canvas/adaptor/canvas_test.go +++ b/backend/domain/workflow/internal/canvas/adaptor/canvas_test.go @@ -263,7 +263,7 @@ func TestDatabaseCURD(t *testing.T) { } func TestHttpRequester(t *testing.T) { - listener, err := net.Listen("tcp", "127.0.0.1:8080") // 指定IP和端口 + listener, err := net.Listen("tcp", "127.0.0.1:8080") // Specify IP and port assert.NoError(t, err) ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if r.URL.Path != "/http_error" { diff --git a/backend/domain/workflow/internal/canvas/validate/canvas_validate.go b/backend/domain/workflow/internal/canvas/validate/canvas_validate.go index b35f2f19..1c31b6cc 100644 --- a/backend/domain/workflow/internal/canvas/validate/canvas_validate.go +++ b/backend/domain/workflow/internal/canvas/validate/canvas_validate.go @@ -527,7 +527,7 @@ func validateConnections(ctx context.Context, c *vo.Canvas) (issues []*Issue, er outDegree[edge.SourceNodeID]++ } - portOutDegree := make(map[string]map[string]int) // 节点ID -> 端口 -> 出度 + portOutDegree := make(map[string]map[string]int) // Node ID - > Port - > Outgoing for _, edge := range c.Edges { if _, ok := selectorPorts[edge.SourceNodeID]; !ok { @@ -573,7 +573,7 @@ func validateConnections(ctx context.Context, c *vo.Canvas) (issues []*Issue, er issues = append(issues, selectorIssues) } } else { - // break, continue 不检查出度 + // Break, continue without checking out degrees if node.Type == vo.BlockTypeBotBreak || node.Type == vo.BlockTypeBotContinue { continue } diff --git a/backend/domain/workflow/internal/nodes/httprequester/http_requester_test.go b/backend/domain/workflow/internal/nodes/httprequester/http_requester_test.go index 7efb7e76..37a42844 100644 --- a/backend/domain/workflow/internal/nodes/httprequester/http_requester_test.go +++ b/backend/domain/workflow/internal/nodes/httprequester/http_requester_test.go @@ -156,7 +156,7 @@ func TestInvoke(t *testing.T) { }, } - // 创建 HTTPRequest 实例 + // Create an HTTPRequest instance hg, err := NewHTTPRequester(context.Background(), cfg) assert.NoError(t, err) @@ -302,7 +302,7 @@ func TestInvoke(t *testing.T) { }, } - // 创建 HTTPRequest 实例 + // Create an HTTPRequest instance hg, err := NewHTTPRequester(context.Background(), cfg) assert.NoError(t, err) @@ -375,7 +375,7 @@ func TestInvoke(t *testing.T) { }, } - // 创建 HTTPRequest 实例 + // Create an HTTPRequest instance hg, err := NewHTTPRequester(context.Background(), cfg) assert.NoError(t, err) diff --git a/backend/domain/workflow/internal/nodes/qa/question_answer.go b/backend/domain/workflow/internal/nodes/qa/question_answer.go index 3e0ea663..3919bc89 100644 --- a/backend/domain/workflow/internal/nodes/qa/question_answer.go +++ b/backend/domain/workflow/internal/nodes/qa/question_answer.go @@ -101,8 +101,8 @@ const ( - 输出按照下面结构体格式返回,包含提取到的字段或者追问的问题 - 不要回复和提取无关的问题 type Output struct { -fields FieldInfo // 根据字段说明已经提取到的字段 -question string // 新一轮追问的问题 +fields FieldInfo // According to the field description, the fields that have been extracted +question string // Follow-up question for the next round }` extractUserPromptSuffix = ` - 严格以 json 格式返回答案。 diff --git a/backend/domain/workflow/internal/nodes/textprocessor/text_processor.go b/backend/domain/workflow/internal/nodes/textprocessor/text_processor.go index e1434d40..e2a7170c 100644 --- a/backend/domain/workflow/internal/nodes/textprocessor/text_processor.go +++ b/backend/domain/workflow/internal/nodes/textprocessor/text_processor.go @@ -87,7 +87,7 @@ func (t *TextProcessor) Invoke(ctx context.Context, input map[string]any) (map[s return nil, fmt.Errorf("input string field must string type but got %T", valueString) } values := strings.Split(valueString, t.config.Separators[0]) - // 对每个分隔符进行迭代处理 + // Iterate over each delimiter for _, sep := range t.config.Separators[1:] { var tempParts []string for _, part := range values { diff --git a/backend/domain/workflow/internal/repo/dal/model/node_execution.gen.go b/backend/domain/workflow/internal/repo/dal/model/node_execution.gen.go index 7def4dd6..465bf7e5 100644 --- a/backend/domain/workflow/internal/repo/dal/model/node_execution.gen.go +++ b/backend/domain/workflow/internal/repo/dal/model/node_execution.gen.go @@ -6,7 +6,7 @@ package model const TableNameNodeExecution = "node_execution" -// NodeExecution node 节点运行记录,用于记录每次workflow执行时,每个节点的状态信息 +// NodeExecution Node run record, used to record the status information of each node during each workflow execution type NodeExecution struct { ID int64 `gorm:"column:id;primaryKey;comment:node execution id" json:"id"` // node execution id ExecuteID int64 `gorm:"column:execute_id;not null;comment:the workflow execute id this node execution belongs to" json:"execute_id"` // the workflow execute id this node execution belongs to diff --git a/backend/domain/workflow/internal/repo/dal/model/workflow_draft.gen.go b/backend/domain/workflow/internal/repo/dal/model/workflow_draft.gen.go index cadde292..3a63987b 100644 --- a/backend/domain/workflow/internal/repo/dal/model/workflow_draft.gen.go +++ b/backend/domain/workflow/internal/repo/dal/model/workflow_draft.gen.go @@ -10,17 +10,17 @@ import ( const TableNameWorkflowDraft = "workflow_draft" -// WorkflowDraft workflow 画布草稿表,用于记录workflow最新的草稿画布信息 +// WorkflowDraft Workflow canvas draft table, used to record the latest draft canvas information of workflow type WorkflowDraft struct { - ID int64 `gorm:"column:id;primaryKey;comment:workflow ID" json:"id"` // workflow ID - Canvas string `gorm:"column:canvas;not null;comment:前端 schema" json:"canvas"` // 前端 schema - InputParams string `gorm:"column:input_params;comment: 入参 schema" json:"input_params"` // 入参 schema - OutputParams string `gorm:"column:output_params;comment: 出参 schema" json:"output_params"` // 出参 schema - TestRunSuccess bool `gorm:"column:test_run_success;not null;comment:0 未运行, 1 运行成功" json:"test_run_success"` // 0 未运行, 1 运行成功 - Modified bool `gorm:"column:modified;not null;comment:0 未被修改, 1 已被修改" json:"modified"` // 0 未被修改, 1 已被修改 - UpdatedAt int64 `gorm:"column:updated_at;autoUpdateTime:milli" json:"updated_at"` - DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"` - CommitID string `gorm:"column:commit_id;not null;comment:used to uniquely identify a draft snapshot" json:"commit_id"` // used to uniquely identify a draft snapshot + ID int64 `gorm:"column:id;primaryKey;comment:workflow ID" json:"id"` // workflow ID + Canvas string `gorm:"column:canvas;not null;comment:Front end schema" json:"canvas"` // Front end schema + InputParams string `gorm:"column:input_params;comment:Input schema" json:"input_params"` // Input schema + OutputParams string `gorm:"column:output_params;comment:Output parameter schema" json:"output_params"` // Output parameter schema + TestRunSuccess bool `gorm:"column:test_run_success;not null;comment:0 not running, 1 running successfully" json:"test_run_success"` // 0 not running, 1 running successfully + Modified bool `gorm:"column:modified;not null;comment:0 has not been modified, 1 has been modified" json:"modified"` // 0 has not been modified, 1 has been modified + UpdatedAt int64 `gorm:"column:updated_at;autoUpdateTime:milli;comment:Update Time in Milliseconds" json:"updated_at"` // Update Time in Milliseconds + DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;comment:Delete Time" json:"deleted_at"` // Delete Time + CommitID string `gorm:"column:commit_id;not null;comment:used to uniquely identify a draft snapshot" json:"commit_id"` // used to uniquely identify a draft snapshot } // TableName WorkflowDraft's table name diff --git a/backend/domain/workflow/internal/repo/dal/model/workflow_execution.gen.go b/backend/domain/workflow/internal/repo/dal/model/workflow_execution.gen.go index 20c0165d..1aab3a38 100644 --- a/backend/domain/workflow/internal/repo/dal/model/workflow_execution.gen.go +++ b/backend/domain/workflow/internal/repo/dal/model/workflow_execution.gen.go @@ -6,7 +6,7 @@ package model const TableNameWorkflowExecution = "workflow_execution" -// WorkflowExecution workflow 执行记录表,用于记录每次workflow执行时的状态 +// WorkflowExecution Workflow Execution Record Table, used to record the status of each workflow execution type WorkflowExecution struct { ID int64 `gorm:"column:id;primaryKey;comment:execute id" json:"id"` // execute id WorkflowID int64 `gorm:"column:workflow_id;not null;comment:workflow_id" json:"workflow_id"` // workflow_id diff --git a/backend/domain/workflow/internal/repo/dal/model/workflow_meta.gen.go b/backend/domain/workflow/internal/repo/dal/model/workflow_meta.gen.go index 3d4c154d..756391b9 100644 --- a/backend/domain/workflow/internal/repo/dal/model/workflow_meta.gen.go +++ b/backend/domain/workflow/internal/repo/dal/model/workflow_meta.gen.go @@ -10,25 +10,25 @@ import ( const TableNameWorkflowMeta = "workflow_meta" -// WorkflowMeta workflow 元信息表,用于记录workflow基本的元信息 +// WorkflowMeta The workflow metadata table,used to record the basic metadata of workflow type WorkflowMeta struct { ID int64 `gorm:"column:id;primaryKey;comment:workflow id" json:"id"` // workflow id Name string `gorm:"column:name;not null;comment:workflow name" json:"name"` // workflow name Description string `gorm:"column:description;not null;comment:workflow description" json:"description"` // workflow description IconURI string `gorm:"column:icon_uri;not null;comment:icon uri" json:"icon_uri"` // icon uri - Status int32 `gorm:"column:status;not null;comment:0:未发布过, 1:已发布过" json:"status"` // 0:未发布过, 1:已发布过 - ContentType int32 `gorm:"column:content_type;not null;comment:0用户 1官方" json:"content_type"` // 0用户 1官方 + Status int32 `gorm:"column:status;not null;comment:0: Not published, 1: Published" json:"status"` // 0: Not published, 1: Published + ContentType int32 `gorm:"column:content_type;not null;comment:0 Users 1 Official" json:"content_type"` // 0 Users 1 Official Mode int32 `gorm:"column:mode;not null;comment:0:workflow, 3:chat_flow" json:"mode"` // 0:workflow, 3:chat_flow CreatedAt int64 `gorm:"column:created_at;not null;autoCreateTime:milli;comment:create time in millisecond" json:"created_at"` // create time in millisecond UpdatedAt int64 `gorm:"column:updated_at;autoUpdateTime:milli;comment:update time in millisecond" json:"updated_at"` // update time in millisecond DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;comment:delete time in millisecond" json:"deleted_at"` // delete time in millisecond CreatorID int64 `gorm:"column:creator_id;not null;comment:user id for creator" json:"creator_id"` // user id for creator Tag int32 `gorm:"column:tag;comment:template tag: Tag: 1=All, 2=Hot, 3=Information, 4=Music, 5=Picture, 6=UtilityTool, 7=Life, 8=Traval, 9=Network, 10=System, 11=Movie, 12=Office, 13=Shopping, 14=Education, 15=Health, 16=Social, 17=Entertainment, 18=Finance, 100=Hidden" json:"tag"` // template tag: Tag: 1=All, 2=Hot, 3=Information, 4=Music, 5=Picture, 6=UtilityTool, 7=Life, 8=Traval, 9=Network, 10=System, 11=Movie, 12=Office, 13=Shopping, 14=Education, 15=Health, 16=Social, 17=Entertainment, 18=Finance, 100=Hidden - AuthorID int64 `gorm:"column:author_id;not null;comment:原作者用户 ID" json:"author_id"` // 原作者用户 ID - SpaceID int64 `gorm:"column:space_id;not null;comment: 空间 ID" json:"space_id"` // 空间 ID - UpdaterID int64 `gorm:"column:updater_id;comment: 更新元信息的用户 ID" json:"updater_id"` // 更新元信息的用户 ID - SourceID int64 `gorm:"column:source_id;comment: 复制来源的 workflow ID" json:"source_id"` // 复制来源的 workflow ID - AppID int64 `gorm:"column:app_id;comment:应用 ID" json:"app_id"` // 应用 ID + AuthorID int64 `gorm:"column:author_id;not null;comment:Original author user ID" json:"author_id"` // Original author user ID + SpaceID int64 `gorm:"column:space_id;not null;comment:space id" json:"space_id"` // space id + UpdaterID int64 `gorm:"column:updater_id;comment:User ID for updating metadata" json:"updater_id"` // User ID for updating metadata + SourceID int64 `gorm:"column:source_id;comment:Workflow ID of source" json:"source_id"` // Workflow ID of source + AppID int64 `gorm:"column:app_id;comment:app id" json:"app_id"` // app id LatestVersion string `gorm:"column:latest_version;comment:the version of the most recent publish" json:"latest_version"` // the version of the most recent publish LatestVersionTs int64 `gorm:"column:latest_version_ts;comment:create time of latest version" json:"latest_version_ts"` // create time of latest version } diff --git a/backend/domain/workflow/internal/repo/dal/model/workflow_reference.gen.go b/backend/domain/workflow/internal/repo/dal/model/workflow_reference.gen.go index 83aad05c..2d784bda 100644 --- a/backend/domain/workflow/internal/repo/dal/model/workflow_reference.gen.go +++ b/backend/domain/workflow/internal/repo/dal/model/workflow_reference.gen.go @@ -10,7 +10,7 @@ import ( const TableNameWorkflowReference = "workflow_reference" -// WorkflowReference workflow 关联关系表,用于记录workflow 直接互相引用关系 +// WorkflowReference The workflow association table,used to record the direct mutual reference relationship between workflows type WorkflowReference struct { ID int64 `gorm:"column:id;primaryKey;comment:workflow id" json:"id"` // workflow id ReferredID int64 `gorm:"column:referred_id;not null;comment:the id of the workflow that is referred by other entities" json:"referred_id"` // the id of the workflow that is referred by other entities @@ -19,7 +19,7 @@ type WorkflowReference struct { ReferringBizType int32 `gorm:"column:referring_biz_type;not null;comment:the biz type the referring entity belongs to: 1. workflow 2. agent" json:"referring_biz_type"` // the biz type the referring entity belongs to: 1. workflow 2. agent CreatedAt int64 `gorm:"column:created_at;not null;autoCreateTime:milli;comment:create time in millisecond" json:"created_at"` // create time in millisecond Status int32 `gorm:"column:status;not null;comment:whether this reference currently takes effect. 0: disabled 1: enabled" json:"status"` // whether this reference currently takes effect. 0: disabled 1: enabled - DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"` + DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;comment:Delete Time" json:"deleted_at"` // Delete Time } // TableName WorkflowReference's table name diff --git a/backend/domain/workflow/internal/repo/dal/model/workflow_snapshot.gen.go b/backend/domain/workflow/internal/repo/dal/model/workflow_snapshot.gen.go index affa011f..5718f321 100644 --- a/backend/domain/workflow/internal/repo/dal/model/workflow_snapshot.gen.go +++ b/backend/domain/workflow/internal/repo/dal/model/workflow_snapshot.gen.go @@ -8,13 +8,13 @@ const TableNameWorkflowSnapshot = "workflow_snapshot" // WorkflowSnapshot snapshot for executed workflow draft type WorkflowSnapshot struct { - WorkflowID int64 `gorm:"column:workflow_id;not null;comment:workflow id this snapshot belongs to" json:"workflow_id"` // workflow id this snapshot belongs to - CommitID string `gorm:"column:commit_id;not null;comment:the commit id of the workflow draft" json:"commit_id"` // the commit id of the workflow draft - Canvas string `gorm:"column:canvas;not null;comment:frontend schema for this snapshot" json:"canvas"` // frontend schema for this snapshot - InputParams string `gorm:"column:input_params;comment:input parameter info" json:"input_params"` // input parameter info - OutputParams string `gorm:"column:output_params;comment:output parameter info" json:"output_params"` // output parameter info - CreatedAt int64 `gorm:"column:created_at;not null;autoCreateTime:milli" json:"created_at"` - ID int64 `gorm:"column:id;primaryKey;autoIncrement:true;comment:ID" json:"id"` // ID + WorkflowID int64 `gorm:"column:workflow_id;not null;comment:workflow id this snapshot belongs to" json:"workflow_id"` // workflow id this snapshot belongs to + CommitID string `gorm:"column:commit_id;not null;comment:the commit id of the workflow draft" json:"commit_id"` // the commit id of the workflow draft + Canvas string `gorm:"column:canvas;not null;comment:frontend schema for this snapshot" json:"canvas"` // frontend schema for this snapshot + InputParams string `gorm:"column:input_params;comment:input parameter info" json:"input_params"` // input parameter info + OutputParams string `gorm:"column:output_params;comment:output parameter info" json:"output_params"` // output parameter info + CreatedAt int64 `gorm:"column:created_at;not null;autoCreateTime:milli;comment:Create Time in Milliseconds" json:"created_at"` // Create Time in Milliseconds + ID int64 `gorm:"column:id;primaryKey;autoIncrement:true;comment:ID" json:"id"` // ID } // TableName WorkflowSnapshot's table name diff --git a/backend/domain/workflow/internal/repo/dal/model/workflow_version.gen.go b/backend/domain/workflow/internal/repo/dal/model/workflow_version.gen.go index 0258f166..8b1e1ac1 100644 --- a/backend/domain/workflow/internal/repo/dal/model/workflow_version.gen.go +++ b/backend/domain/workflow/internal/repo/dal/model/workflow_version.gen.go @@ -10,19 +10,19 @@ import ( const TableNameWorkflowVersion = "workflow_version" -// WorkflowVersion workflow 画布版本信息表,用于记录不同版本的画布信息 +// WorkflowVersion Workflow Canvas Version Information Table, used to record canvas information for different versions type WorkflowVersion struct { - ID int64 `gorm:"column:id;primaryKey;autoIncrement:true;comment:ID" json:"id"` // ID - WorkflowID int64 `gorm:"column:workflow_id;not null;comment:workflow id" json:"workflow_id"` // workflow id - Version string `gorm:"column:version;not null;comment:发布版本" json:"version"` // 发布版本 - VersionDescription string `gorm:"column:version_description;not null;comment:版本描述" json:"version_description"` // 版本描述 - Canvas string `gorm:"column:canvas;not null;comment:前端 schema" json:"canvas"` // 前端 schema - InputParams string `gorm:"column:input_params" json:"input_params"` - OutputParams string `gorm:"column:output_params" json:"output_params"` - CreatorID int64 `gorm:"column:creator_id;not null;comment:发布用户 ID" json:"creator_id"` // 发布用户 ID - CreatedAt int64 `gorm:"column:created_at;not null;autoCreateTime:milli;comment:创建时间毫秒时间戳" json:"created_at"` // 创建时间毫秒时间戳 - DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;comment:删除毫秒时间戳" json:"deleted_at"` // 删除毫秒时间戳 - CommitID string `gorm:"column:commit_id;not null;comment:the commit id corresponding to this version" json:"commit_id"` // the commit id corresponding to this version + ID int64 `gorm:"column:id;primaryKey;autoIncrement:true;comment:ID" json:"id"` // ID + WorkflowID int64 `gorm:"column:workflow_id;not null;comment:workflow id" json:"workflow_id"` // workflow id + Version string `gorm:"column:version;not null;comment:Published version" json:"version"` // Published version + VersionDescription string `gorm:"column:version_description;not null;comment:Version Description" json:"version_description"` // Version Description + Canvas string `gorm:"column:canvas;not null;comment:Front end schema" json:"canvas"` // Front end schema + InputParams string `gorm:"column:input_params;comment:input params" json:"input_params"` // input params + OutputParams string `gorm:"column:output_params;comment:output params" json:"output_params"` // output params + CreatorID int64 `gorm:"column:creator_id;not null;comment:creator id" json:"creator_id"` // creator id + CreatedAt int64 `gorm:"column:created_at;not null;autoCreateTime:milli;comment:Create Time in Milliseconds" json:"created_at"` // Create Time in Milliseconds + DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;comment:Delete Time" json:"deleted_at"` // Delete Time + CommitID string `gorm:"column:commit_id;not null;comment:the commit id corresponding to this version" json:"commit_id"` // the commit id corresponding to this version } // TableName WorkflowVersion's table name diff --git a/backend/domain/workflow/internal/repo/dal/query/node_execution.gen.go b/backend/domain/workflow/internal/repo/dal/query/node_execution.gen.go index aba04f02..6014d70f 100644 --- a/backend/domain/workflow/internal/repo/dal/query/node_execution.gen.go +++ b/backend/domain/workflow/internal/repo/dal/query/node_execution.gen.go @@ -54,7 +54,7 @@ func newNodeExecution(db *gorm.DB, opts ...gen.DOOption) nodeExecution { return _nodeExecution } -// nodeExecution node 节点运行记录,用于记录每次workflow执行时,每个节点的状态信息 +// nodeExecution Node run record, used to record the status information of each node during each workflow execution type nodeExecution struct { nodeExecutionDo diff --git a/backend/domain/workflow/internal/repo/dal/query/workflow_draft.gen.go b/backend/domain/workflow/internal/repo/dal/query/workflow_draft.gen.go index ab055a05..a3954a90 100644 --- a/backend/domain/workflow/internal/repo/dal/query/workflow_draft.gen.go +++ b/backend/domain/workflow/internal/repo/dal/query/workflow_draft.gen.go @@ -42,19 +42,19 @@ func newWorkflowDraft(db *gorm.DB, opts ...gen.DOOption) workflowDraft { return _workflowDraft } -// workflowDraft workflow 画布草稿表,用于记录workflow最新的草稿画布信息 +// workflowDraft Workflow canvas draft table, used to record the latest draft canvas information of workflow type workflowDraft struct { workflowDraftDo ALL field.Asterisk ID field.Int64 // workflow ID - Canvas field.String // 前端 schema - InputParams field.String // 入参 schema - OutputParams field.String // 出参 schema - TestRunSuccess field.Bool // 0 未运行, 1 运行成功 - Modified field.Bool // 0 未被修改, 1 已被修改 - UpdatedAt field.Int64 - DeletedAt field.Field + Canvas field.String // Front end schema + InputParams field.String // Input schema + OutputParams field.String // Output parameter schema + TestRunSuccess field.Bool // 0 not running, 1 running successfully + Modified field.Bool // 0 has not been modified, 1 has been modified + UpdatedAt field.Int64 // Update Time in Milliseconds + DeletedAt field.Field // Delete Time CommitID field.String // used to uniquely identify a draft snapshot fieldMap map[string]field.Expr diff --git a/backend/domain/workflow/internal/repo/dal/query/workflow_execution.gen.go b/backend/domain/workflow/internal/repo/dal/query/workflow_execution.gen.go index 3617d788..d0475bfe 100644 --- a/backend/domain/workflow/internal/repo/dal/query/workflow_execution.gen.go +++ b/backend/domain/workflow/internal/repo/dal/query/workflow_execution.gen.go @@ -60,7 +60,7 @@ func newWorkflowExecution(db *gorm.DB, opts ...gen.DOOption) workflowExecution { return _workflowExecution } -// workflowExecution workflow 执行记录表,用于记录每次workflow执行时的状态 +// workflowExecution Workflow Execution Record Table, used to record the status of each workflow execution type workflowExecution struct { workflowExecutionDo diff --git a/backend/domain/workflow/internal/repo/dal/query/workflow_meta.gen.go b/backend/domain/workflow/internal/repo/dal/query/workflow_meta.gen.go index 2d016bf9..4b3eb988 100644 --- a/backend/domain/workflow/internal/repo/dal/query/workflow_meta.gen.go +++ b/backend/domain/workflow/internal/repo/dal/query/workflow_meta.gen.go @@ -52,7 +52,7 @@ func newWorkflowMeta(db *gorm.DB, opts ...gen.DOOption) workflowMeta { return _workflowMeta } -// workflowMeta workflow 元信息表,用于记录workflow基本的元信息 +// workflowMeta The workflow metadata table,used to record the basic metadata of workflow type workflowMeta struct { workflowMetaDo @@ -61,19 +61,19 @@ type workflowMeta struct { Name field.String // workflow name Description field.String // workflow description IconURI field.String // icon uri - Status field.Int32 // 0:未发布过, 1:已发布过 - ContentType field.Int32 // 0用户 1官方 + Status field.Int32 // 0: Not published, 1: Published + ContentType field.Int32 // 0 Users 1 Official Mode field.Int32 // 0:workflow, 3:chat_flow CreatedAt field.Int64 // create time in millisecond UpdatedAt field.Int64 // update time in millisecond DeletedAt field.Field // delete time in millisecond CreatorID field.Int64 // user id for creator Tag field.Int32 // template tag: Tag: 1=All, 2=Hot, 3=Information, 4=Music, 5=Picture, 6=UtilityTool, 7=Life, 8=Traval, 9=Network, 10=System, 11=Movie, 12=Office, 13=Shopping, 14=Education, 15=Health, 16=Social, 17=Entertainment, 18=Finance, 100=Hidden - AuthorID field.Int64 // 原作者用户 ID - SpaceID field.Int64 // 空间 ID - UpdaterID field.Int64 // 更新元信息的用户 ID - SourceID field.Int64 // 复制来源的 workflow ID - AppID field.Int64 // 应用 ID + AuthorID field.Int64 // Original author user ID + SpaceID field.Int64 // space id + UpdaterID field.Int64 // User ID for updating metadata + SourceID field.Int64 // Workflow ID of source + AppID field.Int64 // app id LatestVersion field.String // the version of the most recent publish LatestVersionTs field.Int64 // create time of latest version diff --git a/backend/domain/workflow/internal/repo/dal/query/workflow_reference.gen.go b/backend/domain/workflow/internal/repo/dal/query/workflow_reference.gen.go index 52fcd79c..cb765d2a 100644 --- a/backend/domain/workflow/internal/repo/dal/query/workflow_reference.gen.go +++ b/backend/domain/workflow/internal/repo/dal/query/workflow_reference.gen.go @@ -41,7 +41,7 @@ func newWorkflowReference(db *gorm.DB, opts ...gen.DOOption) workflowReference { return _workflowReference } -// workflowReference workflow 关联关系表,用于记录workflow 直接互相引用关系 +// workflowReference The workflow association table,used to record the direct mutual reference relationship between workflows type workflowReference struct { workflowReferenceDo @@ -53,7 +53,7 @@ type workflowReference struct { ReferringBizType field.Int32 // the biz type the referring entity belongs to: 1. workflow 2. agent CreatedAt field.Int64 // create time in millisecond Status field.Int32 // whether this reference currently takes effect. 0: disabled 1: enabled - DeletedAt field.Field + DeletedAt field.Field // Delete Time fieldMap map[string]field.Expr } diff --git a/backend/domain/workflow/internal/repo/dal/query/workflow_snapshot.gen.go b/backend/domain/workflow/internal/repo/dal/query/workflow_snapshot.gen.go index a6c4fd07..cbe594e8 100644 --- a/backend/domain/workflow/internal/repo/dal/query/workflow_snapshot.gen.go +++ b/backend/domain/workflow/internal/repo/dal/query/workflow_snapshot.gen.go @@ -50,8 +50,8 @@ type workflowSnapshot struct { Canvas field.String // frontend schema for this snapshot InputParams field.String // input parameter info OutputParams field.String // output parameter info - CreatedAt field.Int64 - ID field.Int64 // ID + CreatedAt field.Int64 // Create Time in Milliseconds + ID field.Int64 // ID fieldMap map[string]field.Expr } diff --git a/backend/domain/workflow/internal/repo/dal/query/workflow_version.gen.go b/backend/domain/workflow/internal/repo/dal/query/workflow_version.gen.go index 74f1b471..e497a648 100644 --- a/backend/domain/workflow/internal/repo/dal/query/workflow_version.gen.go +++ b/backend/domain/workflow/internal/repo/dal/query/workflow_version.gen.go @@ -44,21 +44,21 @@ func newWorkflowVersion(db *gorm.DB, opts ...gen.DOOption) workflowVersion { return _workflowVersion } -// workflowVersion workflow 画布版本信息表,用于记录不同版本的画布信息 +// workflowVersion Workflow Canvas Version Information Table, used to record canvas information for different versions type workflowVersion struct { workflowVersionDo ALL field.Asterisk ID field.Int64 // ID WorkflowID field.Int64 // workflow id - Version field.String // 发布版本 - VersionDescription field.String // 版本描述 - Canvas field.String // 前端 schema - InputParams field.String - OutputParams field.String - CreatorID field.Int64 // 发布用户 ID - CreatedAt field.Int64 // 创建时间毫秒时间戳 - DeletedAt field.Field // 删除毫秒时间戳 + Version field.String // Published version + VersionDescription field.String // Version Description + Canvas field.String // Front end schema + InputParams field.String // input params + OutputParams field.String // output params + CreatorID field.Int64 // creator id + CreatedAt field.Int64 // Create Time in Milliseconds + DeletedAt field.Field // Delete Time CommitID field.String // the commit id corresponding to this version fieldMap map[string]field.Expr diff --git a/backend/domain/workflow/internal/repo/repository.go b/backend/domain/workflow/internal/repo/repository.go index 4de50d9b..c5a25436 100644 --- a/backend/domain/workflow/internal/repo/repository.go +++ b/backend/domain/workflow/internal/repo/repository.go @@ -932,13 +932,13 @@ func (r *RepositoryImpl) MGetLatestVersion(ctx context.Context, policy *vo.MGetP type combinedVersion struct { model.WorkflowMeta - Version string `gorm:"column:version"` // 发布版本 - VersionDescription string `gorm:"column:version_description"` // 版本描述 - Canvas string `gorm:"column:canvas"` // 前端 schema + Version string `gorm:"column:version"` // release version + VersionDescription string `gorm:"column:version_description"` // version description + Canvas string `gorm:"column:canvas"` // Front-end schema InputParams string `gorm:"column:input_params"` OutputParams string `gorm:"column:output_params"` - VersionCreatorID int64 `gorm:"column:version_creator_id"` // 发布用户 ID - VersionCreatedAt int64 `gorm:"column:version_created_at"` // 创建时间毫秒时间戳 + VersionCreatorID int64 `gorm:"column:version_creator_id"` // Publish user ID + VersionCreatedAt int64 `gorm:"column:version_created_at"` // Creation time millisecond timestamp CommitID string `gorm:"column:commit_id"` // the commit id corresponding to this version } diff --git a/backend/infra/contract/document/parser/manager.go b/backend/infra/contract/document/parser/manager.go index e2a377a3..4ce37dee 100644 --- a/backend/infra/contract/document/parser/manager.go +++ b/backend/infra/contract/document/parser/manager.go @@ -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 diff --git a/backend/infra/contract/document/rerank/rerank.go b/backend/infra/contract/document/rerank/rerank.go index 484025cd..144a80ce 100644 --- a/backend/infra/contract/document/rerank/rerank.go +++ b/backend/infra/contract/document/rerank/rerank.go @@ -33,7 +33,7 @@ type Request struct { } type Response struct { - SortedData []*Data // 高分在前 + SortedData []*Data // High score TokenUsage *int64 } diff --git a/backend/infra/contract/document/searchstore/manager.go b/backend/infra/contract/document/searchstore/manager.go index 1725a392..91bed08d 100644 --- a/backend/infra/contract/document/searchstore/manager.go +++ b/backend/infra/contract/document/searchstore/manager.go @@ -64,7 +64,7 @@ const ( type FieldName = string -// 内置 field name +// Built-in field name const ( FieldID FieldName = "id" // int64 FieldCreatorID FieldName = "creator_id" // int64 diff --git a/backend/infra/contract/document/searchstore/options.go b/backend/infra/contract/document/searchstore/options.go index 1cff5324..01e59095 100644 --- a/backend/infra/contract/document/searchstore/options.go +++ b/backend/infra/contract/document/searchstore/options.go @@ -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 { diff --git a/backend/infra/contract/document/table.go b/backend/infra/contract/document/table.go index 638e95d0..dce7ed74 100644 --- a/backend/infra/contract/document/table.go +++ b/backend/infra/contract/document/table.go @@ -36,7 +36,7 @@ type Column struct { Description string Nullable bool IsPrimary bool - Sequence int // 排序编号 + Sequence int // sort number } type TableColumnType int diff --git a/backend/infra/contract/imagex/imagex.go b/backend/infra/contract/imagex/imagex.go index 4ed07876..4268cfc6 100644 --- a/backend/infra/contract/imagex/imagex.go +++ b/backend/infra/contract/imagex/imagex.go @@ -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 { diff --git a/backend/infra/contract/modelmgr/const.go b/backend/infra/contract/modelmgr/const.go index b9d2f689..b8fefe70 100644 --- a/backend/infra/contract/modelmgr/const.go +++ b/backend/infra/contract/modelmgr/const.go @@ -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 diff --git a/backend/infra/contract/modelmgr/desc.go b/backend/infra/contract/modelmgr/desc.go index ab59b71a..2783749f 100644 --- a/backend/infra/contract/modelmgr/desc.go +++ b/backend/infra/contract/modelmgr/desc.go @@ -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 diff --git a/backend/infra/contract/rdb/entity/const.go b/backend/infra/contract/rdb/entity/const.go index d82d8e21..f509a1d8 100644 --- a/backend/infra/contract/rdb/entity/const.go +++ b/backend/infra/contract/rdb/entity/const.go @@ -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 diff --git a/backend/infra/contract/rdb/entity/rdb.go b/backend/infra/contract/rdb/entity/rdb.go index 3e2867f0..d50b3e0f 100644 --- a/backend/infra/contract/rdb/entity/rdb.go +++ b/backend/infra/contract/rdb/entity/rdb.go @@ -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 diff --git a/backend/infra/contract/rdb/rdb.go b/backend/infra/contract/rdb/rdb.go index fe9d5a32..b0a1feb4 100644 --- a/backend/infra/contract/rdb/rdb.go +++ b/backend/infra/contract/rdb/rdb.go @@ -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 } diff --git a/backend/infra/impl/cache/redis/redis.go b/backend/infra/impl/cache/redis/redis.go index 7bbda0e0..5c2ed55c 100644 --- a/backend/infra/impl/cache/redis/redis.go +++ b/backend/infra/impl/cache/redis/redis.go @@ -32,16 +32,16 @@ func New() *redis.Client { Addr: addr, // Redis地址 DB: 0, // 默认数据库 Password: password, - // 连接池配置 - PoolSize: 100, // 最大连接数(建议设置为CPU核心数*10) - MinIdleConns: 10, // 最小空闲连接 - MaxIdleConns: 30, // 最大空闲连接 - ConnMaxIdleTime: 5 * time.Minute, // 空闲连接超时时间 + // connection pool configuration + PoolSize: 100, // Maximum number of connections (recommended to set to CPU cores * 10) + MinIdleConns: 10, // minimum idle connection + MaxIdleConns: 30, // maximum idle connection + ConnMaxIdleTime: 5 * time.Minute, // Idle connection timeout - // 超时配置 - DialTimeout: 5 * time.Second, // 连接建立超时 - ReadTimeout: 3 * time.Second, // 读操作超时 - WriteTimeout: 3 * time.Second, // 写操作超时 + // timeout configuration + DialTimeout: 5 * time.Second, // Connection establishment timed out + ReadTimeout: 3 * time.Second, // read operation timed out + WriteTimeout: 3 * time.Second, // write operation timed out }) return rdb diff --git a/backend/infra/impl/document/parser/builtin/convert.go b/backend/infra/impl/document/parser/builtin/convert.go index 5d1190c6..6228d2c0 100644 --- a/backend/infra/impl/document/parser/builtin/convert.go +++ b/backend/infra/impl/document/parser/builtin/convert.go @@ -62,7 +62,7 @@ func assertValAs(typ document.TableColumnType, val string) (*document.ColumnData ValTime: ptr.Of(emptyTime), }, nil } - // 支持时间戳和时间字符串 + // Supports timestamp and time string i, err := strconv.ParseInt(val, 10, 64) if err == nil { t := time.Unix(i, 0) @@ -152,7 +152,7 @@ func assertValAsForce(typ document.TableColumnType, val string, nullable bool) * } func assertVal(val string) document.ColumnData { - // TODO: 先不处理 image + // TODO: Do not process images first if val == "" { return document.ColumnData{ Type: document.TableColumnTypeUnknown, diff --git a/backend/infra/impl/document/parser/builtin/parse_iter.go b/backend/infra/impl/document/parser/builtin/parse_iter.go index efc22712..7d3a9368 100644 --- a/backend/infra/impl/document/parser/builtin/parse_iter.go +++ b/backend/infra/impl/document/parser/builtin/parse_iter.go @@ -75,7 +75,7 @@ func parseByRowIterator(iter rowIterator, config *contract.Config, opts ...parse var rowData []*document.ColumnData for j := range row { colSchema, found := rev[j] - if !found { // 列裁剪 + if !found { // column clipping continue } diff --git a/backend/infra/impl/document/parser/builtin/parse_json.go b/backend/infra/impl/document/parser/builtin/parse_json.go index c0581836..e031701c 100644 --- a/backend/infra/impl/document/parser/builtin/parse_json.go +++ b/backend/infra/impl/document/parser/builtin/parse_json.go @@ -51,7 +51,7 @@ func parseJSON(config *contract.Config) parseFn { } } else { for k := range rawSlices[0] { - // init 取首个 json item 中 key 的随机顺序 + // Init takes the random order of keys in the first json item header = append(header, k) } } diff --git a/backend/infra/impl/document/parser/builtin/py_parser_protocol.go b/backend/infra/impl/document/parser/builtin/py_parser_protocol.go index 6477acc6..460c7bd0 100644 --- a/backend/infra/impl/document/parser/builtin/py_parser_protocol.go +++ b/backend/infra/impl/document/parser/builtin/py_parser_protocol.go @@ -163,7 +163,7 @@ func parseByPython(config *contract.Config, storage storage.Storage, ocr ocr.OCR } docs = append(docs, doc) } else { - // TODO: 这里有点问题,img label 可能被较短的 chunk size 截断 + // TODO: There is a problem here, the img label may be truncated by the shorter chunk size result.Content[i+1].Content = label + result.Content[i+1].Content } case contentTypeTable: diff --git a/backend/infra/impl/document/parser/builtin/util.go b/backend/infra/impl/document/parser/builtin/util.go index 07162c3d..924d7e96 100644 --- a/backend/infra/impl/document/parser/builtin/util.go +++ b/backend/infra/impl/document/parser/builtin/util.go @@ -35,7 +35,7 @@ const imgSrcFormat = `` func createSecret(uid int64, fileType string) string { num := 10 input := fmt.Sprintf("upload_%d_Ma*9)fhi_%d_gou_%s_rand_%d", uid, time.Now().Unix(), fileType, rand.Intn(100000)) - // 做md5,取前20个,// mapIntToBase62 把数字映射到 Base62 + // Do md5, take the first 20,//mapIntToBase62 map the number to Base62 hash := sha256.Sum256([]byte(fmt.Sprintf("%s", input))) hashString := base64.StdEncoding.EncodeToString(hash[:]) if len(hashString) > num { diff --git a/backend/infra/impl/document/rerank/vikingdb/vikingdb_test.go b/backend/infra/impl/document/rerank/vikingdb/vikingdb_test.go index 15d7af01..5341671e 100644 --- a/backend/infra/impl/document/rerank/vikingdb/vikingdb_test.go +++ b/backend/infra/impl/document/rerank/vikingdb/vikingdb_test.go @@ -27,11 +27,11 @@ package vikingdb // resp, err := r.Rerank(context.Background(), &rerank.Request{ // Data: [][]*knowledge.RetrieveSlice{ // { -// {Slice: &entity.Slice{PlainText: "吉尼斯世界纪录网站数据显示,蓝鲸是目前已知世界上最大的动物,体长可达30米,相当于一架波音737飞机的长度"}}, -// {Slice: &entity.Slice{PlainText: "一头成年雌性弓头鲸可以长到22米长,而一头雄性鲸鱼可以长到18米长"}}, +// {Slice: & entity. Slice {PlainText: "According to the Guinness World Records website, the blue whale is currently the largest animal known in the world, with a body length of up to 30 meters, which is equivalent to the length of a Boeing 737 aircraft"}}, +// {Slice: & entity. Slice {PlainText: "An adult female bowhead whale can grow to 22 meters long, while a male whale can grow to 18 meters long"}}, // }, // }, -// Query: "世界上最大的鲸鱼是什么?", +// Query: "What is the largest whale in the world?" // TopN: nil, // }) // assert.NoError(t, err) @@ -39,8 +39,8 @@ package vikingdb // for _, item := range resp.Sorted { // fmt.Println(item.Slice.PlainText, item.Score) // } -// // 吉尼斯世界纪录网站数据显示,蓝鲸是目前已知世界上最大的动物,体长可达30米,相当于一架波音737飞机的长度 0.6209664529733573 -// // 一头成年雌性弓头鲸可以长到22米长,而一头雄性鲸鱼可以长到18米长 0.4269785303456468 +// According to the Guinness World Records website, the blue whale is the largest known animal in the world, with a body length of up to 30 meters, which is equivalent to the length of a Boeing 737 aircraft 6209664529733573 +// //An adult female bowhead whale can grow up to 22 meters long, while a male whale can grow up to 18 meters 4269785303456468 // // fmt.Println(resp.TokenUsage) // // 95 diff --git a/backend/infra/impl/document/searchstore/milvus/milvus_manager.go b/backend/infra/impl/document/searchstore/milvus/milvus_manager.go index b5e134be..ba033f72 100644 --- a/backend/infra/impl/document/searchstore/milvus/milvus_manager.go +++ b/backend/infra/impl/document/searchstore/milvus/milvus_manager.go @@ -272,7 +272,7 @@ func (m *milvusManager) convertFields(fields []*searchstore.Field) ([]*mentity.F if f.Type != searchstore.FieldTypeText { return nil, fmt.Errorf("[convertFields] milvus only support text field indexing, field=%s, type=%d", f.Name, f.Type) } - // indexing 时只有 content 存储原文 + // Only content is stored when indexing if f.Name == searchstore.FieldTextContent { resp = append(resp, mentity.NewField(). WithName(f.Name). diff --git a/backend/infra/impl/document/searchstore/vikingdb/vikingdb_searchstore.go b/backend/infra/impl/document/searchstore/vikingdb/vikingdb_searchstore.go index 49fed6f4..e71fe278 100644 --- a/backend/infra/impl/document/searchstore/vikingdb/vikingdb_searchstore.go +++ b/backend/infra/impl/document/searchstore/vikingdb/vikingdb_searchstore.go @@ -112,7 +112,7 @@ func (v *vkSearchStore) Retrieve(ctx context.Context, query string, opts ...retr return nil, fmt.Errorf("[Retrieve] vikingdb failed to build filter, %w", err) } if filter != nil { - // 不支持跨 partition 召回,使用 filter 替代 + // Cross-partition recall is not supported, use filter instead searchOpts = searchOpts.SetFilter(filter) } diff --git a/backend/infra/impl/dynconf/static/static_config.go b/backend/infra/impl/dynconf/static/static_config.go index 399a83d4..4c81004a 100644 --- a/backend/infra/impl/dynconf/static/static_config.go +++ b/backend/infra/impl/dynconf/static/static_config.go @@ -26,14 +26,14 @@ const ( ) type Options struct { - absRepoRoot string // yaml文件root前缀的绝对路径 - useJson bool // 需要bind json文件,不指定默认bind yaml + absRepoRoot string // Absolute path to root prefix of yaml file + useJson bool // Requires bind json file, does not specify default bind yaml groups []string } type OptFunc func(o *Options) -// WithAbsRepoRoot 传入自定义指定读取绝对路径/xx下的config..(yaml,json),例如/opt/tiger/xxx +// WithAbsRepoRoot pass in a custom specified read config. < xx >. (yaml, json) under the absolute path/xx, for example/opt/tiger/xxx func WithAbsRepoRoot(absRepoRoot string) OptFunc { return func(o *Options) { if len(absRepoRoot) > 0 { @@ -42,7 +42,7 @@ func WithAbsRepoRoot(absRepoRoot string) OptFunc { } } -// WithUseJSONType 需要查找xx.json结尾的文 +// WithUseJSONType needs to find the text at the end of xx.json func WithUseJSONType(useJson bool) OptFunc { return func(o *Options) { o.useJson = useJson @@ -66,7 +66,7 @@ func loadOpts(opts ...OptFunc) *Options { var configers sync.Map // key: abs path, value: configer -// New 可传入local_config_dir指定读取自定义的绝对路径文件 `/config....yaml` +// New can be passed in local_config_dir specify to read the custom absolute path file '< local_config_dir >/config. < env >. < region >. < cluster > .yaml' func getOrCreateConf(opts ...OptFunc) (configer, error) { options := loadOpts(opts...) if options.absRepoRoot == "" { @@ -102,7 +102,7 @@ func getOrCreateConf(opts ...OptFunc) (configer, error) { return nil, err } } else { - cfg, err = NewConfYaml(dir, options.groups) // 默认使用yaml + cfg, err = NewConfYaml(dir, options.groups) // Default use yaml if err != nil { return nil, err } @@ -113,8 +113,8 @@ func getOrCreateConf(opts ...OptFunc) (configer, error) { return cfg, nil } -// JSONBind 不传dir值,按默认路径,优先级读取/opt/tiger/flowdevops/confcenter/psm/p.s.m/config....json -// 可使用WithAbsRepoRoot 传入自定义指定读取 +// JSONBind does not pass the dir value, according to the default path, the priority is to read/opt/tiger/flowdevops/confcenter/psm/p.s.m/config. < env >. < region >. < cluster > .json +// Custom specified reads can be passed in using WithAbsRepoRoot func JSONBind(structPtr interface{}, opts ...OptFunc) error { opts = append(opts, WithUseJSONType(true)) conf, err := getOrCreateConf(opts...) @@ -124,8 +124,8 @@ func JSONBind(structPtr interface{}, opts ...OptFunc) error { return bindAndValidate(structPtr, conf) } -// YAMLBind 不传dir值,按默认路径,按优先级读取/opt/tiger/flowdevops/confcenter/psm/p.s.m/config....yaml -// 可使用WithAbsRepoRoot 传入自定义指定读取 +// YAMLBind does not pass the dir value, according to the default path, read/opt/tiger/flowdevops/confcenter/psm/p.s.m/config by priority. < env >. < region >. < cluster > .yaml +// Custom specified reads can be passed in using WithAbsRepoRoot func YAMLBind(structPtr interface{}, opts ...OptFunc) error { conf, err := getOrCreateConf(opts...) if err != nil { diff --git a/backend/infra/impl/es/es7.go b/backend/infra/impl/es/es7.go index a02ecf13..1a0a8930 100644 --- a/backend/infra/impl/es/es7.go +++ b/backend/infra/impl/es/es7.go @@ -267,12 +267,12 @@ func (c *es7Client) query2ESQuery(q *Query) map[string]any { base = map[string]any{} } - // 若没有 BoolQuery,直接返回 base query + // If there is no BoolQuery, return the base query directly if q.Bool == nil { return base } - // 如果有 BoolQuery,把 base 作为 BoolQuery 的一部分(或为空) + // If there is a BoolQuery, make base part of the BoolQuery (or empty). boolQuery := map[string]any{} appendBool := func(key string, queries []Query) { @@ -296,7 +296,7 @@ func (c *es7Client) query2ESQuery(q *Query) map[string]any { appendBool("must_not", q.Bool.MustNot) appendBool("should", q.Bool.Should) - // 如果 base 不是空,作为一个 filter 附加进去 + // If base is not empty, append it as a filter if len(base) > 0 { if _, ok := boolQuery["filter"]; !ok { boolQuery["filter"] = []map[string]any{} diff --git a/backend/infra/impl/es/es8.go b/backend/infra/impl/es/es8.go index c9405395..04f88dc7 100644 --- a/backend/infra/impl/es/es8.go +++ b/backend/infra/impl/es/es8.go @@ -132,7 +132,7 @@ func (c *es8Client) query2ESQuery(q *Query) *types.Query { Wildcard: map[string]types.WildcardQuery{ q.KV.Key: { Value: ptr.Of(fmt.Sprintf("*%s*", q.KV.Value)), - CaseInsensitive: ptr.Of(true), // 忽略大小写 + CaseInsensitive: ptr.Of(true), // Ignore case }, }, } diff --git a/backend/infra/impl/eventbus/kafka/consumer.go b/backend/infra/impl/eventbus/kafka/consumer.go index 0792589c..24765d66 100644 --- a/backend/infra/impl/eventbus/kafka/consumer.go +++ b/backend/infra/impl/eventbus/kafka/consumer.go @@ -38,7 +38,7 @@ type consumerImpl struct { func RegisterConsumer(broker string, topic, groupID string, handler eventbus.ConsumerHandler, opts ...eventbus.ConsumerOpt) error { config := sarama.NewConfig() - config.Consumer.Offsets.Initial = sarama.OffsetOldest // 从最早消息开始消费 + config.Consumer.Offsets.Initial = sarama.OffsetOldest // Start consuming from the earliest message config.Consumer.Group.Session.Timeout = 30 * time.Second o := &eventbus.ConsumerOption{} @@ -102,7 +102,7 @@ func (c *consumerImpl) ConsumeClaim(sess sarama.ConsumerGroupSession, claim sara continue } - sess.MarkMessage(msg, "") // TODO: 消费策略可以配置 + sess.MarkMessage(msg, "") // TODO: Consumer policies can be configured } return nil } diff --git a/backend/infra/impl/eventbus/nsq/consumer.go b/backend/infra/impl/eventbus/nsq/consumer.go index 00e0b9c3..709a575f 100644 --- a/backend/infra/impl/eventbus/nsq/consumer.go +++ b/backend/infra/impl/eventbus/nsq/consumer.go @@ -70,7 +70,7 @@ func RegisterConsumer(nameServer, topic, group string, consumerHandler eventbus. return nil } -// 自定义 Handler,处理收到的每条消息 +// Customize the Handler to handle each message received type MessageHandler struct { Topic string Group string diff --git a/backend/infra/impl/eventbus/rmq/consumer.go b/backend/infra/impl/eventbus/rmq/consumer.go index 47d8aea5..bf0e1f82 100644 --- a/backend/infra/impl/eventbus/rmq/consumer.go +++ b/backend/infra/impl/eventbus/rmq/consumer.go @@ -90,7 +90,7 @@ func RegisterConsumer(nameServer, topic, group string, consumerHandler eventbus. err = consumerHandler.HandleMessage(ctx, msg) if err != nil { logs.CtxErrorf(ctx, "[Subscribe] handle msg failed, topic : %s , group : %s, err: %v \n", msg.Topic, msg.Group, err) - return consumer.ConsumeRetryLater, err // TODO: 策略可以可以配置 + return consumer.ConsumeRetryLater, err // TODO: Policies can be configured } fmt.Printf("subscribe callback: %v \n", msgArr[i]) diff --git a/backend/infra/impl/idgen/idgen.go b/backend/infra/impl/idgen/idgen.go index b1231c78..60400288 100644 --- a/backend/infra/impl/idgen/idgen.go +++ b/backend/infra/impl/idgen/idgen.go @@ -34,7 +34,7 @@ const ( type IDGenerator = idgen.IDGenerator func New(client *redis.Client) (idgen.IDGenerator, error) { - // 初始化代码。 + // Initialization code. return &idGenImpl{ cli: client, }, nil @@ -60,7 +60,7 @@ func (i *idGenImpl) GenMultiIDs(ctx context.Context, counts int) ([]int64, error leftNum := int64(counts) lastMs := int64(0) ids := make([]int64, 0, counts) - svrID := int64(0) // 一个 server id 全部是 0 + svrID := int64(0) // A server id is all 0. for idx := int64(0); leftNum > 0 && idx < maxTimeAddrTimes; idx++ { ms := maxInt64(i.GetIDTimeMs(), lastMs) @@ -131,12 +131,12 @@ func (i *idGenImpl) GetIDTimeMs() int64 { } func (i *idGenImpl) Expire(ctx context.Context, key string) { - // 暂时忽略错误 + // Temporarily ignore errors _, _ = i.cli.Expire(ctx, key, counterKeyExpirationTime).Result() } func genIDKey(space string, svrID int64, ms int64) string { - // 此 Key 的格式一旦确定,便不能再变化 + // Once the format of this key is determined, it cannot be changed return fmt.Sprintf("id_generator:%v:%v:%v", space, svrID, ms) } diff --git a/backend/infra/impl/imagex/veimagex/veimagex.go b/backend/infra/impl/imagex/veimagex/veimagex.go index 08de5d05..911930d0 100644 --- a/backend/infra/impl/imagex/veimagex/veimagex.go +++ b/backend/infra/impl/imagex/veimagex/veimagex.go @@ -63,7 +63,7 @@ func (v *veImageX) GetUploadAuth(ctx context.Context, opt ...imagex.UploadAuthOp } func (v *veImageX) GetUploadAuthWithExpire(ctx context.Context, expire time.Duration, opt ...imagex.UploadAuthOpt) (*imagex.SecurityToken, error) { - // opt 转 UploadAuthOption + // Opt to UploadAuthOption option := &imagex.UploadAuthOption{} for _, o := range opt { o(option) diff --git a/backend/infra/impl/rdb/mysql.go b/backend/infra/impl/rdb/mysql.go index ca971b9d..93d419de 100644 --- a/backend/infra/impl/rdb/mysql.go +++ b/backend/infra/impl/rdb/mysql.go @@ -550,7 +550,7 @@ func (m *mysqlService) UpsertData(ctx context.Context, req *rdb.UpsertDataReques } } - // ON DUPLICATE KEY UPDATE部分 + // ON DUPLICATE KEY UPDATE PART updateClauses := make([]string, 0, len(fields)) for _, field := range fields { isKey := false @@ -622,7 +622,7 @@ func (m *mysqlService) getTablePrimaryKeys(ctx context.Context, tableName string return primaryKeys, nil } -// calculateInsertedUpdated 函数保持不变 +// calculateInsertedUpdated function remains unchanged func calculateInsertedUpdated(affectedRows int64, batchSize int) (int64, int64, int64) { updated := int64(0) inserted := affectedRows diff --git a/backend/infra/impl/storage/tos/tos.go b/backend/infra/impl/storage/tos/tos.go index 19cdade5..d236b68e 100644 --- a/backend/infra/impl/storage/tos/tos.go +++ b/backend/infra/impl/storage/tos/tos.go @@ -64,7 +64,7 @@ func getTosClient(ctx context.Context, ak, sk, bucketName, endpoint, region stri bucketName: bucketName, } - // 创建存储桶 + // Create bucket err = t.CheckAndCreateBucket(ctx) if err != nil { return nil, err @@ -82,14 +82,14 @@ func New(ctx context.Context, ak, sk, bucketName, endpoint, region string) (stor } func (t *tosClient) test() { - // 测试上传 + // test upload objectKey := fmt.Sprintf("test-%s.txt", time.Now().Format("20060102150405")) err := t.PutObject(context.Background(), objectKey, []byte("hello world")) if err != nil { logs.CtxErrorf(context.Background(), "PutObject failed, objectKey: %s, err: %v", objectKey, err) } - // 测试下载 + // test download content, err := t.GetObject(context.Background(), objectKey) if err != nil { logs.CtxErrorf(context.Background(), "GetObject failed, objectKey: %s, err: %v", objectKey, err) @@ -97,7 +97,7 @@ func (t *tosClient) test() { logs.CtxInfof(context.Background(), "GetObject content: %s", string(content)) - // 测试获取URL + // Test Get URL url, err := t.GetObjectUrl(context.Background(), objectKey) if err != nil { logs.CtxErrorf(context.Background(), "GetObjectUrl failed, objectKey: %s, err: %v", objectKey, err) @@ -105,7 +105,7 @@ func (t *tosClient) test() { logs.CtxInfof(context.Background(), "GetObjectUrl url: %s", url) - // 测试删除 + // test delete err = t.DeleteObject(context.Background(), objectKey) if err != nil { logs.CtxErrorf(context.Background(), "DeleteObject failed, objectKey: %s, err: %v", objectKey, err) @@ -127,7 +127,7 @@ func (t *tosClient) CheckAndCreateBucket(ctx context.Context) error { } if serverErr.StatusCode == http.StatusNotFound { - // 存储桶不存在 + // Bucket does not exist logs.CtxInfof(ctx, "Bucket not found.") resp, err := client.CreateBucketV2(context.Background(), &tos.CreateBucketV2Input{ Bucket: bucketName, @@ -163,7 +163,7 @@ func (t *tosClient) GetObject(ctx context.Context, objectKey string) ([]byte, er client := t.client bucketName := t.bucketName - // 下载数据到内存 + // Download data to memory getOutput, err := client.GetObjectV2(ctx, &tos.GetObjectV2Input{ Bucket: bucketName, Key: objectKey, @@ -188,7 +188,7 @@ func (t *tosClient) DeleteObject(ctx context.Context, objectKey string) error { client := t.client bucketName := t.bucketName - // 删除存储桶中指定对象 + // Delete the specified object in the bucket _, err := client.DeleteObjectV2(ctx, &tos.DeleteObjectV2Input{ Bucket: bucketName, Key: objectKey, diff --git a/backend/pkg/ctxcache/ctx_cache_test.go b/backend/pkg/ctxcache/ctx_cache_test.go index 92fa5e1e..2e4ca42e 100644 --- a/backend/pkg/ctxcache/ctx_cache_test.go +++ b/backend/pkg/ctxcache/ctx_cache_test.go @@ -28,12 +28,12 @@ func TestCtxCache(t *testing.T) { g := NewGomegaWithT(t) ctx := context.Background() - // 测试没有 initCtxCacheData 场景 + // Test without initCtxCacheData scenario Store(ctx, "test1", "1") _, ok := Get[string](ctx, "test1") g.Expect(ok).Should(BeFalse()) - // 有 initCtxCacheData 场景 + // There is initCtxCacheData scene ctx = Init(ctx) _, ok = Get[string](ctx, "test") diff --git a/backend/pkg/errorx/code/register.go b/backend/pkg/errorx/code/register.go index 6bc17136..9778f839 100644 --- a/backend/pkg/errorx/code/register.go +++ b/backend/pkg/errorx/code/register.go @@ -22,17 +22,17 @@ import ( type RegisterOptionFn = internal.RegisterOption -// WithAffectStability 设置稳定性标识, true:会影响系统稳定性, 并体现在接口错误率中, false:不影响稳定性. +// WithAffectStability sets the stability flag, true: it will affect the system stability and is reflected in the interface error rate, false: it will not affect the stability. func WithAffectStability(affectStability bool) RegisterOptionFn { return internal.WithAffectStability(affectStability) } -// Register 注册用户预定义的错误码信息, PSM服务对应的code_gen子module初始化时调用. +// Register the predefined error code information of the registered user, and call the code_gen sub-module corresponding to the PSM service when initializing. func Register(code int32, msg string, opts ...RegisterOptionFn) { internal.Register(code, msg, opts...) } -// SetDefaultErrorCode 带有PSM信息染色的code替换默认code. +// SetDefaultErrorCode Code with PSM information staining Replace the default code. func SetDefaultErrorCode(code int32) { internal.SetDefaultErrorCode(code) } diff --git a/docker/atlas/migrations/20250730131847_update.sql b/docker/atlas/migrations/20250730131847_update.sql new file mode 100644 index 00000000..9dd0698c --- /dev/null +++ b/docker/atlas/migrations/20250730131847_update.sql @@ -0,0 +1,48 @@ +-- Modify "conversation" table +ALTER TABLE `opencoze`.`conversation` COMMENT "conversation info record", MODIFY COLUMN `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "id", MODIFY COLUMN `connector_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Publish Connector ID", MODIFY COLUMN `scene` tinyint NOT NULL DEFAULT 0 COMMENT "conversation scene", MODIFY COLUMN `section_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "section_id", MODIFY COLUMN `creator_id` bigint unsigned NULL DEFAULT 0 COMMENT "creator_id", MODIFY COLUMN `ext` text NULL COMMENT "ext", MODIFY COLUMN `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", MODIFY COLUMN `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds"; +-- Modify "data_copy_task" table +ALTER TABLE `opencoze`.`data_copy_task` COMMENT "data copy task record", MODIFY COLUMN `master_task_id` varchar(128) NULL DEFAULT "" COMMENT "task id", MODIFY COLUMN `origin_data_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "origin data id", MODIFY COLUMN `target_data_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "target data id", MODIFY COLUMN `origin_space_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "origin space id", MODIFY COLUMN `target_space_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "target space id", MODIFY COLUMN `origin_user_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "origin user id", MODIFY COLUMN `target_user_id` bigint unsigned NULL DEFAULT 0 COMMENT "target user id", MODIFY COLUMN `origin_app_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "origin app id", MODIFY COLUMN `target_app_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "target app id", MODIFY COLUMN `data_type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "data type 1:knowledge, 2:database", MODIFY COLUMN `ext_info` varchar(255) NOT NULL DEFAULT "" COMMENT "ext", MODIFY COLUMN `start_time` bigint NULL DEFAULT 0 COMMENT "task start time", MODIFY COLUMN `finish_time` bigint NULL COMMENT "task finish time", MODIFY COLUMN `status` tinyint NOT NULL DEFAULT 1 COMMENT "1: Create 2: Running 3: Success 4: Failure", MODIFY COLUMN `error_msg` varchar(128) NULL COMMENT "error msg"; +-- Modify "knowledge" table +ALTER TABLE `opencoze`.`knowledge` COMMENT "knowledge tabke", MODIFY COLUMN `id` bigint unsigned NOT NULL COMMENT "id", MODIFY COLUMN `name` varchar(150) NOT NULL DEFAULT "" COMMENT "knowledge's name", MODIFY COLUMN `app_id` bigint NOT NULL DEFAULT 0 COMMENT "app id", MODIFY COLUMN `creator_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "creator id", MODIFY COLUMN `space_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "space id", MODIFY COLUMN `deleted_at` datetime(3) NULL COMMENT "Delete Time", MODIFY COLUMN `status` tinyint NOT NULL DEFAULT 1 COMMENT "0 initialization, 1 effective, 2 invalid", MODIFY COLUMN `description` text NULL COMMENT "description", MODIFY COLUMN `icon_uri` varchar(150) NULL COMMENT "icon uri", MODIFY COLUMN `format_type` tinyint NOT NULL DEFAULT 0 COMMENT "0: Text 1: Table 2: Images"; +-- Modify "knowledge_document" table +ALTER TABLE `opencoze`.`knowledge_document` COMMENT "knowledge document info", MODIFY COLUMN `id` bigint unsigned NOT NULL COMMENT "id", MODIFY COLUMN `knowledge_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "knowledge id", MODIFY COLUMN `name` varchar(150) NOT NULL DEFAULT "" COMMENT "document name", MODIFY COLUMN `file_extension` varchar(20) NOT NULL DEFAULT "0" COMMENT "Document type, txt/pdf/csv etc..", MODIFY COLUMN `document_type` int NOT NULL DEFAULT 0 COMMENT "Document type: 0: Text 1: Table 2: Image", MODIFY COLUMN `uri` text NULL COMMENT "uri", MODIFY COLUMN `size` bigint unsigned NOT NULL DEFAULT 0 COMMENT "document size", MODIFY COLUMN `slice_count` bigint unsigned NOT NULL DEFAULT 0 COMMENT "slice count", MODIFY COLUMN `char_count` bigint unsigned NOT NULL DEFAULT 0 COMMENT "number of characters", MODIFY COLUMN `creator_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "creator id", MODIFY COLUMN `space_id` bigint NOT NULL DEFAULT 0 COMMENT "space id", MODIFY COLUMN `deleted_at` datetime(3) NULL COMMENT "Delete Time", MODIFY COLUMN `source_type` int NULL DEFAULT 0 COMMENT "0: Local file upload, 2: Custom text, 103: Feishu 104: Lark", MODIFY COLUMN `status` int NOT NULL DEFAULT 0 COMMENT "status", MODIFY COLUMN `fail_reason` text NULL COMMENT "fail reason", MODIFY COLUMN `parse_rule` json NULL COMMENT "parse rule", MODIFY COLUMN `table_info` json NULL COMMENT "table info"; +-- Modify "knowledge_document_review" table +ALTER TABLE `opencoze`.`knowledge_document_review` COMMENT "Document slice preview info", MODIFY COLUMN `id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "id", MODIFY COLUMN `space_id` bigint NOT NULL DEFAULT 0 COMMENT "space id", MODIFY COLUMN `name` varchar(150) NOT NULL DEFAULT "" COMMENT "name", MODIFY COLUMN `type` varchar(10) NOT NULL DEFAULT "0" COMMENT "document type", MODIFY COLUMN `uri` text NULL COMMENT "uri", MODIFY COLUMN `format_type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "0 text, 1 table, 2 images", MODIFY COLUMN `status` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "0 Processing 1 Completed 2 Failed 3 Expired", MODIFY COLUMN `chunk_resp_uri` text NULL COMMENT "pre-sliced uri", MODIFY COLUMN `deleted_at` datetime(3) NULL COMMENT "Delete Time", MODIFY COLUMN `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "creator id"; +-- Modify "knowledge_document_slice" table +ALTER TABLE `opencoze`.`knowledge_document_slice` COMMENT "knowledge document slice", MODIFY COLUMN `id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "id", MODIFY COLUMN `document_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "document_id", MODIFY COLUMN `content` text NULL COMMENT "content", MODIFY COLUMN `sequence` decimal(20,5) NOT NULL COMMENT "slice sequence number, starting from 1", MODIFY COLUMN `deleted_at` datetime(3) NULL COMMENT "Delete Time", MODIFY COLUMN `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "creator id", MODIFY COLUMN `space_id` bigint NOT NULL DEFAULT 0 COMMENT "space id", MODIFY COLUMN `status` int NOT NULL DEFAULT 0 COMMENT "status", MODIFY COLUMN `fail_reason` text NULL COMMENT "fail reason", MODIFY COLUMN `hit` bigint unsigned NOT NULL DEFAULT 0 COMMENT "hit counts "; +-- Modify "message" table +ALTER TABLE `opencoze`.`message` COMMENT "message record", MODIFY COLUMN `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "id", MODIFY COLUMN `run_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "run_id", MODIFY COLUMN `role` varchar(100) NOT NULL DEFAULT "" COMMENT "role: user、assistant、system", MODIFY COLUMN `content_type` varchar(100) NOT NULL DEFAULT "" COMMENT "content type 1 text", MODIFY COLUMN `content` mediumtext NULL COMMENT "content", MODIFY COLUMN `message_type` varchar(100) NOT NULL DEFAULT "" COMMENT "message_type", MODIFY COLUMN `display_content` text NULL COMMENT "display content", MODIFY COLUMN `ext` text NULL COMMENT "message ext" COLLATE utf8mb4_general_ci, MODIFY COLUMN `section_id` bigint unsigned NULL COMMENT "section_id", MODIFY COLUMN `broken_position` int NULL DEFAULT -1 COMMENT "broken position", MODIFY COLUMN `status` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "message status: 1 Available 2 Deleted 3 Replaced 4 Broken 5 Failed 6 Streaming 7 Pending", MODIFY COLUMN `model_content` mediumtext NULL COMMENT "model content", MODIFY COLUMN `meta_info` text NULL COMMENT "text tagging information such as citation and highlighting", MODIFY COLUMN `reasoning_content` text NULL COMMENT "reasoning content" COLLATE utf8mb4_general_ci, MODIFY COLUMN `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", MODIFY COLUMN `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds"; +-- Modify "model_entity" table +ALTER TABLE `opencoze`.`model_entity` COMMENT "Model information", MODIFY COLUMN `id` bigint unsigned NOT NULL COMMENT "id", MODIFY COLUMN `meta_id` bigint unsigned NOT NULL COMMENT "model metadata id", MODIFY COLUMN `name` varchar(128) NOT NULL COMMENT "name", MODIFY COLUMN `description` text NULL COMMENT "description", MODIFY COLUMN `default_params` json NULL COMMENT "default params", MODIFY COLUMN `scenario` bigint unsigned NOT NULL COMMENT "scenario", MODIFY COLUMN `status` int NOT NULL DEFAULT 1 COMMENT "model status", MODIFY COLUMN `deleted_at` bigint unsigned NULL COMMENT "Delete Time"; +-- Modify "model_meta" table +ALTER TABLE `opencoze`.`model_meta` COMMENT "Model metadata", MODIFY COLUMN `id` bigint unsigned NOT NULL COMMENT "id", MODIFY COLUMN `model_name` varchar(128) NOT NULL COMMENT "model name", MODIFY COLUMN `protocol` varchar(128) NOT NULL COMMENT "model protocol", MODIFY COLUMN `capability` json NULL COMMENT "capability", MODIFY COLUMN `conn_config` json NULL COMMENT "model conn config", MODIFY COLUMN `status` int NOT NULL DEFAULT 1 COMMENT "model status", MODIFY COLUMN `description` varchar(2048) NOT NULL DEFAULT "" COMMENT "description", MODIFY COLUMN `deleted_at` bigint unsigned NULL COMMENT "Delete Time"; +-- Modify "node_execution" table +ALTER TABLE `opencoze`.`node_execution` COMMENT "Node run record, used to record the status information of each node during each workflow execution"; +-- Modify "prompt_resource" table +ALTER TABLE `opencoze`.`prompt_resource` MODIFY COLUMN `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "id", MODIFY COLUMN `space_id` bigint NOT NULL COMMENT "space id", MODIFY COLUMN `name` varchar(255) NOT NULL COMMENT "name", MODIFY COLUMN `description` varchar(255) NOT NULL COMMENT "description", MODIFY COLUMN `prompt_text` mediumtext NULL COMMENT "prompt text", MODIFY COLUMN `status` int NOT NULL COMMENT "status, 0 is invalid, 1 is valid", MODIFY COLUMN `creator_id` bigint NOT NULL COMMENT "creator id", MODIFY COLUMN `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", MODIFY COLUMN `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds"; +-- Modify "run_record" table +ALTER TABLE `opencoze`.`run_record` COMMENT "run record", MODIFY COLUMN `id` bigint unsigned NOT NULL COMMENT "id", MODIFY COLUMN `conversation_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "conversation id", MODIFY COLUMN `source` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "Execute source 0 API", MODIFY COLUMN `status` varchar(255) NOT NULL DEFAULT "" COMMENT "status,0 Unknown, 1-Created,2-InProgress,3-Completed,4-Failed,5-Expired,6-Cancelled,7-RequiresAction", MODIFY COLUMN `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "creator id", MODIFY COLUMN `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", MODIFY COLUMN `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", MODIFY COLUMN `failed_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Fail Time in Milliseconds", MODIFY COLUMN `completed_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Finish Time in Milliseconds", MODIFY COLUMN `chat_request` text NULL COMMENT "Original request field" COLLATE utf8mb4_general_ci, MODIFY COLUMN `ext` text NULL COMMENT "ext" COLLATE utf8mb4_general_ci; +-- Modify "shortcut_command" table +ALTER TABLE `opencoze`.`shortcut_command` COMMENT "bot shortcut command table", MODIFY COLUMN `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "id", MODIFY COLUMN `object_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Entity ID, this command can be used for this entity", MODIFY COLUMN `command_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "command id", MODIFY COLUMN `command_name` varchar(255) NOT NULL DEFAULT "" COMMENT "command name", MODIFY COLUMN `shortcut_command` varchar(255) NOT NULL DEFAULT "" COMMENT "shortcut command", MODIFY COLUMN `description` varchar(2000) NOT NULL DEFAULT "" COMMENT "description", MODIFY COLUMN `send_type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "send type 0:query 1:panel", MODIFY COLUMN `tool_type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "Type 1 of tool used: WorkFlow 2: Plugin", MODIFY COLUMN `work_flow_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "workflow id", MODIFY COLUMN `plugin_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "plugin id", MODIFY COLUMN `plugin_tool_name` varchar(255) NOT NULL DEFAULT "" COMMENT "plugin tool name", MODIFY COLUMN `template_query` text NULL COMMENT "template query", MODIFY COLUMN `components` json NULL COMMENT "Panel parameters", MODIFY COLUMN `card_schema` text NULL COMMENT "card schema", MODIFY COLUMN `tool_info` json NULL COMMENT "Tool information includes name+variable list", MODIFY COLUMN `status` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "Status, 0 is invalid, 1 is valid", MODIFY COLUMN `creator_id` bigint unsigned NULL DEFAULT 0 COMMENT "creator id", MODIFY COLUMN `is_online` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "Is online information: 0 draft 1 online", MODIFY COLUMN `created_at` bigint NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", MODIFY COLUMN `updated_at` bigint NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", MODIFY COLUMN `agent_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "When executing a multi instruction, which node executes the instruction", MODIFY COLUMN `shortcut_icon` json NULL COMMENT "shortcut icon"; +-- Modify "single_agent_draft" table +ALTER TABLE `opencoze`.`single_agent_draft` MODIFY COLUMN `variables_meta_id` bigint NULL COMMENT "variables meta table ID"; +-- Modify "single_agent_publish" table +ALTER TABLE `opencoze`.`single_agent_publish` COMMENT "Bot connector and release version info", MODIFY COLUMN `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "id", MODIFY COLUMN `publish_id` varchar(50) NOT NULL DEFAULT "" COMMENT "publish id" COLLATE utf8mb4_general_ci, MODIFY COLUMN `connector_ids` json NULL COMMENT "connector_ids", MODIFY COLUMN `publish_info` text NULL COMMENT "publish info" COLLATE utf8mb4_general_ci, MODIFY COLUMN `publish_time` bigint unsigned NOT NULL DEFAULT 0 COMMENT "publish time", MODIFY COLUMN `creator_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "creator id", MODIFY COLUMN `status` tinyint NOT NULL DEFAULT 0 COMMENT "Status 0: In use 1: Delete 3: Disabled", MODIFY COLUMN `extra` json NULL COMMENT "extra"; +-- Modify "single_agent_version" table +ALTER TABLE `opencoze`.`single_agent_version` MODIFY COLUMN `variables_meta_id` bigint NULL COMMENT "variables meta table ID"; +-- Modify "variable_instance" table +ALTER TABLE `opencoze`.`variable_instance` MODIFY COLUMN `id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "id", MODIFY COLUMN `version` varchar(255) NOT NULL COMMENT "agent or project version empty represents draft status", MODIFY COLUMN `keyword` varchar(255) NOT NULL COMMENT "Keyword to Memory", MODIFY COLUMN `type` tinyint NOT NULL COMMENT "Memory type 1 KV 2 list", MODIFY COLUMN `content` text NULL COMMENT "content", MODIFY COLUMN `connector_uid` varchar(255) NOT NULL COMMENT "connector_uid", MODIFY COLUMN `connector_id` bigint NOT NULL COMMENT "connector_id, e.g. coze = 10000010", MODIFY COLUMN `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", MODIFY COLUMN `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds"; +-- Modify "variables_meta" table +ALTER TABLE `opencoze`.`variables_meta` MODIFY COLUMN `id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "id", MODIFY COLUMN `creator_id` bigint unsigned NOT NULL COMMENT "creator id", MODIFY COLUMN `variable_list` json NULL COMMENT "JSON data for variable configuration", MODIFY COLUMN `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", MODIFY COLUMN `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", MODIFY COLUMN `version` varchar(255) NOT NULL COMMENT "Project version, empty represents draft status"; +-- Modify "workflow_draft" table +ALTER TABLE `opencoze`.`workflow_draft` COMMENT "Workflow canvas draft table, used to record the latest draft canvas information of workflow", MODIFY COLUMN `canvas` mediumtext NOT NULL COMMENT "Front end schema", MODIFY COLUMN `input_params` mediumtext NULL COMMENT "Input schema", MODIFY COLUMN `output_params` mediumtext NULL COMMENT "Output parameter schema", MODIFY COLUMN `test_run_success` bool NOT NULL DEFAULT 0 COMMENT "0 not running, 1 running successfully", MODIFY COLUMN `modified` bool NOT NULL DEFAULT 0 COMMENT "0 has not been modified, 1 has been modified", MODIFY COLUMN `updated_at` bigint unsigned NULL COMMENT "Update Time in Milliseconds", MODIFY COLUMN `deleted_at` datetime(3) NULL COMMENT "Delete Time"; +-- Modify "workflow_execution" table +ALTER TABLE `opencoze`.`workflow_execution` COMMENT "Workflow Execution Record Table, used to record the status of each workflow execution"; +-- Modify "workflow_meta" table +ALTER TABLE `opencoze`.`workflow_meta` COMMENT "The workflow metadata table,used to record the basic metadata of workflow", MODIFY COLUMN `status` tinyint unsigned NOT NULL COMMENT "0: Not published, 1: Published", MODIFY COLUMN `content_type` tinyint unsigned NOT NULL COMMENT "0 Users 1 Official", MODIFY COLUMN `author_id` bigint unsigned NOT NULL COMMENT "Original author user ID", MODIFY COLUMN `space_id` bigint unsigned NOT NULL COMMENT "space id", MODIFY COLUMN `updater_id` bigint unsigned NULL COMMENT "User ID for updating metadata", MODIFY COLUMN `source_id` bigint unsigned NULL COMMENT "Workflow ID of source", MODIFY COLUMN `app_id` bigint unsigned NULL COMMENT "app id"; +-- Modify "workflow_reference" table +ALTER TABLE `opencoze`.`workflow_reference` COMMENT "The workflow association table,used to record the direct mutual reference relationship between workflows", MODIFY COLUMN `deleted_at` datetime(3) NULL COMMENT "Delete Time"; +-- Modify "workflow_snapshot" table +ALTER TABLE `opencoze`.`workflow_snapshot` MODIFY COLUMN `created_at` bigint unsigned NOT NULL COMMENT "Create Time in Milliseconds"; +-- Modify "workflow_version" table +ALTER TABLE `opencoze`.`workflow_version` COMMENT "Workflow Canvas Version Information Table, used to record canvas information for different versions", MODIFY COLUMN `version` varchar(50) NOT NULL COMMENT "Published version", MODIFY COLUMN `version_description` varchar(2000) NOT NULL COMMENT "Version Description", MODIFY COLUMN `canvas` mediumtext NOT NULL COMMENT "Front end schema", MODIFY COLUMN `input_params` mediumtext NULL COMMENT "input params", MODIFY COLUMN `output_params` mediumtext NULL COMMENT "output params", MODIFY COLUMN `creator_id` bigint unsigned NOT NULL COMMENT "creator id", MODIFY COLUMN `created_at` bigint unsigned NOT NULL COMMENT "Create Time in Milliseconds", MODIFY COLUMN `deleted_at` datetime(3) NULL COMMENT "Delete Time"; diff --git a/docker/atlas/migrations/atlas.sum b/docker/atlas/migrations/atlas.sum index d7fcbcd8..269aa29f 100644 --- a/docker/atlas/migrations/atlas.sum +++ b/docker/atlas/migrations/atlas.sum @@ -1,4 +1,4 @@ -h1:6MVlbZNblz3Fs7fkT8xJhLsjCBfs8+PpnALEU+5WANo= +h1:NkRT9U8wV1wIRcHvkU2N3yjWDjvyi6avhjzgpMJdEtM= 20250703095335_initial.sql h1:/joaeUTMhXqAEc0KwsSve5+bYM0qPOp+9OizJtsRc+U= 20250703115304_update.sql h1:cbYo6Q6Lh96hB4hu5KW2Nn/Mr0VDpg7a1WPgpIb1SOc= 20250704040445_update.sql h1:QWmoPY//oQ+GFZwET9w/oAWa8mM0KVaD5G8Yiu9bMqY= @@ -6,3 +6,4 @@ h1:6MVlbZNblz3Fs7fkT8xJhLsjCBfs8+PpnALEU+5WANo= 20250710100212_update.sql h1:mN/3iKQDoIw2BTkMwWp3I/qOAcVGrQJ5tOJ0OqH4ZWU= 20250711034533_update.sql h1:EWeK//5urS9hJIRCeD3lwQYWNH9AIKEWG9pMLdw7KPc= 20250717125913_update.sql h1:WtPR99RlWZn0rXZsB19qp1hq0FwO5qmFhcTcV6EnFYs= +20250730131847_update.sql h1:qIutMrXtuOA98jeucTFxXck+sQNjNTtIF2apbCYt3IY= diff --git a/docker/atlas/opencoze_latest_schema.hcl b/docker/atlas/opencoze_latest_schema.hcl index bc71a9a8..95dae745 100644 --- a/docker/atlas/opencoze_latest_schema.hcl +++ b/docker/atlas/opencoze_latest_schema.hcl @@ -557,12 +557,12 @@ table "connector_workflow_version" { } table "conversation" { schema = schema.opencoze - comment = "会话信息表" + comment = "conversation info record" column "id" { null = false type = bigint unsigned = true - comment = "主键ID" + comment = "id" auto_increment = true } column "connector_id" { @@ -570,7 +570,7 @@ table "conversation" { type = bigint default = 0 unsigned = true - comment = "业务线 ID" + comment = "Publish Connector ID" } column "agent_id" { null = false @@ -582,26 +582,26 @@ table "conversation" { null = false type = tinyint default = 0 - comment = "会话场景" + comment = "conversation scene" } column "section_id" { null = false type = bigint default = 0 unsigned = true - comment = "最新section_id" + comment = "section_id" } column "creator_id" { null = true type = bigint default = 0 unsigned = true - comment = "创建者id" + comment = "creator_id" } column "ext" { null = true type = text - comment = "扩展字段" + comment = "ext" } column "status" { null = false @@ -614,14 +614,14 @@ table "conversation" { type = bigint default = 0 unsigned = true - comment = "创建时间" + comment = "Create Time in Milliseconds" } column "updated_at" { null = false type = bigint default = 0 unsigned = true - comment = "更新时间" + comment = "Update Time in Milliseconds" } primary_key { columns = [column.id] @@ -632,104 +632,104 @@ table "conversation" { } table "data_copy_task" { schema = schema.opencoze - comment = "data方向复制任务记录表" + comment = "data copy task record" collate = "utf8mb4_general_ci" column "master_task_id" { - null = false + null = true type = varchar(128) default = "" - comment = "复制任务ID" + comment = "task id" } column "origin_data_id" { null = false type = bigint default = 0 unsigned = true - comment = "源id" + comment = "origin data id" } column "target_data_id" { null = false type = bigint default = 0 unsigned = true - comment = "目标id" + comment = "target data id" } column "origin_space_id" { null = false type = bigint default = 0 unsigned = true - comment = "源团队空间" + comment = "origin space id" } column "target_space_id" { null = false type = bigint default = 0 unsigned = true - comment = "目标团队空间" + comment = "target space id" } column "origin_user_id" { null = false type = bigint default = 0 unsigned = true - comment = "源用户ID" + comment = "origin user id" } column "target_user_id" { - null = false + null = true type = bigint default = 0 unsigned = true - comment = "目标用户ID" + comment = "target user id" } column "origin_app_id" { null = false type = bigint default = 0 unsigned = true - comment = "源AppID" + comment = "origin app id" } column "target_app_id" { null = false type = bigint default = 0 unsigned = true - comment = "目标AppID" + comment = "target app id" } column "data_type" { null = false type = tinyint default = 0 unsigned = true - comment = "数据类型 1:knowledge, 2:database" + comment = "data type 1:knowledge, 2:database" } column "ext_info" { null = false type = varchar(255) default = "" - comment = "存储额外信息" + comment = "ext" } column "start_time" { - null = false + null = true type = bigint default = 0 - comment = "任务开始时间" + comment = "task start time" } column "finish_time" { null = true type = bigint - comment = "任务结束时间" + comment = "task finish time" } column "status" { null = false type = tinyint default = 1 - comment = "1:创建 2:执行中 3:成功 4:失败" + comment = "1: Create 2: Running 3: Success 4: Failure" } column "error_msg" { null = true type = varchar(128) - comment = "错误信息" + comment = "error msg" } column "id" { null = false @@ -851,38 +851,38 @@ table "draft_database_info" { } table "knowledge" { schema = schema.opencoze - comment = "知识库表" + comment = "knowledge tabke" column "id" { null = false type = bigint unsigned = true - comment = "主键ID" + comment = "id" } column "name" { null = false type = varchar(150) default = "" - comment = "名称" + comment = "knowledge's name" } column "app_id" { null = false type = bigint default = 0 - comment = "项目ID,标识该资源是否是项目独有" + comment = "app id" } column "creator_id" { null = false type = bigint default = 0 unsigned = true - comment = "ID" + comment = "creator id" } column "space_id" { null = false type = bigint default = 0 unsigned = true - comment = "空间ID" + comment = "space id" } column "created_at" { null = false @@ -901,29 +901,29 @@ table "knowledge" { column "deleted_at" { null = true type = datetime(3) - comment = "Delete Time in Milliseconds" + comment = "Delete Time" } column "status" { null = false type = tinyint default = 1 - comment = "0 初始化, 1 生效 2 失效" + comment = "0 initialization, 1 effective, 2 invalid" } column "description" { null = true type = text - comment = "描述" + comment = "description" } column "icon_uri" { null = true type = varchar(150) - comment = "头像uri" + comment = "icon uri" } column "format_type" { null = false type = tinyint default = 0 - comment = "0:文本 1:表格 2:图片" + comment = "0: Text 1: Table 2: Images" } primary_key { columns = [column.id] @@ -940,76 +940,76 @@ table "knowledge" { } table "knowledge_document" { schema = schema.opencoze - comment = "知识库文档表" + comment = "knowledge document info" column "id" { null = false type = bigint unsigned = true - comment = "主键ID" + comment = "id" } column "knowledge_id" { null = false type = bigint default = 0 unsigned = true - comment = "所属knowledge的ID" + comment = "knowledge id" } column "name" { null = false type = varchar(150) default = "" - comment = "文档名称" + comment = "document name" } column "file_extension" { null = false type = varchar(20) default = "0" - comment = "文档类型, txt/pdf/csv/..." + comment = "Document type, txt/pdf/csv etc.." } column "document_type" { null = false type = int default = 0 - comment = "文档类型: 0:文本 1:表格 2:图片" + comment = "Document type: 0: Text 1: Table 2: Image" } column "uri" { null = true type = text - comment = "资源uri" + comment = "uri" } column "size" { null = false type = bigint default = 0 unsigned = true - comment = "文档大小" + comment = "document size" } column "slice_count" { null = false type = bigint default = 0 unsigned = true - comment = "分片数量" + comment = "slice count" } column "char_count" { null = false type = bigint default = 0 unsigned = true - comment = "字符数" + comment = "number of characters" } column "creator_id" { null = false type = bigint default = 0 unsigned = true - comment = "创建者ID" + comment = "creator id" } column "space_id" { null = false type = bigint default = 0 - comment = "空间id" + comment = "space id" } column "created_at" { null = false @@ -1028,34 +1028,34 @@ table "knowledge_document" { column "deleted_at" { null = true type = datetime(3) - comment = "Delete Time in Milliseconds" + comment = "Delete Time" } column "source_type" { - null = false + null = true type = int default = 0 - comment = "0:本地文件上传, 2:自定义文本" + comment = "0: Local file upload, 2: Custom text, 103: Feishu 104: Lark" } column "status" { null = false type = int default = 0 - comment = "状态" + comment = "status" } column "fail_reason" { null = true type = text - comment = "失败原因" + comment = "fail reason" } column "parse_rule" { null = true type = json - comment = "解析+切片规则" + comment = "parse rule" } column "table_info" { null = true type = json - comment = "表格信息" + comment = "table info" } primary_key { columns = [column.id] @@ -1069,13 +1069,13 @@ table "knowledge_document" { } table "knowledge_document_review" { schema = schema.opencoze - comment = "文档审阅表" + comment = "Document slice preview info" column "id" { null = false type = bigint default = 0 unsigned = true - comment = "主键ID" + comment = "id" } column "knowledge_id" { null = false @@ -1088,48 +1088,48 @@ table "knowledge_document_review" { null = false type = bigint default = 0 - comment = "空间id" + comment = "space id" } column "name" { null = false type = varchar(150) default = "" - comment = "文档名称" + comment = "name" } column "type" { null = false type = varchar(10) default = "0" - comment = "文档类型" + comment = "document type" } column "uri" { null = true type = text - comment = "资源标识" + comment = "uri" } column "format_type" { null = false type = tinyint default = 0 unsigned = true - comment = "0 文本, 1 表格, 2 图片" + comment = "0 text, 1 table, 2 images" } column "status" { null = false type = tinyint default = 0 unsigned = true - comment = "0 处理中,1 已完成,2 失败,3 失效" + comment = "0 Processing 1 Completed 2 Failed 3 Expired" } column "chunk_resp_uri" { null = true type = text - comment = "预切片tos资源标识" + comment = "pre-sliced uri" } column "deleted_at" { null = true type = datetime(3) - comment = "Delete Time in Milliseconds" + comment = "Delete Time" } column "created_at" { null = false @@ -1149,7 +1149,7 @@ table "knowledge_document_review" { null = false type = bigint default = 0 - comment = "创建者ID" + comment = "creator id" } primary_key { columns = [column.id] @@ -1166,13 +1166,13 @@ table "knowledge_document_review" { } table "knowledge_document_slice" { schema = schema.opencoze - comment = "知识库文件切片表" + comment = "knowledge document slice" column "id" { null = false type = bigint default = 0 unsigned = true - comment = "主键ID" + comment = "id" } column "knowledge_id" { null = false @@ -1186,18 +1186,18 @@ table "knowledge_document_slice" { type = bigint default = 0 unsigned = true - comment = "document id" + comment = "document_id" } column "content" { null = true type = text - comment = "切片内容" + comment = "content" } column "sequence" { null = false type = decimal(20,5) unsigned = false - comment = "切片顺序号, 从1开始" + comment = "slice sequence number, starting from 1" } column "created_at" { null = false @@ -1216,37 +1216,37 @@ table "knowledge_document_slice" { column "deleted_at" { null = true type = datetime(3) - comment = "Delete Time in Milliseconds" + comment = "Delete Time" } column "creator_id" { null = false type = bigint default = 0 - comment = "创建者ID" + comment = "creator id" } column "space_id" { null = false type = bigint default = 0 - comment = "空间ID" + comment = "space id" } column "status" { null = false type = int default = 0 - comment = "状态" + comment = "status" } column "fail_reason" { null = true type = text - comment = "失败原因" + comment = "fail reason" } column "hit" { null = false type = bigint default = 0 unsigned = true - comment = "命中次数" + comment = "hit counts " } primary_key { columns = [column.id] @@ -1263,12 +1263,12 @@ table "knowledge_document_slice" { } table "message" { schema = schema.opencoze - comment = "消息表" + comment = "message record" column "id" { null = false type = bigint unsigned = true - comment = "主键ID" + comment = "id" auto_increment = true } column "run_id" { @@ -1276,7 +1276,7 @@ table "message" { type = bigint default = 0 unsigned = true - comment = "对应的run_id" + comment = "run_id" } column "conversation_id" { null = false @@ -1302,69 +1302,69 @@ table "message" { null = false type = varchar(100) default = "" - comment = "角色: user、assistant、system" + comment = "role: user、assistant、system" } column "content_type" { null = false type = varchar(100) default = "" - comment = "内容类型 1 text" + comment = "content type 1 text" } column "content" { null = true type = mediumtext - comment = "内容" + comment = "content" } column "message_type" { null = false type = varchar(100) default = "" - comment = "消息类型:" + comment = "message_type" } column "display_content" { null = true type = text - comment = "展示内容" + comment = "display content" } column "ext" { null = true type = text - comment = "message 扩展字段" + comment = "message ext" collate = "utf8mb4_general_ci" } column "section_id" { null = true type = bigint unsigned = true - comment = "段落id" + comment = "section_id" } column "broken_position" { null = true type = int default = -1 - comment = "打断位置" + comment = "broken position" } column "status" { null = false type = tinyint default = 0 unsigned = true - comment = "消息状态 1 Available 2 Deleted 3 Replaced 4 Broken 5 Failed 6 Streaming 7 Pending" + comment = "message status: 1 Available 2 Deleted 3 Replaced 4 Broken 5 Failed 6 Streaming 7 Pending" } column "model_content" { null = true type = mediumtext - comment = "模型输入内容" + comment = "model content" } column "meta_info" { null = true type = text - comment = "引用、高亮等文本标记信息" + comment = "text tagging information such as citation and highlighting" } column "reasoning_content" { null = true type = text - comment = "思考内容" + comment = "reasoning content" collate = "utf8mb4_general_ci" } column "created_at" { @@ -1372,14 +1372,14 @@ table "message" { type = bigint default = 0 unsigned = true - comment = "创建时间" + comment = "Create Time in Milliseconds" } column "updated_at" { null = false type = bigint default = 0 unsigned = true - comment = "更新时间" + comment = "Update Time in Milliseconds" } primary_key { columns = [column.id] @@ -1393,45 +1393,45 @@ table "message" { } table "model_entity" { schema = schema.opencoze - comment = "模型信息" + comment = "Model information" column "id" { null = false type = bigint unsigned = true - comment = "主键ID" + comment = "id" } column "meta_id" { null = false type = bigint unsigned = true - comment = "模型元信息 id" + comment = "model metadata id" } column "name" { null = false type = varchar(128) - comment = "名称" + comment = "name" } column "description" { null = true type = text - comment = "描述" + comment = "description" } column "default_params" { null = true type = json - comment = "默认参数" + comment = "default params" } column "scenario" { null = false type = bigint unsigned = true - comment = "模型应用场景" + comment = "scenario" } column "status" { null = false type = int default = 1 - comment = "模型状态" + comment = "model status" } column "created_at" { null = false @@ -1451,7 +1451,7 @@ table "model_entity" { null = true type = bigint unsigned = true - comment = "Delete Time in Milliseconds" + comment = "Delete Time" } primary_key { columns = [column.id] @@ -1465,22 +1465,22 @@ table "model_entity" { } table "model_meta" { schema = schema.opencoze - comment = "模型元信息" + comment = "Model metadata" column "id" { null = false type = bigint unsigned = true - comment = "主键ID" + comment = "id" } column "model_name" { null = false type = varchar(128) - comment = "模型名称" + comment = "model name" } column "protocol" { null = false type = varchar(128) - comment = "模型协议" + comment = "model protocol" } column "icon_uri" { null = false @@ -1491,24 +1491,24 @@ table "model_meta" { column "capability" { null = true type = json - comment = "模型能力" + comment = "capability" } column "conn_config" { null = true type = json - comment = "模型连接配置" + comment = "model conn config" } column "status" { null = false type = int default = 1 - comment = "模型状态" + comment = "model status" } column "description" { null = false type = varchar(2048) default = "" - comment = "模型描述" + comment = "description" } column "created_at" { null = false @@ -1528,7 +1528,7 @@ table "model_meta" { null = true type = bigint unsigned = true - comment = "Delete Time in Milliseconds" + comment = "Delete Time" } column "icon_url" { null = false @@ -1545,7 +1545,7 @@ table "model_meta" { } table "node_execution" { schema = schema.opencoze - comment = "node 节点运行记录,用于记录每次workflow执行时,每个节点的状态信息" + comment = "Node run record, used to record the status information of each node during each workflow execution" collate = "utf8mb4_0900_ai_ci" column "id" { null = false @@ -2165,52 +2165,52 @@ table "prompt_resource" { null = false type = bigint unsigned = true - comment = "主键ID" + comment = "id" auto_increment = true } column "space_id" { null = false type = bigint - comment = "空间ID" + comment = "space id" } column "name" { null = false type = varchar(255) - comment = "名称" + comment = "name" } column "description" { null = false type = varchar(255) - comment = "描述" + comment = "description" } column "prompt_text" { null = true type = mediumtext - comment = "prompt正文" + comment = "prompt text" } column "status" { null = false type = int - comment = "状态,0无效,1有效" + comment = "status, 0 is invalid, 1 is valid" } column "creator_id" { null = false type = bigint - comment = "创建者ID" + comment = "creator id" } column "created_at" { null = false type = bigint default = 0 unsigned = true - comment = "创建时间" + comment = "Create Time in Milliseconds" } column "updated_at" { null = false type = bigint default = 0 unsigned = true - comment = "更新时间" + comment = "Update Time in Milliseconds" } primary_key { columns = [column.id] @@ -2221,19 +2221,19 @@ table "prompt_resource" { } table "run_record" { schema = schema.opencoze - comment = "执行记录表" + comment = "run record" column "id" { null = false type = bigint unsigned = true - comment = "主键ID" + comment = "id" } column "conversation_id" { null = false type = bigint default = 0 unsigned = true - comment = "会话 ID" + comment = "conversation id" } column "section_id" { null = false @@ -2260,40 +2260,40 @@ table "run_record" { type = tinyint default = 0 unsigned = true - comment = "执行来源 0 API," + comment = "Execute source 0 API" } column "status" { null = false type = varchar(255) default = "" - comment = "状态,0 Unknown, 1-Created,2-InProgress,3-Completed,4-Failed,5-Expired,6-Cancelled,7-RequiresAction" + comment = "status,0 Unknown, 1-Created,2-InProgress,3-Completed,4-Failed,5-Expired,6-Cancelled,7-RequiresAction" } column "creator_id" { null = false type = bigint default = 0 - comment = "创建者标识" + comment = "creator id" } column "created_at" { null = false type = bigint default = 0 unsigned = true - comment = "创建时间" + comment = "Create Time in Milliseconds" } column "updated_at" { null = false type = bigint default = 0 unsigned = true - comment = "更新时间" + comment = "Update Time in Milliseconds" } column "failed_at" { null = false type = bigint default = 0 unsigned = true - comment = "失败时间" + comment = "Fail Time in Milliseconds" } column "last_error" { null = true @@ -2306,18 +2306,18 @@ table "run_record" { type = bigint default = 0 unsigned = true - comment = "结束时间" + comment = "Finish Time in Milliseconds" } column "chat_request" { null = true type = text - comment = "保存原始请求的部分字段" + comment = "Original request field" collate = "utf8mb4_general_ci" } column "ext" { null = true type = text - comment = "扩展字段" + comment = "ext" collate = "utf8mb4_general_ci" } column "usage" { @@ -2334,13 +2334,13 @@ table "run_record" { } table "shortcut_command" { schema = schema.opencoze - comment = "bot快捷指令表" + comment = "bot shortcut command table" collate = "utf8mb4_general_ci" column "id" { null = false type = bigint unsigned = true - comment = "主键ID" + comment = "id" auto_increment = true } column "object_id" { @@ -2348,131 +2348,131 @@ table "shortcut_command" { type = bigint default = 0 unsigned = true - comment = "实体ID,该实体可用这个指令" + comment = "Entity ID, this command can be used for this entity" } column "command_id" { null = false type = bigint default = 0 unsigned = true - comment = "命令ID" + comment = "command id" } column "command_name" { null = false type = varchar(255) default = "" - comment = "命令名称" + comment = "command name" } column "shortcut_command" { null = false type = varchar(255) default = "" - comment = "快捷指令" + comment = "shortcut command" } column "description" { null = false type = varchar(2000) default = "" - comment = "命令描述" + comment = "description" } column "send_type" { null = false type = tinyint default = 0 unsigned = true - comment = "发送类型 0:query 1:panel" + comment = "send type 0:query 1:panel" } column "tool_type" { null = false type = tinyint default = 0 unsigned = true - comment = "使用工具的type 1:workFlow 2:插件" + comment = "Type 1 of tool used: WorkFlow 2: Plugin" } column "work_flow_id" { null = false type = bigint default = 0 unsigned = true - comment = "使用workFlow的id" + comment = "workflow id" } column "plugin_id" { null = false type = bigint default = 0 unsigned = true - comment = "使用插件的id" + comment = "plugin id" } column "plugin_tool_name" { null = false type = varchar(255) default = "" - comment = "使用插件的api_name" + comment = "plugin tool name" } column "template_query" { null = true type = text - comment = "query模板" + comment = "template query" } column "components" { null = true type = json - comment = "panel参数" + comment = "Panel parameters" } column "card_schema" { null = true type = text - comment = "卡片schema" + comment = "card schema" } column "tool_info" { null = true type = json - comment = "工具信息 包含name+变量列表" + comment = "Tool information includes name+variable list" } column "status" { null = false type = tinyint default = 0 unsigned = true - comment = "状态,0无效,1有效" + comment = "Status, 0 is invalid, 1 is valid" } column "creator_id" { null = true type = bigint default = 0 unsigned = true - comment = "创建者ID" + comment = "creator id" } column "is_online" { null = false type = tinyint default = 0 unsigned = true - comment = "是否为线上信息 0草稿 1线上" + comment = "Is online information: 0 draft 1 online" } column "created_at" { null = false type = bigint default = 0 - comment = "创建时间" + comment = "Create Time in Milliseconds" } column "updated_at" { null = false type = bigint default = 0 - comment = "更新时间" + comment = "Update Time in Milliseconds" } column "agent_id" { null = false type = bigint default = 0 unsigned = true - comment = "multi的指令时,该指令由哪个节点执行" + comment = "When executing a multi instruction, which node executes the instruction" } column "shortcut_icon" { null = true type = json - comment = "快捷指令图标" + comment = "shortcut icon" } column "plugin_tool_id" { null = false @@ -2555,7 +2555,7 @@ table "single_agent_draft" { column "variables_meta_id" { null = true type = bigint - comment = "variables meta 表 ID" + comment = "variables meta table ID" } column "model_info" { null = true @@ -2625,12 +2625,12 @@ table "single_agent_draft" { } table "single_agent_publish" { schema = schema.opencoze - comment = "bot 渠道和发布版本流水表" + comment = "Bot connector and release version info" column "id" { null = false type = bigint unsigned = true - comment = "主键id" + comment = "id" auto_increment = true } column "agent_id" { @@ -2644,13 +2644,13 @@ table "single_agent_publish" { null = false type = varchar(50) default = "" - comment = "发布 id" + comment = "publish id" collate = "utf8mb4_general_ci" } column "connector_ids" { null = true type = json - comment = "发布的 connector_ids" + comment = "connector_ids" } column "version" { null = false @@ -2661,7 +2661,7 @@ table "single_agent_publish" { column "publish_info" { null = true type = text - comment = "发布信息" + comment = "publish info" collate = "utf8mb4_general_ci" } column "publish_time" { @@ -2669,7 +2669,7 @@ table "single_agent_publish" { type = bigint default = 0 unsigned = true - comment = "发布时间" + comment = "publish time" } column "created_at" { null = false @@ -2690,18 +2690,18 @@ table "single_agent_publish" { type = bigint default = 0 unsigned = true - comment = "发布人 user_id" + comment = "creator id" } column "status" { null = false type = tinyint default = 0 - comment = "状态 0:使用中 1:删除 3:禁用" + comment = "Status 0: In use 1: Delete 3: Disabled" } column "extra" { null = true type = json - comment = "扩展字段" + comment = "extra" } primary_key { columns = [column.id] @@ -2783,7 +2783,7 @@ table "single_agent_version" { column "variables_meta_id" { null = true type = bigint - comment = "variables meta 表 ID" + comment = "variables meta table ID" } column "model_info" { null = true @@ -3387,7 +3387,7 @@ table "variable_instance" { type = bigint default = 0 unsigned = true - comment = "主键ID" + comment = "id" } column "biz_type" { null = false @@ -3404,46 +3404,46 @@ table "variable_instance" { column "version" { null = false type = varchar(255) - comment = "agent or project 版本,为空代表草稿态" + comment = "agent or project version empty represents draft status" } column "keyword" { null = false type = varchar(255) - comment = "记忆的KEY" + comment = "Keyword to Memory" } column "type" { null = false type = tinyint - comment = "记忆类型 1 KV 2 list" + comment = "Memory type 1 KV 2 list" } column "content" { null = true type = text - comment = "记忆内容" + comment = "content" } column "connector_uid" { null = false type = varchar(255) - comment = "二方用户ID" + comment = "connector_uid" } column "connector_id" { null = false type = bigint - comment = "二方id, e.g. coze = 10000010" + comment = "connector_id, e.g. coze = 10000010" } column "created_at" { null = false type = bigint default = 0 unsigned = true - comment = "创建时间" + comment = "Create Time in Milliseconds" } column "updated_at" { null = false type = bigint default = 0 unsigned = true - comment = "更新时间" + comment = "Update Time in Milliseconds" } primary_key { columns = [column.id] @@ -3461,13 +3461,13 @@ table "variables_meta" { type = bigint default = 0 unsigned = true - comment = "主键ID" + comment = "id" } column "creator_id" { null = false type = bigint unsigned = true - comment = "创建者ID" + comment = "creator id" } column "biz_type" { null = false @@ -3484,26 +3484,26 @@ table "variables_meta" { column "variable_list" { null = true type = json - comment = "变量配置的json数据" + comment = "JSON data for variable configuration" } column "created_at" { null = false type = bigint default = 0 unsigned = true - comment = "create time" + comment = "Create Time in Milliseconds" } column "updated_at" { null = false type = bigint default = 0 unsigned = true - comment = "update time" + comment = "Update Time in Milliseconds" } column "version" { null = false type = varchar(255) - comment = "project版本,为空代表草稿态" + comment = "Project version, empty represents draft status" } primary_key { columns = [column.id] @@ -3518,7 +3518,7 @@ table "variables_meta" { } table "workflow_draft" { schema = schema.opencoze - comment = "workflow 画布草稿表,用于记录workflow最新的草稿画布信息" + comment = "Workflow canvas draft table, used to record the latest draft canvas information of workflow" column "id" { null = false type = bigint @@ -3528,38 +3528,40 @@ table "workflow_draft" { column "canvas" { null = false type = mediumtext - comment = "前端 schema" + comment = "Front end schema" } column "input_params" { null = true type = mediumtext - comment = " 入参 schema" + comment = "Input schema" } column "output_params" { null = true type = mediumtext - comment = " 出参 schema" + comment = "Output parameter schema" } column "test_run_success" { null = false type = bool default = 0 - comment = "0 未运行, 1 运行成功" + comment = "0 not running, 1 running successfully" } column "modified" { null = false type = bool default = 0 - comment = "0 未被修改, 1 已被修改" + comment = "0 has not been modified, 1 has been modified" } column "updated_at" { null = true type = bigint unsigned = true + comment = "Update Time in Milliseconds" } column "deleted_at" { - null = true - type = datetime(3) + null = true + type = datetime(3) + comment = "Delete Time" } column "commit_id" { null = false @@ -3578,7 +3580,7 @@ table "workflow_draft" { } table "workflow_execution" { schema = schema.opencoze - comment = "workflow 执行记录表,用于记录每次workflow执行时的状态" + comment = "Workflow Execution Record Table, used to record the status of each workflow execution" column "id" { null = false type = bigint @@ -3741,7 +3743,7 @@ table "workflow_execution" { } table "workflow_meta" { schema = schema.opencoze - comment = "workflow 元信息表,用于记录workflow基本的元信息" + comment = "The workflow metadata table,used to record the basic metadata of workflow" column "id" { null = false type = bigint @@ -3767,13 +3769,13 @@ table "workflow_meta" { null = false type = tinyint unsigned = true - comment = "0:未发布过, 1:已发布过" + comment = "0: Not published, 1: Published" } column "content_type" { null = false type = tinyint unsigned = true - comment = "0用户 1官方" + comment = "0 Users 1 Official" } column "mode" { null = false @@ -3814,31 +3816,31 @@ table "workflow_meta" { null = false type = bigint unsigned = true - comment = "原作者用户 ID" + comment = "Original author user ID" } column "space_id" { null = false type = bigint unsigned = true - comment = " 空间 ID" + comment = "space id" } column "updater_id" { null = true type = bigint unsigned = true - comment = " 更新元信息的用户 ID" + comment = "User ID for updating metadata" } column "source_id" { null = true type = bigint unsigned = true - comment = " 复制来源的 workflow ID" + comment = "Workflow ID of source" } column "app_id" { null = true type = bigint unsigned = true - comment = "应用 ID" + comment = "app id" } column "latest_version" { null = true @@ -3869,7 +3871,7 @@ table "workflow_meta" { } table "workflow_reference" { schema = schema.opencoze - comment = "workflow 关联关系表,用于记录workflow 直接互相引用关系" + comment = "The workflow association table,used to record the direct mutual reference relationship between workflows" column "id" { null = false type = bigint @@ -3913,8 +3915,9 @@ table "workflow_reference" { comment = "whether this reference currently takes effect. 0: disabled 1: enabled" } column "deleted_at" { - null = true - type = datetime(3) + null = true + type = datetime(3) + comment = "Delete Time" } primary_key { columns = [column.id] @@ -3963,6 +3966,7 @@ table "workflow_snapshot" { null = false type = bigint unsigned = true + comment = "Create Time in Milliseconds" } column "id" { null = false @@ -3981,7 +3985,7 @@ table "workflow_snapshot" { } table "workflow_version" { schema = schema.opencoze - comment = "workflow 画布版本信息表,用于记录不同版本的画布信息" + comment = "Workflow Canvas Version Information Table, used to record canvas information for different versions" column "id" { null = false type = bigint @@ -3998,42 +4002,44 @@ table "workflow_version" { column "version" { null = false type = varchar(50) - comment = "发布版本" + comment = "Published version" } column "version_description" { null = false type = varchar(2000) - comment = "版本描述" + comment = "Version Description" } column "canvas" { null = false type = mediumtext - comment = "前端 schema" + comment = "Front end schema" } column "input_params" { - null = true - type = mediumtext + null = true + type = mediumtext + comment = "input params" } column "output_params" { - null = true - type = mediumtext + null = true + type = mediumtext + comment = "output params" } column "creator_id" { null = false type = bigint unsigned = true - comment = "发布用户 ID" + comment = "creator id" } column "created_at" { null = false type = bigint unsigned = true - comment = "创建时间毫秒时间戳" + comment = "Create Time in Milliseconds" } column "deleted_at" { null = true type = datetime(3) - comment = "删除毫秒时间戳" + comment = "Delete Time" } column "commit_id" { null = false diff --git a/docker/volumes/mysql/schema.sql b/docker/volumes/mysql/schema.sql index 5d4fdc50..e3b73a0d 100755 --- a/docker/volumes/mysql/schema.sql +++ b/docker/volumes/mysql/schema.sql @@ -17,27 +17,27 @@ CREATE TABLE IF NOT EXISTS `app_release_record` (`id` bigint unsigned NOT NULL D -- Create "connector_workflow_version" table CREATE TABLE IF NOT EXISTS `connector_workflow_version` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "id", `app_id` bigint unsigned NOT NULL COMMENT "app id", `connector_id` bigint unsigned NOT NULL COMMENT "connector id", `workflow_id` bigint unsigned NOT NULL COMMENT "workflow id", `version` varchar(256) NOT NULL COMMENT "version", `created_at` bigint unsigned NOT NULL COMMENT "create time in millisecond", PRIMARY KEY (`id`), INDEX `idx_connector_id_workflow_id_create_at` (`connector_id`, `workflow_id`, `created_at`), UNIQUE INDEX `idx_connector_id_workflow_id_version` (`connector_id`, `workflow_id`, `version`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci; -- Create "conversation" table -CREATE TABLE IF NOT EXISTS `conversation` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "主键ID", `connector_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "业务线 ID", `agent_id` bigint NOT NULL DEFAULT 0 COMMENT "agent_id", `scene` tinyint NOT NULL DEFAULT 0 COMMENT "会话场景", `section_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "最新section_id", `creator_id` bigint unsigned NULL DEFAULT 0 COMMENT "创建者id", `ext` text NULL COMMENT "扩展字段", `status` tinyint NOT NULL DEFAULT 1 COMMENT "status: 1-normal 2-deleted", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "创建时间", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "更新时间", PRIMARY KEY (`id`), INDEX `idx_connector_bot_status` (`connector_id`, `agent_id`, `creator_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "会话信息表"; +CREATE TABLE IF NOT EXISTS `conversation` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "id", `connector_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Publish Connector ID", `agent_id` bigint NOT NULL DEFAULT 0 COMMENT "agent_id", `scene` tinyint NOT NULL DEFAULT 0 COMMENT "conversation scene", `section_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "section_id", `creator_id` bigint unsigned NULL DEFAULT 0 COMMENT "creator_id", `ext` text NULL COMMENT "ext", `status` tinyint NOT NULL DEFAULT 1 COMMENT "status: 1-normal 2-deleted", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", PRIMARY KEY (`id`), INDEX `idx_connector_bot_status` (`connector_id`, `agent_id`, `creator_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "conversation info record" AUTO_INCREMENT 7532101736270397441; -- Create "data_copy_task" table -CREATE TABLE IF NOT EXISTS `data_copy_task` (`master_task_id` varchar(128) NOT NULL DEFAULT "" COMMENT "复制任务ID", `origin_data_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "源id", `target_data_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "目标id", `origin_space_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "源团队空间", `target_space_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "目标团队空间", `origin_user_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "源用户ID", `target_user_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "目标用户ID", `origin_app_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "源AppID", `target_app_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "目标AppID", `data_type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "数据类型 1:knowledge, 2:database", `ext_info` varchar(255) NOT NULL DEFAULT "" COMMENT "存储额外信息", `start_time` bigint NOT NULL DEFAULT 0 COMMENT "任务开始时间", `finish_time` bigint NULL COMMENT "任务结束时间", `status` tinyint NOT NULL DEFAULT 1 COMMENT "1:创建 2:执行中 3:成功 4:失败", `error_msg` varchar(128) NULL COMMENT "错误信息", `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "ID", PRIMARY KEY (`id`), UNIQUE INDEX `uniq_master_task_id_origin_data_id_data_type` (`master_task_id`, `origin_data_id`, `data_type`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_general_ci COMMENT "data方向复制任务记录表"; +CREATE TABLE IF NOT EXISTS `data_copy_task` (`master_task_id` varchar(128) NULL DEFAULT "" COMMENT "task id", `origin_data_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "origin data id", `target_data_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "target data id", `origin_space_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "origin space id", `target_space_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "target space id", `origin_user_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "origin user id", `target_user_id` bigint unsigned NULL DEFAULT 0 COMMENT "target user id", `origin_app_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "origin app id", `target_app_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "target app id", `data_type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "data type 1:knowledge, 2:database", `ext_info` varchar(255) NOT NULL DEFAULT "" COMMENT "ext", `start_time` bigint NULL DEFAULT 0 COMMENT "task start time", `finish_time` bigint NULL COMMENT "task finish time", `status` tinyint NOT NULL DEFAULT 1 COMMENT "1: Create 2: Running 3: Success 4: Failure", `error_msg` varchar(128) NULL COMMENT "error msg", `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "ID", PRIMARY KEY (`id`), UNIQUE INDEX `uniq_master_task_id_origin_data_id_data_type` (`master_task_id`, `origin_data_id`, `data_type`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_general_ci COMMENT "data copy task record"; -- Create "draft_database_info" table CREATE TABLE IF NOT EXISTS `draft_database_info` (`id` bigint unsigned NOT NULL COMMENT "ID", `app_id` bigint unsigned NULL COMMENT "App ID", `space_id` bigint unsigned NOT NULL COMMENT "Space ID", `related_online_id` bigint unsigned NOT NULL COMMENT "The primary key ID of online_database_info table", `is_visible` tinyint NOT NULL DEFAULT 1 COMMENT "Visibility: 0 invisible, 1 visible", `prompt_disabled` tinyint NOT NULL DEFAULT 0 COMMENT "Support prompt calls: 1 not supported, 0 supported", `table_name` varchar(255) NOT NULL COMMENT "Table name", `table_desc` varchar(256) NULL COMMENT "Table description", `table_field` text NULL COMMENT "Table field info", `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "Creator ID", `icon_uri` varchar(255) NOT NULL COMMENT "Icon Uri", `physical_table_name` varchar(255) NULL COMMENT "The name of the real physical table", `rw_mode` bigint NOT NULL DEFAULT 1 COMMENT "Read and write permission modes: 1. Limited read and write mode 2. Read-only mode 3. Full read and write mode", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` datetime NULL COMMENT "Delete Time", PRIMARY KEY (`id`), INDEX `idx_space_app_creator_deleted` (`space_id`, `app_id`, `creator_id`, `deleted_at`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_general_ci COMMENT "draft database info"; -- Create "knowledge" table -CREATE TABLE IF NOT EXISTS `knowledge` (`id` bigint unsigned NOT NULL COMMENT "主键ID", `name` varchar(150) NOT NULL DEFAULT "" COMMENT "名称", `app_id` bigint NOT NULL DEFAULT 0 COMMENT "项目ID,标识该资源是否是项目独有", `creator_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "ID", `space_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "空间ID", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` datetime(3) NULL COMMENT "Delete Time in Milliseconds", `status` tinyint NOT NULL DEFAULT 1 COMMENT "0 初始化, 1 生效 2 失效", `description` text NULL COMMENT "描述", `icon_uri` varchar(150) NULL COMMENT "头像uri", `format_type` tinyint NOT NULL DEFAULT 0 COMMENT "0:文本 1:表格 2:图片", PRIMARY KEY (`id`), INDEX `idx_app_id` (`app_id`), INDEX `idx_creator_id` (`creator_id`), INDEX `idx_space_id_deleted_at_updated_at` (`space_id`, `deleted_at`, `updated_at`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "知识库表"; +CREATE TABLE IF NOT EXISTS `knowledge` (`id` bigint unsigned NOT NULL COMMENT "id", `name` varchar(150) NOT NULL DEFAULT "" COMMENT "knowledge's name", `app_id` bigint NOT NULL DEFAULT 0 COMMENT "app id", `creator_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "creator id", `space_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "space id", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` datetime(3) NULL COMMENT "Delete Time", `status` tinyint NOT NULL DEFAULT 1 COMMENT "0 initialization, 1 effective, 2 invalid", `description` text NULL COMMENT "description", `icon_uri` varchar(150) NULL COMMENT "icon uri", `format_type` tinyint NOT NULL DEFAULT 0 COMMENT "0: Text 1: Table 2: Images", PRIMARY KEY (`id`), INDEX `idx_app_id` (`app_id`), INDEX `idx_creator_id` (`creator_id`), INDEX `idx_space_id_deleted_at_updated_at` (`space_id`, `deleted_at`, `updated_at`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "knowledge tabke"; -- Create "knowledge_document" table -CREATE TABLE IF NOT EXISTS `knowledge_document` (`id` bigint unsigned NOT NULL COMMENT "主键ID", `knowledge_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "所属knowledge的ID", `name` varchar(150) NOT NULL DEFAULT "" COMMENT "文档名称", `file_extension` varchar(20) NOT NULL DEFAULT "0" COMMENT "文档类型, txt/pdf/csv/...", `document_type` int NOT NULL DEFAULT 0 COMMENT "文档类型: 0:文本 1:表格 2:图片", `uri` text NULL COMMENT "资源uri", `size` bigint unsigned NOT NULL DEFAULT 0 COMMENT "文档大小", `slice_count` bigint unsigned NOT NULL DEFAULT 0 COMMENT "分片数量", `char_count` bigint unsigned NOT NULL DEFAULT 0 COMMENT "字符数", `creator_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "创建者ID", `space_id` bigint NOT NULL DEFAULT 0 COMMENT "空间id", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` datetime(3) NULL COMMENT "Delete Time in Milliseconds", `source_type` int NOT NULL DEFAULT 0 COMMENT "0:本地文件上传, 2:自定义文本", `status` int NOT NULL DEFAULT 0 COMMENT "状态", `fail_reason` text NULL COMMENT "失败原因", `parse_rule` json NULL COMMENT "解析+切片规则", `table_info` json NULL COMMENT "表格信息", PRIMARY KEY (`id`), INDEX `idx_creator_id` (`creator_id`), INDEX `idx_knowledge_id_deleted_at_updated_at` (`knowledge_id`, `deleted_at`, `updated_at`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "知识库文档表"; +CREATE TABLE IF NOT EXISTS `knowledge_document` (`id` bigint unsigned NOT NULL COMMENT "id", `knowledge_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "knowledge id", `name` varchar(150) NOT NULL DEFAULT "" COMMENT "document name", `file_extension` varchar(20) NOT NULL DEFAULT "0" COMMENT "Document type, txt/pdf/csv etc..", `document_type` int NOT NULL DEFAULT 0 COMMENT "Document type: 0: Text 1: Table 2: Image", `uri` text NULL COMMENT "uri", `size` bigint unsigned NOT NULL DEFAULT 0 COMMENT "document size", `slice_count` bigint unsigned NOT NULL DEFAULT 0 COMMENT "slice count", `char_count` bigint unsigned NOT NULL DEFAULT 0 COMMENT "number of characters", `creator_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "creator id", `space_id` bigint NOT NULL DEFAULT 0 COMMENT "space id", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` datetime(3) NULL COMMENT "Delete Time", `source_type` int NULL DEFAULT 0 COMMENT "0: Local file upload, 2: Custom text, 103: Feishu 104: Lark", `status` int NOT NULL DEFAULT 0 COMMENT "status", `fail_reason` text NULL COMMENT "fail reason", `parse_rule` json NULL COMMENT "parse rule", `table_info` json NULL COMMENT "table info", PRIMARY KEY (`id`), INDEX `idx_creator_id` (`creator_id`), INDEX `idx_knowledge_id_deleted_at_updated_at` (`knowledge_id`, `deleted_at`, `updated_at`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "knowledge document info"; -- Create "knowledge_document_review" table -CREATE TABLE IF NOT EXISTS `knowledge_document_review` (`id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "主键ID", `knowledge_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "knowledge id", `space_id` bigint NOT NULL DEFAULT 0 COMMENT "空间id", `name` varchar(150) NOT NULL DEFAULT "" COMMENT "文档名称", `type` varchar(10) NOT NULL DEFAULT "0" COMMENT "文档类型", `uri` text NULL COMMENT "资源标识", `format_type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "0 文本, 1 表格, 2 图片", `status` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "0 处理中,1 已完成,2 失败,3 失效", `chunk_resp_uri` text NULL COMMENT "预切片tos资源标识", `deleted_at` datetime(3) NULL COMMENT "Delete Time in Milliseconds", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "创建者ID", PRIMARY KEY (`id`), INDEX `idx_dataset_id` (`knowledge_id`, `status`, `updated_at`), INDEX `idx_uri` (`uri` (100))) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "文档审阅表"; +CREATE TABLE IF NOT EXISTS `knowledge_document_review` (`id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "id", `knowledge_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "knowledge id", `space_id` bigint NOT NULL DEFAULT 0 COMMENT "space id", `name` varchar(150) NOT NULL DEFAULT "" COMMENT "name", `type` varchar(10) NOT NULL DEFAULT "0" COMMENT "document type", `uri` text NULL COMMENT "uri", `format_type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "0 text, 1 table, 2 images", `status` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "0 Processing 1 Completed 2 Failed 3 Expired", `chunk_resp_uri` text NULL COMMENT "pre-sliced uri", `deleted_at` datetime(3) NULL COMMENT "Delete Time", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "creator id", PRIMARY KEY (`id`), INDEX `idx_dataset_id` (`knowledge_id`, `status`, `updated_at`), INDEX `idx_uri` (`uri` (100))) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Document slice preview info"; -- Create "knowledge_document_slice" table -CREATE TABLE IF NOT EXISTS `knowledge_document_slice` (`id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "主键ID", `knowledge_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "knowledge id", `document_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "document id", `content` text NULL COMMENT "切片内容", `sequence` decimal(20,5) NOT NULL COMMENT "切片顺序号, 从1开始", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` datetime(3) NULL COMMENT "Delete Time in Milliseconds", `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "创建者ID", `space_id` bigint NOT NULL DEFAULT 0 COMMENT "空间ID", `status` int NOT NULL DEFAULT 0 COMMENT "状态", `fail_reason` text NULL COMMENT "失败原因", `hit` bigint unsigned NOT NULL DEFAULT 0 COMMENT "命中次数", PRIMARY KEY (`id`), INDEX `idx_document_id_deleted_at_sequence` (`document_id`, `deleted_at`, `sequence`), INDEX `idx_knowledge_id_document_id` (`knowledge_id`, `document_id`), INDEX `idx_sequence` (`sequence`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "知识库文件切片表"; +CREATE TABLE IF NOT EXISTS `knowledge_document_slice` (`id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "id", `knowledge_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "knowledge id", `document_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "document_id", `content` text NULL COMMENT "content", `sequence` decimal(20,5) NOT NULL COMMENT "slice sequence number, starting from 1", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` datetime(3) NULL COMMENT "Delete Time", `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "creator id", `space_id` bigint NOT NULL DEFAULT 0 COMMENT "space id", `status` int NOT NULL DEFAULT 0 COMMENT "status", `fail_reason` text NULL COMMENT "fail reason", `hit` bigint unsigned NOT NULL DEFAULT 0 COMMENT "hit counts ", PRIMARY KEY (`id`), INDEX `idx_document_id_deleted_at_sequence` (`document_id`, `deleted_at`, `sequence`), INDEX `idx_knowledge_id_document_id` (`knowledge_id`, `document_id`), INDEX `idx_sequence` (`sequence`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "knowledge document slice"; -- Create "message" table -CREATE TABLE IF NOT EXISTS `message` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "主键ID", `run_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "对应的run_id", `conversation_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "conversation id", `user_id` varchar(60) NOT NULL DEFAULT "" COMMENT "user id", `agent_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "agent_id", `role` varchar(100) NOT NULL DEFAULT "" COMMENT "角色: user、assistant、system", `content_type` varchar(100) NOT NULL DEFAULT "" COMMENT "内容类型 1 text", `content` mediumtext NULL COMMENT "内容", `message_type` varchar(100) NOT NULL DEFAULT "" COMMENT "消息类型:", `display_content` text NULL COMMENT "展示内容", `ext` text NULL COMMENT "message 扩展字段" COLLATE utf8mb4_general_ci, `section_id` bigint unsigned NULL COMMENT "段落id", `broken_position` int NULL DEFAULT -1 COMMENT "打断位置", `status` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "消息状态 1 Available 2 Deleted 3 Replaced 4 Broken 5 Failed 6 Streaming 7 Pending", `model_content` mediumtext NULL COMMENT "模型输入内容", `meta_info` text NULL COMMENT "引用、高亮等文本标记信息", `reasoning_content` text NULL COMMENT "思考内容" COLLATE utf8mb4_general_ci, `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "创建时间", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "更新时间", PRIMARY KEY (`id`), INDEX `idx_conversation_id` (`conversation_id`), INDEX `idx_run_id` (`run_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "消息表"; +CREATE TABLE IF NOT EXISTS `message` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "id", `run_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "run_id", `conversation_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "conversation id", `user_id` varchar(60) NOT NULL DEFAULT "" COMMENT "user id", `agent_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "agent_id", `role` varchar(100) NOT NULL DEFAULT "" COMMENT "role: user、assistant、system", `content_type` varchar(100) NOT NULL DEFAULT "" COMMENT "content type 1 text", `content` mediumtext NULL COMMENT "content", `message_type` varchar(100) NOT NULL DEFAULT "" COMMENT "message_type", `display_content` text NULL COMMENT "display content", `ext` text NULL COMMENT "message ext" COLLATE utf8mb4_general_ci, `section_id` bigint unsigned NULL COMMENT "section_id", `broken_position` int NULL DEFAULT -1 COMMENT "broken position", `status` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "message status: 1 Available 2 Deleted 3 Replaced 4 Broken 5 Failed 6 Streaming 7 Pending", `model_content` mediumtext NULL COMMENT "model content", `meta_info` text NULL COMMENT "text tagging information such as citation and highlighting", `reasoning_content` text NULL COMMENT "reasoning content" COLLATE utf8mb4_general_ci, `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", PRIMARY KEY (`id`), INDEX `idx_conversation_id` (`conversation_id`), INDEX `idx_run_id` (`run_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "message record"; -- Create "model_entity" table -CREATE TABLE IF NOT EXISTS `model_entity` (`id` bigint unsigned NOT NULL COMMENT "主键ID", `meta_id` bigint unsigned NOT NULL COMMENT "模型元信息 id", `name` varchar(128) NOT NULL COMMENT "名称", `description` text NULL COMMENT "描述", `default_params` json NULL COMMENT "默认参数", `scenario` bigint unsigned NOT NULL COMMENT "模型应用场景", `status` int NOT NULL DEFAULT 1 COMMENT "模型状态", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` bigint unsigned NULL COMMENT "Delete Time in Milliseconds", PRIMARY KEY (`id`), INDEX `idx_scenario` (`scenario`), INDEX `idx_status` (`status`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "模型信息"; +CREATE TABLE IF NOT EXISTS `model_entity` (`id` bigint unsigned NOT NULL COMMENT "id", `meta_id` bigint unsigned NOT NULL COMMENT "model metadata id", `name` varchar(128) NOT NULL COMMENT "name", `description` text NULL COMMENT "description", `default_params` json NULL COMMENT "default params", `scenario` bigint unsigned NOT NULL COMMENT "scenario", `status` int NOT NULL DEFAULT 1 COMMENT "model status", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` bigint unsigned NULL COMMENT "Delete Time", PRIMARY KEY (`id`), INDEX `idx_scenario` (`scenario`), INDEX `idx_status` (`status`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Model information"; -- Create "model_meta" table -CREATE TABLE IF NOT EXISTS `model_meta` (`id` bigint unsigned NOT NULL COMMENT "主键ID", `model_name` varchar(128) NOT NULL COMMENT "模型名称", `protocol` varchar(128) NOT NULL COMMENT "模型协议", `icon_uri` varchar(255) NOT NULL DEFAULT "" COMMENT "Icon URI", `capability` json NULL COMMENT "模型能力", `conn_config` json NULL COMMENT "模型连接配置", `status` int NOT NULL DEFAULT 1 COMMENT "模型状态", `description` varchar(2048) NOT NULL DEFAULT "" COMMENT "模型描述", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` bigint unsigned NULL COMMENT "Delete Time in Milliseconds", `icon_url` varchar(255) NOT NULL DEFAULT "" COMMENT "Icon URL", PRIMARY KEY (`id`), INDEX `idx_status` (`status`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "模型元信息"; +CREATE TABLE IF NOT EXISTS `model_meta` (`id` bigint unsigned NOT NULL COMMENT "id", `model_name` varchar(128) NOT NULL COMMENT "model name", `protocol` varchar(128) NOT NULL COMMENT "model protocol", `icon_uri` varchar(255) NOT NULL DEFAULT "" COMMENT "Icon URI", `capability` json NULL COMMENT "capability", `conn_config` json NULL COMMENT "model conn config", `status` int NOT NULL DEFAULT 1 COMMENT "model status", `description` varchar(2048) NOT NULL DEFAULT "" COMMENT "description", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` bigint unsigned NULL COMMENT "Delete Time", `icon_url` varchar(255) NOT NULL DEFAULT "" COMMENT "Icon URL", PRIMARY KEY (`id`), INDEX `idx_status` (`status`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Model metadata"; -- Create "node_execution" table -CREATE TABLE IF NOT EXISTS `node_execution` (`id` bigint unsigned NOT NULL COMMENT "node execution id", `execute_id` bigint unsigned NOT NULL COMMENT "the workflow execute id this node execution belongs to", `node_id` varchar(128) NOT NULL COMMENT "node key" COLLATE utf8mb4_unicode_ci, `node_name` varchar(128) NOT NULL COMMENT "name of the node" COLLATE utf8mb4_unicode_ci, `node_type` varchar(128) NOT NULL COMMENT "the type of the node, in string" COLLATE utf8mb4_unicode_ci, `created_at` bigint unsigned NOT NULL COMMENT "create time in millisecond", `status` tinyint unsigned NOT NULL COMMENT "1=waiting 2=running 3=success 4=fail", `duration` bigint unsigned NULL COMMENT "execution duration in millisecond", `input` mediumtext NULL COMMENT "actual input of the node" COLLATE utf8mb4_unicode_ci, `output` mediumtext NULL COMMENT "actual output of the node" COLLATE utf8mb4_unicode_ci, `raw_output` mediumtext NULL COMMENT "the original output of the node" COLLATE utf8mb4_unicode_ci, `error_info` mediumtext NULL COMMENT "error info" COLLATE utf8mb4_unicode_ci, `error_level` varchar(32) NULL COMMENT "level of the error" COLLATE utf8mb4_unicode_ci, `input_tokens` bigint unsigned NULL COMMENT "number of input tokens", `output_tokens` bigint unsigned NULL COMMENT "number of output tokens", `updated_at` bigint unsigned NULL COMMENT "update time in millisecond", `composite_node_index` bigint unsigned NULL COMMENT "loop or batch's execution index", `composite_node_items` mediumtext NULL COMMENT "the items extracted from parent composite node for this index" COLLATE utf8mb4_unicode_ci, `parent_node_id` varchar(128) NULL COMMENT "when as inner node for loop or batch, this is the parent node's key" COLLATE utf8mb4_unicode_ci, `sub_execute_id` bigint unsigned NULL COMMENT "if this node is sub_workflow, the exe id of the sub workflow", `extra` mediumtext NULL COMMENT "extra info" COLLATE utf8mb4_unicode_ci, PRIMARY KEY (`id`), INDEX `idx_execute_id_node_id` (`execute_id`, `node_id`), INDEX `idx_execute_id_parent_node_id` (`execute_id`, `parent_node_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT "node 节点运行记录,用于记录每次workflow执行时,每个节点的状态信息"; +CREATE TABLE IF NOT EXISTS `node_execution` (`id` bigint unsigned NOT NULL COMMENT "node execution id", `execute_id` bigint unsigned NOT NULL COMMENT "the workflow execute id this node execution belongs to", `node_id` varchar(128) NOT NULL COMMENT "node key" COLLATE utf8mb4_unicode_ci, `node_name` varchar(128) NOT NULL COMMENT "name of the node" COLLATE utf8mb4_unicode_ci, `node_type` varchar(128) NOT NULL COMMENT "the type of the node, in string" COLLATE utf8mb4_unicode_ci, `created_at` bigint unsigned NOT NULL COMMENT "create time in millisecond", `status` tinyint unsigned NOT NULL COMMENT "1=waiting 2=running 3=success 4=fail", `duration` bigint unsigned NULL COMMENT "execution duration in millisecond", `input` mediumtext NULL COMMENT "actual input of the node" COLLATE utf8mb4_unicode_ci, `output` mediumtext NULL COMMENT "actual output of the node" COLLATE utf8mb4_unicode_ci, `raw_output` mediumtext NULL COMMENT "the original output of the node" COLLATE utf8mb4_unicode_ci, `error_info` mediumtext NULL COMMENT "error info" COLLATE utf8mb4_unicode_ci, `error_level` varchar(32) NULL COMMENT "level of the error" COLLATE utf8mb4_unicode_ci, `input_tokens` bigint unsigned NULL COMMENT "number of input tokens", `output_tokens` bigint unsigned NULL COMMENT "number of output tokens", `updated_at` bigint unsigned NULL COMMENT "update time in millisecond", `composite_node_index` bigint unsigned NULL COMMENT "loop or batch's execution index", `composite_node_items` mediumtext NULL COMMENT "the items extracted from parent composite node for this index" COLLATE utf8mb4_unicode_ci, `parent_node_id` varchar(128) NULL COMMENT "when as inner node for loop or batch, this is the parent node's key" COLLATE utf8mb4_unicode_ci, `sub_execute_id` bigint unsigned NULL COMMENT "if this node is sub_workflow, the exe id of the sub workflow", `extra` mediumtext NULL COMMENT "extra info" COLLATE utf8mb4_unicode_ci, PRIMARY KEY (`id`), INDEX `idx_execute_id_node_id` (`execute_id`, `node_id`), INDEX `idx_execute_id_parent_node_id` (`execute_id`, `parent_node_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT "Node run record, used to record the status information of each node during each workflow execution"; -- Create "online_database_info" table CREATE TABLE IF NOT EXISTS `online_database_info` (`id` bigint unsigned NOT NULL COMMENT "ID", `app_id` bigint unsigned NULL COMMENT "App ID", `space_id` bigint unsigned NOT NULL COMMENT "Space ID", `related_draft_id` bigint unsigned NOT NULL COMMENT "The primary key ID of draft_database_info table", `is_visible` tinyint NOT NULL DEFAULT 1 COMMENT "Visibility: 0 invisible, 1 visible", `prompt_disabled` tinyint NOT NULL DEFAULT 0 COMMENT "Support prompt calls: 1 not supported, 0 supported", `table_name` varchar(255) NOT NULL COMMENT "Table name", `table_desc` varchar(256) NULL COMMENT "Table description", `table_field` text NULL COMMENT "Table field info", `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "Creator ID", `icon_uri` varchar(255) NOT NULL COMMENT "Icon Uri", `physical_table_name` varchar(255) NULL COMMENT "The name of the real physical table", `rw_mode` bigint NOT NULL DEFAULT 1 COMMENT "Read and write permission modes: 1. Limited read and write mode 2. Read-only mode 3. Full read and write mode", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` datetime NULL COMMENT "Delete Time", PRIMARY KEY (`id`), INDEX `idx_space_app_creator_deleted` (`space_id`, `app_id`, `creator_id`, `deleted_at`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_general_ci COMMENT "online database info"; -- Create "plugin" table @@ -49,23 +49,23 @@ CREATE TABLE IF NOT EXISTS `plugin_oauth_auth` (`id` bigint unsigned NOT NULL DE -- Create "plugin_version" table CREATE TABLE IF NOT EXISTS `plugin_version` (`id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Primary Key ID", `space_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Space ID", `developer_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Developer ID", `plugin_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Plugin ID", `app_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Application ID", `icon_uri` varchar(512) NOT NULL DEFAULT "" COMMENT "Icon URI", `server_url` varchar(512) NOT NULL DEFAULT "" COMMENT "Server URL", `plugin_type` tinyint NOT NULL DEFAULT 0 COMMENT "Plugin Type, 1:http, 6:local", `version` varchar(255) NOT NULL DEFAULT "" COMMENT "Plugin Version, e.g. v1.0.0", `version_desc` text NULL COMMENT "Plugin Version Description", `manifest` json NULL COMMENT "Plugin Manifest", `openapi_doc` json NULL COMMENT "OpenAPI Document, only stores the root", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `deleted_at` datetime NULL COMMENT "Delete Time", PRIMARY KEY (`id`), UNIQUE INDEX `uniq_idx_plugin_version` (`plugin_id`, `version`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Plugin Version"; -- Create "prompt_resource" table -CREATE TABLE IF NOT EXISTS `prompt_resource` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "主键ID", `space_id` bigint NOT NULL COMMENT "空间ID", `name` varchar(255) NOT NULL COMMENT "名称", `description` varchar(255) NOT NULL COMMENT "描述", `prompt_text` mediumtext NULL COMMENT "prompt正文", `status` int NOT NULL COMMENT "状态,0无效,1有效", `creator_id` bigint NOT NULL COMMENT "创建者ID", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "创建时间", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "更新时间", PRIMARY KEY (`id`), INDEX `idx_creator_id` (`creator_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT "prompt_resource"; +CREATE TABLE IF NOT EXISTS `prompt_resource` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "id", `space_id` bigint NOT NULL COMMENT "space id", `name` varchar(255) NOT NULL COMMENT "name", `description` varchar(255) NOT NULL COMMENT "description", `prompt_text` mediumtext NULL COMMENT "prompt text", `status` int NOT NULL COMMENT "status, 0 is invalid, 1 is valid", `creator_id` bigint NOT NULL COMMENT "creator id", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", PRIMARY KEY (`id`), INDEX `idx_creator_id` (`creator_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT "prompt_resource"; -- Create "run_record" table -CREATE TABLE IF NOT EXISTS `run_record` (`id` bigint unsigned NOT NULL COMMENT "主键ID", `conversation_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "会话 ID", `section_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "section ID", `agent_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "agent_id", `user_id` varchar(255) NOT NULL DEFAULT "" COMMENT "user id", `source` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "执行来源 0 API,", `status` varchar(255) NOT NULL DEFAULT "" COMMENT "状态,0 Unknown, 1-Created,2-InProgress,3-Completed,4-Failed,5-Expired,6-Cancelled,7-RequiresAction", `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "创建者标识", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "创建时间", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "更新时间", `failed_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "失败时间", `last_error` text NULL COMMENT "error message" COLLATE utf8mb4_general_ci, `completed_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "结束时间", `chat_request` text NULL COMMENT "保存原始请求的部分字段" COLLATE utf8mb4_general_ci, `ext` text NULL COMMENT "扩展字段" COLLATE utf8mb4_general_ci, `usage` json NULL COMMENT "usage", PRIMARY KEY (`id`), INDEX `idx_c_s` (`conversation_id`, `section_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "执行记录表"; +CREATE TABLE IF NOT EXISTS `run_record` (`id` bigint unsigned NOT NULL COMMENT "id", `conversation_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "conversation id", `section_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "section ID", `agent_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "agent_id", `user_id` varchar(255) NOT NULL DEFAULT "" COMMENT "user id", `source` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "Execute source 0 API", `status` varchar(255) NOT NULL DEFAULT "" COMMENT "status,0 Unknown, 1-Created,2-InProgress,3-Completed,4-Failed,5-Expired,6-Cancelled,7-RequiresAction", `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "creator id", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `failed_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Fail Time in Milliseconds", `last_error` text NULL COMMENT "error message" COLLATE utf8mb4_general_ci, `completed_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Finish Time in Milliseconds", `chat_request` text NULL COMMENT "Original request field" COLLATE utf8mb4_general_ci, `ext` text NULL COMMENT "ext" COLLATE utf8mb4_general_ci, `usage` json NULL COMMENT "usage", PRIMARY KEY (`id`), INDEX `idx_c_s` (`conversation_id`, `section_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "run record"; -- Create "shortcut_command" table -CREATE TABLE IF NOT EXISTS `shortcut_command` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "主键ID", `object_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "实体ID,该实体可用这个指令", `command_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "命令ID", `command_name` varchar(255) NOT NULL DEFAULT "" COMMENT "命令名称", `shortcut_command` varchar(255) NOT NULL DEFAULT "" COMMENT "快捷指令", `description` varchar(2000) NOT NULL DEFAULT "" COMMENT "命令描述", `send_type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "发送类型 0:query 1:panel", `tool_type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "使用工具的type 1:workFlow 2:插件", `work_flow_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "使用workFlow的id", `plugin_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "使用插件的id", `plugin_tool_name` varchar(255) NOT NULL DEFAULT "" COMMENT "使用插件的api_name", `template_query` text NULL COMMENT "query模板", `components` json NULL COMMENT "panel参数", `card_schema` text NULL COMMENT "卡片schema", `tool_info` json NULL COMMENT "工具信息 包含name+变量列表", `status` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "状态,0无效,1有效", `creator_id` bigint unsigned NULL DEFAULT 0 COMMENT "创建者ID", `is_online` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "是否为线上信息 0草稿 1线上", `created_at` bigint NOT NULL DEFAULT 0 COMMENT "创建时间", `updated_at` bigint NOT NULL DEFAULT 0 COMMENT "更新时间", `agent_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "multi的指令时,该指令由哪个节点执行", `shortcut_icon` json NULL COMMENT "快捷指令图标", `plugin_tool_id` bigint NOT NULL DEFAULT 0 COMMENT "tool_id", PRIMARY KEY (`id`), UNIQUE INDEX `uniq_object_command_id_type` (`object_id`, `command_id`, `is_online`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_general_ci COMMENT "bot快捷指令表"; +CREATE TABLE IF NOT EXISTS `shortcut_command` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "id", `object_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Entity ID, this command can be used for this entity", `command_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "command id", `command_name` varchar(255) NOT NULL DEFAULT "" COMMENT "command name", `shortcut_command` varchar(255) NOT NULL DEFAULT "" COMMENT "shortcut command", `description` varchar(2000) NOT NULL DEFAULT "" COMMENT "description", `send_type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "send type 0:query 1:panel", `tool_type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "Type 1 of tool used: WorkFlow 2: Plugin", `work_flow_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "workflow id", `plugin_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "plugin id", `plugin_tool_name` varchar(255) NOT NULL DEFAULT "" COMMENT "plugin tool name", `template_query` text NULL COMMENT "template query", `components` json NULL COMMENT "Panel parameters", `card_schema` text NULL COMMENT "card schema", `tool_info` json NULL COMMENT "Tool information includes name+variable list", `status` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "Status, 0 is invalid, 1 is valid", `creator_id` bigint unsigned NULL DEFAULT 0 COMMENT "creator id", `is_online` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "Is online information: 0 draft 1 online", `created_at` bigint NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `agent_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "When executing a multi instruction, which node executes the instruction", `shortcut_icon` json NULL COMMENT "shortcut icon", `plugin_tool_id` bigint NOT NULL DEFAULT 0 COMMENT "tool_id", PRIMARY KEY (`id`), UNIQUE INDEX `uniq_object_command_id_type` (`object_id`, `command_id`, `is_online`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_general_ci COMMENT "bot shortcut command table"; -- Create "single_agent_draft" table -CREATE TABLE IF NOT EXISTS `single_agent_draft` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "Primary Key ID", `agent_id` bigint NOT NULL DEFAULT 0 COMMENT "Agent ID", `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "Creator ID", `space_id` bigint NOT NULL DEFAULT 0 COMMENT "Space ID", `name` varchar(255) NOT NULL DEFAULT "" COMMENT "Agent Name", `description` text NOT NULL COMMENT "Agent Description", `icon_uri` varchar(255) NOT NULL DEFAULT "" COMMENT "Icon URI", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` datetime(3) NULL COMMENT "delete time in millisecond", `variables_meta_id` bigint NULL COMMENT "variables meta 表 ID", `model_info` json NULL COMMENT "Model Configuration Information", `onboarding_info` json NULL COMMENT "Onboarding Information", `prompt` json NULL COMMENT "Agent Prompt Configuration", `plugin` json NULL COMMENT "Agent Plugin Base Configuration", `knowledge` json NULL COMMENT "Agent Knowledge Base Configuration", `workflow` json NULL COMMENT "Agent Workflow Configuration", `suggest_reply` json NULL COMMENT "Suggested Replies", `jump_config` json NULL COMMENT "Jump Configuration", `background_image_info_list` json NULL COMMENT "Background image", `database_config` json NULL COMMENT "Agent Database Base Configuration", `shortcut_command` json NULL COMMENT "shortcut command", PRIMARY KEY (`id`), INDEX `idx_creator_id` (`creator_id`), UNIQUE INDEX `uniq_agent_id` (`agent_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Single Agent Draft Copy Table"; +CREATE TABLE IF NOT EXISTS `single_agent_draft` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "Primary Key ID", `agent_id` bigint NOT NULL DEFAULT 0 COMMENT "Agent ID", `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "Creator ID", `space_id` bigint NOT NULL DEFAULT 0 COMMENT "Space ID", `name` varchar(255) NOT NULL DEFAULT "" COMMENT "Agent Name", `description` text NOT NULL COMMENT "Agent Description", `icon_uri` varchar(255) NOT NULL DEFAULT "" COMMENT "Icon URI", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` datetime(3) NULL COMMENT "delete time in millisecond", `variables_meta_id` bigint NULL COMMENT "variables meta table ID", `model_info` json NULL COMMENT "Model Configuration Information", `onboarding_info` json NULL COMMENT "Onboarding Information", `prompt` json NULL COMMENT "Agent Prompt Configuration", `plugin` json NULL COMMENT "Agent Plugin Base Configuration", `knowledge` json NULL COMMENT "Agent Knowledge Base Configuration", `workflow` json NULL COMMENT "Agent Workflow Configuration", `suggest_reply` json NULL COMMENT "Suggested Replies", `jump_config` json NULL COMMENT "Jump Configuration", `background_image_info_list` json NULL COMMENT "Background image", `database_config` json NULL COMMENT "Agent Database Base Configuration", `shortcut_command` json NULL COMMENT "shortcut command", PRIMARY KEY (`id`), INDEX `idx_creator_id` (`creator_id`), UNIQUE INDEX `uniq_agent_id` (`agent_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Single Agent Draft Copy Table" AUTO_INCREMENT 29; -- Create "single_agent_publish" table -CREATE TABLE IF NOT EXISTS `single_agent_publish` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "主键id", `agent_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "agent_id", `publish_id` varchar(50) NOT NULL DEFAULT "" COMMENT "发布 id" COLLATE utf8mb4_general_ci, `connector_ids` json NULL COMMENT "发布的 connector_ids", `version` varchar(255) NOT NULL DEFAULT "" COMMENT "Agent Version", `publish_info` text NULL COMMENT "发布信息" COLLATE utf8mb4_general_ci, `publish_time` bigint unsigned NOT NULL DEFAULT 0 COMMENT "发布时间", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `creator_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "发布人 user_id", `status` tinyint NOT NULL DEFAULT 0 COMMENT "状态 0:使用中 1:删除 3:禁用", `extra` json NULL COMMENT "扩展字段", PRIMARY KEY (`id`), INDEX `idx_agent_id_version` (`agent_id`, `version`), INDEX `idx_creator_id` (`creator_id`), INDEX `idx_publish_id` (`publish_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "bot 渠道和发布版本流水表"; +CREATE TABLE IF NOT EXISTS `single_agent_publish` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "id", `agent_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "agent_id", `publish_id` varchar(50) NOT NULL DEFAULT "" COMMENT "publish id" COLLATE utf8mb4_general_ci, `connector_ids` json NULL COMMENT "connector_ids", `version` varchar(255) NOT NULL DEFAULT "" COMMENT "Agent Version", `publish_info` text NULL COMMENT "publish info" COLLATE utf8mb4_general_ci, `publish_time` bigint unsigned NOT NULL DEFAULT 0 COMMENT "publish time", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `creator_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "creator id", `status` tinyint NOT NULL DEFAULT 0 COMMENT "Status 0: In use 1: Delete 3: Disabled", `extra` json NULL COMMENT "extra", PRIMARY KEY (`id`), INDEX `idx_agent_id_version` (`agent_id`, `version`), INDEX `idx_creator_id` (`creator_id`), INDEX `idx_publish_id` (`publish_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Bot connector and release version info"; -- Create "single_agent_version" table -CREATE TABLE IF NOT EXISTS `single_agent_version` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "Primary Key ID", `agent_id` bigint NOT NULL DEFAULT 0 COMMENT "Agent ID", `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "Creator ID", `space_id` bigint NOT NULL DEFAULT 0 COMMENT "Space ID", `name` varchar(255) NOT NULL DEFAULT "" COMMENT "Agent Name", `description` text NOT NULL COMMENT "Agent Description", `icon_uri` varchar(255) NOT NULL DEFAULT "" COMMENT "Icon URI", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` datetime(3) NULL COMMENT "delete time in millisecond", `variables_meta_id` bigint NULL COMMENT "variables meta 表 ID", `model_info` json NULL COMMENT "Model Configuration Information", `onboarding_info` json NULL COMMENT "Onboarding Information", `prompt` json NULL COMMENT "Agent Prompt Configuration", `plugin` json NULL COMMENT "Agent Plugin Base Configuration", `knowledge` json NULL COMMENT "Agent Knowledge Base Configuration", `workflow` json NULL COMMENT "Agent Workflow Configuration", `suggest_reply` json NULL COMMENT "Suggested Replies", `jump_config` json NULL COMMENT "Jump Configuration", `connector_id` bigint unsigned NOT NULL COMMENT "Connector ID", `version` varchar(255) NOT NULL DEFAULT "" COMMENT "Agent Version", `background_image_info_list` json NULL COMMENT "Background image", `database_config` json NULL COMMENT "Agent Database Base Configuration", `shortcut_command` json NULL COMMENT "shortcut command", PRIMARY KEY (`id`), INDEX `idx_creator_id` (`creator_id`), UNIQUE INDEX `uniq_agent_id_and_version_connector_id` (`agent_id`, `version`, `connector_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Single Agent Version Copy Table"; +CREATE TABLE IF NOT EXISTS `single_agent_version` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "Primary Key ID", `agent_id` bigint NOT NULL DEFAULT 0 COMMENT "Agent ID", `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "Creator ID", `space_id` bigint NOT NULL DEFAULT 0 COMMENT "Space ID", `name` varchar(255) NOT NULL DEFAULT "" COMMENT "Agent Name", `description` text NOT NULL COMMENT "Agent Description", `icon_uri` varchar(255) NOT NULL DEFAULT "" COMMENT "Icon URI", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` datetime(3) NULL COMMENT "delete time in millisecond", `variables_meta_id` bigint NULL COMMENT "variables meta table ID", `model_info` json NULL COMMENT "Model Configuration Information", `onboarding_info` json NULL COMMENT "Onboarding Information", `prompt` json NULL COMMENT "Agent Prompt Configuration", `plugin` json NULL COMMENT "Agent Plugin Base Configuration", `knowledge` json NULL COMMENT "Agent Knowledge Base Configuration", `workflow` json NULL COMMENT "Agent Workflow Configuration", `suggest_reply` json NULL COMMENT "Suggested Replies", `jump_config` json NULL COMMENT "Jump Configuration", `connector_id` bigint unsigned NOT NULL COMMENT "Connector ID", `version` varchar(255) NOT NULL DEFAULT "" COMMENT "Agent Version", `background_image_info_list` json NULL COMMENT "Background image", `database_config` json NULL COMMENT "Agent Database Base Configuration", `shortcut_command` json NULL COMMENT "shortcut command", PRIMARY KEY (`id`), INDEX `idx_creator_id` (`creator_id`), UNIQUE INDEX `uniq_agent_id_and_version_connector_id` (`agent_id`, `version`, `connector_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Single Agent Version Copy Table"; -- Create "space" table -CREATE TABLE IF NOT EXISTS `space` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "Primary Key ID, Space ID", `owner_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Owner ID", `name` varchar(200) NOT NULL DEFAULT "" COMMENT "Space Name", `description` varchar(2000) NOT NULL DEFAULT "" COMMENT "Space Description", `icon_uri` varchar(200) NOT NULL DEFAULT "" COMMENT "Icon URI", `creator_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Creator ID", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Creation Time (Milliseconds)", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time (Milliseconds)", `deleted_at` bigint unsigned NULL COMMENT "Deletion Time (Milliseconds)", PRIMARY KEY (`id`), INDEX `idx_creator_id` (`creator_id`), INDEX `idx_owner_id` (`owner_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Space Table"; +CREATE TABLE IF NOT EXISTS `space` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "Primary Key ID, Space ID", `owner_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Owner ID", `name` varchar(200) NOT NULL DEFAULT "" COMMENT "Space Name", `description` varchar(2000) NOT NULL DEFAULT "" COMMENT "Space Description", `icon_uri` varchar(200) NOT NULL DEFAULT "" COMMENT "Icon URI", `creator_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Creator ID", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Creation Time (Milliseconds)", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time (Milliseconds)", `deleted_at` bigint unsigned NULL COMMENT "Deletion Time (Milliseconds)", PRIMARY KEY (`id`), INDEX `idx_creator_id` (`creator_id`), INDEX `idx_owner_id` (`owner_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Space Table" AUTO_INCREMENT 7532071516331048961; -- Create "space_user" table -CREATE TABLE IF NOT EXISTS `space_user` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "Primary Key ID, Auto Increment", `space_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Space ID", `user_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "User ID", `role_type` int NOT NULL DEFAULT 3 COMMENT "Role Type: 1.owner 2.admin 3.member", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Creation Time (Milliseconds)", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time (Milliseconds)", PRIMARY KEY (`id`), INDEX `idx_user_id` (`user_id`), UNIQUE INDEX `uniq_space_user` (`space_id`, `user_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Space Member Table"; +CREATE TABLE IF NOT EXISTS `space_user` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "Primary Key ID, Auto Increment", `space_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Space ID", `user_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "User ID", `role_type` int NOT NULL DEFAULT 3 COMMENT "Role Type: 1.owner 2.admin 3.member", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Creation Time (Milliseconds)", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time (Milliseconds)", PRIMARY KEY (`id`), INDEX `idx_user_id` (`user_id`), UNIQUE INDEX `uniq_space_user` (`space_id`, `user_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Space Member Table" AUTO_INCREMENT 2; -- Create "template" table -CREATE TABLE IF NOT EXISTS `template` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "Primary Key ID", `agent_id` bigint NOT NULL DEFAULT 0 COMMENT "Agent ID", `workflow_id` bigint NOT NULL DEFAULT 0 COMMENT "Workflow ID", `space_id` bigint NOT NULL DEFAULT 0 COMMENT "Space ID", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `heat` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Heat", `product_entity_type` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Product Entity Type", `meta_info` json NULL COMMENT "Meta Info", `agent_extra` json NULL COMMENT "Agent Extra Info", `workflow_extra` json NULL COMMENT "Workflow Extra Info", `project_extra` json NULL COMMENT "Project Extra Info", PRIMARY KEY (`id`), UNIQUE INDEX `uniq_agent_id` (`agent_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Template Info Table"; +CREATE TABLE IF NOT EXISTS `template` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "Primary Key ID", `agent_id` bigint NOT NULL DEFAULT 0 COMMENT "Agent ID", `workflow_id` bigint NOT NULL DEFAULT 0 COMMENT "Workflow ID", `space_id` bigint NOT NULL DEFAULT 0 COMMENT "Space ID", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `heat` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Heat", `product_entity_type` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Product Entity Type", `meta_info` json NULL COMMENT "Meta Info", `agent_extra` json NULL COMMENT "Agent Extra Info", `workflow_extra` json NULL COMMENT "Workflow Extra Info", `project_extra` json NULL COMMENT "Project Extra Info", PRIMARY KEY (`id`), UNIQUE INDEX `uniq_agent_id` (`agent_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Template Info Table" AUTO_INCREMENT 25; -- Create "tool" table CREATE TABLE IF NOT EXISTS `tool` (`id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Tool ID", `plugin_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Plugin ID", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `version` varchar(255) NOT NULL DEFAULT "" COMMENT "Tool Version, e.g. v1.0.0", `sub_url` varchar(512) NOT NULL DEFAULT "" COMMENT "Sub URL Path", `method` varchar(64) NOT NULL DEFAULT "" COMMENT "HTTP Request Method", `operation` json NULL COMMENT "Tool Openapi Operation Schema", `activated_status` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "0:activated; 1:deactivated", PRIMARY KEY (`id`), INDEX `idx_plugin_activated_status` (`plugin_id`, `activated_status`), UNIQUE INDEX `uniq_idx_plugin_sub_url_method` (`plugin_id`, `sub_url`, `method`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Latest Tool"; -- Create "tool_draft" table @@ -73,23 +73,23 @@ CREATE TABLE IF NOT EXISTS `tool_draft` (`id` bigint unsigned NOT NULL DEFAULT 0 -- Create "tool_version" table CREATE TABLE IF NOT EXISTS `tool_version` (`id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Primary Key ID", `tool_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Tool ID", `plugin_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Plugin ID", `version` varchar(255) NOT NULL DEFAULT "" COMMENT "Tool Version, e.g. v1.0.0", `sub_url` varchar(512) NOT NULL DEFAULT "" COMMENT "Sub URL Path", `method` varchar(64) NOT NULL DEFAULT "" COMMENT "HTTP Request Method", `operation` json NULL COMMENT "Tool Openapi Operation Schema", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `deleted_at` datetime NULL COMMENT "Delete Time", PRIMARY KEY (`id`), UNIQUE INDEX `uniq_idx_tool_version` (`tool_id`, `version`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Tool Version"; -- Create "user" table -CREATE TABLE IF NOT EXISTS `user` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "Primary Key ID", `name` varchar(128) NOT NULL DEFAULT "" COMMENT "User Nickname", `unique_name` varchar(128) NOT NULL DEFAULT "" COMMENT "User Unique Name", `email` varchar(128) NOT NULL DEFAULT "" COMMENT "Email", `password` varchar(128) NOT NULL DEFAULT "" COMMENT "Password (Encrypted)", `description` varchar(512) NOT NULL DEFAULT "" COMMENT "User Description", `icon_uri` varchar(512) NOT NULL DEFAULT "" COMMENT "Avatar URI", `user_verified` bool NOT NULL DEFAULT 0 COMMENT "User Verification Status", `locale` varchar(128) NOT NULL DEFAULT "" COMMENT "Locale", `session_key` varchar(256) NOT NULL DEFAULT "" COMMENT "Session Key", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Creation Time (Milliseconds)", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time (Milliseconds)", `deleted_at` bigint unsigned NULL COMMENT "Deletion Time (Milliseconds)", PRIMARY KEY (`id`), INDEX `idx_session_key` (`session_key`), UNIQUE INDEX `uniq_email` (`email`), UNIQUE INDEX `uniq_unique_name` (`unique_name`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "User Table"; +CREATE TABLE IF NOT EXISTS `user` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "Primary Key ID", `name` varchar(128) NOT NULL DEFAULT "" COMMENT "User Nickname", `unique_name` varchar(128) NOT NULL DEFAULT "" COMMENT "User Unique Name", `email` varchar(128) NOT NULL DEFAULT "" COMMENT "Email", `password` varchar(128) NOT NULL DEFAULT "" COMMENT "Password (Encrypted)", `description` varchar(512) NOT NULL DEFAULT "" COMMENT "User Description", `icon_uri` varchar(512) NOT NULL DEFAULT "" COMMENT "Avatar URI", `user_verified` bool NOT NULL DEFAULT 0 COMMENT "User Verification Status", `locale` varchar(128) NOT NULL DEFAULT "" COMMENT "Locale", `session_key` varchar(256) NOT NULL DEFAULT "" COMMENT "Session Key", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Creation Time (Milliseconds)", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time (Milliseconds)", `deleted_at` bigint unsigned NULL COMMENT "Deletion Time (Milliseconds)", PRIMARY KEY (`id`), INDEX `idx_session_key` (`session_key`), UNIQUE INDEX `uniq_email` (`email`), UNIQUE INDEX `uniq_unique_name` (`unique_name`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "User Table" AUTO_INCREMENT 7532071516318466049; -- Create "variable_instance" table -CREATE TABLE IF NOT EXISTS `variable_instance` (`id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "主键ID", `biz_type` tinyint unsigned NOT NULL COMMENT "1 for agent,2 for app", `biz_id` varchar(128) NOT NULL DEFAULT "" COMMENT "1 for agent_id,2 for app_id", `version` varchar(255) NOT NULL COMMENT "agent or project 版本,为空代表草稿态", `keyword` varchar(255) NOT NULL COMMENT "记忆的KEY", `type` tinyint NOT NULL COMMENT "记忆类型 1 KV 2 list", `content` text NULL COMMENT "记忆内容", `connector_uid` varchar(255) NOT NULL COMMENT "二方用户ID", `connector_id` bigint NOT NULL COMMENT "二方id, e.g. coze = 10000010", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "创建时间", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "更新时间", PRIMARY KEY (`id`), INDEX `idx_connector_key` (`biz_id`, `biz_type`, `version`, `connector_uid`, `connector_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT "KV Memory"; +CREATE TABLE IF NOT EXISTS `variable_instance` (`id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "id", `biz_type` tinyint unsigned NOT NULL COMMENT "1 for agent,2 for app", `biz_id` varchar(128) NOT NULL DEFAULT "" COMMENT "1 for agent_id,2 for app_id", `version` varchar(255) NOT NULL COMMENT "agent or project version empty represents draft status", `keyword` varchar(255) NOT NULL COMMENT "Keyword to Memory", `type` tinyint NOT NULL COMMENT "Memory type 1 KV 2 list", `content` text NULL COMMENT "content", `connector_uid` varchar(255) NOT NULL COMMENT "connector_uid", `connector_id` bigint NOT NULL COMMENT "connector_id, e.g. coze = 10000010", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", PRIMARY KEY (`id`), INDEX `idx_connector_key` (`biz_id`, `biz_type`, `version`, `connector_uid`, `connector_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT "KV Memory"; -- Create "variables_meta" table -CREATE TABLE IF NOT EXISTS `variables_meta` (`id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "主键ID", `creator_id` bigint unsigned NOT NULL COMMENT "创建者ID", `biz_type` tinyint unsigned NOT NULL COMMENT "1 for agent,2 for app", `biz_id` varchar(128) NOT NULL DEFAULT "" COMMENT "1 for agent_id,2 for app_id", `variable_list` json NULL COMMENT "变量配置的json数据", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "create time", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "update time", `version` varchar(255) NOT NULL COMMENT "project版本,为空代表草稿态", PRIMARY KEY (`id`), INDEX `idx_user_key` (`creator_id`), UNIQUE INDEX `uniq_project_key` (`biz_id`, `biz_type`, `version`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT "KV Memory meta"; +CREATE TABLE IF NOT EXISTS `variables_meta` (`id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "id", `creator_id` bigint unsigned NOT NULL COMMENT "creator id", `biz_type` tinyint unsigned NOT NULL COMMENT "1 for agent,2 for app", `biz_id` varchar(128) NOT NULL DEFAULT "" COMMENT "1 for agent_id,2 for app_id", `variable_list` json NULL COMMENT "JSON data for variable configuration", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `version` varchar(255) NOT NULL COMMENT "Project version, empty represents draft status", PRIMARY KEY (`id`), INDEX `idx_user_key` (`creator_id`), UNIQUE INDEX `uniq_project_key` (`biz_id`, `biz_type`, `version`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT "KV Memory meta"; -- Create "workflow_draft" table -CREATE TABLE IF NOT EXISTS `workflow_draft` (`id` bigint unsigned NOT NULL COMMENT "workflow ID", `canvas` mediumtext NOT NULL COMMENT "前端 schema", `input_params` mediumtext NULL COMMENT " 入参 schema", `output_params` mediumtext NULL COMMENT " 出参 schema", `test_run_success` bool NOT NULL DEFAULT 0 COMMENT "0 未运行, 1 运行成功", `modified` bool NOT NULL DEFAULT 0 COMMENT "0 未被修改, 1 已被修改", `updated_at` bigint unsigned NULL, `deleted_at` datetime(3) NULL, `commit_id` varchar(255) NOT NULL COMMENT "used to uniquely identify a draft snapshot", PRIMARY KEY (`id`), INDEX `idx_updated_at` (`updated_at` DESC)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "workflow 画布草稿表,用于记录workflow最新的草稿画布信息"; +CREATE TABLE IF NOT EXISTS `workflow_draft` (`id` bigint unsigned NOT NULL COMMENT "workflow ID", `canvas` mediumtext NOT NULL COMMENT "Front end schema", `input_params` mediumtext NULL COMMENT "Input schema", `output_params` mediumtext NULL COMMENT "Output parameter schema", `test_run_success` bool NOT NULL DEFAULT 0 COMMENT "0 not running, 1 running successfully", `modified` bool NOT NULL DEFAULT 0 COMMENT "0 has not been modified, 1 has been modified", `updated_at` bigint unsigned NULL COMMENT "Update Time in Milliseconds", `deleted_at` datetime(3) NULL COMMENT "Delete Time", `commit_id` varchar(255) NOT NULL COMMENT "used to uniquely identify a draft snapshot", PRIMARY KEY (`id`), INDEX `idx_updated_at` (`updated_at` DESC)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Workflow canvas draft table, used to record the latest draft canvas information of workflow"; -- Create "workflow_execution" table -CREATE TABLE IF NOT EXISTS `workflow_execution` (`id` bigint unsigned NOT NULL COMMENT "execute id", `workflow_id` bigint unsigned NOT NULL COMMENT "workflow_id", `version` varchar(50) NULL COMMENT "workflow version. empty if is draft", `space_id` bigint unsigned NOT NULL COMMENT "the space id the workflow belongs to", `mode` tinyint unsigned NOT NULL COMMENT "the execution mode: 1. debug run 2. release run 3. node debug", `operator_id` bigint unsigned NOT NULL COMMENT "the user id that runs this workflow", `connector_id` bigint unsigned NULL COMMENT "the connector on which this execution happened", `connector_uid` varchar(64) NULL COMMENT "user id of the connector", `created_at` bigint unsigned NOT NULL COMMENT "create time in millisecond", `log_id` varchar(128) NULL COMMENT "log id", `status` tinyint unsigned NULL COMMENT "1=running 2=success 3=fail 4=interrupted", `duration` bigint unsigned NULL COMMENT "execution duration in millisecond", `input` mediumtext NULL COMMENT "actual input of this execution", `output` mediumtext NULL COMMENT "the actual output of this execution", `error_code` varchar(255) NULL COMMENT "error code if any", `fail_reason` mediumtext NULL COMMENT "the reason for failure", `input_tokens` bigint unsigned NULL COMMENT "number of input tokens", `output_tokens` bigint unsigned NULL COMMENT "number of output tokens", `updated_at` bigint unsigned NULL COMMENT "update time in millisecond", `root_execution_id` bigint unsigned NULL COMMENT "the top level execution id. Null if this is the root", `parent_node_id` varchar(128) NULL COMMENT "the node key for the sub_workflow node that executes this workflow", `app_id` bigint unsigned NULL COMMENT "app id this workflow execution belongs to", `node_count` mediumint unsigned NULL COMMENT "the total node count of the workflow", `resume_event_id` bigint unsigned NULL COMMENT "the current event ID which is resuming", `agent_id` bigint unsigned NULL COMMENT "the agent that this execution binds to", `sync_pattern` tinyint unsigned NULL COMMENT "the sync pattern 1. sync 2. async 3. stream", `commit_id` varchar(255) NULL COMMENT "draft commit id this execution belongs to", PRIMARY KEY (`id`), INDEX `idx_workflow_id_version_mode_created_at` (`workflow_id`, `version`, `mode`, `created_at`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "workflow 执行记录表,用于记录每次workflow执行时的状态"; +CREATE TABLE IF NOT EXISTS `workflow_execution` (`id` bigint unsigned NOT NULL COMMENT "execute id", `workflow_id` bigint unsigned NOT NULL COMMENT "workflow_id", `version` varchar(50) NULL COMMENT "workflow version. empty if is draft", `space_id` bigint unsigned NOT NULL COMMENT "the space id the workflow belongs to", `mode` tinyint unsigned NOT NULL COMMENT "the execution mode: 1. debug run 2. release run 3. node debug", `operator_id` bigint unsigned NOT NULL COMMENT "the user id that runs this workflow", `connector_id` bigint unsigned NULL COMMENT "the connector on which this execution happened", `connector_uid` varchar(64) NULL COMMENT "user id of the connector", `created_at` bigint unsigned NOT NULL COMMENT "create time in millisecond", `log_id` varchar(128) NULL COMMENT "log id", `status` tinyint unsigned NULL COMMENT "1=running 2=success 3=fail 4=interrupted", `duration` bigint unsigned NULL COMMENT "execution duration in millisecond", `input` mediumtext NULL COMMENT "actual input of this execution", `output` mediumtext NULL COMMENT "the actual output of this execution", `error_code` varchar(255) NULL COMMENT "error code if any", `fail_reason` mediumtext NULL COMMENT "the reason for failure", `input_tokens` bigint unsigned NULL COMMENT "number of input tokens", `output_tokens` bigint unsigned NULL COMMENT "number of output tokens", `updated_at` bigint unsigned NULL COMMENT "update time in millisecond", `root_execution_id` bigint unsigned NULL COMMENT "the top level execution id. Null if this is the root", `parent_node_id` varchar(128) NULL COMMENT "the node key for the sub_workflow node that executes this workflow", `app_id` bigint unsigned NULL COMMENT "app id this workflow execution belongs to", `node_count` mediumint unsigned NULL COMMENT "the total node count of the workflow", `resume_event_id` bigint unsigned NULL COMMENT "the current event ID which is resuming", `agent_id` bigint unsigned NULL COMMENT "the agent that this execution binds to", `sync_pattern` tinyint unsigned NULL COMMENT "the sync pattern 1. sync 2. async 3. stream", `commit_id` varchar(255) NULL COMMENT "draft commit id this execution belongs to", PRIMARY KEY (`id`), INDEX `idx_workflow_id_version_mode_created_at` (`workflow_id`, `version`, `mode`, `created_at`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Workflow Execution Record Table, used to record the status of each workflow execution"; -- Create "workflow_meta" table -CREATE TABLE IF NOT EXISTS `workflow_meta` (`id` bigint unsigned NOT NULL COMMENT "workflow id", `name` varchar(256) NOT NULL COMMENT "workflow name", `description` varchar(2000) NOT NULL COMMENT "workflow description", `icon_uri` varchar(256) NOT NULL COMMENT "icon uri", `status` tinyint unsigned NOT NULL COMMENT "0:未发布过, 1:已发布过", `content_type` tinyint unsigned NOT NULL COMMENT "0用户 1官方", `mode` tinyint unsigned NOT NULL COMMENT "0:workflow, 3:chat_flow", `created_at` bigint unsigned NOT NULL COMMENT "create time in millisecond", `updated_at` bigint unsigned NULL COMMENT "update time in millisecond", `deleted_at` datetime(3) NULL COMMENT "delete time in millisecond", `creator_id` bigint unsigned NOT NULL COMMENT "user id for creator", `tag` tinyint unsigned NULL COMMENT "template tag: Tag: 1=All, 2=Hot, 3=Information, 4=Music, 5=Picture, 6=UtilityTool, 7=Life, 8=Traval, 9=Network, 10=System, 11=Movie, 12=Office, 13=Shopping, 14=Education, 15=Health, 16=Social, 17=Entertainment, 18=Finance, 100=Hidden", `author_id` bigint unsigned NOT NULL COMMENT "原作者用户 ID", `space_id` bigint unsigned NOT NULL COMMENT " 空间 ID", `updater_id` bigint unsigned NULL COMMENT " 更新元信息的用户 ID", `source_id` bigint unsigned NULL COMMENT " 复制来源的 workflow ID", `app_id` bigint unsigned NULL COMMENT "应用 ID", `latest_version` varchar(50) NULL COMMENT "the version of the most recent publish", `latest_version_ts` bigint unsigned NULL COMMENT "create time of latest version", PRIMARY KEY (`id`), INDEX `idx_app_id` (`app_id`), INDEX `idx_latest_version_ts` (`latest_version_ts` DESC), INDEX `idx_space_id_app_id_status_latest_version_ts` (`space_id`, `app_id`, `status`, `latest_version_ts`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "workflow 元信息表,用于记录workflow基本的元信息"; +CREATE TABLE IF NOT EXISTS `workflow_meta` (`id` bigint unsigned NOT NULL COMMENT "workflow id", `name` varchar(256) NOT NULL COMMENT "workflow name", `description` varchar(2000) NOT NULL COMMENT "workflow description", `icon_uri` varchar(256) NOT NULL COMMENT "icon uri", `status` tinyint unsigned NOT NULL COMMENT "0: Not published, 1: Published", `content_type` tinyint unsigned NOT NULL COMMENT "0 Users 1 Official", `mode` tinyint unsigned NOT NULL COMMENT "0:workflow, 3:chat_flow", `created_at` bigint unsigned NOT NULL COMMENT "create time in millisecond", `updated_at` bigint unsigned NULL COMMENT "update time in millisecond", `deleted_at` datetime(3) NULL COMMENT "delete time in millisecond", `creator_id` bigint unsigned NOT NULL COMMENT "user id for creator", `tag` tinyint unsigned NULL COMMENT "template tag: Tag: 1=All, 2=Hot, 3=Information, 4=Music, 5=Picture, 6=UtilityTool, 7=Life, 8=Traval, 9=Network, 10=System, 11=Movie, 12=Office, 13=Shopping, 14=Education, 15=Health, 16=Social, 17=Entertainment, 18=Finance, 100=Hidden", `author_id` bigint unsigned NOT NULL COMMENT "Original author user ID", `space_id` bigint unsigned NOT NULL COMMENT "space id", `updater_id` bigint unsigned NULL COMMENT "User ID for updating metadata", `source_id` bigint unsigned NULL COMMENT "Workflow ID of source", `app_id` bigint unsigned NULL COMMENT "app id", `latest_version` varchar(50) NULL COMMENT "the version of the most recent publish", `latest_version_ts` bigint unsigned NULL COMMENT "create time of latest version", PRIMARY KEY (`id`), INDEX `idx_app_id` (`app_id`), INDEX `idx_latest_version_ts` (`latest_version_ts` DESC), INDEX `idx_space_id_app_id_status_latest_version_ts` (`space_id`, `app_id`, `status`, `latest_version_ts`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "The workflow metadata table,used to record the basic metadata of workflow"; -- Create "workflow_reference" table -CREATE TABLE IF NOT EXISTS `workflow_reference` (`id` bigint unsigned NOT NULL COMMENT "workflow id", `referred_id` bigint unsigned NOT NULL COMMENT "the id of the workflow that is referred by other entities", `referring_id` bigint unsigned NOT NULL COMMENT "the entity id that refers this workflow", `refer_type` tinyint unsigned NOT NULL COMMENT "1 subworkflow 2 tool", `referring_biz_type` tinyint unsigned NOT NULL COMMENT "the biz type the referring entity belongs to: 1. workflow 2. agent", `created_at` bigint unsigned NOT NULL COMMENT "create time in millisecond", `status` tinyint unsigned NOT NULL COMMENT "whether this reference currently takes effect. 0: disabled 1: enabled", `deleted_at` datetime(3) NULL, PRIMARY KEY (`id`), INDEX `idx_referred_id_referring_biz_type_status` (`referred_id`, `referring_biz_type`, `status`), INDEX `idx_referring_id_status` (`referring_id`, `status`), UNIQUE INDEX `uniq_referred_id_referring_id_refer_type` (`referred_id`, `referring_id`, `refer_type`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "workflow 关联关系表,用于记录workflow 直接互相引用关系"; +CREATE TABLE IF NOT EXISTS `workflow_reference` (`id` bigint unsigned NOT NULL COMMENT "workflow id", `referred_id` bigint unsigned NOT NULL COMMENT "the id of the workflow that is referred by other entities", `referring_id` bigint unsigned NOT NULL COMMENT "the entity id that refers this workflow", `refer_type` tinyint unsigned NOT NULL COMMENT "1 subworkflow 2 tool", `referring_biz_type` tinyint unsigned NOT NULL COMMENT "the biz type the referring entity belongs to: 1. workflow 2. agent", `created_at` bigint unsigned NOT NULL COMMENT "create time in millisecond", `status` tinyint unsigned NOT NULL COMMENT "whether this reference currently takes effect. 0: disabled 1: enabled", `deleted_at` datetime(3) NULL COMMENT "Delete Time", PRIMARY KEY (`id`), INDEX `idx_referred_id_referring_biz_type_status` (`referred_id`, `referring_biz_type`, `status`), INDEX `idx_referring_id_status` (`referring_id`, `status`), UNIQUE INDEX `uniq_referred_id_referring_id_refer_type` (`referred_id`, `referring_id`, `refer_type`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "The workflow association table,used to record the direct mutual reference relationship between workflows"; -- Create "workflow_snapshot" table -CREATE TABLE IF NOT EXISTS `workflow_snapshot` (`workflow_id` bigint unsigned NOT NULL COMMENT "workflow id this snapshot belongs to", `commit_id` varchar(255) NOT NULL COMMENT "the commit id of the workflow draft", `canvas` mediumtext NOT NULL COMMENT "frontend schema for this snapshot", `input_params` mediumtext NULL COMMENT "input parameter info", `output_params` mediumtext NULL COMMENT "output parameter info", `created_at` bigint unsigned NOT NULL, `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "ID", PRIMARY KEY (`id`), UNIQUE INDEX `uniq_workflow_id_commit_id` (`workflow_id`, `commit_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "snapshot for executed workflow draft"; +CREATE TABLE IF NOT EXISTS `workflow_snapshot` (`workflow_id` bigint unsigned NOT NULL COMMENT "workflow id this snapshot belongs to", `commit_id` varchar(255) NOT NULL COMMENT "the commit id of the workflow draft", `canvas` mediumtext NOT NULL COMMENT "frontend schema for this snapshot", `input_params` mediumtext NULL COMMENT "input parameter info", `output_params` mediumtext NULL COMMENT "output parameter info", `created_at` bigint unsigned NOT NULL COMMENT "Create Time in Milliseconds", `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "ID", PRIMARY KEY (`id`), UNIQUE INDEX `uniq_workflow_id_commit_id` (`workflow_id`, `commit_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "snapshot for executed workflow draft"; -- Create "workflow_version" table -CREATE TABLE IF NOT EXISTS `workflow_version` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "ID", `workflow_id` bigint unsigned NOT NULL COMMENT "workflow id", `version` varchar(50) NOT NULL COMMENT "发布版本", `version_description` varchar(2000) NOT NULL COMMENT "版本描述", `canvas` mediumtext NOT NULL COMMENT "前端 schema", `input_params` mediumtext NULL, `output_params` mediumtext NULL, `creator_id` bigint unsigned NOT NULL COMMENT "发布用户 ID", `created_at` bigint unsigned NOT NULL COMMENT "创建时间毫秒时间戳", `deleted_at` datetime(3) NULL COMMENT "删除毫秒时间戳", `commit_id` varchar(255) NOT NULL COMMENT "the commit id corresponding to this version", PRIMARY KEY (`id`), INDEX `idx_id_created_at` (`workflow_id`, `created_at`), UNIQUE INDEX `uniq_workflow_id_version` (`workflow_id`, `version`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "workflow 画布版本信息表,用于记录不同版本的画布信息"; +CREATE TABLE IF NOT EXISTS `workflow_version` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "ID", `workflow_id` bigint unsigned NOT NULL COMMENT "workflow id", `version` varchar(50) NOT NULL COMMENT "Published version", `version_description` varchar(2000) NOT NULL COMMENT "Version Description", `canvas` mediumtext NOT NULL COMMENT "Front end schema", `input_params` mediumtext NULL COMMENT "input params", `output_params` mediumtext NULL COMMENT "output params", `creator_id` bigint unsigned NOT NULL COMMENT "creator id", `created_at` bigint unsigned NOT NULL COMMENT "Create Time in Milliseconds", `deleted_at` datetime(3) NULL COMMENT "Delete Time", `commit_id` varchar(255) NOT NULL COMMENT "the commit id corresponding to this version", PRIMARY KEY (`id`), INDEX `idx_id_created_at` (`workflow_id`, `created_at`), UNIQUE INDEX `uniq_workflow_id_version` (`workflow_id`, `version`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Workflow Canvas Version Information Table, used to record canvas information for different versions"; -- 初始化用户表数据 -- 使用 INSERT ON DUPLICATE KEY UPDATE 语句 -- 当主键或唯一键冲突时,不会插入新记录,而是更新指定字段 diff --git a/helm/charts/opencoze/files/mysql/schema.sql b/helm/charts/opencoze/files/mysql/schema.sql index 5d4fdc50..e3b73a0d 100755 --- a/helm/charts/opencoze/files/mysql/schema.sql +++ b/helm/charts/opencoze/files/mysql/schema.sql @@ -17,27 +17,27 @@ CREATE TABLE IF NOT EXISTS `app_release_record` (`id` bigint unsigned NOT NULL D -- Create "connector_workflow_version" table CREATE TABLE IF NOT EXISTS `connector_workflow_version` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "id", `app_id` bigint unsigned NOT NULL COMMENT "app id", `connector_id` bigint unsigned NOT NULL COMMENT "connector id", `workflow_id` bigint unsigned NOT NULL COMMENT "workflow id", `version` varchar(256) NOT NULL COMMENT "version", `created_at` bigint unsigned NOT NULL COMMENT "create time in millisecond", PRIMARY KEY (`id`), INDEX `idx_connector_id_workflow_id_create_at` (`connector_id`, `workflow_id`, `created_at`), UNIQUE INDEX `idx_connector_id_workflow_id_version` (`connector_id`, `workflow_id`, `version`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci; -- Create "conversation" table -CREATE TABLE IF NOT EXISTS `conversation` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "主键ID", `connector_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "业务线 ID", `agent_id` bigint NOT NULL DEFAULT 0 COMMENT "agent_id", `scene` tinyint NOT NULL DEFAULT 0 COMMENT "会话场景", `section_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "最新section_id", `creator_id` bigint unsigned NULL DEFAULT 0 COMMENT "创建者id", `ext` text NULL COMMENT "扩展字段", `status` tinyint NOT NULL DEFAULT 1 COMMENT "status: 1-normal 2-deleted", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "创建时间", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "更新时间", PRIMARY KEY (`id`), INDEX `idx_connector_bot_status` (`connector_id`, `agent_id`, `creator_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "会话信息表"; +CREATE TABLE IF NOT EXISTS `conversation` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "id", `connector_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Publish Connector ID", `agent_id` bigint NOT NULL DEFAULT 0 COMMENT "agent_id", `scene` tinyint NOT NULL DEFAULT 0 COMMENT "conversation scene", `section_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "section_id", `creator_id` bigint unsigned NULL DEFAULT 0 COMMENT "creator_id", `ext` text NULL COMMENT "ext", `status` tinyint NOT NULL DEFAULT 1 COMMENT "status: 1-normal 2-deleted", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", PRIMARY KEY (`id`), INDEX `idx_connector_bot_status` (`connector_id`, `agent_id`, `creator_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "conversation info record" AUTO_INCREMENT 7532101736270397441; -- Create "data_copy_task" table -CREATE TABLE IF NOT EXISTS `data_copy_task` (`master_task_id` varchar(128) NOT NULL DEFAULT "" COMMENT "复制任务ID", `origin_data_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "源id", `target_data_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "目标id", `origin_space_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "源团队空间", `target_space_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "目标团队空间", `origin_user_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "源用户ID", `target_user_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "目标用户ID", `origin_app_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "源AppID", `target_app_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "目标AppID", `data_type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "数据类型 1:knowledge, 2:database", `ext_info` varchar(255) NOT NULL DEFAULT "" COMMENT "存储额外信息", `start_time` bigint NOT NULL DEFAULT 0 COMMENT "任务开始时间", `finish_time` bigint NULL COMMENT "任务结束时间", `status` tinyint NOT NULL DEFAULT 1 COMMENT "1:创建 2:执行中 3:成功 4:失败", `error_msg` varchar(128) NULL COMMENT "错误信息", `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "ID", PRIMARY KEY (`id`), UNIQUE INDEX `uniq_master_task_id_origin_data_id_data_type` (`master_task_id`, `origin_data_id`, `data_type`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_general_ci COMMENT "data方向复制任务记录表"; +CREATE TABLE IF NOT EXISTS `data_copy_task` (`master_task_id` varchar(128) NULL DEFAULT "" COMMENT "task id", `origin_data_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "origin data id", `target_data_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "target data id", `origin_space_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "origin space id", `target_space_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "target space id", `origin_user_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "origin user id", `target_user_id` bigint unsigned NULL DEFAULT 0 COMMENT "target user id", `origin_app_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "origin app id", `target_app_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "target app id", `data_type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "data type 1:knowledge, 2:database", `ext_info` varchar(255) NOT NULL DEFAULT "" COMMENT "ext", `start_time` bigint NULL DEFAULT 0 COMMENT "task start time", `finish_time` bigint NULL COMMENT "task finish time", `status` tinyint NOT NULL DEFAULT 1 COMMENT "1: Create 2: Running 3: Success 4: Failure", `error_msg` varchar(128) NULL COMMENT "error msg", `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "ID", PRIMARY KEY (`id`), UNIQUE INDEX `uniq_master_task_id_origin_data_id_data_type` (`master_task_id`, `origin_data_id`, `data_type`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_general_ci COMMENT "data copy task record"; -- Create "draft_database_info" table CREATE TABLE IF NOT EXISTS `draft_database_info` (`id` bigint unsigned NOT NULL COMMENT "ID", `app_id` bigint unsigned NULL COMMENT "App ID", `space_id` bigint unsigned NOT NULL COMMENT "Space ID", `related_online_id` bigint unsigned NOT NULL COMMENT "The primary key ID of online_database_info table", `is_visible` tinyint NOT NULL DEFAULT 1 COMMENT "Visibility: 0 invisible, 1 visible", `prompt_disabled` tinyint NOT NULL DEFAULT 0 COMMENT "Support prompt calls: 1 not supported, 0 supported", `table_name` varchar(255) NOT NULL COMMENT "Table name", `table_desc` varchar(256) NULL COMMENT "Table description", `table_field` text NULL COMMENT "Table field info", `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "Creator ID", `icon_uri` varchar(255) NOT NULL COMMENT "Icon Uri", `physical_table_name` varchar(255) NULL COMMENT "The name of the real physical table", `rw_mode` bigint NOT NULL DEFAULT 1 COMMENT "Read and write permission modes: 1. Limited read and write mode 2. Read-only mode 3. Full read and write mode", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` datetime NULL COMMENT "Delete Time", PRIMARY KEY (`id`), INDEX `idx_space_app_creator_deleted` (`space_id`, `app_id`, `creator_id`, `deleted_at`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_general_ci COMMENT "draft database info"; -- Create "knowledge" table -CREATE TABLE IF NOT EXISTS `knowledge` (`id` bigint unsigned NOT NULL COMMENT "主键ID", `name` varchar(150) NOT NULL DEFAULT "" COMMENT "名称", `app_id` bigint NOT NULL DEFAULT 0 COMMENT "项目ID,标识该资源是否是项目独有", `creator_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "ID", `space_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "空间ID", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` datetime(3) NULL COMMENT "Delete Time in Milliseconds", `status` tinyint NOT NULL DEFAULT 1 COMMENT "0 初始化, 1 生效 2 失效", `description` text NULL COMMENT "描述", `icon_uri` varchar(150) NULL COMMENT "头像uri", `format_type` tinyint NOT NULL DEFAULT 0 COMMENT "0:文本 1:表格 2:图片", PRIMARY KEY (`id`), INDEX `idx_app_id` (`app_id`), INDEX `idx_creator_id` (`creator_id`), INDEX `idx_space_id_deleted_at_updated_at` (`space_id`, `deleted_at`, `updated_at`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "知识库表"; +CREATE TABLE IF NOT EXISTS `knowledge` (`id` bigint unsigned NOT NULL COMMENT "id", `name` varchar(150) NOT NULL DEFAULT "" COMMENT "knowledge's name", `app_id` bigint NOT NULL DEFAULT 0 COMMENT "app id", `creator_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "creator id", `space_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "space id", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` datetime(3) NULL COMMENT "Delete Time", `status` tinyint NOT NULL DEFAULT 1 COMMENT "0 initialization, 1 effective, 2 invalid", `description` text NULL COMMENT "description", `icon_uri` varchar(150) NULL COMMENT "icon uri", `format_type` tinyint NOT NULL DEFAULT 0 COMMENT "0: Text 1: Table 2: Images", PRIMARY KEY (`id`), INDEX `idx_app_id` (`app_id`), INDEX `idx_creator_id` (`creator_id`), INDEX `idx_space_id_deleted_at_updated_at` (`space_id`, `deleted_at`, `updated_at`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "knowledge tabke"; -- Create "knowledge_document" table -CREATE TABLE IF NOT EXISTS `knowledge_document` (`id` bigint unsigned NOT NULL COMMENT "主键ID", `knowledge_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "所属knowledge的ID", `name` varchar(150) NOT NULL DEFAULT "" COMMENT "文档名称", `file_extension` varchar(20) NOT NULL DEFAULT "0" COMMENT "文档类型, txt/pdf/csv/...", `document_type` int NOT NULL DEFAULT 0 COMMENT "文档类型: 0:文本 1:表格 2:图片", `uri` text NULL COMMENT "资源uri", `size` bigint unsigned NOT NULL DEFAULT 0 COMMENT "文档大小", `slice_count` bigint unsigned NOT NULL DEFAULT 0 COMMENT "分片数量", `char_count` bigint unsigned NOT NULL DEFAULT 0 COMMENT "字符数", `creator_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "创建者ID", `space_id` bigint NOT NULL DEFAULT 0 COMMENT "空间id", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` datetime(3) NULL COMMENT "Delete Time in Milliseconds", `source_type` int NOT NULL DEFAULT 0 COMMENT "0:本地文件上传, 2:自定义文本", `status` int NOT NULL DEFAULT 0 COMMENT "状态", `fail_reason` text NULL COMMENT "失败原因", `parse_rule` json NULL COMMENT "解析+切片规则", `table_info` json NULL COMMENT "表格信息", PRIMARY KEY (`id`), INDEX `idx_creator_id` (`creator_id`), INDEX `idx_knowledge_id_deleted_at_updated_at` (`knowledge_id`, `deleted_at`, `updated_at`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "知识库文档表"; +CREATE TABLE IF NOT EXISTS `knowledge_document` (`id` bigint unsigned NOT NULL COMMENT "id", `knowledge_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "knowledge id", `name` varchar(150) NOT NULL DEFAULT "" COMMENT "document name", `file_extension` varchar(20) NOT NULL DEFAULT "0" COMMENT "Document type, txt/pdf/csv etc..", `document_type` int NOT NULL DEFAULT 0 COMMENT "Document type: 0: Text 1: Table 2: Image", `uri` text NULL COMMENT "uri", `size` bigint unsigned NOT NULL DEFAULT 0 COMMENT "document size", `slice_count` bigint unsigned NOT NULL DEFAULT 0 COMMENT "slice count", `char_count` bigint unsigned NOT NULL DEFAULT 0 COMMENT "number of characters", `creator_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "creator id", `space_id` bigint NOT NULL DEFAULT 0 COMMENT "space id", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` datetime(3) NULL COMMENT "Delete Time", `source_type` int NULL DEFAULT 0 COMMENT "0: Local file upload, 2: Custom text, 103: Feishu 104: Lark", `status` int NOT NULL DEFAULT 0 COMMENT "status", `fail_reason` text NULL COMMENT "fail reason", `parse_rule` json NULL COMMENT "parse rule", `table_info` json NULL COMMENT "table info", PRIMARY KEY (`id`), INDEX `idx_creator_id` (`creator_id`), INDEX `idx_knowledge_id_deleted_at_updated_at` (`knowledge_id`, `deleted_at`, `updated_at`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "knowledge document info"; -- Create "knowledge_document_review" table -CREATE TABLE IF NOT EXISTS `knowledge_document_review` (`id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "主键ID", `knowledge_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "knowledge id", `space_id` bigint NOT NULL DEFAULT 0 COMMENT "空间id", `name` varchar(150) NOT NULL DEFAULT "" COMMENT "文档名称", `type` varchar(10) NOT NULL DEFAULT "0" COMMENT "文档类型", `uri` text NULL COMMENT "资源标识", `format_type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "0 文本, 1 表格, 2 图片", `status` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "0 处理中,1 已完成,2 失败,3 失效", `chunk_resp_uri` text NULL COMMENT "预切片tos资源标识", `deleted_at` datetime(3) NULL COMMENT "Delete Time in Milliseconds", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "创建者ID", PRIMARY KEY (`id`), INDEX `idx_dataset_id` (`knowledge_id`, `status`, `updated_at`), INDEX `idx_uri` (`uri` (100))) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "文档审阅表"; +CREATE TABLE IF NOT EXISTS `knowledge_document_review` (`id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "id", `knowledge_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "knowledge id", `space_id` bigint NOT NULL DEFAULT 0 COMMENT "space id", `name` varchar(150) NOT NULL DEFAULT "" COMMENT "name", `type` varchar(10) NOT NULL DEFAULT "0" COMMENT "document type", `uri` text NULL COMMENT "uri", `format_type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "0 text, 1 table, 2 images", `status` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "0 Processing 1 Completed 2 Failed 3 Expired", `chunk_resp_uri` text NULL COMMENT "pre-sliced uri", `deleted_at` datetime(3) NULL COMMENT "Delete Time", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "creator id", PRIMARY KEY (`id`), INDEX `idx_dataset_id` (`knowledge_id`, `status`, `updated_at`), INDEX `idx_uri` (`uri` (100))) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Document slice preview info"; -- Create "knowledge_document_slice" table -CREATE TABLE IF NOT EXISTS `knowledge_document_slice` (`id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "主键ID", `knowledge_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "knowledge id", `document_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "document id", `content` text NULL COMMENT "切片内容", `sequence` decimal(20,5) NOT NULL COMMENT "切片顺序号, 从1开始", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` datetime(3) NULL COMMENT "Delete Time in Milliseconds", `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "创建者ID", `space_id` bigint NOT NULL DEFAULT 0 COMMENT "空间ID", `status` int NOT NULL DEFAULT 0 COMMENT "状态", `fail_reason` text NULL COMMENT "失败原因", `hit` bigint unsigned NOT NULL DEFAULT 0 COMMENT "命中次数", PRIMARY KEY (`id`), INDEX `idx_document_id_deleted_at_sequence` (`document_id`, `deleted_at`, `sequence`), INDEX `idx_knowledge_id_document_id` (`knowledge_id`, `document_id`), INDEX `idx_sequence` (`sequence`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "知识库文件切片表"; +CREATE TABLE IF NOT EXISTS `knowledge_document_slice` (`id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "id", `knowledge_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "knowledge id", `document_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "document_id", `content` text NULL COMMENT "content", `sequence` decimal(20,5) NOT NULL COMMENT "slice sequence number, starting from 1", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` datetime(3) NULL COMMENT "Delete Time", `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "creator id", `space_id` bigint NOT NULL DEFAULT 0 COMMENT "space id", `status` int NOT NULL DEFAULT 0 COMMENT "status", `fail_reason` text NULL COMMENT "fail reason", `hit` bigint unsigned NOT NULL DEFAULT 0 COMMENT "hit counts ", PRIMARY KEY (`id`), INDEX `idx_document_id_deleted_at_sequence` (`document_id`, `deleted_at`, `sequence`), INDEX `idx_knowledge_id_document_id` (`knowledge_id`, `document_id`), INDEX `idx_sequence` (`sequence`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "knowledge document slice"; -- Create "message" table -CREATE TABLE IF NOT EXISTS `message` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "主键ID", `run_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "对应的run_id", `conversation_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "conversation id", `user_id` varchar(60) NOT NULL DEFAULT "" COMMENT "user id", `agent_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "agent_id", `role` varchar(100) NOT NULL DEFAULT "" COMMENT "角色: user、assistant、system", `content_type` varchar(100) NOT NULL DEFAULT "" COMMENT "内容类型 1 text", `content` mediumtext NULL COMMENT "内容", `message_type` varchar(100) NOT NULL DEFAULT "" COMMENT "消息类型:", `display_content` text NULL COMMENT "展示内容", `ext` text NULL COMMENT "message 扩展字段" COLLATE utf8mb4_general_ci, `section_id` bigint unsigned NULL COMMENT "段落id", `broken_position` int NULL DEFAULT -1 COMMENT "打断位置", `status` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "消息状态 1 Available 2 Deleted 3 Replaced 4 Broken 5 Failed 6 Streaming 7 Pending", `model_content` mediumtext NULL COMMENT "模型输入内容", `meta_info` text NULL COMMENT "引用、高亮等文本标记信息", `reasoning_content` text NULL COMMENT "思考内容" COLLATE utf8mb4_general_ci, `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "创建时间", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "更新时间", PRIMARY KEY (`id`), INDEX `idx_conversation_id` (`conversation_id`), INDEX `idx_run_id` (`run_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "消息表"; +CREATE TABLE IF NOT EXISTS `message` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "id", `run_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "run_id", `conversation_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "conversation id", `user_id` varchar(60) NOT NULL DEFAULT "" COMMENT "user id", `agent_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "agent_id", `role` varchar(100) NOT NULL DEFAULT "" COMMENT "role: user、assistant、system", `content_type` varchar(100) NOT NULL DEFAULT "" COMMENT "content type 1 text", `content` mediumtext NULL COMMENT "content", `message_type` varchar(100) NOT NULL DEFAULT "" COMMENT "message_type", `display_content` text NULL COMMENT "display content", `ext` text NULL COMMENT "message ext" COLLATE utf8mb4_general_ci, `section_id` bigint unsigned NULL COMMENT "section_id", `broken_position` int NULL DEFAULT -1 COMMENT "broken position", `status` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "message status: 1 Available 2 Deleted 3 Replaced 4 Broken 5 Failed 6 Streaming 7 Pending", `model_content` mediumtext NULL COMMENT "model content", `meta_info` text NULL COMMENT "text tagging information such as citation and highlighting", `reasoning_content` text NULL COMMENT "reasoning content" COLLATE utf8mb4_general_ci, `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", PRIMARY KEY (`id`), INDEX `idx_conversation_id` (`conversation_id`), INDEX `idx_run_id` (`run_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "message record"; -- Create "model_entity" table -CREATE TABLE IF NOT EXISTS `model_entity` (`id` bigint unsigned NOT NULL COMMENT "主键ID", `meta_id` bigint unsigned NOT NULL COMMENT "模型元信息 id", `name` varchar(128) NOT NULL COMMENT "名称", `description` text NULL COMMENT "描述", `default_params` json NULL COMMENT "默认参数", `scenario` bigint unsigned NOT NULL COMMENT "模型应用场景", `status` int NOT NULL DEFAULT 1 COMMENT "模型状态", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` bigint unsigned NULL COMMENT "Delete Time in Milliseconds", PRIMARY KEY (`id`), INDEX `idx_scenario` (`scenario`), INDEX `idx_status` (`status`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "模型信息"; +CREATE TABLE IF NOT EXISTS `model_entity` (`id` bigint unsigned NOT NULL COMMENT "id", `meta_id` bigint unsigned NOT NULL COMMENT "model metadata id", `name` varchar(128) NOT NULL COMMENT "name", `description` text NULL COMMENT "description", `default_params` json NULL COMMENT "default params", `scenario` bigint unsigned NOT NULL COMMENT "scenario", `status` int NOT NULL DEFAULT 1 COMMENT "model status", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` bigint unsigned NULL COMMENT "Delete Time", PRIMARY KEY (`id`), INDEX `idx_scenario` (`scenario`), INDEX `idx_status` (`status`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Model information"; -- Create "model_meta" table -CREATE TABLE IF NOT EXISTS `model_meta` (`id` bigint unsigned NOT NULL COMMENT "主键ID", `model_name` varchar(128) NOT NULL COMMENT "模型名称", `protocol` varchar(128) NOT NULL COMMENT "模型协议", `icon_uri` varchar(255) NOT NULL DEFAULT "" COMMENT "Icon URI", `capability` json NULL COMMENT "模型能力", `conn_config` json NULL COMMENT "模型连接配置", `status` int NOT NULL DEFAULT 1 COMMENT "模型状态", `description` varchar(2048) NOT NULL DEFAULT "" COMMENT "模型描述", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` bigint unsigned NULL COMMENT "Delete Time in Milliseconds", `icon_url` varchar(255) NOT NULL DEFAULT "" COMMENT "Icon URL", PRIMARY KEY (`id`), INDEX `idx_status` (`status`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "模型元信息"; +CREATE TABLE IF NOT EXISTS `model_meta` (`id` bigint unsigned NOT NULL COMMENT "id", `model_name` varchar(128) NOT NULL COMMENT "model name", `protocol` varchar(128) NOT NULL COMMENT "model protocol", `icon_uri` varchar(255) NOT NULL DEFAULT "" COMMENT "Icon URI", `capability` json NULL COMMENT "capability", `conn_config` json NULL COMMENT "model conn config", `status` int NOT NULL DEFAULT 1 COMMENT "model status", `description` varchar(2048) NOT NULL DEFAULT "" COMMENT "description", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` bigint unsigned NULL COMMENT "Delete Time", `icon_url` varchar(255) NOT NULL DEFAULT "" COMMENT "Icon URL", PRIMARY KEY (`id`), INDEX `idx_status` (`status`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Model metadata"; -- Create "node_execution" table -CREATE TABLE IF NOT EXISTS `node_execution` (`id` bigint unsigned NOT NULL COMMENT "node execution id", `execute_id` bigint unsigned NOT NULL COMMENT "the workflow execute id this node execution belongs to", `node_id` varchar(128) NOT NULL COMMENT "node key" COLLATE utf8mb4_unicode_ci, `node_name` varchar(128) NOT NULL COMMENT "name of the node" COLLATE utf8mb4_unicode_ci, `node_type` varchar(128) NOT NULL COMMENT "the type of the node, in string" COLLATE utf8mb4_unicode_ci, `created_at` bigint unsigned NOT NULL COMMENT "create time in millisecond", `status` tinyint unsigned NOT NULL COMMENT "1=waiting 2=running 3=success 4=fail", `duration` bigint unsigned NULL COMMENT "execution duration in millisecond", `input` mediumtext NULL COMMENT "actual input of the node" COLLATE utf8mb4_unicode_ci, `output` mediumtext NULL COMMENT "actual output of the node" COLLATE utf8mb4_unicode_ci, `raw_output` mediumtext NULL COMMENT "the original output of the node" COLLATE utf8mb4_unicode_ci, `error_info` mediumtext NULL COMMENT "error info" COLLATE utf8mb4_unicode_ci, `error_level` varchar(32) NULL COMMENT "level of the error" COLLATE utf8mb4_unicode_ci, `input_tokens` bigint unsigned NULL COMMENT "number of input tokens", `output_tokens` bigint unsigned NULL COMMENT "number of output tokens", `updated_at` bigint unsigned NULL COMMENT "update time in millisecond", `composite_node_index` bigint unsigned NULL COMMENT "loop or batch's execution index", `composite_node_items` mediumtext NULL COMMENT "the items extracted from parent composite node for this index" COLLATE utf8mb4_unicode_ci, `parent_node_id` varchar(128) NULL COMMENT "when as inner node for loop or batch, this is the parent node's key" COLLATE utf8mb4_unicode_ci, `sub_execute_id` bigint unsigned NULL COMMENT "if this node is sub_workflow, the exe id of the sub workflow", `extra` mediumtext NULL COMMENT "extra info" COLLATE utf8mb4_unicode_ci, PRIMARY KEY (`id`), INDEX `idx_execute_id_node_id` (`execute_id`, `node_id`), INDEX `idx_execute_id_parent_node_id` (`execute_id`, `parent_node_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT "node 节点运行记录,用于记录每次workflow执行时,每个节点的状态信息"; +CREATE TABLE IF NOT EXISTS `node_execution` (`id` bigint unsigned NOT NULL COMMENT "node execution id", `execute_id` bigint unsigned NOT NULL COMMENT "the workflow execute id this node execution belongs to", `node_id` varchar(128) NOT NULL COMMENT "node key" COLLATE utf8mb4_unicode_ci, `node_name` varchar(128) NOT NULL COMMENT "name of the node" COLLATE utf8mb4_unicode_ci, `node_type` varchar(128) NOT NULL COMMENT "the type of the node, in string" COLLATE utf8mb4_unicode_ci, `created_at` bigint unsigned NOT NULL COMMENT "create time in millisecond", `status` tinyint unsigned NOT NULL COMMENT "1=waiting 2=running 3=success 4=fail", `duration` bigint unsigned NULL COMMENT "execution duration in millisecond", `input` mediumtext NULL COMMENT "actual input of the node" COLLATE utf8mb4_unicode_ci, `output` mediumtext NULL COMMENT "actual output of the node" COLLATE utf8mb4_unicode_ci, `raw_output` mediumtext NULL COMMENT "the original output of the node" COLLATE utf8mb4_unicode_ci, `error_info` mediumtext NULL COMMENT "error info" COLLATE utf8mb4_unicode_ci, `error_level` varchar(32) NULL COMMENT "level of the error" COLLATE utf8mb4_unicode_ci, `input_tokens` bigint unsigned NULL COMMENT "number of input tokens", `output_tokens` bigint unsigned NULL COMMENT "number of output tokens", `updated_at` bigint unsigned NULL COMMENT "update time in millisecond", `composite_node_index` bigint unsigned NULL COMMENT "loop or batch's execution index", `composite_node_items` mediumtext NULL COMMENT "the items extracted from parent composite node for this index" COLLATE utf8mb4_unicode_ci, `parent_node_id` varchar(128) NULL COMMENT "when as inner node for loop or batch, this is the parent node's key" COLLATE utf8mb4_unicode_ci, `sub_execute_id` bigint unsigned NULL COMMENT "if this node is sub_workflow, the exe id of the sub workflow", `extra` mediumtext NULL COMMENT "extra info" COLLATE utf8mb4_unicode_ci, PRIMARY KEY (`id`), INDEX `idx_execute_id_node_id` (`execute_id`, `node_id`), INDEX `idx_execute_id_parent_node_id` (`execute_id`, `parent_node_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT "Node run record, used to record the status information of each node during each workflow execution"; -- Create "online_database_info" table CREATE TABLE IF NOT EXISTS `online_database_info` (`id` bigint unsigned NOT NULL COMMENT "ID", `app_id` bigint unsigned NULL COMMENT "App ID", `space_id` bigint unsigned NOT NULL COMMENT "Space ID", `related_draft_id` bigint unsigned NOT NULL COMMENT "The primary key ID of draft_database_info table", `is_visible` tinyint NOT NULL DEFAULT 1 COMMENT "Visibility: 0 invisible, 1 visible", `prompt_disabled` tinyint NOT NULL DEFAULT 0 COMMENT "Support prompt calls: 1 not supported, 0 supported", `table_name` varchar(255) NOT NULL COMMENT "Table name", `table_desc` varchar(256) NULL COMMENT "Table description", `table_field` text NULL COMMENT "Table field info", `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "Creator ID", `icon_uri` varchar(255) NOT NULL COMMENT "Icon Uri", `physical_table_name` varchar(255) NULL COMMENT "The name of the real physical table", `rw_mode` bigint NOT NULL DEFAULT 1 COMMENT "Read and write permission modes: 1. Limited read and write mode 2. Read-only mode 3. Full read and write mode", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` datetime NULL COMMENT "Delete Time", PRIMARY KEY (`id`), INDEX `idx_space_app_creator_deleted` (`space_id`, `app_id`, `creator_id`, `deleted_at`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_general_ci COMMENT "online database info"; -- Create "plugin" table @@ -49,23 +49,23 @@ CREATE TABLE IF NOT EXISTS `plugin_oauth_auth` (`id` bigint unsigned NOT NULL DE -- Create "plugin_version" table CREATE TABLE IF NOT EXISTS `plugin_version` (`id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Primary Key ID", `space_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Space ID", `developer_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Developer ID", `plugin_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Plugin ID", `app_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Application ID", `icon_uri` varchar(512) NOT NULL DEFAULT "" COMMENT "Icon URI", `server_url` varchar(512) NOT NULL DEFAULT "" COMMENT "Server URL", `plugin_type` tinyint NOT NULL DEFAULT 0 COMMENT "Plugin Type, 1:http, 6:local", `version` varchar(255) NOT NULL DEFAULT "" COMMENT "Plugin Version, e.g. v1.0.0", `version_desc` text NULL COMMENT "Plugin Version Description", `manifest` json NULL COMMENT "Plugin Manifest", `openapi_doc` json NULL COMMENT "OpenAPI Document, only stores the root", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `deleted_at` datetime NULL COMMENT "Delete Time", PRIMARY KEY (`id`), UNIQUE INDEX `uniq_idx_plugin_version` (`plugin_id`, `version`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Plugin Version"; -- Create "prompt_resource" table -CREATE TABLE IF NOT EXISTS `prompt_resource` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "主键ID", `space_id` bigint NOT NULL COMMENT "空间ID", `name` varchar(255) NOT NULL COMMENT "名称", `description` varchar(255) NOT NULL COMMENT "描述", `prompt_text` mediumtext NULL COMMENT "prompt正文", `status` int NOT NULL COMMENT "状态,0无效,1有效", `creator_id` bigint NOT NULL COMMENT "创建者ID", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "创建时间", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "更新时间", PRIMARY KEY (`id`), INDEX `idx_creator_id` (`creator_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT "prompt_resource"; +CREATE TABLE IF NOT EXISTS `prompt_resource` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "id", `space_id` bigint NOT NULL COMMENT "space id", `name` varchar(255) NOT NULL COMMENT "name", `description` varchar(255) NOT NULL COMMENT "description", `prompt_text` mediumtext NULL COMMENT "prompt text", `status` int NOT NULL COMMENT "status, 0 is invalid, 1 is valid", `creator_id` bigint NOT NULL COMMENT "creator id", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", PRIMARY KEY (`id`), INDEX `idx_creator_id` (`creator_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT "prompt_resource"; -- Create "run_record" table -CREATE TABLE IF NOT EXISTS `run_record` (`id` bigint unsigned NOT NULL COMMENT "主键ID", `conversation_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "会话 ID", `section_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "section ID", `agent_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "agent_id", `user_id` varchar(255) NOT NULL DEFAULT "" COMMENT "user id", `source` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "执行来源 0 API,", `status` varchar(255) NOT NULL DEFAULT "" COMMENT "状态,0 Unknown, 1-Created,2-InProgress,3-Completed,4-Failed,5-Expired,6-Cancelled,7-RequiresAction", `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "创建者标识", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "创建时间", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "更新时间", `failed_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "失败时间", `last_error` text NULL COMMENT "error message" COLLATE utf8mb4_general_ci, `completed_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "结束时间", `chat_request` text NULL COMMENT "保存原始请求的部分字段" COLLATE utf8mb4_general_ci, `ext` text NULL COMMENT "扩展字段" COLLATE utf8mb4_general_ci, `usage` json NULL COMMENT "usage", PRIMARY KEY (`id`), INDEX `idx_c_s` (`conversation_id`, `section_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "执行记录表"; +CREATE TABLE IF NOT EXISTS `run_record` (`id` bigint unsigned NOT NULL COMMENT "id", `conversation_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "conversation id", `section_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "section ID", `agent_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "agent_id", `user_id` varchar(255) NOT NULL DEFAULT "" COMMENT "user id", `source` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "Execute source 0 API", `status` varchar(255) NOT NULL DEFAULT "" COMMENT "status,0 Unknown, 1-Created,2-InProgress,3-Completed,4-Failed,5-Expired,6-Cancelled,7-RequiresAction", `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "creator id", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `failed_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Fail Time in Milliseconds", `last_error` text NULL COMMENT "error message" COLLATE utf8mb4_general_ci, `completed_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Finish Time in Milliseconds", `chat_request` text NULL COMMENT "Original request field" COLLATE utf8mb4_general_ci, `ext` text NULL COMMENT "ext" COLLATE utf8mb4_general_ci, `usage` json NULL COMMENT "usage", PRIMARY KEY (`id`), INDEX `idx_c_s` (`conversation_id`, `section_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "run record"; -- Create "shortcut_command" table -CREATE TABLE IF NOT EXISTS `shortcut_command` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "主键ID", `object_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "实体ID,该实体可用这个指令", `command_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "命令ID", `command_name` varchar(255) NOT NULL DEFAULT "" COMMENT "命令名称", `shortcut_command` varchar(255) NOT NULL DEFAULT "" COMMENT "快捷指令", `description` varchar(2000) NOT NULL DEFAULT "" COMMENT "命令描述", `send_type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "发送类型 0:query 1:panel", `tool_type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "使用工具的type 1:workFlow 2:插件", `work_flow_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "使用workFlow的id", `plugin_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "使用插件的id", `plugin_tool_name` varchar(255) NOT NULL DEFAULT "" COMMENT "使用插件的api_name", `template_query` text NULL COMMENT "query模板", `components` json NULL COMMENT "panel参数", `card_schema` text NULL COMMENT "卡片schema", `tool_info` json NULL COMMENT "工具信息 包含name+变量列表", `status` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "状态,0无效,1有效", `creator_id` bigint unsigned NULL DEFAULT 0 COMMENT "创建者ID", `is_online` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "是否为线上信息 0草稿 1线上", `created_at` bigint NOT NULL DEFAULT 0 COMMENT "创建时间", `updated_at` bigint NOT NULL DEFAULT 0 COMMENT "更新时间", `agent_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "multi的指令时,该指令由哪个节点执行", `shortcut_icon` json NULL COMMENT "快捷指令图标", `plugin_tool_id` bigint NOT NULL DEFAULT 0 COMMENT "tool_id", PRIMARY KEY (`id`), UNIQUE INDEX `uniq_object_command_id_type` (`object_id`, `command_id`, `is_online`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_general_ci COMMENT "bot快捷指令表"; +CREATE TABLE IF NOT EXISTS `shortcut_command` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "id", `object_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Entity ID, this command can be used for this entity", `command_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "command id", `command_name` varchar(255) NOT NULL DEFAULT "" COMMENT "command name", `shortcut_command` varchar(255) NOT NULL DEFAULT "" COMMENT "shortcut command", `description` varchar(2000) NOT NULL DEFAULT "" COMMENT "description", `send_type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "send type 0:query 1:panel", `tool_type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "Type 1 of tool used: WorkFlow 2: Plugin", `work_flow_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "workflow id", `plugin_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "plugin id", `plugin_tool_name` varchar(255) NOT NULL DEFAULT "" COMMENT "plugin tool name", `template_query` text NULL COMMENT "template query", `components` json NULL COMMENT "Panel parameters", `card_schema` text NULL COMMENT "card schema", `tool_info` json NULL COMMENT "Tool information includes name+variable list", `status` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "Status, 0 is invalid, 1 is valid", `creator_id` bigint unsigned NULL DEFAULT 0 COMMENT "creator id", `is_online` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "Is online information: 0 draft 1 online", `created_at` bigint NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `agent_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "When executing a multi instruction, which node executes the instruction", `shortcut_icon` json NULL COMMENT "shortcut icon", `plugin_tool_id` bigint NOT NULL DEFAULT 0 COMMENT "tool_id", PRIMARY KEY (`id`), UNIQUE INDEX `uniq_object_command_id_type` (`object_id`, `command_id`, `is_online`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_general_ci COMMENT "bot shortcut command table"; -- Create "single_agent_draft" table -CREATE TABLE IF NOT EXISTS `single_agent_draft` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "Primary Key ID", `agent_id` bigint NOT NULL DEFAULT 0 COMMENT "Agent ID", `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "Creator ID", `space_id` bigint NOT NULL DEFAULT 0 COMMENT "Space ID", `name` varchar(255) NOT NULL DEFAULT "" COMMENT "Agent Name", `description` text NOT NULL COMMENT "Agent Description", `icon_uri` varchar(255) NOT NULL DEFAULT "" COMMENT "Icon URI", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` datetime(3) NULL COMMENT "delete time in millisecond", `variables_meta_id` bigint NULL COMMENT "variables meta 表 ID", `model_info` json NULL COMMENT "Model Configuration Information", `onboarding_info` json NULL COMMENT "Onboarding Information", `prompt` json NULL COMMENT "Agent Prompt Configuration", `plugin` json NULL COMMENT "Agent Plugin Base Configuration", `knowledge` json NULL COMMENT "Agent Knowledge Base Configuration", `workflow` json NULL COMMENT "Agent Workflow Configuration", `suggest_reply` json NULL COMMENT "Suggested Replies", `jump_config` json NULL COMMENT "Jump Configuration", `background_image_info_list` json NULL COMMENT "Background image", `database_config` json NULL COMMENT "Agent Database Base Configuration", `shortcut_command` json NULL COMMENT "shortcut command", PRIMARY KEY (`id`), INDEX `idx_creator_id` (`creator_id`), UNIQUE INDEX `uniq_agent_id` (`agent_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Single Agent Draft Copy Table"; +CREATE TABLE IF NOT EXISTS `single_agent_draft` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "Primary Key ID", `agent_id` bigint NOT NULL DEFAULT 0 COMMENT "Agent ID", `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "Creator ID", `space_id` bigint NOT NULL DEFAULT 0 COMMENT "Space ID", `name` varchar(255) NOT NULL DEFAULT "" COMMENT "Agent Name", `description` text NOT NULL COMMENT "Agent Description", `icon_uri` varchar(255) NOT NULL DEFAULT "" COMMENT "Icon URI", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` datetime(3) NULL COMMENT "delete time in millisecond", `variables_meta_id` bigint NULL COMMENT "variables meta table ID", `model_info` json NULL COMMENT "Model Configuration Information", `onboarding_info` json NULL COMMENT "Onboarding Information", `prompt` json NULL COMMENT "Agent Prompt Configuration", `plugin` json NULL COMMENT "Agent Plugin Base Configuration", `knowledge` json NULL COMMENT "Agent Knowledge Base Configuration", `workflow` json NULL COMMENT "Agent Workflow Configuration", `suggest_reply` json NULL COMMENT "Suggested Replies", `jump_config` json NULL COMMENT "Jump Configuration", `background_image_info_list` json NULL COMMENT "Background image", `database_config` json NULL COMMENT "Agent Database Base Configuration", `shortcut_command` json NULL COMMENT "shortcut command", PRIMARY KEY (`id`), INDEX `idx_creator_id` (`creator_id`), UNIQUE INDEX `uniq_agent_id` (`agent_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Single Agent Draft Copy Table" AUTO_INCREMENT 29; -- Create "single_agent_publish" table -CREATE TABLE IF NOT EXISTS `single_agent_publish` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "主键id", `agent_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "agent_id", `publish_id` varchar(50) NOT NULL DEFAULT "" COMMENT "发布 id" COLLATE utf8mb4_general_ci, `connector_ids` json NULL COMMENT "发布的 connector_ids", `version` varchar(255) NOT NULL DEFAULT "" COMMENT "Agent Version", `publish_info` text NULL COMMENT "发布信息" COLLATE utf8mb4_general_ci, `publish_time` bigint unsigned NOT NULL DEFAULT 0 COMMENT "发布时间", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `creator_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "发布人 user_id", `status` tinyint NOT NULL DEFAULT 0 COMMENT "状态 0:使用中 1:删除 3:禁用", `extra` json NULL COMMENT "扩展字段", PRIMARY KEY (`id`), INDEX `idx_agent_id_version` (`agent_id`, `version`), INDEX `idx_creator_id` (`creator_id`), INDEX `idx_publish_id` (`publish_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "bot 渠道和发布版本流水表"; +CREATE TABLE IF NOT EXISTS `single_agent_publish` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "id", `agent_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "agent_id", `publish_id` varchar(50) NOT NULL DEFAULT "" COMMENT "publish id" COLLATE utf8mb4_general_ci, `connector_ids` json NULL COMMENT "connector_ids", `version` varchar(255) NOT NULL DEFAULT "" COMMENT "Agent Version", `publish_info` text NULL COMMENT "publish info" COLLATE utf8mb4_general_ci, `publish_time` bigint unsigned NOT NULL DEFAULT 0 COMMENT "publish time", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `creator_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "creator id", `status` tinyint NOT NULL DEFAULT 0 COMMENT "Status 0: In use 1: Delete 3: Disabled", `extra` json NULL COMMENT "extra", PRIMARY KEY (`id`), INDEX `idx_agent_id_version` (`agent_id`, `version`), INDEX `idx_creator_id` (`creator_id`), INDEX `idx_publish_id` (`publish_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Bot connector and release version info"; -- Create "single_agent_version" table -CREATE TABLE IF NOT EXISTS `single_agent_version` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "Primary Key ID", `agent_id` bigint NOT NULL DEFAULT 0 COMMENT "Agent ID", `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "Creator ID", `space_id` bigint NOT NULL DEFAULT 0 COMMENT "Space ID", `name` varchar(255) NOT NULL DEFAULT "" COMMENT "Agent Name", `description` text NOT NULL COMMENT "Agent Description", `icon_uri` varchar(255) NOT NULL DEFAULT "" COMMENT "Icon URI", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` datetime(3) NULL COMMENT "delete time in millisecond", `variables_meta_id` bigint NULL COMMENT "variables meta 表 ID", `model_info` json NULL COMMENT "Model Configuration Information", `onboarding_info` json NULL COMMENT "Onboarding Information", `prompt` json NULL COMMENT "Agent Prompt Configuration", `plugin` json NULL COMMENT "Agent Plugin Base Configuration", `knowledge` json NULL COMMENT "Agent Knowledge Base Configuration", `workflow` json NULL COMMENT "Agent Workflow Configuration", `suggest_reply` json NULL COMMENT "Suggested Replies", `jump_config` json NULL COMMENT "Jump Configuration", `connector_id` bigint unsigned NOT NULL COMMENT "Connector ID", `version` varchar(255) NOT NULL DEFAULT "" COMMENT "Agent Version", `background_image_info_list` json NULL COMMENT "Background image", `database_config` json NULL COMMENT "Agent Database Base Configuration", `shortcut_command` json NULL COMMENT "shortcut command", PRIMARY KEY (`id`), INDEX `idx_creator_id` (`creator_id`), UNIQUE INDEX `uniq_agent_id_and_version_connector_id` (`agent_id`, `version`, `connector_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Single Agent Version Copy Table"; +CREATE TABLE IF NOT EXISTS `single_agent_version` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "Primary Key ID", `agent_id` bigint NOT NULL DEFAULT 0 COMMENT "Agent ID", `creator_id` bigint NOT NULL DEFAULT 0 COMMENT "Creator ID", `space_id` bigint NOT NULL DEFAULT 0 COMMENT "Space ID", `name` varchar(255) NOT NULL DEFAULT "" COMMENT "Agent Name", `description` text NOT NULL COMMENT "Agent Description", `icon_uri` varchar(255) NOT NULL DEFAULT "" COMMENT "Icon URI", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `deleted_at` datetime(3) NULL COMMENT "delete time in millisecond", `variables_meta_id` bigint NULL COMMENT "variables meta table ID", `model_info` json NULL COMMENT "Model Configuration Information", `onboarding_info` json NULL COMMENT "Onboarding Information", `prompt` json NULL COMMENT "Agent Prompt Configuration", `plugin` json NULL COMMENT "Agent Plugin Base Configuration", `knowledge` json NULL COMMENT "Agent Knowledge Base Configuration", `workflow` json NULL COMMENT "Agent Workflow Configuration", `suggest_reply` json NULL COMMENT "Suggested Replies", `jump_config` json NULL COMMENT "Jump Configuration", `connector_id` bigint unsigned NOT NULL COMMENT "Connector ID", `version` varchar(255) NOT NULL DEFAULT "" COMMENT "Agent Version", `background_image_info_list` json NULL COMMENT "Background image", `database_config` json NULL COMMENT "Agent Database Base Configuration", `shortcut_command` json NULL COMMENT "shortcut command", PRIMARY KEY (`id`), INDEX `idx_creator_id` (`creator_id`), UNIQUE INDEX `uniq_agent_id_and_version_connector_id` (`agent_id`, `version`, `connector_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Single Agent Version Copy Table"; -- Create "space" table -CREATE TABLE IF NOT EXISTS `space` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "Primary Key ID, Space ID", `owner_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Owner ID", `name` varchar(200) NOT NULL DEFAULT "" COMMENT "Space Name", `description` varchar(2000) NOT NULL DEFAULT "" COMMENT "Space Description", `icon_uri` varchar(200) NOT NULL DEFAULT "" COMMENT "Icon URI", `creator_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Creator ID", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Creation Time (Milliseconds)", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time (Milliseconds)", `deleted_at` bigint unsigned NULL COMMENT "Deletion Time (Milliseconds)", PRIMARY KEY (`id`), INDEX `idx_creator_id` (`creator_id`), INDEX `idx_owner_id` (`owner_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Space Table"; +CREATE TABLE IF NOT EXISTS `space` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "Primary Key ID, Space ID", `owner_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Owner ID", `name` varchar(200) NOT NULL DEFAULT "" COMMENT "Space Name", `description` varchar(2000) NOT NULL DEFAULT "" COMMENT "Space Description", `icon_uri` varchar(200) NOT NULL DEFAULT "" COMMENT "Icon URI", `creator_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Creator ID", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Creation Time (Milliseconds)", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time (Milliseconds)", `deleted_at` bigint unsigned NULL COMMENT "Deletion Time (Milliseconds)", PRIMARY KEY (`id`), INDEX `idx_creator_id` (`creator_id`), INDEX `idx_owner_id` (`owner_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Space Table" AUTO_INCREMENT 7532071516331048961; -- Create "space_user" table -CREATE TABLE IF NOT EXISTS `space_user` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "Primary Key ID, Auto Increment", `space_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Space ID", `user_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "User ID", `role_type` int NOT NULL DEFAULT 3 COMMENT "Role Type: 1.owner 2.admin 3.member", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Creation Time (Milliseconds)", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time (Milliseconds)", PRIMARY KEY (`id`), INDEX `idx_user_id` (`user_id`), UNIQUE INDEX `uniq_space_user` (`space_id`, `user_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Space Member Table"; +CREATE TABLE IF NOT EXISTS `space_user` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "Primary Key ID, Auto Increment", `space_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Space ID", `user_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "User ID", `role_type` int NOT NULL DEFAULT 3 COMMENT "Role Type: 1.owner 2.admin 3.member", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Creation Time (Milliseconds)", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time (Milliseconds)", PRIMARY KEY (`id`), INDEX `idx_user_id` (`user_id`), UNIQUE INDEX `uniq_space_user` (`space_id`, `user_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Space Member Table" AUTO_INCREMENT 2; -- Create "template" table -CREATE TABLE IF NOT EXISTS `template` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "Primary Key ID", `agent_id` bigint NOT NULL DEFAULT 0 COMMENT "Agent ID", `workflow_id` bigint NOT NULL DEFAULT 0 COMMENT "Workflow ID", `space_id` bigint NOT NULL DEFAULT 0 COMMENT "Space ID", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `heat` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Heat", `product_entity_type` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Product Entity Type", `meta_info` json NULL COMMENT "Meta Info", `agent_extra` json NULL COMMENT "Agent Extra Info", `workflow_extra` json NULL COMMENT "Workflow Extra Info", `project_extra` json NULL COMMENT "Project Extra Info", PRIMARY KEY (`id`), UNIQUE INDEX `uniq_agent_id` (`agent_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Template Info Table"; +CREATE TABLE IF NOT EXISTS `template` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "Primary Key ID", `agent_id` bigint NOT NULL DEFAULT 0 COMMENT "Agent ID", `workflow_id` bigint NOT NULL DEFAULT 0 COMMENT "Workflow ID", `space_id` bigint NOT NULL DEFAULT 0 COMMENT "Space ID", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `heat` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Heat", `product_entity_type` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Product Entity Type", `meta_info` json NULL COMMENT "Meta Info", `agent_extra` json NULL COMMENT "Agent Extra Info", `workflow_extra` json NULL COMMENT "Workflow Extra Info", `project_extra` json NULL COMMENT "Project Extra Info", PRIMARY KEY (`id`), UNIQUE INDEX `uniq_agent_id` (`agent_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Template Info Table" AUTO_INCREMENT 25; -- Create "tool" table CREATE TABLE IF NOT EXISTS `tool` (`id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Tool ID", `plugin_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Plugin ID", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `version` varchar(255) NOT NULL DEFAULT "" COMMENT "Tool Version, e.g. v1.0.0", `sub_url` varchar(512) NOT NULL DEFAULT "" COMMENT "Sub URL Path", `method` varchar(64) NOT NULL DEFAULT "" COMMENT "HTTP Request Method", `operation` json NULL COMMENT "Tool Openapi Operation Schema", `activated_status` tinyint unsigned NOT NULL DEFAULT 0 COMMENT "0:activated; 1:deactivated", PRIMARY KEY (`id`), INDEX `idx_plugin_activated_status` (`plugin_id`, `activated_status`), UNIQUE INDEX `uniq_idx_plugin_sub_url_method` (`plugin_id`, `sub_url`, `method`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Latest Tool"; -- Create "tool_draft" table @@ -73,23 +73,23 @@ CREATE TABLE IF NOT EXISTS `tool_draft` (`id` bigint unsigned NOT NULL DEFAULT 0 -- Create "tool_version" table CREATE TABLE IF NOT EXISTS `tool_version` (`id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Primary Key ID", `tool_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Tool ID", `plugin_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Plugin ID", `version` varchar(255) NOT NULL DEFAULT "" COMMENT "Tool Version, e.g. v1.0.0", `sub_url` varchar(512) NOT NULL DEFAULT "" COMMENT "Sub URL Path", `method` varchar(64) NOT NULL DEFAULT "" COMMENT "HTTP Request Method", `operation` json NULL COMMENT "Tool Openapi Operation Schema", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `deleted_at` datetime NULL COMMENT "Delete Time", PRIMARY KEY (`id`), UNIQUE INDEX `uniq_idx_tool_version` (`tool_id`, `version`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Tool Version"; -- Create "user" table -CREATE TABLE IF NOT EXISTS `user` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "Primary Key ID", `name` varchar(128) NOT NULL DEFAULT "" COMMENT "User Nickname", `unique_name` varchar(128) NOT NULL DEFAULT "" COMMENT "User Unique Name", `email` varchar(128) NOT NULL DEFAULT "" COMMENT "Email", `password` varchar(128) NOT NULL DEFAULT "" COMMENT "Password (Encrypted)", `description` varchar(512) NOT NULL DEFAULT "" COMMENT "User Description", `icon_uri` varchar(512) NOT NULL DEFAULT "" COMMENT "Avatar URI", `user_verified` bool NOT NULL DEFAULT 0 COMMENT "User Verification Status", `locale` varchar(128) NOT NULL DEFAULT "" COMMENT "Locale", `session_key` varchar(256) NOT NULL DEFAULT "" COMMENT "Session Key", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Creation Time (Milliseconds)", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time (Milliseconds)", `deleted_at` bigint unsigned NULL COMMENT "Deletion Time (Milliseconds)", PRIMARY KEY (`id`), INDEX `idx_session_key` (`session_key`), UNIQUE INDEX `uniq_email` (`email`), UNIQUE INDEX `uniq_unique_name` (`unique_name`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "User Table"; +CREATE TABLE IF NOT EXISTS `user` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "Primary Key ID", `name` varchar(128) NOT NULL DEFAULT "" COMMENT "User Nickname", `unique_name` varchar(128) NOT NULL DEFAULT "" COMMENT "User Unique Name", `email` varchar(128) NOT NULL DEFAULT "" COMMENT "Email", `password` varchar(128) NOT NULL DEFAULT "" COMMENT "Password (Encrypted)", `description` varchar(512) NOT NULL DEFAULT "" COMMENT "User Description", `icon_uri` varchar(512) NOT NULL DEFAULT "" COMMENT "Avatar URI", `user_verified` bool NOT NULL DEFAULT 0 COMMENT "User Verification Status", `locale` varchar(128) NOT NULL DEFAULT "" COMMENT "Locale", `session_key` varchar(256) NOT NULL DEFAULT "" COMMENT "Session Key", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Creation Time (Milliseconds)", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time (Milliseconds)", `deleted_at` bigint unsigned NULL COMMENT "Deletion Time (Milliseconds)", PRIMARY KEY (`id`), INDEX `idx_session_key` (`session_key`), UNIQUE INDEX `uniq_email` (`email`), UNIQUE INDEX `uniq_unique_name` (`unique_name`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "User Table" AUTO_INCREMENT 7532071516318466049; -- Create "variable_instance" table -CREATE TABLE IF NOT EXISTS `variable_instance` (`id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "主键ID", `biz_type` tinyint unsigned NOT NULL COMMENT "1 for agent,2 for app", `biz_id` varchar(128) NOT NULL DEFAULT "" COMMENT "1 for agent_id,2 for app_id", `version` varchar(255) NOT NULL COMMENT "agent or project 版本,为空代表草稿态", `keyword` varchar(255) NOT NULL COMMENT "记忆的KEY", `type` tinyint NOT NULL COMMENT "记忆类型 1 KV 2 list", `content` text NULL COMMENT "记忆内容", `connector_uid` varchar(255) NOT NULL COMMENT "二方用户ID", `connector_id` bigint NOT NULL COMMENT "二方id, e.g. coze = 10000010", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "创建时间", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "更新时间", PRIMARY KEY (`id`), INDEX `idx_connector_key` (`biz_id`, `biz_type`, `version`, `connector_uid`, `connector_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT "KV Memory"; +CREATE TABLE IF NOT EXISTS `variable_instance` (`id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "id", `biz_type` tinyint unsigned NOT NULL COMMENT "1 for agent,2 for app", `biz_id` varchar(128) NOT NULL DEFAULT "" COMMENT "1 for agent_id,2 for app_id", `version` varchar(255) NOT NULL COMMENT "agent or project version empty represents draft status", `keyword` varchar(255) NOT NULL COMMENT "Keyword to Memory", `type` tinyint NOT NULL COMMENT "Memory type 1 KV 2 list", `content` text NULL COMMENT "content", `connector_uid` varchar(255) NOT NULL COMMENT "connector_uid", `connector_id` bigint NOT NULL COMMENT "connector_id, e.g. coze = 10000010", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", PRIMARY KEY (`id`), INDEX `idx_connector_key` (`biz_id`, `biz_type`, `version`, `connector_uid`, `connector_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT "KV Memory"; -- Create "variables_meta" table -CREATE TABLE IF NOT EXISTS `variables_meta` (`id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "主键ID", `creator_id` bigint unsigned NOT NULL COMMENT "创建者ID", `biz_type` tinyint unsigned NOT NULL COMMENT "1 for agent,2 for app", `biz_id` varchar(128) NOT NULL DEFAULT "" COMMENT "1 for agent_id,2 for app_id", `variable_list` json NULL COMMENT "变量配置的json数据", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "create time", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "update time", `version` varchar(255) NOT NULL COMMENT "project版本,为空代表草稿态", PRIMARY KEY (`id`), INDEX `idx_user_key` (`creator_id`), UNIQUE INDEX `uniq_project_key` (`biz_id`, `biz_type`, `version`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT "KV Memory meta"; +CREATE TABLE IF NOT EXISTS `variables_meta` (`id` bigint unsigned NOT NULL DEFAULT 0 COMMENT "id", `creator_id` bigint unsigned NOT NULL COMMENT "creator id", `biz_type` tinyint unsigned NOT NULL COMMENT "1 for agent,2 for app", `biz_id` varchar(128) NOT NULL DEFAULT "" COMMENT "1 for agent_id,2 for app_id", `variable_list` json NULL COMMENT "JSON data for variable configuration", `created_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Create Time in Milliseconds", `updated_at` bigint unsigned NOT NULL DEFAULT 0 COMMENT "Update Time in Milliseconds", `version` varchar(255) NOT NULL COMMENT "Project version, empty represents draft status", PRIMARY KEY (`id`), INDEX `idx_user_key` (`creator_id`), UNIQUE INDEX `uniq_project_key` (`biz_id`, `biz_type`, `version`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT "KV Memory meta"; -- Create "workflow_draft" table -CREATE TABLE IF NOT EXISTS `workflow_draft` (`id` bigint unsigned NOT NULL COMMENT "workflow ID", `canvas` mediumtext NOT NULL COMMENT "前端 schema", `input_params` mediumtext NULL COMMENT " 入参 schema", `output_params` mediumtext NULL COMMENT " 出参 schema", `test_run_success` bool NOT NULL DEFAULT 0 COMMENT "0 未运行, 1 运行成功", `modified` bool NOT NULL DEFAULT 0 COMMENT "0 未被修改, 1 已被修改", `updated_at` bigint unsigned NULL, `deleted_at` datetime(3) NULL, `commit_id` varchar(255) NOT NULL COMMENT "used to uniquely identify a draft snapshot", PRIMARY KEY (`id`), INDEX `idx_updated_at` (`updated_at` DESC)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "workflow 画布草稿表,用于记录workflow最新的草稿画布信息"; +CREATE TABLE IF NOT EXISTS `workflow_draft` (`id` bigint unsigned NOT NULL COMMENT "workflow ID", `canvas` mediumtext NOT NULL COMMENT "Front end schema", `input_params` mediumtext NULL COMMENT "Input schema", `output_params` mediumtext NULL COMMENT "Output parameter schema", `test_run_success` bool NOT NULL DEFAULT 0 COMMENT "0 not running, 1 running successfully", `modified` bool NOT NULL DEFAULT 0 COMMENT "0 has not been modified, 1 has been modified", `updated_at` bigint unsigned NULL COMMENT "Update Time in Milliseconds", `deleted_at` datetime(3) NULL COMMENT "Delete Time", `commit_id` varchar(255) NOT NULL COMMENT "used to uniquely identify a draft snapshot", PRIMARY KEY (`id`), INDEX `idx_updated_at` (`updated_at` DESC)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Workflow canvas draft table, used to record the latest draft canvas information of workflow"; -- Create "workflow_execution" table -CREATE TABLE IF NOT EXISTS `workflow_execution` (`id` bigint unsigned NOT NULL COMMENT "execute id", `workflow_id` bigint unsigned NOT NULL COMMENT "workflow_id", `version` varchar(50) NULL COMMENT "workflow version. empty if is draft", `space_id` bigint unsigned NOT NULL COMMENT "the space id the workflow belongs to", `mode` tinyint unsigned NOT NULL COMMENT "the execution mode: 1. debug run 2. release run 3. node debug", `operator_id` bigint unsigned NOT NULL COMMENT "the user id that runs this workflow", `connector_id` bigint unsigned NULL COMMENT "the connector on which this execution happened", `connector_uid` varchar(64) NULL COMMENT "user id of the connector", `created_at` bigint unsigned NOT NULL COMMENT "create time in millisecond", `log_id` varchar(128) NULL COMMENT "log id", `status` tinyint unsigned NULL COMMENT "1=running 2=success 3=fail 4=interrupted", `duration` bigint unsigned NULL COMMENT "execution duration in millisecond", `input` mediumtext NULL COMMENT "actual input of this execution", `output` mediumtext NULL COMMENT "the actual output of this execution", `error_code` varchar(255) NULL COMMENT "error code if any", `fail_reason` mediumtext NULL COMMENT "the reason for failure", `input_tokens` bigint unsigned NULL COMMENT "number of input tokens", `output_tokens` bigint unsigned NULL COMMENT "number of output tokens", `updated_at` bigint unsigned NULL COMMENT "update time in millisecond", `root_execution_id` bigint unsigned NULL COMMENT "the top level execution id. Null if this is the root", `parent_node_id` varchar(128) NULL COMMENT "the node key for the sub_workflow node that executes this workflow", `app_id` bigint unsigned NULL COMMENT "app id this workflow execution belongs to", `node_count` mediumint unsigned NULL COMMENT "the total node count of the workflow", `resume_event_id` bigint unsigned NULL COMMENT "the current event ID which is resuming", `agent_id` bigint unsigned NULL COMMENT "the agent that this execution binds to", `sync_pattern` tinyint unsigned NULL COMMENT "the sync pattern 1. sync 2. async 3. stream", `commit_id` varchar(255) NULL COMMENT "draft commit id this execution belongs to", PRIMARY KEY (`id`), INDEX `idx_workflow_id_version_mode_created_at` (`workflow_id`, `version`, `mode`, `created_at`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "workflow 执行记录表,用于记录每次workflow执行时的状态"; +CREATE TABLE IF NOT EXISTS `workflow_execution` (`id` bigint unsigned NOT NULL COMMENT "execute id", `workflow_id` bigint unsigned NOT NULL COMMENT "workflow_id", `version` varchar(50) NULL COMMENT "workflow version. empty if is draft", `space_id` bigint unsigned NOT NULL COMMENT "the space id the workflow belongs to", `mode` tinyint unsigned NOT NULL COMMENT "the execution mode: 1. debug run 2. release run 3. node debug", `operator_id` bigint unsigned NOT NULL COMMENT "the user id that runs this workflow", `connector_id` bigint unsigned NULL COMMENT "the connector on which this execution happened", `connector_uid` varchar(64) NULL COMMENT "user id of the connector", `created_at` bigint unsigned NOT NULL COMMENT "create time in millisecond", `log_id` varchar(128) NULL COMMENT "log id", `status` tinyint unsigned NULL COMMENT "1=running 2=success 3=fail 4=interrupted", `duration` bigint unsigned NULL COMMENT "execution duration in millisecond", `input` mediumtext NULL COMMENT "actual input of this execution", `output` mediumtext NULL COMMENT "the actual output of this execution", `error_code` varchar(255) NULL COMMENT "error code if any", `fail_reason` mediumtext NULL COMMENT "the reason for failure", `input_tokens` bigint unsigned NULL COMMENT "number of input tokens", `output_tokens` bigint unsigned NULL COMMENT "number of output tokens", `updated_at` bigint unsigned NULL COMMENT "update time in millisecond", `root_execution_id` bigint unsigned NULL COMMENT "the top level execution id. Null if this is the root", `parent_node_id` varchar(128) NULL COMMENT "the node key for the sub_workflow node that executes this workflow", `app_id` bigint unsigned NULL COMMENT "app id this workflow execution belongs to", `node_count` mediumint unsigned NULL COMMENT "the total node count of the workflow", `resume_event_id` bigint unsigned NULL COMMENT "the current event ID which is resuming", `agent_id` bigint unsigned NULL COMMENT "the agent that this execution binds to", `sync_pattern` tinyint unsigned NULL COMMENT "the sync pattern 1. sync 2. async 3. stream", `commit_id` varchar(255) NULL COMMENT "draft commit id this execution belongs to", PRIMARY KEY (`id`), INDEX `idx_workflow_id_version_mode_created_at` (`workflow_id`, `version`, `mode`, `created_at`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Workflow Execution Record Table, used to record the status of each workflow execution"; -- Create "workflow_meta" table -CREATE TABLE IF NOT EXISTS `workflow_meta` (`id` bigint unsigned NOT NULL COMMENT "workflow id", `name` varchar(256) NOT NULL COMMENT "workflow name", `description` varchar(2000) NOT NULL COMMENT "workflow description", `icon_uri` varchar(256) NOT NULL COMMENT "icon uri", `status` tinyint unsigned NOT NULL COMMENT "0:未发布过, 1:已发布过", `content_type` tinyint unsigned NOT NULL COMMENT "0用户 1官方", `mode` tinyint unsigned NOT NULL COMMENT "0:workflow, 3:chat_flow", `created_at` bigint unsigned NOT NULL COMMENT "create time in millisecond", `updated_at` bigint unsigned NULL COMMENT "update time in millisecond", `deleted_at` datetime(3) NULL COMMENT "delete time in millisecond", `creator_id` bigint unsigned NOT NULL COMMENT "user id for creator", `tag` tinyint unsigned NULL COMMENT "template tag: Tag: 1=All, 2=Hot, 3=Information, 4=Music, 5=Picture, 6=UtilityTool, 7=Life, 8=Traval, 9=Network, 10=System, 11=Movie, 12=Office, 13=Shopping, 14=Education, 15=Health, 16=Social, 17=Entertainment, 18=Finance, 100=Hidden", `author_id` bigint unsigned NOT NULL COMMENT "原作者用户 ID", `space_id` bigint unsigned NOT NULL COMMENT " 空间 ID", `updater_id` bigint unsigned NULL COMMENT " 更新元信息的用户 ID", `source_id` bigint unsigned NULL COMMENT " 复制来源的 workflow ID", `app_id` bigint unsigned NULL COMMENT "应用 ID", `latest_version` varchar(50) NULL COMMENT "the version of the most recent publish", `latest_version_ts` bigint unsigned NULL COMMENT "create time of latest version", PRIMARY KEY (`id`), INDEX `idx_app_id` (`app_id`), INDEX `idx_latest_version_ts` (`latest_version_ts` DESC), INDEX `idx_space_id_app_id_status_latest_version_ts` (`space_id`, `app_id`, `status`, `latest_version_ts`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "workflow 元信息表,用于记录workflow基本的元信息"; +CREATE TABLE IF NOT EXISTS `workflow_meta` (`id` bigint unsigned NOT NULL COMMENT "workflow id", `name` varchar(256) NOT NULL COMMENT "workflow name", `description` varchar(2000) NOT NULL COMMENT "workflow description", `icon_uri` varchar(256) NOT NULL COMMENT "icon uri", `status` tinyint unsigned NOT NULL COMMENT "0: Not published, 1: Published", `content_type` tinyint unsigned NOT NULL COMMENT "0 Users 1 Official", `mode` tinyint unsigned NOT NULL COMMENT "0:workflow, 3:chat_flow", `created_at` bigint unsigned NOT NULL COMMENT "create time in millisecond", `updated_at` bigint unsigned NULL COMMENT "update time in millisecond", `deleted_at` datetime(3) NULL COMMENT "delete time in millisecond", `creator_id` bigint unsigned NOT NULL COMMENT "user id for creator", `tag` tinyint unsigned NULL COMMENT "template tag: Tag: 1=All, 2=Hot, 3=Information, 4=Music, 5=Picture, 6=UtilityTool, 7=Life, 8=Traval, 9=Network, 10=System, 11=Movie, 12=Office, 13=Shopping, 14=Education, 15=Health, 16=Social, 17=Entertainment, 18=Finance, 100=Hidden", `author_id` bigint unsigned NOT NULL COMMENT "Original author user ID", `space_id` bigint unsigned NOT NULL COMMENT "space id", `updater_id` bigint unsigned NULL COMMENT "User ID for updating metadata", `source_id` bigint unsigned NULL COMMENT "Workflow ID of source", `app_id` bigint unsigned NULL COMMENT "app id", `latest_version` varchar(50) NULL COMMENT "the version of the most recent publish", `latest_version_ts` bigint unsigned NULL COMMENT "create time of latest version", PRIMARY KEY (`id`), INDEX `idx_app_id` (`app_id`), INDEX `idx_latest_version_ts` (`latest_version_ts` DESC), INDEX `idx_space_id_app_id_status_latest_version_ts` (`space_id`, `app_id`, `status`, `latest_version_ts`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "The workflow metadata table,used to record the basic metadata of workflow"; -- Create "workflow_reference" table -CREATE TABLE IF NOT EXISTS `workflow_reference` (`id` bigint unsigned NOT NULL COMMENT "workflow id", `referred_id` bigint unsigned NOT NULL COMMENT "the id of the workflow that is referred by other entities", `referring_id` bigint unsigned NOT NULL COMMENT "the entity id that refers this workflow", `refer_type` tinyint unsigned NOT NULL COMMENT "1 subworkflow 2 tool", `referring_biz_type` tinyint unsigned NOT NULL COMMENT "the biz type the referring entity belongs to: 1. workflow 2. agent", `created_at` bigint unsigned NOT NULL COMMENT "create time in millisecond", `status` tinyint unsigned NOT NULL COMMENT "whether this reference currently takes effect. 0: disabled 1: enabled", `deleted_at` datetime(3) NULL, PRIMARY KEY (`id`), INDEX `idx_referred_id_referring_biz_type_status` (`referred_id`, `referring_biz_type`, `status`), INDEX `idx_referring_id_status` (`referring_id`, `status`), UNIQUE INDEX `uniq_referred_id_referring_id_refer_type` (`referred_id`, `referring_id`, `refer_type`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "workflow 关联关系表,用于记录workflow 直接互相引用关系"; +CREATE TABLE IF NOT EXISTS `workflow_reference` (`id` bigint unsigned NOT NULL COMMENT "workflow id", `referred_id` bigint unsigned NOT NULL COMMENT "the id of the workflow that is referred by other entities", `referring_id` bigint unsigned NOT NULL COMMENT "the entity id that refers this workflow", `refer_type` tinyint unsigned NOT NULL COMMENT "1 subworkflow 2 tool", `referring_biz_type` tinyint unsigned NOT NULL COMMENT "the biz type the referring entity belongs to: 1. workflow 2. agent", `created_at` bigint unsigned NOT NULL COMMENT "create time in millisecond", `status` tinyint unsigned NOT NULL COMMENT "whether this reference currently takes effect. 0: disabled 1: enabled", `deleted_at` datetime(3) NULL COMMENT "Delete Time", PRIMARY KEY (`id`), INDEX `idx_referred_id_referring_biz_type_status` (`referred_id`, `referring_biz_type`, `status`), INDEX `idx_referring_id_status` (`referring_id`, `status`), UNIQUE INDEX `uniq_referred_id_referring_id_refer_type` (`referred_id`, `referring_id`, `refer_type`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "The workflow association table,used to record the direct mutual reference relationship between workflows"; -- Create "workflow_snapshot" table -CREATE TABLE IF NOT EXISTS `workflow_snapshot` (`workflow_id` bigint unsigned NOT NULL COMMENT "workflow id this snapshot belongs to", `commit_id` varchar(255) NOT NULL COMMENT "the commit id of the workflow draft", `canvas` mediumtext NOT NULL COMMENT "frontend schema for this snapshot", `input_params` mediumtext NULL COMMENT "input parameter info", `output_params` mediumtext NULL COMMENT "output parameter info", `created_at` bigint unsigned NOT NULL, `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "ID", PRIMARY KEY (`id`), UNIQUE INDEX `uniq_workflow_id_commit_id` (`workflow_id`, `commit_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "snapshot for executed workflow draft"; +CREATE TABLE IF NOT EXISTS `workflow_snapshot` (`workflow_id` bigint unsigned NOT NULL COMMENT "workflow id this snapshot belongs to", `commit_id` varchar(255) NOT NULL COMMENT "the commit id of the workflow draft", `canvas` mediumtext NOT NULL COMMENT "frontend schema for this snapshot", `input_params` mediumtext NULL COMMENT "input parameter info", `output_params` mediumtext NULL COMMENT "output parameter info", `created_at` bigint unsigned NOT NULL COMMENT "Create Time in Milliseconds", `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "ID", PRIMARY KEY (`id`), UNIQUE INDEX `uniq_workflow_id_commit_id` (`workflow_id`, `commit_id`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "snapshot for executed workflow draft"; -- Create "workflow_version" table -CREATE TABLE IF NOT EXISTS `workflow_version` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "ID", `workflow_id` bigint unsigned NOT NULL COMMENT "workflow id", `version` varchar(50) NOT NULL COMMENT "发布版本", `version_description` varchar(2000) NOT NULL COMMENT "版本描述", `canvas` mediumtext NOT NULL COMMENT "前端 schema", `input_params` mediumtext NULL, `output_params` mediumtext NULL, `creator_id` bigint unsigned NOT NULL COMMENT "发布用户 ID", `created_at` bigint unsigned NOT NULL COMMENT "创建时间毫秒时间戳", `deleted_at` datetime(3) NULL COMMENT "删除毫秒时间戳", `commit_id` varchar(255) NOT NULL COMMENT "the commit id corresponding to this version", PRIMARY KEY (`id`), INDEX `idx_id_created_at` (`workflow_id`, `created_at`), UNIQUE INDEX `uniq_workflow_id_version` (`workflow_id`, `version`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "workflow 画布版本信息表,用于记录不同版本的画布信息"; +CREATE TABLE IF NOT EXISTS `workflow_version` (`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT "ID", `workflow_id` bigint unsigned NOT NULL COMMENT "workflow id", `version` varchar(50) NOT NULL COMMENT "Published version", `version_description` varchar(2000) NOT NULL COMMENT "Version Description", `canvas` mediumtext NOT NULL COMMENT "Front end schema", `input_params` mediumtext NULL COMMENT "input params", `output_params` mediumtext NULL COMMENT "output params", `creator_id` bigint unsigned NOT NULL COMMENT "creator id", `created_at` bigint unsigned NOT NULL COMMENT "Create Time in Milliseconds", `deleted_at` datetime(3) NULL COMMENT "Delete Time", `commit_id` varchar(255) NOT NULL COMMENT "the commit id corresponding to this version", PRIMARY KEY (`id`), INDEX `idx_id_created_at` (`workflow_id`, `created_at`), UNIQUE INDEX `uniq_workflow_id_version` (`workflow_id`, `version`)) ENGINE=InnoDB CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT "Workflow Canvas Version Information Table, used to record canvas information for different versions"; -- 初始化用户表数据 -- 使用 INSERT ON DUPLICATE KEY UPDATE 语句 -- 当主键或唯一键冲突时,不会插入新记录,而是更新指定字段 diff --git a/idl/bot_common/bot_common.thrift b/idl/bot_common/bot_common.thrift index f4d9ec32..993fae75 100644 --- a/idl/bot_common/bot_common.thrift +++ b/idl/bot_common/bot_common.thrift @@ -13,20 +13,20 @@ struct AuthToken { } struct PromptInfo { - 1: optional string Prompt (api.body="prompt"), // 文本prompt + 1: optional string Prompt (api.body="prompt"), // Text prompt } struct ModelInfo { - 1: optional i64 ModelId (agw.js_conv="str", api.js_conv="true", api.body="model_id"), // 模型id - 2: optional double Temperature (api.body="temperature") , // 温度,模型输出随机性,值越大越随机,越小越保守(0-1] - 3: optional i32 MaxTokens (api.body="max_tokens") , // 回复最大Token数 - 4: optional double TopP (api.body="top_p") , // 另一种模型的输出随机性,值越大越随机[0,1] - 5: optional double FrequencyPenalty (api.body="frequency_penalty") , // 频率惩罚,调整生成内容中的单词频率,正值单词越少见[-1.0,1.0] - 6: optional double PresencePenalty (api.body="presence_penalty") , // 存在惩罚,调整生成内容中新词语频率,正值避免重复单词,用新词[-1.0,1.0] - 7: optional ShortMemoryPolicy ShortMemoryPolicy (api.body="short_memory_policy") , // 上下文策略 - 8: optional i32 TopK (api.body="top_k") , // 生成时,采样候选集的大小 - 9: optional ModelResponseFormat ResponseFormat (api.body="response_format") , // 模型回复内容格式 - 10: optional ModelStyle ModelStyle (api.body="model_style") , // 用户选择的模型风格 + 1: optional i64 ModelId (agw.js_conv="str", api.js_conv="true", api.body="model_id"), // Model ID + 2: optional double Temperature (api.body="temperature") , // Temperature, model output randomness, the larger the value, the more random, the smaller the more conservative (0-1] + 3: optional i32 MaxTokens (api.body="max_tokens") , // Maximum Token Reply + 4: optional double TopP (api.body="top_p") , // Another model's output randomness, the larger the value, the more random [0, 1] + 5: optional double FrequencyPenalty (api.body="frequency_penalty") , // Frequency penalty, adjust the frequency of words in the generated content, the fewer positive words are [-1.0, 1.0] + 6: optional double PresencePenalty (api.body="presence_penalty") , // There is a penalty, adjust the frequency of new words in the generated content, avoid repeating words with positive values, and use new words [-1.0, 1.0] + 7: optional ShortMemoryPolicy ShortMemoryPolicy (api.body="short_memory_policy") , // contextual policy + 8: optional i32 TopK (api.body="top_k") , // When generating, sample the size of the candidate set + 9: optional ModelResponseFormat ResponseFormat (api.body="response_format") , // model reply content format + 10: optional ModelStyle ModelStyle (api.body="model_style") , // User-selected model style } enum ModelStyle { @@ -41,7 +41,7 @@ enum ModelResponseFormat { JSON = 2, } -// 上下文允许传输的类型 +// The type of transmission allowed by the context enum ContextMode { Chat = 0, FunctionCall_1 = 1, @@ -79,23 +79,23 @@ enum ModelFuncConfigStatus { } struct ShortMemoryPolicy { - 1: optional ContextMode ContextMode (api.body="context_mode") , // 上下文允许传输的类型 - 2: optional i32 HistoryRound (api.body="history_round"), // 上下文带的轮数 + 1: optional ContextMode ContextMode (api.body="context_mode") , // The type of transmission allowed by the context + 2: optional i32 HistoryRound (api.body="history_round"), // Number of rounds of context band } struct PluginInfo { - 1: optional i64 PluginId (agw.js_conv="str", api.js_conv="true", api.body="plugin_id"), // 插件id + 1: optional i64 PluginId (agw.js_conv="str", api.js_conv="true", api.body="plugin_id"), // Plugin ID 2: optional i64 ApiId (agw.js_conv="str", api.js_conv="true", api.body="api_id") , // api Id - 3: optional string ApiName (api.body="api_name") , // api name O项目用 + 3: optional string ApiName (api.body="api_name") , // API name O project 100: optional i64 ApiVersionMs (agw.js_conv="str", api.js_conv="true", api.body="api_version_ms"), // api version } struct WorkflowInfo { 1: optional i64 WorkflowId (agw.js_conv="str", api.js_conv="true", api.body="workflow_id"), // WorkflowId - 2: optional i64 PluginId (agw.js_conv="str", api.js_conv="true", api.body="plugin_id") , // 插件id + 2: optional i64 PluginId (agw.js_conv="str", api.js_conv="true", api.body="plugin_id") , // Plugin ID 3: optional i64 ApiId (agw.js_conv="str", api.js_conv="true", api.body="api_id") , // api Id - 4: optional WorkflowMode FlowMode (agw.js_conv="str", api.body="flow_mode") // workflow or imageflow, 默认为workflow + 4: optional WorkflowMode FlowMode (agw.js_conv="str", api.body="flow_mode") // Workflow or imageflow, default to workflow 5: optional string WorkflowName (api.body="workflow_name") , // workflow name 6: optional string Desc (api.body="desc", api.body="desc"), 7: optional list Parameters (api.body="parameters", api.body="parameters"), @@ -107,7 +107,7 @@ struct PluginParameter { 3: optional bool Required (api.body="required") 4: optional string Type (api.body="type") 5: optional list SubParameters (api.body="sub_parameters") - 6: optional string SubType (api.body="sub_type") // 如果Type是数组,则有subtype + 6: optional string SubType (api.body="sub_type") // If Type is an array, there is a subtype } enum WorkflowMode { @@ -117,19 +117,19 @@ enum WorkflowMode { ChatFlow = 3 All = 100 } -// onboarding内容生成模式 +// onboarding content generation mode enum OnboardingMode { - NO_NEED = 1, // 不需要 - USE_MANUAL = 2, // 人工指定内容(多语言支持由LLM兜底) - USE_LLM = 3, // 由LLM生成 + NO_NEED = 1, // No. + USE_MANUAL = 2, // Manually specify content (multi-language support is covered by LLM) + USE_LLM = 3, // Generated by LLM } -struct OnboardingInfo { // 对应 Coze Opening Dialog - 1: optional string Prologue (api.body="prologue") , // 开场白 - 2: optional list SuggestedQuestions (api.body="suggested_questions") , // 建议问题 - 3: optional OnboardingMode OnboardingMode (api.body="onboarding_mode") , // 开场白模型 - 4: optional string CustomizedOnboardingPrompt (api.body="customized_onboarding_prompt"), // LLM生成,用户自定义 Prompt - 5: optional SuggestedQuestionsShowMode SuggestedQuestionsShowMode (api.body="suggested_questions_show_mode") , // 开场白预设问题展示方式 默认0 随机展示 +struct OnboardingInfo { // Coze Opening Dialog + 1: optional string Prologue (api.body="prologue") , // opening statement + 2: optional list SuggestedQuestions (api.body="suggested_questions") , // suggestion question + 3: optional OnboardingMode OnboardingMode (api.body="onboarding_mode") , // Opener model + 4: optional string CustomizedOnboardingPrompt (api.body="customized_onboarding_prompt"), // LLM Generation, User-defined Prompt + 5: optional SuggestedQuestionsShowMode SuggestedQuestionsShowMode (api.body="suggested_questions_show_mode") , // The opening statement presets the problem display method, and the default is 0 random display. } enum SuggestedQuestionsShowMode{ @@ -141,32 +141,32 @@ enum SuggestReplyMode{ System = 0, Custom = 1, Disable = 2, - OriBot = 3, // agent专用,复用源Bot配置 + OriBot = 3, // Agent specific, multiplexed source Bot configuration } // suggest -struct SuggestReplyInfo { // 对应 Coze Auto-Suggestion - 1: optional SuggestReplyMode SuggestReplyMode (api.body="suggest_reply_mode") , // 建议问题模型 - 2: optional string CustomizedSuggestPrompt (api.body="customized_suggest_prompt"), // 用户自定义建议问题 - 3: optional string ChainTaskName (api.body="chain_task_name") , // 运行Prompt的ChainTask名称 +struct SuggestReplyInfo { // Coze Auto-Suggestion + 1: optional SuggestReplyMode SuggestReplyMode (api.body="suggest_reply_mode") , // suggestion problem model + 2: optional string CustomizedSuggestPrompt (api.body="customized_suggest_prompt"), // user-defined suggestion questions + 3: optional string ChainTaskName (api.body="chain_task_name") , // The name of the ChainTask that runs the Prompt } // tts Voices -struct VoicesInfo { // 对应 Coze Voices - 1: optional bool Muted (api.body="muted") , // 是否开启声音 true:禁用 false:开启 - 2: optional map I18nLangVoice (api.body="i18n_lang_voice"), // 多语音音色配置 - 7: optional map I18nLangVoiceStr (api.body="i18n_lang_voice_str"), // 多语音音色配置, string类型 - 3: optional bool Autoplay (api.body="autoplay") , // 是否自动播放 - 4: optional map AutoplayVoice (api.body="autoplay_voice") , // 自动播放的音色 - 5: optional bool CloseVoiceCall (api.body="voice_call") , // 是否关闭语音通话,true:关闭 false:开启 默认为false - 6: optional DefaultUserInputType DefaultUserInputType (api.body="default_user_input_type"), // 默认用户输入类型 +struct VoicesInfo { // Coze Voices + 1: optional bool Muted (api.body="muted") , // Whether to turn on sound true: disable false: turn on + 2: optional map I18nLangVoice (api.body="i18n_lang_voice"), // Multi-voice voice configuration + 7: optional map I18nLangVoiceStr (api.body="i18n_lang_voice_str"), // Multi-voice tone configuration, string type + 3: optional bool Autoplay (api.body="autoplay") , // Whether to play automatically + 4: optional map AutoplayVoice (api.body="autoplay_voice") , // autoplay timbre + 5: optional bool CloseVoiceCall (api.body="voice_call") , // Whether to turn off voice calls, true: turn off false: turn on, default is false + 6: optional DefaultUserInputType DefaultUserInputType (api.body="default_user_input_type"), // Default user input type } enum DefaultUserInputType { - NotSet = 0, // 没设置 - Text = 1, // 文字 - Voice = 2, // 按住语音 - Call = 3, // 语音通话 + NotSet = 0, // Not set + Text = 1, // Text + Voice = 2, // Hold down the voice + Call = 3, // voice call } // AnswerActions @@ -176,32 +176,32 @@ enum AnswerActionsMode { } enum AnswerActionTriggerType { - Direct = 1, // 平台预设Trigger action - WebView = 2, // 点击Action 显示自定义的H5页面 - SendMessage = 3, // 点击Action 发送自定义的用户消息 + Direct = 1, // Platform preset Trigger action + WebView = 2, // Click Action to display the custom H5 page + SendMessage = 3, // Click Action to send a custom user message } struct AnswerActionTriggerRule { 1: AnswerActionTriggerType Type (api.body="type") , 2: bool NeedPreloading (api.body="need_preloading"), - 3: map TriggerData (api.body="trigger_data") , // 根据 AnswerActionTriggerType决定 + 3: map TriggerData (api.body="trigger_data") , // According to AnswerActionTriggerType } struct ActionIcon { - 1: string Type (api.body="type") , // 自定义的按钮 type 不用传 - 2: string DefaultUrl (api.body="default_url"), // 默认状态 - 3: string ActiveUrl (api.body="active_url") , // 按下按钮的状态 - 4: string DefaultUri (api.body="default_uri"), // 默认状态 - 5: string ActiveUri (api.body="active_uri") , // 按下按钮的状态 + 1: string Type (api.body="type") , // Customized button type does not need to be passed + 2: string DefaultUrl (api.body="default_url"), // default state + 3: string ActiveUrl (api.body="active_url") , // The state of pressing the button + 4: string DefaultUri (api.body="default_uri"), // default state + 5: string ActiveUri (api.body="active_uri") , // The state of pressing the button } struct AnswerActionConfig { - 1: string Key (api.body="key") , // 预制的只需要传key - 2: string Name (api.body="name") , // 默认 - 3: ActionIcon Icon (api.body="icon") , // 下发uri - 4: map NameI18n (api.body="name_i18n") , // 存储用户i18的name - 5: AnswerActionTriggerRule TriggerRule (api.body="trigger_rule"), // Direct 没有值; WebView 包含 webview_url和 webview_callback_psm两个key;SendMessage 包含send_message_prompt - 6: i32 Position (api.body="position") , // 位置 + 1: string Key (api.body="key") , // The prefabricated one only needs to pass the key. + 2: string Name (api.body="name") , // default + 3: ActionIcon Icon (api.body="icon") , // Send uri. + 4: map NameI18n (api.body="name_i18n") , // Store the name of user i18 + 5: AnswerActionTriggerRule TriggerRule (api.body="trigger_rule"), // Direct has no value; WebView contains webview_url and webview_callback_psm keys; SendMessage contains send_message_prompt + 6: i32 Position (api.body="position") , // location } struct AnswerActions { @@ -217,31 +217,31 @@ struct BotExtInfo { 4: optional string BotTemplateName (api.body="bot_template_name"), 5: optional bool UseUGCVoice (api.body="use_ugc_voice") , 6: optional i32 AppId (api.body="app_id") , - 7: optional bool BindingMp (api.body="binding_mp") , // 是否绑定小程序标识 + 7: optional bool BindingMp (api.body="binding_mp") , // Whether to bind the Mini Program logo } struct KnowledgeInfo { - 1: optional string Id (api.body="id") , // 知识库id - 2: optional string Name (api.body="name"), // 知识库名称 + 1: optional string Id (api.body="id") , // Knowledge ID + 2: optional string Name (api.body="name"), // Knowledge base name } enum SearchStrategy { - SemanticSearch = 0, // 语义搜索 - HybirdSearch = 1, // 混合搜索 - FullTextSearch = 20, // 全文搜索 + SemanticSearch = 0, // semantic search + HybirdSearch = 1, // Hybrid Search + FullTextSearch = 20, // Full Text Search } struct Knowledge { - 1: optional list KnowledgeInfo (api.body="knowledge_info") , // 知识库信息 - 2: optional i64 TopK (api.body="top_k") , // 召回最大数据量 - 3: optional double MinScore (api.body="min_score") , // 最小匹配度 - 4: optional bool Auto (api.body="auto") , // 自动召回 - 5: optional SearchStrategy SearchStrategy (api.body="search_strategy"), // 搜索策略 - 6: optional bool ShowSource (api.body="show_source"), // 是否展示来源 - 7: optional KnowledgeNoRecallReplyMode NoRecallReplyMode (api.body="no_recall_reply_mode"), // 无召回回复mode,默认0 - 8: optional string NoRecallReplyCustomizePrompt (api.body="no_recall_reply_customize_prompt"), // 无召回回复时自定义prompt,当NoRecallReplyMode=1时生效 - 9: optional KnowledgeShowSourceMode ShowSourceMode (api.body="show_source_mode"), // 来源展示方式 默认值0 卡片列表方式 - 10: optional RecallStrategy RecallStrategy (api.body="recall_strategy"), // 召回策略, 默认值为true + 1: optional list KnowledgeInfo (api.body="knowledge_info") , // Knowledge Base Information + 2: optional i64 TopK (api.body="top_k") , // recall maximum data volume + 3: optional double MinScore (api.body="min_score") , // minimum match + 4: optional bool Auto (api.body="auto") , // automatic recall + 5: optional SearchStrategy SearchStrategy (api.body="search_strategy"), // search strategy + 6: optional bool ShowSource (api.body="show_source"), // Whether to show the source + 7: optional KnowledgeNoRecallReplyMode NoRecallReplyMode (api.body="no_recall_reply_mode"), // No recall reply mode, default 0 + 8: optional string NoRecallReplyCustomizePrompt (api.body="no_recall_reply_customize_prompt"), // Custom prompt for no recall reply, effective when NoRecallReplyMode = 1 + 9: optional KnowledgeShowSourceMode ShowSourceMode (api.body="show_source_mode"), // Source display method, default value 0 card list method + 10: optional RecallStrategy RecallStrategy (api.body="recall_strategy"), // Recall policy, default value is true } struct RecallStrategy { @@ -262,54 +262,54 @@ enum KnowledgeNoRecallReplyMode{ } enum SocietyVisibility { - Public = 1, // 对所有人可见 - Anonymous = 2, // 仅对host可见 - Custom = 3, // 自定义 + Public = 1, // Visible to all + Anonymous = 2, // Visible to host only + Custom = 3, // custom } struct SocietyVisibiltyConfig { - 1: SocietyVisibility VisibilityType (api.body="visibility_type", go.tag="json:\"visibility_type,omitempty\"") , // 社会场景中可见性: Public = 1,Anonymous = 2 - 2: list VisibilityRoles (api.body="visibility_roles", go.tag="json:\"visibility_roles,omitempty\""), // 可见角色列表 + 1: SocietyVisibility VisibilityType (api.body="visibility_type", go.tag="json:\"visibility_type,omitempty\"") , // Visibility in Social Scene: Public = 1, Anonymous = 2 + 2: list VisibilityRoles (api.body="visibility_roles", go.tag="json:\"visibility_roles,omitempty\""), // list of visible characters } struct Variable { 1: optional string Key (api.body="key") , // key, Field - 2: optional string Description (api.body="description") , // 描述 - 3: optional string DefaultValue (api.body="default_value"), // 默认值 - 4: optional bool IsSystem (api.body="is_system"), // 是否系统值系统值 - 5: optional bool PromptDisabled (api.body="prompt_disabled"), // 是否支持在Prompt中调用 默认支持 - 6: optional SocietyVisibiltyConfig SocietyVisibilityConfig (api.body="society_visibility_config", go.tag="json:\"society_visibility_config,omitempty\""), // 社会场景中可见性: Public = 1,Anonymous = 2 - 7: optional bool IsDisabled (api.body="is_disabled"), // 是否禁用,默认为false代表启用 + 2: optional string Description (api.body="description") , // describe + 3: optional string DefaultValue (api.body="default_value"), // default value + 4: optional bool IsSystem (api.body="is_system"), // Whether the system value is the system value + 5: optional bool PromptDisabled (api.body="prompt_disabled"), // Whether to support calling in Prompt, the default is supported + 6: optional SocietyVisibiltyConfig SocietyVisibilityConfig (api.body="society_visibility_config", go.tag="json:\"society_visibility_config,omitempty\""), // Visibility in Social Scene: Public = 1, Anonymous = 2 + 7: optional bool IsDisabled (api.body="is_disabled"), // Whether to disable, the default is false to enable } -struct TaskInfo { // coze 上的 Scheduled Tasks - 1: optional bool UserTaskAllowed (api.body="user_task_allowed") , // 用户开启task任务 - 2: optional i64 EnablePresetTask (api.body="enable_preset_task"), // 允许预设任务 +struct TaskInfo { // Scheduled Tasks on Coze + 1: optional bool UserTaskAllowed (api.body="user_task_allowed") , // User starts task + 2: optional i64 EnablePresetTask (api.body="enable_preset_task"), // Allow preset tasks } enum FieldItemType { - Text = 1, // 文本 String - Number = 2, // 数字 Integer - Date = 3, // 时间 Time + Text = 1, // Text String + Number = 2, // Digital Integer + Date = 3, // Time Time Float = 4, // float Number Boolean = 5, // bool Boolean } struct FieldItem { - 1: optional string Name (api.body="name") , // 字段名称 - 2: optional string Desc (api.body="desc") , // 字段描述 - 3: optional FieldItemType Type (api.body="type") , // 字段类型 - 4: optional bool MustRequired (api.body="must_required") , // 是否必填 - 5: optional i64 Id (agw.js_conv="str", api.js_conv="true", api.body="id"), // 字段Id 新增为0 - 6: optional string TypeStr (api.body="type_str") , // 字段类型 str - 7: optional i64 AlterId (api.body="alterId") , // 字段类型 str + 1: optional string Name (api.body="name") , // field name + 2: optional string Desc (api.body="desc") , // Field description + 3: optional FieldItemType Type (api.body="type") , // field type + 4: optional bool MustRequired (api.body="must_required") , // Is it required? + 5: optional i64 Id (agw.js_conv="str", api.js_conv="true", api.body="id"), // The field Id is added as 0. + 6: optional string TypeStr (api.body="type_str") , // Field type str + 7: optional i64 AlterId (api.body="alterId") , // Field type str } struct Database { 1: optional string TableId (api.body="table_id") , // table id - 2: optional string TableName (api.body="table_name"), // table名称 - 3: optional string TableDesc (api.body="table_desc"), // table简介 - 4: optional list FieldList (api.body="field_list"), // table字段信息 - 5: optional bool PromptDisabled (api.body="prompt_disabled"), // 是否支持在Prompt中调用 默认支持 + 2: optional string TableName (api.body="table_name"), // Table name + 3: optional string TableDesc (api.body="table_desc"), // Table Introduction + 4: optional list FieldList (api.body="field_list"), // Table field information + 5: optional bool PromptDisabled (api.body="prompt_disabled"), // Whether to support calling in Prompt, the default is supported 6: optional BotTableRWMode RWMode (api.body="rw_mode"), } @@ -328,7 +328,7 @@ enum AgentType { Bot_Agent = 4, } -//版本兼容:0-旧版本 1-可回退的新版本 2-不可回退的新版本 3-可回退的新版本(不再提示) +//Version Compatibility: 0 - Old Version 1 - Rollback New Version 2 - Non-Rollback New Version 3 - Rollback New Version (no longer prompted) enum AgentVersionCompat{ OldVersion = 0 MiddleVersion = 1 @@ -339,14 +339,14 @@ enum AgentVersionCompat{ struct Agent { 1 : i64 AgentId (agw.js_conv="str", api.js_conv="true", api.body="agent_id") , 2 : string AgentName (api.body="agent_name") , - 3 : PromptInfo PromptInfo (api.body="prompt_info") , // prompt 信息 - 4 : list PluginInfoList (api.body="plugin_info_list") , // plugin列表 - 5 : Knowledge Knowledge (api.body="knowledge") , // 数据集 - 6 : list WorkflowInfoList (api.body="workflow_info_list") , // Workflow 列表 - 7 : ModelInfo ModelInfo (api.body="model_info") , // 模型配置 - 8 : list Intents (api.body="intents") , // 意图信息 + 3 : PromptInfo PromptInfo (api.body="prompt_info") , // Prompt message + 4 : list PluginInfoList (api.body="plugin_info_list") , // List of plugins + 5 : Knowledge Knowledge (api.body="knowledge") , // dataset + 6 : list WorkflowInfoList (api.body="workflow_info_list") , // Workflow List + 7 : ModelInfo ModelInfo (api.body="model_info") , // model configuration + 8 : list Intents (api.body="intents") , // intent information 9 : AgentType AgentType (api.body="agent_type") , - 10: bool RootAgent (api.body="root_agent") , // 是否是rootagent + 10: bool RootAgent (api.body="root_agent") , // Is it a rootagent? 11: i64 ReferenceId (agw.js_conv="str", api.js_conv="true", api.body="reference_id"), 12: string FirstVersion (api.body="first_version") , 13: string LastVersion (api.body="last_version") , @@ -355,11 +355,11 @@ struct Agent { 16: JumpConfig JumpConfig (api.body="jump_config") , 17: SuggestReplyInfo SuggestReplyInfo (api.body="suggest_reply_info") , 18: string Description (api.body="description") , - 19: AgentVersionCompat VersionCompat (api.body="version_compat") , // multi_agent版本兼容字段 + 19: AgentVersionCompat VersionCompat (api.body="version_compat") , // multi_agent version compatibility field 20: optional HookInfo HookInfo (api.body="hook_info") , - 21: optional string CurrentVersion (api.body="current_version") , //子bot当前版本 - 22: optional ReferenceInfoStatus ReferenceInfoStatus (api.body="reference_info_status") , // 1:有可用更新 2:被删除 - 23: optional ReferenceUpdateType UpdateType (api.body="update_type") , //子bot更新类型 + 21: optional string CurrentVersion (api.body="current_version") , //The current version of the subbot + 22: optional ReferenceInfoStatus ReferenceInfoStatus (api.body="reference_info_status") , // 1: Available update 2: Removed + 23: optional ReferenceUpdateType UpdateType (api.body="update_type") , //Subbot update type } struct AgentPosition{ @@ -390,28 +390,28 @@ enum BotMode{ WorkflowMode = 2, } -enum BotSpecies { // bot种类 - Default = 0, // 从flow创建 - Function = 1, // 从coze创建 +enum BotSpecies { // Bot type + Default = 0, // Create from flow + Function = 1, // Created from coze } enum TimeCapsuleMode { - Off = 0, // 关 - On = 1, // 开 + Off = 0, // close + On = 1, // open } enum DisablePromptCalling { Off = 0, On = 1, } -// 时间胶囊信息 +// Time Capsule Information struct TimeCapsuleInfo { 1: optional TimeCapsuleMode TimeCapsuleMode (api.body="time_capsule_mode"), 2: optional DisablePromptCalling DisablePromptCalling (api.body="disable_prompt_calling"), } struct BotTagInfo { - 1: optional TimeCapsuleInfo TimeCapsuleInfo (api.body="time_capsule_info"), // 时间胶囊信息 tag key : time_capsule + 1: optional TimeCapsuleInfo TimeCapsuleInfo (api.body="time_capsule_info"), // Time capsule information tag key: time_capsule } struct FileboxInfo{ @@ -433,100 +433,100 @@ enum BusinessType { DouyinAvatar = 1 } -// bot信息 +// bot information struct BotInfo { 1 : i64 BotId (agw.js_conv="str", api.js_conv="true", api.body="bot_id") , // bot id - 2 : string Name (api.body="name") , // bot名称 - 3 : string Description (api.body="description") , // bot描述 - 4 : string IconUri (api.body="icon_uri") , // bot 图标uri - 5 : string IconUrl (api.body="icon_url") , // bot 图标url - 6 : i64 CreatorId (agw.js_conv="str", api.js_conv="true", api.body="creator_id") , // 创建人id - 7 : i64 CreateTime (agw.js_conv="str", api.js_conv="true", api.body="create_time") , // 创建时间 - 8 : i64 UpdateTime (agw.js_conv="str", api.js_conv="true", api.body="update_time") , // 更新时间 - 9 : i64 ConnectorId (agw.js_conv="str", api.js_conv="true", api.body="connector_id"), // 业务线 - 10: string Version (api.body="version") , // 版本,毫秒 - 11: ModelInfo ModelInfo (api.body="model_info") , // 模型配置 - 12: PromptInfo PromptInfo (api.body="prompt_info") , // prompt 信息 - 13: list PluginInfoList (api.body="plugin_info_list") , // plugin列表 - 14: list WorkflowInfoList (api.body="workflow_info_list") , // Workflow 列表 - 15: OnboardingInfo OnboardingInfo (api.body="onboarding_info") , // 开场白 - 16: Knowledge Knowledge (api.body="knowledge") , // 数据集 - 17: list VariableList (api.body="variable_list") , // kv存储 - 18: TaskInfo TaskInfo (api.body="task_info") , // 任务管理/预设任务 - 19: list DatabaseList (api.body="database_list") , // 数据表 - 20: SuggestReplyInfo SuggestReplyInfo (api.body="suggest_reply_info") , // 推荐问题 - 21: VoicesInfo VoicesInfo (api.body="voices_info") , // 音色配置 - 22: BotExtInfo BotExtInfo (api.body="bot_ext_info") , // 额外信息,扩展字段 - 23: BotMode BotMode (api.body="bot_mode") , // bot 类型,single agent or multi agent - 24: list Agents (api.body="agents") , // multi agent mode agent信息 - 25: BotSpecies BotSpecies (api.body="bot_species") , // Bot种类 - 26: BotTagInfo BotTagInfo (api.body="bot_tag_info") , // bot tag 信息,用户新增字段 - 27: FileboxInfo FileboxInfo (api.body="filebox_info") , // filebox 信息 - 28: MultiAgentInfo MultiAgentInfo (api.body="multi_agent_info") , // multi_agent结构体 - 29: list BackgroundImageInfoList (api.body="background_image_info_list") , // 背景图列表结构体 + 2 : string Name (api.body="name") , // bot name + 3 : string Description (api.body="description") , // Bot description + 4 : string IconUri (api.body="icon_uri") , // Bot icon uri + 5 : string IconUrl (api.body="icon_url") , // Bot icon url + 6 : i64 CreatorId (agw.js_conv="str", api.js_conv="true", api.body="creator_id") , // creator id + 7 : i64 CreateTime (agw.js_conv="str", api.js_conv="true", api.body="create_time") , // create_time + 8 : i64 UpdateTime (agw.js_conv="str", api.js_conv="true", api.body="update_time") , // update time + 9 : i64 ConnectorId (agw.js_conv="str", api.js_conv="true", api.body="connector_id"), // line of business + 10: string Version (api.body="version") , // Version, ms + 11: ModelInfo ModelInfo (api.body="model_info") , // model configuration + 12: PromptInfo PromptInfo (api.body="prompt_info") , // Prompt message + 13: list PluginInfoList (api.body="plugin_info_list") , // List of plugins + 14: list WorkflowInfoList (api.body="workflow_info_list") , // Workflow List + 15: OnboardingInfo OnboardingInfo (api.body="onboarding_info") , // opening statement + 16: Knowledge Knowledge (api.body="knowledge") , // dataset + 17: list VariableList (api.body="variable_list") , // KV storage + 18: TaskInfo TaskInfo (api.body="task_info") , // Task management/preset tasks + 19: list DatabaseList (api.body="database_list") , // data table + 20: SuggestReplyInfo SuggestReplyInfo (api.body="suggest_reply_info") , // referral question + 21: VoicesInfo VoicesInfo (api.body="voices_info") , // Timbre Configuration + 22: BotExtInfo BotExtInfo (api.body="bot_ext_info") , // Additional information, extended fields + 23: BotMode BotMode (api.body="bot_mode") , // Bot type, single agent or multi agent + 24: list Agents (api.body="agents") , // Multi agent mode agent information + 25: BotSpecies BotSpecies (api.body="bot_species") , // Bot type + 26: BotTagInfo BotTagInfo (api.body="bot_tag_info") , // Bot tag information, user new field + 27: FileboxInfo FileboxInfo (api.body="filebox_info") , // FileBox Information + 28: MultiAgentInfo MultiAgentInfo (api.body="multi_agent_info") , // multi_agent structure + 29: list BackgroundImageInfoList (api.body="background_image_info_list") , // Background cover list structure 30: list ShortcutSort (api.body="shortcut_sort") , - 31: BotStatus Status (api.body="status") , // bot状态 - 32: optional HookInfo HookInfo (api.body="hook_info") , // hook信息 - 33: UserQueryCollectConf UserQueryCollectConf (api.body="user_query_collect_conf") , // 用户query收集配置 - 34: LayoutInfo LayoutInfo (api.body="layout_info") , // workflow模式的编排信息 + 31: BotStatus Status (api.body="status") , // bot state + 32: optional HookInfo HookInfo (api.body="hook_info") , // Hook information + 33: UserQueryCollectConf UserQueryCollectConf (api.body="user_query_collect_conf") , // User query collection configuration + 34: LayoutInfo LayoutInfo (api.body="layout_info") , // Orchestration information for workflow patterns 35: BusinessType BusinessType (api.body="business_type") } struct CommonKnowledge { - 1: list knowledge_infos , // 知识库信息 + 1: list knowledge_infos , // Knowledge Base Information } -struct ShortcutCommandComponent { // panel参数 - 1 : string name //参数名字 - 2 : string description //参数描述 - 3 : string type // 输入类型 text、select、file - 4 : optional string tool_parameter // 请求工具时,参数的key 对应tool的参数名称,没有则为不返回 - 5 : optional list options // type为select时的可选项列表 or type为file时,支持哪些类型 image、doc、table、audio、video、zip、code、txt、ppt - 6 : optional string default_value // 默认值 没配置时不返回 - 7 : bool is_hide // 是否隐藏不展示 线上bot tool类型的快捷指令不返回hide=true的component +struct ShortcutCommandComponent { // Panel parameters + 1 : string name //parameter name + 2 : string description //parameter description + 3 : string type // Input type text, select, file + 4 : optional string tool_parameter // When requesting a tool, the key of the parameter corresponds to the parameter name of the tool. If not, it will not be returned. + 5 : optional list options // Options list when type is select or what types are supported when type is file image, doc, table, audio, video, zip, code, txt, ppt + 6 : optional string default_value // Default value, not returned when not configured + 7 : bool is_hide // Whether to hide or not to show, the shortcut command of the online bot tool type does not return the component with hide = true } struct ShortcutCommandToolInfo { 1: string name // - 2: string type // tool类型 workflow plugin + 2: string type // Tool type workflow plugin } struct ShortcutCommandInfo { - 1: i64 id (api.js_conv="true") // 快捷指令id - 2: string name // 快捷指令按钮名称 - 3: string command // 快捷指令 - 4: string description // 快捷指令描述 - 5: string query_template // 指令query模版 - 6: string icon_url // 快捷指令icon - 7: optional list components // 组件列表(参数列表) - 8: optional ShortcutCommandToolInfo tool // tool信息 - 9: optional i64 agent_id (api.js_conv="true") //multi的指令时,该指令由哪个节点执行 没配置不返回 + 1: i64 id (api.js_conv="true") // Quick Command ID + 2: string name // Shortcut button name + 3: string command // Quick Instruction + 4: string description // shortcut description + 5: string query_template // Command query template + 6: string icon_url // Quick command icon + 7: optional list components // Component list (parameter list) + 8: optional ShortcutCommandToolInfo tool // Tool information + 9: optional i64 agent_id (api.js_conv="true") //When the multi instruction is executed by which node, it will not be returned without configuration } struct OpenAPIBotInfo { 1 : i64 bot_id (api.js_conv="true") , // bot id - 2 : string name, // bot名称 - 3 : string description, // bot描述 - 4 : string icon_url, // bot图像url - 5 : i64 create_time, // 创建时间 - 6 : i64 update_time, // 更新时间 - 7 : string version, // 版本 - 8 : PromptInfo prompt_info, // prompt 信息 - 9 : OnboardingInfo onboarding_info, // 开场白 - 10: BotMode bot_mode, // bot 类型,single agent or multi agent -// 11: optional list voice_data_list, // 选择的语音信息 - 12: optional ModelInfo model_info, // 模型信息 - 13: list plugin_info_list, // 插件信息列表 - 14: optional CommonKnowledge knowledge // 知识库信息 - 15: list workflow_info_list, // workflow信息列表 - 16: list shortcut_commands, // 快捷指令信息列表 -// 17: list voice_info_list, // 音色配置 - 18: string default_user_input_type, // 默认用户输入类型 - 19: SuggestReplyInfo suggest_reply_info, // 用户问题建议 - 20: BackgroundImageInfo background_image_info, // 背景图片 - 21: list variables, // 变量列表 + 2 : string name, // bot name + 3 : string description, // Bot description + 4 : string icon_url, // Bot image url + 5 : i64 create_time, // create_time + 6 : i64 update_time, // update time + 7 : string version, // version + 8 : PromptInfo prompt_info, // Prompt message + 9 : OnboardingInfo onboarding_info, // opening statement + 10: BotMode bot_mode, // Bot type, single agent or multi agent +// 11: optional list < VoiceData > voice_data_list,//selected voice message + 12: optional ModelInfo model_info, // model information + 13: list plugin_info_list, // Plugin information list + 14: optional CommonKnowledge knowledge // Knowledge Base Information + 15: list workflow_info_list, // Workflow information list + 16: list shortcut_commands, // Quick Command Information List +// 17: list < Voice > voice_info_list,//Tone Configuration + 18: string default_user_input_type, // Default user input type + 19: SuggestReplyInfo suggest_reply_info, // User Question Suggestions + 20: BackgroundImageInfo background_image_info, // background image + 21: list variables, // Variable list } @@ -537,14 +537,14 @@ struct LayoutInfo { } struct UserQueryCollectConf { - 1: bool IsCollected (api.body="is_collected") , // 是否开启收集开关 - 2: string PrivatePolicy (api.body="private_policy") , // 隐私协议链接 + 1: bool IsCollected (api.body="is_collected") , // Whether to turn on the collection switch + 2: string PrivatePolicy (api.body="private_policy") , // Privacy Policy Link } struct MultiAgentInfo { - 1: MultiAgentSessionType SessionType (api.body="session_type") , // multi_agent会话接管方式 - 2: AgentVersionCompatInfo VersionCompatInfo (api.body="version_compat_info") , // multi_agent版本兼容字段 前端用 - 3: MultiAgentConnectorType ConnectorType (api.body="connector_type") , // multi_agent连线类型 前端用 + 1: MultiAgentSessionType SessionType (api.body="session_type") , // multi_agent session takeover + 2: AgentVersionCompatInfo VersionCompatInfo (api.body="version_compat_info") , // multi_agent version compatibility field, front-end use + 3: MultiAgentConnectorType ConnectorType (api.body="connector_type") , // multi_agent connection type, front end } struct AgentVersionCompatInfo { @@ -553,18 +553,18 @@ struct AgentVersionCompatInfo { } struct BackgroundImageInfo { - 1: optional BackgroundImageDetail WebBackgroundImage (api.body="web_background_image") , // web端背景图 - 2: optional BackgroundImageDetail MobileBackgroundImage (api.body="mobile_background_image") , // 移动端背景图 + 1: optional BackgroundImageDetail WebBackgroundImage (api.body="web_background_image") , // Web background cover + 2: optional BackgroundImageDetail MobileBackgroundImage (api.body="mobile_background_image") , // Mobile end background cover } struct BackgroundImageDetail { - 1: optional string OriginImageUri (api.body="origin_image_uri") // 原始图片 + 1: optional string OriginImageUri (api.body="origin_image_uri") // original image 2: optional string OriginImageUrl (api.body="origin_image_url") - 3: optional string ImageUri (api.body="image_uri") // 实际使用图片 + 3: optional string ImageUri (api.body="image_uri") // Actual use of pictures 4: optional string ImageUrl (api.body="image_url") 5: optional string ThemeColor (api.body="theme_color") - 6: optional GradientPosition GradientPosition (api.body="gradient_position") // 渐变位置 - 7: optional CanvasPosition CanvasPosition (api.body="canvas_position") // 裁剪画布位置 + 6: optional GradientPosition GradientPosition (api.body="gradient_position") // Gradual change of position + 7: optional CanvasPosition CanvasPosition (api.body="canvas_position") // Crop canvas position } struct GradientPosition { @@ -581,54 +581,54 @@ struct CanvasPosition { } -// bot信息 for 更新 +// Update for bot information struct BotInfoForUpdate { 1: optional i64 BotId (agw.js_conv="str", api.js_conv="true",api.body="bot_id") // bot id - 2: optional string Name (api.body="name") // bot名称 - 3: optional string Description (api.body="description") // bot描述 - 4: optional string IconUri (api.body="icon_uri") // bot 图标uri - 5: optional string IconUrl (api.body="icon_url") // bot 图标url - 6: optional i64 CreatorId (agw.js_conv="str", api.js_conv="true", api.body="creator_id") // 创建人id - 7: optional i64 CreateTime (agw.js_conv="str", api.js_conv="true", api.body="create_time") // 创建时间 - 8: optional i64 UpdateTime (agw.js_conv="str", api.js_conv="true", api.body="update_time") // 更新时间 - 9: optional i64 ConnectorId (agw.js_conv="str", api.js_conv="true", api.body="connector_id") // 业务线 - 10: optional string Version (api.body="version") // 版本,毫秒 - 11: optional ModelInfo ModelInfo (api.body="model_info") // 模型配置 - 12: optional PromptInfo PromptInfo (api.body="prompt_info") // prompt 信息 - 13: optional list PluginInfoList (api.body="plugin_info_list") // plugin列表 - 14: optional list WorkflowInfoList (api.body="workflow_info_list") // Workflow 列表 - 15: optional OnboardingInfo OnboardingInfo (api.body="onboarding_info") // 开场白 - 16: optional Knowledge Knowledge (api.body="knowledge") // 数据集 - 17: optional list VariableList (api.body="variable_list") // kv存储 - 18: optional TaskInfo TaskInfo (api.body="task_info") // 任务管理/预设任务 - 19: optional list DatabaseList (api.body="database_list") // 数据表 - 20: optional SuggestReplyInfo SuggestReplyInfo (api.body="suggest_reply_info") // 推荐问题 - 21: optional VoicesInfo VoicesInfo (api.body="voices_info") // 音色配置 - 22: optional BotExtInfo BotExtInfo (api.body="bot_ext_info") // 额外信息,扩展字段 - 23: optional BotMode BotMode (api.body="bot_mode") // bot 类型,single agent or multi agent - 24: optional list Agents (api.body="agents") // multi agent mode agent信息 - 25: BotSpecies BotSpecies (api.body="bot_species") // Bot种类 - 26: optional BotTagInfo BotTagInfo (api.body="bot_tag_info") // bot tag 信息,用户新增字段 - 27: optional FileboxInfo FileboxInfo (api.body="filebox_info") // filebox 信息 - 28: optional MultiAgentInfo MultiAgentInfo (api.body="multi_agent_info") // multi_agent结构体 - 29: optional list BackgroundImageInfoList (api.body="background_image_info_list") // 背景图列表结构体 + 2: optional string Name (api.body="name") // bot name + 3: optional string Description (api.body="description") // Bot description + 4: optional string IconUri (api.body="icon_uri") // Bot icon uri + 5: optional string IconUrl (api.body="icon_url") // Bot icon url + 6: optional i64 CreatorId (agw.js_conv="str", api.js_conv="true", api.body="creator_id") // creator id + 7: optional i64 CreateTime (agw.js_conv="str", api.js_conv="true", api.body="create_time") // create_time + 8: optional i64 UpdateTime (agw.js_conv="str", api.js_conv="true", api.body="update_time") // update time + 9: optional i64 ConnectorId (agw.js_conv="str", api.js_conv="true", api.body="connector_id") // line of business + 10: optional string Version (api.body="version") // Version, ms + 11: optional ModelInfo ModelInfo (api.body="model_info") // model configuration + 12: optional PromptInfo PromptInfo (api.body="prompt_info") // Prompt message + 13: optional list PluginInfoList (api.body="plugin_info_list") // List of plugins + 14: optional list WorkflowInfoList (api.body="workflow_info_list") // Workflow List + 15: optional OnboardingInfo OnboardingInfo (api.body="onboarding_info") // opening statement + 16: optional Knowledge Knowledge (api.body="knowledge") // dataset + 17: optional list VariableList (api.body="variable_list") // KV storage + 18: optional TaskInfo TaskInfo (api.body="task_info") // Task management/preset tasks + 19: optional list DatabaseList (api.body="database_list") // data table + 20: optional SuggestReplyInfo SuggestReplyInfo (api.body="suggest_reply_info") // referral question + 21: optional VoicesInfo VoicesInfo (api.body="voices_info") // Timbre Configuration + 22: optional BotExtInfo BotExtInfo (api.body="bot_ext_info") // Additional information, extended fields + 23: optional BotMode BotMode (api.body="bot_mode") // Bot type, single agent or multi agent + 24: optional list Agents (api.body="agents") // Multi agent mode agent information + 25: BotSpecies BotSpecies (api.body="bot_species") // Bot type + 26: optional BotTagInfo BotTagInfo (api.body="bot_tag_info") // Bot tag information, user new field + 27: optional FileboxInfo FileboxInfo (api.body="filebox_info") // FileBox Information + 28: optional MultiAgentInfo MultiAgentInfo (api.body="multi_agent_info") // multi_agent structure + 29: optional list BackgroundImageInfoList (api.body="background_image_info_list") // Background cover list structure 30: optional list ShortcutSort (api.body="shortcut_sort") 31: optional HookInfo HookInfo (api.body="hook_info") - 32: optional UserQueryCollectConf UserQueryCollectConf (api.body="user_query_collect_conf")// 用户query收集配置 - 33: optional LayoutInfo LayoutInfo(api.body="layout_info") // workflow模式的编排信息 + 32: optional UserQueryCollectConf UserQueryCollectConf (api.body="user_query_collect_conf")// User query collection configuration + 33: optional LayoutInfo LayoutInfo(api.body="layout_info") // Orchestration information for workflow patterns } struct AgentForUpdate { - 1: optional i64 AgentId (agw.js_conv="str", api.js_conv="true", api.body="id") // agw字段名做了特殊映射 注意 - 2: optional string AgentName (api.body="name") // agw字段名做了特殊映射 注意 - 3: optional PromptInfo PromptInfo (api.body="prompt_info") // prompt 信息 - 4: optional list PluginInfoList (api.body="plugin_info_list") // plugin列表 - 5: optional Knowledge Knowledge (api.body="knowledge") // 数据集 - 6: optional list WorkflowInfoList (api.body="workflow_info_list") // Workflow 列表 - 7: optional ModelInfo ModelInfo (api.body="model_info") // 模型配置 - 8: optional list Intents (api.body="intents") // 意图信息 + 1: optional i64 AgentId (agw.js_conv="str", api.js_conv="true", api.body="id") // The agw field names are specially mapped, note that + 2: optional string AgentName (api.body="name") // The agw field names are specially mapped, note that + 3: optional PromptInfo PromptInfo (api.body="prompt_info") // Prompt message + 4: optional list PluginInfoList (api.body="plugin_info_list") // List of plugins + 5: optional Knowledge Knowledge (api.body="knowledge") // dataset + 6: optional list WorkflowInfoList (api.body="workflow_info_list") // Workflow List + 7: optional ModelInfo ModelInfo (api.body="model_info") // model configuration + 8: optional list Intents (api.body="intents") // intent information 9: optional AgentType AgentType (api.body="agent_type") - 10: optional bool RootAgent (api.body="root_agent") // 是否是rootagent + 10: optional bool RootAgent (api.body="root_agent") // Is it a rootagent? 11: optional i64 ReferenceId (agw.js_conv="str", api.js_conv="true", api.body="reference_id") 12: optional string FirstVersion (api.body="first_version") 13: optional string LastVersion (api.body="last_version") @@ -637,16 +637,16 @@ struct AgentForUpdate { 16: optional JumpConfig JumpConfig (api.body="jump_config") 17: optional SuggestReplyInfo SuggestReplyInfo (api.body="suggest_reply_info") 18: optional string Description (api.body="description") - 19: optional AgentVersionCompat VersionCompat (api.body="version_compat") // multi_agent版本兼容字段 + 19: optional AgentVersionCompat VersionCompat (api.body="version_compat") // multi_agent version compatibility field 20: optional HookInfo HookInfo (api.body="hook_info") } struct TableDetail { 1: optional string TableId // table id - 2: optional string TableName // table名称 - 3: optional string TableDesc // table简介 - 4: optional list FieldList // table字段信息 - 5: optional bool PromptDisabled (api.body="prompt_disabled"), // 是否支持在Prompt中调用 默认支持 + 2: optional string TableName // Table name + 3: optional string TableDesc // Table Introduction + 4: optional list FieldList // Table field information + 5: optional bool PromptDisabled (api.body="prompt_disabled"), // Whether to support calling in Prompt, the default is supported } struct TaskPluginInputField { @@ -671,25 +671,25 @@ struct TaskWebhookOutput { } struct TaskInfoDetail { // Tasks Detail - 1: optional string TaskId // 任务唯一标识 - 2: optional string UserQuestion // 定时器触发时执行的 query,例如:提醒我喝水. 二期:TriggerType == "Time" - 3: optional string CreateTime // 定时任务创建时间 - 4: optional string NextTime // 定时任务下次执行的时间点 - 5: optional i64 Status // 任务状态:有效/无效 - 6: optional i32 PresetType // 1-草稿,2-线上 - 7: optional string CronExpr // 定时任务的 crontab 表达式 - 8: optional string TaskContent // 处理过后的 UserQuestion,例如:喝水 - 9: optional string TimeZone // 时区 - 10: optional string TaskName // 任务名称 + 1: optional string TaskId // task unique identifier + 2: optional string UserQuestion // The query executed when the timer fires, for example: Remind me to drink water. Phase 2: TriggerType == "Time" + 3: optional string CreateTime // Timed task create_time + 4: optional string NextTime // The time when the scheduled task will next execute + 5: optional i64 Status // Task Status: Valid/Invalid + 6: optional i32 PresetType // 1-Draft, 2-Online + 7: optional string CronExpr // crontab expression for timed tasks + 8: optional string TaskContent // Treated UserQuestions, such as Drinking Water + 9: optional string TimeZone // Time Zone + 10: optional string TaskName // task name 11: optional string TriggerType // "Time", "Event" 12: optional string Action // "Bot query", "Plugin", "Workflow" - 13: optional string BotQuery // Action == "Bot query" 时的输入 - 14: optional string PluginName // plugin 和 workflow 都用这个字段 - 15: optional TaskPluginInput PluginInput // plugin 和 workflow 都用这个字段 + 13: optional string BotQuery // Action == "Bot query" + 14: optional string PluginName // Both plugins and workflows use this field + 15: optional TaskPluginInput PluginInput // Both plugins and workflows use this field 16: optional string WebhookUrl // TriggerType == "Event" 17: optional string WebhookBearerToken // TriggerType == "Event" 18: optional TaskWebhookOutput WebhookOutput // TriggerType == "Event" - 19: optional string OriginId // 溯源 ID。创建时生成,更新/发布不变 + 19: optional string OriginId // Traceability ID. Generated when created, updated/released unchanged } struct DraftBotInfoV2 { @@ -720,16 +720,16 @@ struct JumpConfig { } enum IndependentTiming { - Pre = 1 // 判断用户输入(前置) - Post = 2 // 判断节点输出(后置) - PreAndPost = 3 // 前置模式和后置模式支持同时选择 + Pre = 1 // Determine user input (front) + Post = 2 // Determine node output (postfix) + PreAndPost = 3 // Front mode and rear mode support simultaneous selection } enum IndependentRecognitionModelType { - SLM = 0 // 小模型 - LLM = 1 // 大模型 + SLM = 0 // Small model + LLM = 1 // Large model } struct IndependentModeConfig { - 1: IndependentTiming judge_timing // 判断时机 + 1: IndependentTiming judge_timing // judge timing 2: i32 history_round 3: IndependentRecognitionModelType model_type 4: optional string model_id @@ -737,9 +737,9 @@ struct IndependentModeConfig { } struct MessageFeedback { - 1: MessageFeedbackType feedback_type // 反馈类型 - 2: list detail_types // 细分类型 - 3: string detail_content // 负反馈自定义内容,对应用户选择Others + 1: MessageFeedbackType feedback_type // feedback type + 2: list detail_types // segmentation type + 3: string detail_content // Negative feedback custom content, corresponding to user selection Others } enum MessageFeedbackType { @@ -750,10 +750,10 @@ enum MessageFeedbackType { enum MessageFeedbackDetailType { UnlikeDefault = 0 - UnlikeHarmful = 1 // 有害信息 - UnlikeIncorrect = 2 // 信息有误 - UnlikeNotFollowInstructions = 3 // 未遵循指令 - UnlikeOthers = 4 // 其他 + UnlikeHarmful = 1 // Harmful information + UnlikeIncorrect = 2 // incorrect information + UnlikeNotFollowInstructions = 3 // Did not follow instructions + UnlikeOthers = 4 // other } enum Scene{ @@ -762,10 +762,10 @@ enum Scene{ BotStore = 2, CozeHome = 3, Playground = 4, - Evaluation = 5, // 评测平台 + Evaluation = 5, // evaluation platform AgentAPP = 6, - PromptOptimize = 7, //prompt优化 - GenerateAgentInfo = 8 // createbot的nl2bot功能 + PromptOptimize = 7, //Prompt optimization + GenerateAgentInfo = 8 // Createbot's nl2bot features } struct UserLabel { @@ -844,12 +844,12 @@ struct ChatV3MessageDetail { } struct HookInfo { - 1: optional list pre_agent_jump_hook // pre agent跳转hook - 2: optional list post_agent_jump_hook // post agent跳转hook - 3: optional list flow_hook // 流程hook - 4: optional list atomic_hook // 原子能力hook - 5: optional list llm_call_hook // 模型调用hook - 6: optional list res_parsing_hook // 对话结果hook + 1: optional list pre_agent_jump_hook // Pre agent jump hook + 2: optional list post_agent_jump_hook // Post agent jump hook + 3: optional list flow_hook // Process hook + 4: optional list atomic_hook // Atomic power hook + 5: optional list llm_call_hook // Model call hook + 6: optional list res_parsing_hook // Conversation result hook 7: optional list suggestion_hook // suggesion hook } struct HookItem { @@ -874,21 +874,21 @@ struct HookItem { // struct EnterMessage { // 1: required string Role (api.body = "role") -// 2: string Content(api.body = "content") // 内容 +// 2: string Content (api.body = "content")//content // 3: map MetaData(api.body = "meta_data") // 4: string ContentType(api.body = "content_type")//text/card/object_string // 5: string Type(api.body = "type") // } // struct OpenMessageApi { -// 1: string Id(api.body = "id") // 主键ID -// 2: string BotId(api.body = "bot_id") // bot id //已TODO 所有的i64加注解str,入参和出参都要 +// 1: string Id (api.body = "id")//primary key ID +// 2: string BotId (api.body = "bot_id")//bot id//TODO All i64 plus annotation str, imported parameters and exported parameters are required // 3: string Role(api.body = "role") -// 4: string Content(api.body = "content") // 内容 +// 4: string Content (api.body = "content")//content // 5: string ConversationId(api.body = "conversation_id") // conversation id // 6: map MetaData(api.body = "meta_data") -// 7: string CreatedAt(api.body = "created_at") // 创建时间 -// 8: string UpdatedAt(api.body = "updated_at") // 更新时间 //已TODO 时间改成int +// 7: string CreatedAt (api.body = "created_at")//create_time +// 8: string UpdatedAt (api.body = "updated_at")//Update time//Change TODO time to int // 9: string ChatId(api.body = "chat_id") // 10: string ContentType(api.body = "content_type") // 11: string Type(api.body = "type") @@ -900,6 +900,6 @@ enum ReferenceUpdateType { } enum ReferenceInfoStatus { - HasUpdates = 1 // 1:有可用更新 - IsDelete = 2 // 2:被删除 + HasUpdates = 1 // 1: Updates are available + IsDelete = 2 // 2: Deleted } diff --git a/idl/bot_platform/ocean_cloud_workflow/ocean_cloud_workflow.thrift b/idl/bot_platform/ocean_cloud_workflow/ocean_cloud_workflow.thrift index c0cd73a0..3ef80b7c 100644 --- a/idl/bot_platform/ocean_cloud_workflow/ocean_cloud_workflow.thrift +++ b/idl/bot_platform/ocean_cloud_workflow/ocean_cloud_workflow.thrift @@ -7,45 +7,45 @@ include "../../resource/resource_common.thrift" namespace go ocean.cloud.workflow service WorkflowService { - // 创建流程 + // Create process workflow.CreateWorkflowResponse CreateWorkflow(1:workflow.CreateWorkflowRequest request) (api.post='/api/workflow_api/create', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") - // 查询流程 + // query process workflow.GetCanvasInfoResponse GetCanvasInfo(1:workflow.GetCanvasInfoRequest request) (api.post='/api/workflow_api/canvas', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") workflow.GetHistorySchemaResponse GetHistorySchema(1:workflow.GetHistorySchemaRequest request) (api.post='/api/workflow_api/history_schema', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") - // 保存流程 + // save process workflow.SaveWorkflowResponse SaveWorkflow(1:workflow.SaveWorkflowRequest request) (api.post='/api/workflow_api/save', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") workflow.UpdateWorkflowMetaResponse UpdateWorkflowMeta(1:workflow.UpdateWorkflowMetaRequest request) (api.post='/api/workflow_api/update_meta', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") workflow.DeleteWorkflowResponse DeleteWorkflow(1:workflow.DeleteWorkflowRequest request) (api.post='/api/workflow_api/delete', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") workflow.BatchDeleteWorkflowResponse BatchDeleteWorkflow(1:workflow.BatchDeleteWorkflowRequest request) (api.post='/api/workflow_api/batch_delete', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") workflow.GetDeleteStrategyResponse GetDeleteStrategy(1: workflow.GetDeleteStrategyRequest request)(api.post='/api/workflow_api/delete_strategy', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") - // 发布流程。该接口的用途是发布非 project 内部的流程。 + // Publish process. The purpose of this interface is to publish processes that are not internal to the project. workflow.PublishWorkflowResponse PublishWorkflow(1:workflow.PublishWorkflowRequest request) (api.post='/api/workflow_api/publish', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") workflow.CopyWorkflowResponse CopyWorkflow(1:workflow.CopyWorkflowRequest request) (api.post='/api/workflow_api/copy', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") workflow.CopyWkTemplateApiResponse CopyWkTemplateApi(1:workflow.CopyWkTemplateApiRequest request) (api.post='/api/workflow_api/copy_wk_template', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") workflow.GetReleasedWorkflowsResponse GetReleasedWorkflows(1: workflow.GetReleasedWorkflowsRequest request) (api.post='/api/workflow_api/released_workflows', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") workflow.GetWorkflowReferencesResponse GetWorkflowReferences(1: workflow.GetWorkflowReferencesRequest request) (api.post='/api/workflow_api/workflow_references', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") - // 获取示例流程列表 + // Get a list of sample processes workflow.GetExampleWorkFlowListResponse GetExampleWorkFlowList(1: workflow.GetExampleWorkFlowListRequest request)(api.post='/api/workflow_api/example_workflow_list', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") - // 获取流程列表。 + // Gets a list of processes. workflow.GetWorkFlowListResponse GetWorkFlowList(1: workflow.GetWorkFlowListRequest request) (api.post='/api/workflow_api/workflow_list', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") workflow.QueryWorkflowNodeTypeResponse QueryWorkflowNodeTypes(1: workflow.QueryWorkflowNodeTypeRequest request)(api.post="/api/workflow_api/node_type", api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") - // 画布 + // Canvas workflow.NodeTemplateListResponse NodeTemplateList(1: workflow.NodeTemplateListRequest request)(api.post='/api/workflow_api/node_template_list', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") workflow.NodePanelSearchResponse NodePanelSearch(1: workflow.NodePanelSearchRequest request)(api.post='/api/workflow_api/node_panel_search', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") workflow.GetLLMNodeFCSettingsMergedResponse GetLLMNodeFCSettingsMerged(1: workflow.GetLLMNodeFCSettingsMergedRequest req)(api.post='/api/workflow_api/llm_fc_setting_merged', api.category="workflow_api", api.gen_path="workflow_trace", agw.preserve_base = "true") workflow.GetLLMNodeFCSettingDetailResponse GetLLMNodeFCSettingDetail(1: workflow.GetLLMNodeFCSettingDetailRequest req)(api.post='/api/workflow_api/llm_fc_setting_detail', api.category="workflow_api", api.gen_path="workflow_trace", agw.preserve_base = "true") - // 试运行流程(test run) + // Practice running process (test run) workflow.WorkFlowTestRunResponse WorkFlowTestRun(1:workflow.WorkFlowTestRunRequest request) (api.post='/api/workflow_api/test_run', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") workflow.WorkflowTestResumeResponse WorkFlowTestResume(1:workflow.WorkflowTestResumeRequest request) (api.post='/api/workflow_api/test_resume', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") workflow.CancelWorkFlowResponse CancelWorkFlow(1:workflow.CancelWorkFlowRequest request) (api.post='/api/workflow_api/cancel', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") - // 查看试运行执行历史。 + // View practice run history. workflow.GetWorkflowProcessResponse GetWorkFlowProcess(1:workflow.GetWorkflowProcessRequest request)(api.get='/api/workflow_api/get_process', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") workflow.GetNodeExecuteHistoryResponse GetNodeExecuteHistory(1:workflow.GetNodeExecuteHistoryRequest request)(api.get='/api/workflow_api/get_node_execute_history', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") workflow.GetApiDetailResponse GetApiDetail(1: workflow.GetApiDetailRequest request) (api.get='/api/workflow_api/apiDetail', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") workflow.WorkflowNodeDebugV2Response WorkflowNodeDebugV2(1: workflow.WorkflowNodeDebugV2Request request) (api.post='/api/workflow_api/nodeDebug', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") - // 文件上传 + // file upload workflow.GetUploadAuthTokenResponse GetWorkflowUploadAuthToken(1: workflow.GetUploadAuthTokenRequest request)(api.post = '/api/workflow_api/upload/auth_token', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") workflow.SignImageURLResponse SignImageURL(1: workflow.SignImageURLRequest request)(api.post='/api/workflow_api/sign_image_url', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") // conversation @@ -54,7 +54,7 @@ service WorkflowService { workflow.DeleteProjectConversationDefResponse DeleteProjectConversationDef(1: workflow.DeleteProjectConversationDefRequest request)(api.post = '/api/workflow_api/project_conversation/delete', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") workflow.ListProjectConversationResponse ListProjectConversationDef(1: workflow.ListProjectConversationRequest request)(api.get = '/api/workflow_api/project_conversation/list', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") // Trace - // 列出历史执行的trace + // List traces of historical execution trace.ListRootSpansResponse ListRootSpans (1: trace.ListRootSpansRequest req)(api.post='/api/workflow_api/list_spans', api.category="workflow_trace", api.gen_path="workflow_trace", agw.preserve_base = "true") trace.GetTraceSDKResponse GetTraceSDK (1: trace.GetTraceSDKRequest req)(api.post='/api/workflow_api/get_trace', api.category="workflow_trace", api.gen_path="workflow_trace", agw.preserve_base = "true") // App @@ -65,7 +65,7 @@ service WorkflowService { workflow.GetChatFlowRoleResponse GetChatFlowRole(1: workflow.GetChatFlowRoleRequest request) (api.get='/api/workflow_api/chat_flow_role/get', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") workflow.CreateChatFlowRoleResponse CreateChatFlowRole(1: workflow.CreateChatFlowRoleRequest request) (api.post='/api/workflow_api/chat_flow_role/create', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") workflow.DeleteChatFlowRoleResponse DeleteChatFlowRole(1: workflow.DeleteChatFlowRoleRequest request) (api.post='/api/workflow_api/chat_flow_role/delete', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") - // App 发布管理 + // App Release Management workflow.ListPublishWorkflowResponse ListPublishWorkflow(1: workflow.ListPublishWorkflowRequest request) (api.post='/api/workflow_api/list_publish_workflow', api.category="workflow_api", api.gen_path="workflow_api", agw.preserve_base = "true") // Open API diff --git a/idl/bot_platform/ocean_cloud_workflow/trace.thrift b/idl/bot_platform/ocean_cloud_workflow/trace.thrift index 26ba316f..c95c8564 100644 --- a/idl/bot_platform/ocean_cloud_workflow/trace.thrift +++ b/idl/bot_platform/ocean_cloud_workflow/trace.thrift @@ -3,9 +3,9 @@ include "../../base.thrift" namespace go ocean.cloud.workflow enum FrontedTagType { - TEXT = 0 // 文本 - TIME = 1 // 时间,用时间戳,单位是毫秒 - TIME_DURATION = 2 // 时间间隔,单位是毫秒 + TEXT = 0 // Text + TIME = 1 // Time, with timestamp, in milliseconds + TIME_DURATION = 2 // Time interval, in milliseconds } // Tag @@ -39,15 +39,15 @@ enum SpanStatus{ } struct ListRootSpansRequest { - 2: required i64 StartAt (go.tag = "json:\"start_at\"", api.body = "start_at") // 单位是毫秒 - 3: required i64 EndAt (go.tag = "json:\"end_at\"", api.body = "end_at") // 单位是毫秒 + 2: required i64 StartAt (go.tag = "json:\"start_at\"", api.body = "start_at") // It's in milliseconds. + 3: required i64 EndAt (go.tag = "json:\"end_at\"", api.body = "end_at") // It's in milliseconds. 4: optional i16 Limit (go.tag = "json:\"limit\"", api.body = "limit") 5: optional bool DescByStartTime (go.tag = "json:\"desc_by_start_time\"", api.body = "desc_by_start_time") 6: optional i32 Offset (go.tag = "json:\"offset\"", api.body = "offset") 7: required string WorkflowID(go.tag = "json:\"workflow_id\"", api.body = "workflow_id") 8: optional string Input(go.tag = "json:\"input\"", api.body = "input") 9: optional SpanStatus Status(go.tag = "json:\"status\"", api.body = "status") - 10: optional i32 ExecuteMode (go.tag = "json:\"execute_mode\"", api.body = "execute_mode") // 正式运行/试运行/节点Debug + 10: optional i32 ExecuteMode (go.tag = "json:\"execute_mode\"", api.body = "execute_mode") // Formal run/practice run/Node Debug 255: optional base.Base Base } @@ -62,8 +62,8 @@ struct Span { 7: string Type (go.tag = "json:\"type\"", agw.key = "type") 8: string Name (go.tag = "json:\"name\"", agw.key = "name") 9: string ParentID (go.tag = "json:\"parent_id\"", agw.key = "parent_id") - 10: i64 Duration (go.tag = "json:\"duration\"", agw.key = "duration") // 单位是毫秒 - 11: i64 StartTime (go.tag = "json:\"start_time\"", agw.key = "start_time") // 单位是毫秒 + 10: i64 Duration (go.tag = "json:\"duration\"", agw.key = "duration") // It's in milliseconds. + 11: i64 StartTime (go.tag = "json:\"start_time\"", agw.key = "start_time") // It's in milliseconds. 12: i32 StatusCode (go.tag = "json:\"status_code\"", agw.key = "status_code") 13: list Tags (go.tag = "json:\"tags\"", agw.key = "tags") } @@ -93,8 +93,8 @@ struct ListRootSpansResponse { struct GetTraceSDKRequest { 2: optional string LogID (go.tag = "json:\"log_id\"", api.query = "log_id") - 4: optional i64 StartAt (go.tag = "json:\"start_at\"", api.query = "start_at") // 单位是毫秒 - 5: optional i64 EndAt (go.tag = "json:\"end_at\"", api.query = "end_at") // 单位是毫秒 + 4: optional i64 StartAt (go.tag = "json:\"start_at\"", api.query = "start_at") // It's in milliseconds. + 5: optional i64 EndAt (go.tag = "json:\"end_at\"", api.query = "end_at") // It's in milliseconds. 6: optional i64 WorkflowID (go.tag = "json:\"workflow_id\"", api.query = "workflow_id") 7: optional i64 ExecuteID (go.tag = "json:\"execute_id\"", api.query = "execute_id") @@ -102,9 +102,9 @@ struct GetTraceSDKRequest { } enum QueryScene { - ALICE_OP = 0 // doubao cici 全链路调试台 - DOUBAO_CICI_DEBUG = 1 // doubao cici debug 功能 - WORKFLOW_DEBUG = 2 // workflow debug 功能 + ALICE_OP = 0 // Doubao cici full link debugging station + DOUBAO_CICI_DEBUG = 1 // Doubao cici debugging function + WORKFLOW_DEBUG = 2 // Workflow debugging } enum TenantLevel { @@ -119,15 +119,15 @@ struct GetTraceSDKResponse { struct KeyScene { - 1: optional string Scene (go.tag = "json:\"scene\"", agw.key = "scene") // 场景,如"拆分搜索词"\"搜索" - 2: optional string StatusMessage (go.tag = "json:\"status_message\"", agw.key = "status_message") // 状态信息 + 1: optional string Scene (go.tag = "json:\"scene\"", agw.key = "scene") // Scenarios such as "Split search terms"\ "Search" + 2: optional string StatusMessage (go.tag = "json:\"status_message\"", agw.key = "status_message") // status information 3: optional string System (go.tag = "json:\"system\"", agw.key = "system") - 4: optional list HistoryMessages (go.tag = "json:\"history_messages\"", agw.key = "history_messages") // 历史消息 - 5: optional KeySceneInput Input (go.tag = "json:\"input\"", agw.key = "input") // 输入 - 6: optional KeySceneOutput Output (go.tag = "json:\"output\"", agw.key = "output") // 输出 - 7: optional i64 Duration (go.tag = "json:\"duration\"", agw.key = "duration") // 单位是毫秒 - 8: optional i64 StartTime (go.tag = "json:\"start_time\"", api.body = "start_time") // 开始时间,用于排序,单位是毫秒 - 9: optional list SubKeyScenes (go.tag = "json:\"sub_key_scenes\"", agw.key = "sub_key_scenes") // 子场景 + 4: optional list HistoryMessages (go.tag = "json:\"history_messages\"", agw.key = "history_messages") // chat history + 5: optional KeySceneInput Input (go.tag = "json:\"input\"", agw.key = "input") // input + 6: optional KeySceneOutput Output (go.tag = "json:\"output\"", agw.key = "output") // output + 7: optional i64 Duration (go.tag = "json:\"duration\"", agw.key = "duration") // It's in milliseconds. + 8: optional i64 StartTime (go.tag = "json:\"start_time\"", api.body = "start_time") // Start time, used for sorting, in milliseconds + 9: optional list SubKeyScenes (go.tag = "json:\"sub_key_scenes\"", agw.key = "sub_key_scenes") // subscene } struct KeySceneInput { @@ -141,13 +141,13 @@ struct KeySceneOutput { } struct TraceSummaryContent { - 1: optional string Key (go.tag = "json:\"key\"", agw.key = "key") // 键 - 2: optional string Content (go.tag = "json:\"content\"", agw.key = "content") // 内容 + 1: optional string Key (go.tag = "json:\"key\"", agw.key = "key") // key + 2: optional string Content (go.tag = "json:\"content\"", agw.key = "content") // content } struct MessageItem { - 1: optional string Role (go.tag = "json:\"role\"", agw.key = "role") // 角色 - 2: optional string Content (go.tag = "json:\"content\"", agw.key = "content") // 内容 + 1: optional string Role (go.tag = "json:\"role\"", agw.key = "role") // role + 2: optional string Content (go.tag = "json:\"content\"", agw.key = "content") // content } struct SpanSummary { @@ -157,31 +157,31 @@ struct SpanSummary { struct FrontendTag { 1: required string Key (go.tag = "json:\"key\"", agw.key = "key") - 2: optional string KeyAlias (go.tag = "json:\"key_alias\"", agw.key = "key_alias") // 多语,如无配置时值沿用 key + 2: optional string KeyAlias (go.tag = "json:\"key_alias\"", agw.key = "key_alias") // Multilingual, if there is no configuration value, use the key 3: required TagType TagType (go.tag = "json:\"tag_type\"", agw.key = "tag_type") 4: optional Value Value (go.tag = "json:\"value\"", agw.key = "value") - 5: optional FrontedTagType FrontendTagType (go.tag = "json:\"frontend_tag_type\"", agw.key = "frontend_tag_type") // 前端类型,用于前端处理 - 6: optional bool canCopy (go.tag = "json:\"can_copy\"", agw.key = "can_copy") // 是否可复制 + 5: optional FrontedTagType FrontendTagType (go.tag = "json:\"frontend_tag_type\"", agw.key = "frontend_tag_type") // Front-end type for front-end processing + 6: optional bool canCopy (go.tag = "json:\"can_copy\"", agw.key = "can_copy") // Can it be copied? } struct TraceSummary{ - 1: optional string System (go.tag = "json:\"system\"", agw.key = "system") // 一级 System 的文本 - 2: optional list HistoryMessages (go.tag = "json:\"history_messages\"", agw.key = "history_messages") // 一级历史消息 + 1: optional string System (go.tag = "json:\"system\"", agw.key = "system") // System 1 text + 2: optional list HistoryMessages (go.tag = "json:\"history_messages\"", agw.key = "history_messages") // Level 1 chat history 3: optional list KeyScenes (go.tag = "json:\"key_scenes\"", agw.key = "key_scenes") - 4: optional string Input (go.tag = "json:\"input\"", agw.key = "input") // 输入 - 5: optional string Output (go.tag = "json:\"output\"", agw.key = "output") // 输出 - 6: optional i64 Duration (go.tag = "json:\"duration\"", agw.key = "duration") // 一级当前对话的耗时, 单位是毫秒 - 7: optional string UserID (go.tag = "json:\"user_id\"", agw.key = "user_id") // 用户ID + 4: optional string Input (go.tag = "json:\"input\"", agw.key = "input") // input + 5: optional string Output (go.tag = "json:\"output\"", agw.key = "output") // output + 6: optional i64 Duration (go.tag = "json:\"duration\"", agw.key = "duration") // The duration of the current conversation, in milliseconds + 7: optional string UserID (go.tag = "json:\"user_id\"", agw.key = "user_id") // user ID } struct TraceHeader { - 1: optional i64 Duration (go.tag = "json:\"duration\"", agw.key = "duration") // 单位是毫秒 - 2: optional i32 Tokens (agw.key = "tokens") // 输入消耗token数 + 1: optional i64 Duration (go.tag = "json:\"duration\"", agw.key = "duration") // It's in milliseconds. + 2: optional i32 Tokens (agw.key = "tokens") // Enter the number of tokens consumed 3: optional i32 StatusCode (go.tag = "json:\"status_code\"", agw.key = "status_code") 4: optional list Tags (go.tag = "json:\"tags\"", agw.key = "tags") - 5: optional string MessageID (go.tag = "json:\"message_id\"", agw.key = "message_id") // 消息ID - 6: optional i64 StartTime (go.tag = "json:\"start_time\"", agw.key = "start_time") // 单位是毫秒 + 5: optional string MessageID (go.tag = "json:\"message_id\"", agw.key = "message_id") // Message ID + 6: optional i64 StartTime (go.tag = "json:\"start_time\"", agw.key = "start_time") // It's in milliseconds. } @@ -196,7 +196,7 @@ struct TraceFrontendDoubaoCiciDebug { 3: optional TraceSummary summary (go.tag = "json:\"summary\"", agw.key = "summary") } enum InputOutputType { - TEXT = 0 // 文本类型 + TEXT = 0 // Text type } struct SpanInputOutput { @@ -212,16 +212,16 @@ struct TraceFrontendSpan { 5: string Name (go.tag = "json:\"name\"", agw.key = "name") 6: string AliasName (go.tag = "json:\"alias_name\"", agw.key = "alias_name") 7: string ParentID (go.tag = "json:\"parent_id\"", agw.key = "parent_id") - 8: i64 Duration (go.tag = "json:\"duration\"", agw.key = "duration") // 单位是毫秒 - 9: i64 StartTime (go.tag = "json:\"start_time\"", agw.key = "start_time") // 单位是毫秒 + 8: i64 Duration (go.tag = "json:\"duration\"", agw.key = "duration") // It's in milliseconds. + 9: i64 StartTime (go.tag = "json:\"start_time\"", agw.key = "start_time") // It's in milliseconds. 10: i32 StatusCode (go.tag = "json:\"status_code\"", agw.key = "status_code") 11: optional list Tags (go.tag = "json:\"tags\"", agw.key = "tags") - 12: optional SpanSummary summary (go.tag = "json:\"summary\"", agw.key = "summary") // 节点详情 + 12: optional SpanSummary summary (go.tag = "json:\"summary\"", agw.key = "summary") // node details 13: optional SpanInputOutput Input (go.tag = "json:\"input\"", agw.key = "input") 14: optional SpanInputOutput Output (go.tag = "json:\"output\"", agw.key = "output") - 15: optional bool IsEntry (go.tag = "json:\"is_entry\"", agw.key = "is_entry") // 是否是入口节点 - 16: optional string ProductLine (go.tag = "json:\"product_line\"", agw.key = "product_line") // 产品线 - 17: optional bool IsKeySpan (go.tag = "json:\"is_key_span\"", agw.key = "is_key_span") // 是否是关键节点 - 18: optional list OwnerList (go.tag = "json:\"owner_list\"", agw.key = "owner_list") // 节点负责人列表, 邮箱前缀 - 19: optional string RundownDocURL (go.tag = "json:\"rundown_doc_url\"", agw.key = "rundown_doc_url") // 节点详情文档 + 15: optional bool IsEntry (go.tag = "json:\"is_entry\"", agw.key = "is_entry") // Is it an entry node? + 16: optional string ProductLine (go.tag = "json:\"product_line\"", agw.key = "product_line") // product line + 17: optional bool IsKeySpan (go.tag = "json:\"is_key_span\"", agw.key = "is_key_span") // Is it a key node? + 18: optional list OwnerList (go.tag = "json:\"owner_list\"", agw.key = "owner_list") // Node owner list, mailbox prefix + 19: optional string RundownDocURL (go.tag = "json:\"rundown_doc_url\"", agw.key = "rundown_doc_url") // Node Details Document } diff --git a/idl/bot_platform/ocean_cloud_workflow/workflow.thrift b/idl/bot_platform/ocean_cloud_workflow/workflow.thrift index 1dd094b1..ade4dddf 100644 --- a/idl/bot_platform/ocean_cloud_workflow/workflow.thrift +++ b/idl/bot_platform/ocean_cloud_workflow/workflow.thrift @@ -8,27 +8,27 @@ enum PersistenceModel { External = 3, } -// WorkflowMode 用来区分 Workflow 和 chatflow +// WorkflowMode is used to distinguish between Workflow and chatflow. enum WorkflowMode { Workflow = 0 , Imageflow = 1 , SceneFlow = 2 , ChatFlow = 3 , - All = 100 , // 仅在查询时使用 + All = 100 , // Use only when querying } -// workflow 商品审核草稿状态 +// Workflow Product Review Draft Status enum ProductDraftStatus { - Default = 0, // 默认 - Pending = 1, // 审核中 - Approved = 2, // 审核通过 - Rejected = 3, // 审核不通过 - Abandoned = 4, // 已废弃 + Default = 0, // default + Pending = 1, // Under review. + Approved = 2, // approved + Rejected = 3, // The review failed. + Abandoned = 4, // Abandoned } enum CollaboratorMode { - Close = 0, // 关闭多人协作模式 - Open = 1, // 开启多人协作模式 + Close = 0, // Turn off multiplayer collaboration mode + Open = 1, // Enable multiplayer collaboration mode } struct Workflow{ @@ -38,52 +38,52 @@ struct Workflow{ 4 : string url , 5 : string icon_uri , 6 : WorkFlowDevStatus status , - 7 : WorkFlowType type , // 类型,1:官方模版 - 8 : string plugin_id , // workflow对应的插件id + 7 : WorkFlowType type , // Type 1: Official Template + 8 : string plugin_id , // Plugin ID for workflow 9 : i64 create_time , 10: i64 update_time , 11: SchemaType schema_type , 12: optional Node start_node , 13: optional Tag tag , - 14: optional string template_author_id , // 模版创作者id - 15: optional string template_author_name , // 模版创作者昵称 - 16: optional string template_author_picture_url, // 模版创作者头像 - 17: optional string space_id , // 空间id - 18: optional string interface_str , // 流程出入参 - 19: optional string schema_json , // 新版workflow的定义 schema - 20: Creator creator , // workflow创作者信息 - 21: PersistenceModel persistence_model , // 存储模型 - 22: WorkflowMode flow_mode , // workflow or imageflow,默认值为workflow - 23: ProductDraftStatus product_draft_status , // workflow商品审核版本状态 + 14: optional string template_author_id , // template creator id + 15: optional string template_author_name , // template creator nickname + 16: optional string template_author_picture_url, // template creator avatar + 17: optional string space_id , // Space ID + 18: optional string interface_str , // process entry and exit + 19: optional string schema_json , // New workflow definition schema + 20: Creator creator , // Workflow creator information + 21: PersistenceModel persistence_model , // Storage Model + 22: WorkflowMode flow_mode , // Workflow or imageflow, the default is workflow + 23: ProductDraftStatus product_draft_status , // Workflow product review version status 24: optional string external_flow_info , // {"project_id":"xxx","flow_id":xxxx} - 25: CollaboratorMode collaborator_mode , // workflow多人协作按钮状态 + 25: CollaboratorMode collaborator_mode , // Workflow Multiplayer Collaboration Button Status 26: list check_result, 27: optional string project_id, - 28: optional string dev_plugin_id, // project 下的 workflow 才有 + 28: optional string dev_plugin_id, // Only the workflow under the project is available. } struct CheckResult { - 1: CheckType type, // 校验类型 - 2: bool is_pass, // 是否通过 - 3: string reason, // 不通过原因 + 1: CheckType type, // check type + 2: bool is_pass, // Whether to pass + 3: string reason, // Reason for not passing } struct Creator { 1: string id , 2: string name , 3: string avatar_url , - 4: bool self (pilota.name="rust_self"), // 是否是自己创建的 + 4: bool self (pilota.name="rust_self"), // Did you create it yourself? } enum SchemaType{ - DAG = 0, // 废弃 + DAG = 0, // abandoned FDL = 1, - BlockWise = 2, // 废弃 + BlockWise = 2, // abandoned } enum WorkFlowType{ - User = 0, // 用户自定义 - GuanFang = 1, // 官方模板 + User = 0, // user defined + GuanFang = 1, // official template } enum Tag{ @@ -109,7 +109,7 @@ enum Tag{ Hidden = 100, } -//节点结构 +//Node structure enum NodeType{ Start = 1 , End = 2 , @@ -143,7 +143,7 @@ enum NodeType{ DatasetDelete = 60, } -//节点模版类型,与NodeType基本保持一致,copy一份是因为新增了一个Imageflow类型,避免影响原来NodeType的业务语意 +//The node template type is basically the same as NodeType. One copy is due to the addition of an Imageflow type to avoid affecting the business semantics of the original NodeType enum NodeTemplateType{ Start = 1 , End = 2 , @@ -226,7 +226,7 @@ struct Param{ 3: InputType type , 4: bool required , 5: string value , - 6: ParamRequirementType requirement , // 要求 1不允许删除 2不允许更改名称 3什么都可修改 4只显示,全部不允许更改 + 6: ParamRequirementType requirement , // Requirements 1 Do not allow deletion 2 Do not allow name change 3 Anything can be modified 4 Only display, all are not allowed to be changed 7: optional string from_node_id, 8: optional list from_output , } @@ -262,9 +262,9 @@ struct IfParam { } struct IfBranch { - 1: optional list if_conditions , // 该分支的条件 - 2: optional IfConditionRelation if_condition_relation, // 该分支各条件的关系 - 3: optional list next_node_id , // 该分支对应的下一个节点 + 1: optional list if_conditions , // Conditions for this branch + 2: optional IfConditionRelation if_condition_relation, // The relationship between the conditions of this branch + 3: optional list next_node_id , // The next node corresponding to this branch } struct IfCondition { @@ -283,31 +283,31 @@ enum TerminatePlanType{ USESETTING = 2, } -struct TerminatePlan{//结束方式 +struct TerminatePlan{//End method 1: TerminatePlanType plan , 2: string content, } struct NodeParam{ - 1 : optional list input_list , // 输入参数列表,支持多级;支持mapping - 2 : optional list output_list , // 输出参数列表,支持多级 - 3 : optional APIParam api_param , // 如果是API类型的Node,插件名、API名、插件版本、API的描述 - 4 : optional CodeParam code_param , // 如果是代码片段,则包含代码内容 - 5 : optional LLMParam llm_param , // 如果是模型,则包含模型的基础信息 - 6 : optional DatasetParam dataset_param , // 如果是数据集,选择数据集的片段 - 7 : optional TerminatePlan terminate_plan , // end节点,如何结束 - 8 : optional list input_parameters , // (新)输入参数列表 - 9 : optional list output_parameters, // (新)输出参数列表 - 10: optional Batch batch , // 批量设置情况 - 11: optional IfParam if_param , // if节点参数 + 1 : optional list input_list , // Enter parameter list, support multi-level; support mapping + 2 : optional list output_list , // Output parameter list, support multi-level + 3 : optional APIParam api_param , // If it is an API type Node, plug-in name, API name, plug-in version, API description + 4 : optional CodeParam code_param , // If it is a code snippet, include the code content + 5 : optional LLMParam llm_param , // If it is a model, include the basic information of the model + 6 : optional DatasetParam dataset_param , // If it is a dataset, select a fragment of the dataset + 7 : optional TerminatePlan terminate_plan , // End node, how to end + 8 : optional list input_parameters , // (New) input parameter list + 9 : optional list output_parameters, // (New) Output parameter list + 10: optional Batch batch , // batch setup + 11: optional IfParam if_param , // if node parameter } struct NodeDesc{ 1: string desc , - 2: string name , // 副标题名称 - 3: string icon_url , // 该类型的icon - 4: i32 support_batch, // 是否支持批量,1不支持,2支持 - 5: i32 link_limit , // 连接要求 1左右都可连接 2只支持右侧 + 2: string name , // Subtitle name + 3: string icon_url , // This type of icon + 4: i32 support_batch, // Whether to support batch, 1 does not support, 2 supports + 5: i32 link_limit , // Connection requirements 1 or so can be connected 2 only support the right side } struct OpenAPI{ 1: list input_list , @@ -315,26 +315,26 @@ struct OpenAPI{ } struct Batch{ - 1: bool is_batch , // batch开关是否打开 - 2: i64 take_count , // 只处理数组[0,take_count)范围的输入 - 3: Parameter input_param, // 需要Batch的输入 + 1: bool is_batch , // Is the batch switch on? + 2: i64 take_count , // Only process input in the range [0, take_count) + 3: Parameter input_param, // Batch input required } struct Node{ 1: string workflow_id, - 2: string node_id , // 节点id - 3: string node_name , // 更改node名称 - 4: NodeType node_type , // 节点类型 - 5: NodeParam node_param , // 节点的核心参数 - 6: LayOut lay_out , // Node的位置 - 7: NodeDesc desc , // Node的描述,说明链接 - 8: list depends_on , // 依赖的上游节点 - 9: OpenAPI open_api , // 所有的输入和输出 + 2: string node_id , // Node ID + 3: string node_name , // Change node name + 4: NodeType node_type , // Node type + 5: NodeParam node_param , // Core parameters of the node + 6: LayOut lay_out , // Node location + 7: NodeDesc desc , // Description of Node, explaining the link + 8: list depends_on , // dependent upstream node + 9: OpenAPI open_api , // All inputs and outputs } enum SupportBatch{ - NOT_SUPPORT = 1, // 1:不支持 - SUPPORT = 2, // 2:支持 + NOT_SUPPORT = 1, // 1: Not supported + SUPPORT = 2, // 2: Support } enum PluginParamTypeFormat { @@ -347,50 +347,50 @@ struct Parameter { 3 : bool required , 4 : InputType type , 5 : list sub_parameters, - 6 : InputType sub_type , // 如果Type是数组,则有subtype - 7 : optional string from_node_id , // 如果入参的值是引用的则有fromNodeId - 8 : optional list from_output , // 具体引用哪个节点的key - 9 : optional string value , // 如果入参是用户手输 就放这里 + 6 : InputType sub_type , // If Type is an array, there is a subtype + 7 : optional string from_node_id , // fromNodeId if the value of the imported parameter is a reference + 8 : optional list from_output , // Which node's key is specifically referenced? + 9 : optional string value , // If the imported parameter is the user's hand input, put it here 10: optional PluginParamTypeFormat format , - 11: optional i64 assist_type , // 辅助类型;type=string生效,0 为unset - 12: optional i64 sub_assist_type, // 如果Type是数组,表示子元素的辅助类型;sub_type=string生效,0 为unset + 11: optional i64 assist_type , // Auxiliary type; type = string takes effect, 0 is unset + 12: optional i64 sub_assist_type, // If Type is an array, it represents the auxiliary type of the child element; sub_type = string takes effect, 0 is unset } -//状态,1不可提交 2可提交 3已提交 4废弃 +//Status, 1 Not Submitted 2 Submitted 3 Submitted 4 Obsolete enum WorkFlowDevStatus{ - CanNotSubmit = 1, // 不可提交 - CanSubmit = 2, // 可提交 - HadSubmit = 3, // 已提交 - Deleted = 4, // 删除 + CanNotSubmit = 1, // unsubmittable + CanSubmit = 2, // submittable + HadSubmit = 3, // Submitted + Deleted = 4, // delete } -//状态,1不可发布 2可发布 3已发布 4删除 5下架 +//Status, 1 Unpublishable 2 Publishable 3 Published 4 Deleted 5 Removed enum WorkFlowStatus{ - CanNotPublish = 1, // 不可发布 - CanPublish = 2, // 可发布 - HadPublished = 3, // 已发布 - Deleted = 4, // 删除 - Unlisted = 5, // 下架 + CanNotPublish = 1, // unpublishable + CanPublish = 2, // publishable + HadPublished = 3, // Published + Deleted = 4, // delete + Unlisted = 5, // offline } struct CreateWorkflowRequest{ - 1 : required string name , // 流程名 - 2 : required string desc , // 流程描述,不可为空 - 3 : required string icon_uri , // 流程图标uri,不可为空 - 4 : required string space_id , // 空间id,不可为空 - 5 : optional WorkflowMode flow_mode , // workflow or chatflow,默认值为workflow + 1 : required string name , // process name + 2 : required string desc , // Process description, not null + 3 : required string icon_uri , // Process icon uri, not nullable + 4 : required string space_id , // Space id, cannot be empty + 5 : optional WorkflowMode flow_mode , // Workflow or chatflow, the default is workflow 6 : optional SchemaType schema_type , 7 : optional string bind_biz_id , - 8 : optional i32 bind_biz_type, // 绑定业务类型,非必要不填写。参考BindBizType结构体,值为3时代表抖音分身 - 9 : optional string project_id , // 应用id,填写时代表流程是project下的流程,需要跟随project发布 - 10 : optional bool create_conversation, // 是否创建会话,仅当flow_mode=chatflow时生效 + 8 : optional i32 bind_biz_type, // Bind the business type, do not fill in if necessary. Refer to the BindBizType structure, when the value is 3, it represents the Douyin doppelganger. + 9 : optional string project_id , // Application id, when filled in, it means that the process is the process under the project, and it needs to be released with the project. + 10 : optional bool create_conversation, // Whether to create a session, only if flow_mode = chatflow 255: optional base.Base Base , } struct CreateWorkflowData{ - 1: string workflow_id , // 流程的id,用来标识唯一的流程 - 2: string name , // 流程名 + 1: string workflow_id , // The ID of the process, used to identify a unique process + 2: string name , // process name 3: string url , 4: WorkFlowStatus status , 5: SchemaType type , @@ -407,13 +407,13 @@ struct CreateWorkflowResponse{ } struct SaveWorkflowRequest{ - 1 : required string workflow_id , // 流程的id,用来标识唯一的流程 - 2 : optional string schema , // 流程的schema - 3 : optional string space_id , // required,空间id,不可为空 + 1 : required string workflow_id , // The ID of the process, used to identify a unique process + 2 : optional string schema , // Process schema + 3 : optional string space_id , // Required, space id, not nullable 4 : optional string name , 5 : optional string desc , 6 : optional string icon_uri , - 7 : required string submit_commit_id , // 提交的 commit_id。其作用是唯一标识一个流程的单个提交版本(每个 commit_id 仅对应且仅能对应一个流程的一次提交版本)。 + 7 : required string submit_commit_id , // The commit_id of a commit. This is used to uniquely identify individual commit versions of a process (each commit_id corresponds only and only to one commit version of a process). 8 : optional bool ignore_status_transfer, 255: optional base.Base Base , @@ -504,15 +504,15 @@ struct CanvasData { 3: DBCanvasData db_data , 4: OperationInfo operation_info , 5: optional string external_flow_info, - 6: optional bool is_bind_agent , // 是否绑定了Agent + 6: optional bool is_bind_agent , // Is the Agent bound? 7: optional string bind_biz_id , 8: optional i32 bind_biz_type , 9: optional string workflow_version , } struct GetCanvasInfoRequest { - 1 : required string space_id , // 空间id,不可为空 - 2 : optional string workflow_id, // required,流程id,不可为空 + 1 : required string space_id , // Space id, cannot be empty + 2 : optional string workflow_id, // Required, process id, not null 255: optional base.Base Base , } @@ -536,7 +536,7 @@ enum OperateType { struct GetHistorySchemaRequest { 1 : required string space_id , 2 : required string workflow_id, - 3 : optional string commit_id , // 多次分页的时候需要传入 + 3 : optional string commit_id , // You need to pass in when paging multiple times. 4 : required OperateType type , 5 : optional string env , 6 : optional string workflow_version, @@ -575,8 +575,8 @@ struct GetHistorySchemaResponse{ } enum DeleteAction{ - BlockwiseUnbind = 1, // Blockwise的解绑 - BlockwiseDelete = 2, // Blockwise的删除 + BlockwiseUnbind = 1, // Blockwise Unbinding + BlockwiseDelete = 2, // Blockwise removal } struct DeleteWorkflowRequest{ @@ -632,20 +632,20 @@ struct GetDeleteStrategyResponse{ } enum DeleteType{ - CanDelete = 0, // 可以删除:无workflow商品/商品下架/第一次上架且审核失败 - RejectProductDraft = 1, // 删除后审核失败:workflow商品第一次上架并处于审核中 - UnListProduct = 2, // 需要商品先下架:workflow商品已上架 + CanDelete = 0, // Can be deleted: No workflow product/product removed from the shelves/first time on the shelves and the review failed + RejectProductDraft = 1, // Review failed after deletion: The workflow product is on the shelves for the first time and is under review. + UnListProduct = 2, // Products that need to be removed from the shelves first: workflow products have been put on the shelves. } struct PublishWorkflowRequest{ 1 : required string workflow_id , 2 : required string space_id , 3 : required bool has_collaborator, - 4 : optional string env , // 发布到哪个环境,不填默认线上 - 5 : optional string commit_id , // 使用哪个版本发布,不填默认最新提交版本 - 6 : optional bool force , // 强制发布。若流程发布前执行了 TestRun 步骤,“force” 参数值应为 false,或不传递该参数;若流程发布前未执行 TestRun 步骤,“force” 参数值应为 true 。 - 7 : optional string workflow_version, // required, 发布workflow的版本号,遵循 SemVer 格式为"vx.y.z",必须比当前版本大,可通过 GetCanvasInfo 获取当前版本 - 8 : optional string version_description, // workflow的版本描述 + 4 : optional string env , // Which environment to publish to, do not fill in the default line + 5 : optional string commit_id , // Which version to use to release, do not fill in the default latest commit version + 6 : optional bool force , // Force release. If the TestRun step was executed before the process was published, the "force" parameter value should be false, or not passed; if the TestRun step was not executed before the process was published, the "force" parameter value should be true. + 7 : optional string workflow_version, // Required, the version number of the published workflow, in SemVer format "vx.y.z", must be larger than the current version, the current version can be obtained through GetCanvasInfo + 8 : optional string version_description, // Workflow version description 255: optional base.Base Base , } @@ -687,7 +687,7 @@ struct UserInfo { 1: i64 user_id , 2: string user_name , 3: string user_avatar, - 4: string nickname, // 用户昵称 + 4: string nickname, // user nickname } struct ReleasedWorkflowData { @@ -710,7 +710,7 @@ struct ReleasedWorkflow { 12: string version , 13: i64 create_time , 14: i64 update_time , - 15: Creator creator , // workflow创作者信息 + 15: Creator creator , // Workflow creator information 16: WorkflowMode flow_mode , 17: string flow_version , 18: string flow_version_desc , @@ -733,7 +733,7 @@ enum OrderBy { Id = 4, } -// Workflow 过滤条件 +// Workflow filter struct WorkflowFilter { 1: string workflow_id, 2: optional string workflow_version, @@ -749,8 +749,8 @@ struct GetReleasedWorkflowsRequest { 8 : optional string space_id , 9 : optional OrderBy order_by , 10 : optional bool login_user_create, - 11 : optional WorkflowMode flow_mode , // workflow or imageflow, 默认为workflow - 12 : optional list workflow_filter_list, // 过滤条件,支持workflow_id和workflow_version + 11 : optional WorkflowMode flow_mode , // Workflow or imageflow, default to workflow + 12 : optional list workflow_filter_list, // Filter conditions, support workflow_id and workflow_version 255: optional base.Base Base , } @@ -790,11 +790,11 @@ struct GetExampleWorkFlowListResponse { } struct GetExampleWorkFlowListRequest { - 1 : optional i32 page , // 分页功能,指定希望获取的结果列表的页码。 - 2 : optional i32 size , // 分页功能,指定每页返回的条目数量, 必须大于0,小于等于100 - 5 : optional string name , // 根据工作流的名称来筛选示例工作流列表。 - 11 : optional WorkflowMode flow_mode , // 根据工作流的模式(例如:标准工作流、对话流等)筛选示例工作流列表。 - 14 : optional list checker , // Bot的 Workflow as Agent模式会使用,只会使用BotAgent = 3的场景 + 1 : optional i32 page , // Paging function, specifying the page number of the list of results you want to retrieve. + 2 : optional i32 size , // Paging function, specifies the number of entries returned per page, must be greater than 0, less than or equal to 100 + 5 : optional string name , // Filter the list of sample workflows by the name of the workflow. + 11 : optional WorkflowMode flow_mode , // Filter the sample workflow list based on the workflow pattern (e.g., standard workflow, conversation flow, etc.). + 14 : optional list checker , // Bot's Workflow as Agent mode will be used, only scenarios with BotAgent = 3 will be used 255: optional base.Base Base , } @@ -815,24 +815,24 @@ enum CheckType { enum BindBizType { Agent = 1 , Scene = 2 , - DouYinBot = 3, // 抖音分身 + DouYinBot = 3, // Douyin doppelganger } struct GetWorkFlowListRequest { 1 : optional i32 page , - 2 : optional i32 size , // 分页大小,一般为10 - 3 : optional list workflow_ids , // 根据流程id列表查询对应的流程 - 4 : optional WorkFlowType type , // 根据流程类型筛选流程 - 5 : optional string name , // 根据流程名称筛选流程 - 6 : optional Tag tags , // 根据标签筛选流程 - 7 : optional string space_id , // required,空间id - 8 : optional WorkFlowListStatus status , // 根据流程是否已发布筛选流程 + 2 : optional i32 size , // Page size, usually 10. + 3 : optional list workflow_ids , // Query the corresponding process according to the process id list + 4 : optional WorkFlowType type , // Filter processes by process type + 5 : optional string name , // Filter processes by process name + 6 : optional Tag tags , // Filter process by label + 7 : optional string space_id , // Required, space id + 8 : optional WorkFlowListStatus status , // Filter process according to whether the process has been published 9 : optional OrderBy order_by , - 10 : optional bool login_user_create, // 根据接口请求人是否为流程创建人筛选流程 - 11 : optional WorkflowMode flow_mode , // workflow or chatflow, 默认为workflow。根据流程类型筛选流程 - 12 : optional list schema_type_list , // 新增字段,用于筛选schema_type - 13 : optional string project_id , // 在对应project下查询流程 - 14 : optional list checker, // 用于project发布过滤,此列表中的每个 CheckType 元素可指定特定规则,决定了返回的流程是否通过检查。 + 10 : optional bool login_user_create, // Filter processes based on whether the interface requester is the process creator + 11 : optional WorkflowMode flow_mode , // Workflow or chatflow, the default is workflow. Filter processes by process type + 12 : optional list schema_type_list , // New field for filtering schema_type + 13 : optional string project_id , // Query process under the corresponding project + 14 : optional list checker, // For project publication filtering, each CheckType element in this list can specify a specific rule that determines whether the returned process passes the check. 15 : optional string bind_biz_id , 16 : optional BindBizType bind_biz_type, 17 : optional string project_version, @@ -847,9 +847,9 @@ struct ResourceActionAuth{ } struct ResourceAuthInfo{ - 1: string workflow_id, // 资源id - 2: string user_id , // 用户id - 3: ResourceActionAuth auth , // 用户资源操作权限 + 1: string workflow_id, // Resource ID + 2: string user_id , // user id + 3: ResourceActionAuth auth , // user resource operation permission } struct WorkFlowListData { @@ -899,9 +899,9 @@ struct WorkFlowTestRunRequest { 1 : required string workflow_id , 2 : map input , 3 : optional string space_id , - 4 : optional string bot_id , // agent的id,非project下的流程,涉及变量节点、数据库的流程 - 5 : optional string submit_commit_id, // 废弃 - 6 : optional string commit_id , // 指定vcs commit_id,默认为空 + 4 : optional string bot_id , // The id of the agent, the process under non-project, the process involving variable nodes and databases + 5 : optional string submit_commit_id, // abandoned + 6 : optional string commit_id , // Specify vcs commit_id, default is empty 7 : optional string project_id, 255: optional base.Base Base , @@ -956,7 +956,7 @@ struct CancelWorkFlowResponse { 255: required base.BaseResp BaseResp, } -// workflow快照基本信息 +// Workflow snapshot basic information struct WkPluginBasicData{ 1 : i64 workflow_id (api.js_conv="true"), 2 : i64 space_id (api.js_conv="true"), @@ -965,7 +965,7 @@ struct WkPluginBasicData{ 5 : string url , 6 : string icon_uri , 7 : WorkFlowStatus status, - 8 : i64 plugin_id (api.js_conv="true"), // workflow 对应的插件id + 8 : i64 plugin_id (api.js_conv="true"), // Plugin ID for workflow 9 : i64 create_time , 10: i64 update_time , 11: i64 source_id (api.js_conv="true"), @@ -980,13 +980,13 @@ struct WkPluginBasicData{ struct CopyWkTemplateApiRequest{ 1 : required list workflow_ids, - 2 : required i64 target_space_id (api.js_conv='true'), // 拷贝的目标空间 + 2 : required i64 target_space_id (api.js_conv='true'), // Copy target space 255: optional base.Base Base , } struct CopyWkTemplateApiResponse{ - 1 : required map data (api.js_conv='true'), // 模板ID:拷贝副本的数据 + 1 : required map data (api.js_conv='true'), // Template ID: Copy copy of data 253: required i64 code , 254: required string msg , @@ -995,12 +995,12 @@ struct CopyWkTemplateApiResponse{ // === node history === struct GetWorkflowProcessRequest{ - 1 : required string workflow_id, // 流程id,不为空 - 2 : required string space_id , // 空间id,不为空 - 3 : optional string execute_id , // 流程的执行id - 4 : optional string sub_execute_id, // 子流程的执行id - 5 : optional bool need_async, // 是否返回所有的batch节点内容 - 6 : optional string log_id, // 未传execute_id时,可通过log_id取到execute_id + 1 : required string workflow_id, // Process id, not empty + 2 : required string space_id , // Space id, not empty + 3 : optional string execute_id , // Execution ID of the process + 4 : optional string sub_execute_id, // Execution ID of the subprocess + 5 : optional bool need_async, // Whether to return all batch node contents + 6 : optional string log_id, // When execute_id is not transmitted, it can be obtained through log_id execute_id 7 : optional i64 node_id (agw.key="node_id", agw.js_conv="str", api.js_conv='true'), 255: optional base.Base Base , @@ -1020,12 +1020,12 @@ enum WorkflowExeHistoryStatus{ } struct TokenAndCost{ - 1: optional string inputTokens , // input消耗Token数 - 2: optional string inputCost , // input花费 - 3: optional string outputTokens, // Output消耗Token数 - 4: optional string outputCost , // Output花费 - 5: optional string totalTokens , // 总消耗Token数 - 6: optional string totalCost , // 总花费 + 1: optional string inputTokens , // Input Consumption Tokens + 2: optional string inputCost , // Input cost + 3: optional string outputTokens, // Output Consumption Tokens + 4: optional string outputCost , // Output cost + 5: optional string totalTokens , // Total Consumed Tokens + 6: optional string totalCost , // total cost } enum NodeHistoryScene{ @@ -1037,9 +1037,9 @@ struct GetNodeExecuteHistoryRequest{ 1 : required string workflow_id, 2 : required string space_id , 3 : required string execute_id , - 5 : required string node_id, // 节点id - 6 : optional bool is_batch, // 是否批次节点 - 7 : optional i32 batch_index, // 执行批次 + 5 : required string node_id, // Node ID + 6 : optional bool is_batch, // Whether batch node + 7 : optional i32 batch_index, // execution batch 8 : required string node_type, 9 : optional NodeHistoryScene node_history_scene, @@ -1059,14 +1059,14 @@ struct GetWorkFlowProcessData{ 2 : string executeId , 3 : WorkflowExeStatus executeStatus , 4 : list nodeResults , - 5 : string rate , // 执行进度 - 6 : WorkflowExeHistoryStatus exeHistoryStatus, // 现节点试运行状态 1:没有试运行 2:试运行过 - 7 : string workflowExeCost , // workflow试运行耗时 - 8 : optional TokenAndCost tokenAndCost , // 消耗 - 9 : optional string reason , // 失败原因 - 10: optional string lastNodeID , // 最后一个节点的ID + 5 : string rate , // execution progress + 6 : WorkflowExeHistoryStatus exeHistoryStatus, // Current node practice run state 1: no practice run 2: practice run + 7 : string workflowExeCost , // Workflow practice running time + 8 : optional TokenAndCost tokenAndCost , // consume + 9 : optional string reason , // reason for failure + 10: optional string lastNodeID , // The ID of the last node 11: string logID , - 12: list nodeEvents, // 只返回中断中的 event + 12: list nodeEvents, // Returns only events in the interrupt 13: string projectId, } @@ -1083,11 +1083,11 @@ struct NodeResult{ 3 : string NodeName , 5 : NodeExeStatus nodeStatus , 6 : string errorInfo , - 7 : string input , // 入参 jsonstring类型 - 8 : string output , // 出参 jsonstring - 9 : string nodeExeCost , // 运行耗时 eg:3s - 10: optional TokenAndCost tokenAndCost , // 消耗 - 11: optional string raw_output , // 直接输出 + 7 : string input , // Imported parameters jsonString type + 8 : string output , // Exported parameter jsonString + 9 : string nodeExeCost , // Running time eg: 3s + 10: optional TokenAndCost tokenAndCost , // consume + 11: optional string raw_output , // direct output 12: string errorLevel , 13: optional i32 index , 14: optional string items , @@ -1119,8 +1119,8 @@ struct NodeEvent{ 3: string node_title, 4: string data, 5: string node_icon, - 6: string node_id, // 实际为node_execute_id - 7: string schema_node_id, // 与画布里的node_id对应 + 6: string node_id, // Actually node_execute_id + 7: string schema_node_id, // Corresponds to node_id on canvas } struct GetUploadAuthTokenRequest { @@ -1187,7 +1187,7 @@ struct NodeError { struct PathError { 1: string start, 2: string end , - 3: list path , // 路径上的节点ID + 3: list path , // Node ID on the path } struct NodeTemplate { @@ -1201,50 +1201,50 @@ struct NodeTemplate { 8: string color , } -// 插件配置 +// plug-in configuration struct PluginAPINode { - // 实际的插件配置 + // Actual plug-in configuration 1: string plugin_id, 2: string api_id , 3: string api_name , - // 用于节点展示 + // For node display 4: string name , 5: string desc , 6: string icon_url , 7: string node_type, } -// 查看更多图像插件 +// View more image plugins struct PluginCategory { 1: string plugin_category_id, 2: bool only_official, - // 用于节点展示 + // For node display 3: string name , 4: string icon_url , 5: string node_type, } struct NodeTemplateListRequest { - 1 : optional list need_types, // 需要的节点类型 不传默认返回全部 - 2 : optional list node_types, // 需要的节点类型, string 类型 + 1 : optional list need_types, // Required node type, return all by default without passing + 2 : optional list node_types, // Required node type, string type 255: optional base.Base Base, } struct NodeTemplateListData { 1: list template_list, - 2: list cate_list , // 节点的展示分类配置 + 2: list cate_list , // Display classification configuration of nodes 3: list plugin_api_list , 4: list plugin_category_list, } struct NodeCategory { - 1: string name , // 分类名,空字符串表示下面的节点不属于任何分类 + 1: string name , // Category name, empty string indicates that the following node does not belong to any category 2: list node_type_list, - 3: optional list plugin_api_id_list, // 插件的api_id列表 - 4: optional list plugin_category_id_list, // 跳转官方插件列表的分类配置 - // 5: optional NodeCategory sub_category, // 子分类,如需支持多层,可以用sub_category来实现 + 3: optional list plugin_api_id_list, // List of api_id plugins + 4: optional list plugin_category_id_list, // Jump to the classification configuration of the official plug-in list + // 5: optional NodeCategory sub_category,//sub-category, if you need to support multi-layer, you can use sub_category to achieve } struct NodeTemplateListResponse { @@ -1340,7 +1340,7 @@ struct NodeInfo { } struct GetWorkflowDetailInfoRequest { - 1 : optional list workflow_filter_list, // 过滤条件,支持workflow_id和workflow_version + 1 : optional list workflow_filter_list, // Filter conditions, support workflow_id and workflow_version 2 : optional string space_id , 255: optional base.Base Base , @@ -1370,7 +1370,7 @@ struct WorkflowDetailInfoData { 13: string icon_uri , 14: WorkflowMode flow_mode , 15: string plugin_id , - 16: Creator creator , // workflow创作者信息 + 16: Creator creator , // Workflow creator information 17: string flow_version , 18: string flow_version_desc , 19: string latest_flow_version , @@ -1428,13 +1428,13 @@ enum ParameterLocation{ Header = 4, } -// 默认入参的设置来源 +// Default imported parameter settings source enum DefaultParamSource { - Input = 0, // 默认用户输入 - Variable = 1, // 引用变量 + Input = 0, // default user input + Variable = 1, // reference variable } -// 针对File类型参数的细分类型 +// Subdivision types for File type parameters enum AssistParameterType { DEFAULT = 1, IMAGE = 2, @@ -1452,7 +1452,7 @@ enum AssistParameterType { struct APIParameter { - 1 : string id , // for前端,无实际意义 + 1 : string id , // For the front end, no practical significance 2 : string name , 3 : string desc , 4 : ParameterType type , @@ -1474,8 +1474,8 @@ struct APIParameter { 20: optional bool exclusive_minimum , 21: optional bool exclusive_maximum , 22: optional string biz_extend , - 23: optional DefaultParamSource default_param_source , // 默认入参的设置来源 - 24: optional string variable_ref , // 引用variable的key + 23: optional DefaultParamSource default_param_source , // Default imported parameter settings source + 24: optional string variable_ref , // Reference variable key 25: optional AssistParameterType assist_type , } @@ -1495,7 +1495,7 @@ struct FCPluginSetting { 4: list request_params , 5: list response_params , 6: ResponseStyle response_style, - 7: optional AsyncConf async_conf, // 本期暂时不支持 + 7: optional AsyncConf async_conf, // This issue is temporarily not supported. 8: bool is_draft, 9: string plugin_version, } @@ -1506,7 +1506,7 @@ struct FCWorkflowSetting { 3: list request_params , 4: list response_params , 5: ResponseStyle response_style, - 6: optional AsyncConf async_conf, // 本期暂时不支持 + 6: optional AsyncConf async_conf, // This issue is temporarily not supported. 7: bool is_draft, 8: string workflow_version, } @@ -1580,7 +1580,7 @@ struct PluginDetail { } struct APIDetail { - 1: string id , // api的id + 1: string id , // API ID 2: string name, 3: string description, 4: list parameters, @@ -1651,7 +1651,7 @@ struct UpdateProjectConversationDefResponse { struct DeleteProjectConversationDefRequest { 1: required string project_id , 2: required string unique_id, - 3: map replace, // 替换表,每个 wf 草稿分别替换成哪个, 未替换的情况下 success =false,replace 会返回待替换列表 + 3: map replace, // Replace the table, which one to replace each wf draft with. If not replaced, success = false, replace will return the list to be replaced. 4: bool check_only, 5: required string space_id, @@ -1660,7 +1660,7 @@ struct DeleteProjectConversationDefRequest { struct DeleteProjectConversationDefResponse { 1: bool success, - 2: list need_replace, // 如果未传递 replacemap, 会失败,返回需要替换的 wf + 2: list need_replace, // If no replacemap is passed, it will fail, returning the wf that needs to be replaced 253: required i64 code , 254: required string msg , 255: required base.BaseResp BaseResp, @@ -1678,14 +1678,14 @@ enum CreateEnv { struct ListProjectConversationRequest { 1: required string project_id , - 2: CreateMethod create_method, // 0=在project 创建(静态会话),1=通过 wf 节点创建(动态会话) - 3: CreateEnv create_env, // 0=wf 节点试运行创建的 1=wf 节点发布后运行的 - 4: string cursor, // 分页偏移,不传从第一条开始 - 5: i64 limit, // 一次拉取数量 + 2: CreateMethod create_method, // 0 = created in project (static session), 1 = created through wf node (dynamic session) + 3: CreateEnv create_env, // 0 = wf node practice run created 1 = wf node run after release + 4: string cursor, // Paging offset, do not pass from the first item + 5: i64 limit, // number of pulls at one time 6: required string space_id, - 7: string nameLike, // conversationName 模糊搜索 - 8: string connector_id, // create_env=1 时传递,传对应的渠道 id,当前默认 1024(openapi) - 9: optional string project_version, // project版本 + 7: string nameLike, // conversationName fuzzy search + 8: string connector_id, // create_env = 1, pass the corresponding channel id, the current default 1024 (openapi) + 9: optional string project_version, // Project version 255: optional base.Base Base , } @@ -1693,29 +1693,29 @@ struct ListProjectConversationRequest { struct ProjectConversation { 1: string unique_id, 2: string conversation_name, - 3: string conversation_id, // 对于自己在 coze 渠道的 conversationid + 3: string conversation_id, // For your own conversationid in the coze channel 4: string release_conversation_name, } struct ListProjectConversationResponse { 1: list data, - 2: string cursor, // 游标,为空表示没有下一页了, 翻页时带上这个字段 + 2: string cursor, // Cursor, empty means there is no next page, bring this field when turning the page 253: required i64 code , 254: required string msg , 255: required base.BaseResp BaseResp, } enum SuggestReplyInfoMode{ - Disable = 0, // 关闭 - System = 1, // 系统 - Custom = 2, // 自定义 + Disable = 0, // close + System = 1, // system + Custom = 2, // custom } // suggest -struct SuggestReplyInfo { // 对应 Coze Auto-Suggestion - 1: optional SuggestReplyInfoMode SuggestReplyMode (agw.key="suggest_reply_mode",go.tag = "json:\"suggest_reply_mode\"") , // 建议问题模型 - 2: optional string CustomizedSuggestPrompt (agw.key="customized_suggest_prompt",go.tag = "json:\"customized_suggest_prompt\""), // 用户自定义建议问题 +struct SuggestReplyInfo { // Coze Auto-Suggestion + 1: optional SuggestReplyInfoMode SuggestReplyMode (agw.key="suggest_reply_mode",go.tag = "json:\"suggest_reply_mode\"") , // suggestion problem model + 2: optional string CustomizedSuggestPrompt (agw.key="customized_suggest_prompt",go.tag = "json:\"customized_suggest_prompt\""), // user-defined suggestion questions } enum Caller{ @@ -1724,35 +1724,35 @@ enum Caller{ } struct OnboardingInfo{ - 1: string Prologue (agw.key="prologue",go.tag = "json:\"prologue\"")// markdown 格式 - 2: optional list SuggestedQuestions(agw.key="suggested_questions",go.tag = "json:\"suggested_questions\"") // 问题列表 - 3: optional bool DisplayAllSuggestions(agw.key="display_all_suggestions",go.tag = "json:\"display_all_suggestions\"") // 是否显示所有建议问题 + 1: string Prologue (agw.key="prologue",go.tag = "json:\"prologue\"")// Markdown format + 2: optional list SuggestedQuestions(agw.key="suggested_questions",go.tag = "json:\"suggested_questions\"") // List of questions + 3: optional bool DisplayAllSuggestions(agw.key="display_all_suggestions",go.tag = "json:\"display_all_suggestions\"") // Whether to display all suggested questions } struct VoiceConfig{ 1: string VoiceName (agw.key="voice_name",go.tag = "json:\"voice_name\"") - 2: string VoiceID (agw.key="voice_id",go.tag = "json:\"voice_id\"")// 音色ID + 2: string VoiceID (agw.key="voice_id",go.tag = "json:\"voice_id\"")// timbre ID } enum InputMode{ - Text = 1 (agw.key="text", go.tag = "json:\"text\"")// 打字输入 - Audio = 2 (agw.key="audio", go.tag = "json:\"audio\"")// 语音输入 + Text = 1 (agw.key="text", go.tag = "json:\"text\"")// Type input + Audio = 2 (agw.key="audio", go.tag = "json:\"audio\"")// Voice input } enum SendVoiceMode{ - Text = 1 (agw.key="text", go.tag = "json:\"text\"")// 文本消息 - Audio = 2 (agw.key="audio", go.tag = "json:\"audio\"")// 发送为语音 + Text = 1 (agw.key="text", go.tag = "json:\"text\"")// text message + Audio = 2 (agw.key="audio", go.tag = "json:\"audio\"")// Send as voice } struct AudioConfig{ - 1: optional map VoiceConfigMap (agw.key="voice_config_map", go.tag = "json:\"voice_config_map\"") //key为语言 "zh", "en" "ja" "es" "id" "pt" - 3: bool IsTextToVoiceEnable (agw.key="is_text_to_voice_enable", go.tag = "json:\"is_text_to_voice_enable\"")// 文本转语音开关 - 4: InputMode AgentMessageType (agw.key="agent_message_type", go.tag = "json:\"agent_message_type\"")// 智能体消息形式 + 1: optional map VoiceConfigMap (agw.key="voice_config_map", go.tag = "json:\"voice_config_map\"") //Key for language "zh", "en" "ja" "es" "id" "pt" + 3: bool IsTextToVoiceEnable (agw.key="is_text_to_voice_enable", go.tag = "json:\"is_text_to_voice_enable\"")// Text to speech switch + 4: InputMode AgentMessageType (agw.key="agent_message_type", go.tag = "json:\"agent_message_type\"")// agent message form } struct UserInputConfig{ - 1: InputMode DefaultInputMode (agw.key="default_input_mode", go.tag = "json:\"default_input_mode\"")// 默认输入方式 - 2: SendVoiceMode SendVoiceMode (agw.key="send_voice_mode", go.tag = "json:\"send_voice_mode\"")// 用户语音消息发送形式 + 1: InputMode DefaultInputMode (agw.key="default_input_mode", go.tag = "json:\"default_input_mode\"")// Default input method + 2: SendVoiceMode SendVoiceMode (agw.key="send_voice_mode", go.tag = "json:\"send_voice_mode\"")// User voice message sending form } struct GradientPosition { @@ -1770,18 +1770,18 @@ struct CanvasPosition { struct BackgroundImageDetail { - 1: optional string OriginImageUri (agw.key="origin_image_uri", go.tag = "json:\"origin_image_uri\"") // 原始图片 + 1: optional string OriginImageUri (agw.key="origin_image_uri", go.tag = "json:\"origin_image_uri\"") // original image 2: optional string OriginImageUrl (agw.key="origin_image_url", go.tag = "json:\"origin_image_url\"") - 3: optional string ImageUri (agw.key="image_uri", go.tag = "json:\"image_uri\"") // 实际使用图片 + 3: optional string ImageUri (agw.key="image_uri", go.tag = "json:\"image_uri\"") // Actual use of pictures 4: optional string ImageUrl (agw.key="image_url", go.tag = "json:\"image_url\"") 5: optional string ThemeColor (agw.key="theme_color", go.tag = "json:\"theme_color\"") - 6: optional GradientPosition GradientPosition (agw.key="gradient_position", go.tag = "json:\"gradient_position\"") // 渐变位置 - 7: optional CanvasPosition CanvasPosition (agw.key="canvas_position", go.tag = "json:\"canvas_position\"") // 裁剪画布位置 + 6: optional GradientPosition GradientPosition (agw.key="gradient_position", go.tag = "json:\"gradient_position\"") // Gradual change of position + 7: optional CanvasPosition CanvasPosition (agw.key="canvas_position", go.tag = "json:\"canvas_position\"") // Crop canvas position } struct BackgroundImageInfo { - 1: optional BackgroundImageDetail WebBackgroundImage (agw.key="web_background_image",go.tag = "json:\"web_background_image\"") , // web端背景图 - 2: optional BackgroundImageDetail MobileBackgroundImage (agw.key="mobile_background_image"go.tag = "json:\"mobile_background_image\"") , // 移动端背景图 + 1: optional BackgroundImageDetail WebBackgroundImage (agw.key="web_background_image",go.tag = "json:\"web_background_image\"") , // Web background cover + 2: optional BackgroundImageDetail MobileBackgroundImage (agw.key="mobile_background_image"go.tag = "json:\"mobile_background_image\"") , // Mobile end background cover } struct AvatarConfig{ @@ -1792,16 +1792,16 @@ struct AvatarConfig{ struct ChatFlowRole{ 1: string ID (agw.key = "id",go.tag = "json:\"id\"") 2: string WorkflowID (agw.key = "workflow_id",go.tag = "json:\"workflow_id\"") - 3: string ConnectorID (agw.key="connector_id",go.tag = "json:\"connector_id\"") // 渠道ID - 4: optional AvatarConfig Avatar (agw.key="avatar",go.tag = "json:\"avatar\"") // 角色头像 - 5: optional string Description (agw.key="description",go.tag = "json:\"description\"")// 角色描述 - 6: optional OnboardingInfo OnboardingInfo (agw.key="onboarding_info",go.tag = "json:\"onboarding_info\"")// 开场白 - 7: optional string Name (agw.key="name",go.tag = "json:\"name\"") // 角色名称 - 8: optional SuggestReplyInfo SuggestReplyInfo (agw.key="suggest_reply_info",go.tag = "json:\"suggest_reply_info\"")// 用户问题建议 - 9: optional BackgroundImageInfo BackgroundImageInfo (agw.key="background_image_info",go.tag = "json:\"background_image_info\"")// 背景图 - 10: optional AudioConfig AudioConfig (agw.key="audio_config",go.tag = "json:\"audio_config\"")// 语音配置:音色、电话等 - 11: optional UserInputConfig UserInputConfig (agw.key="user_input_config",go.tag = "json:\"user_input_config\"") // 用户输入方式 - 12: optional string ProjectVersion (agw.key="project_version",go.tag = "json:\"project_version\"") // 项目版本 + 3: string ConnectorID (agw.key="connector_id",go.tag = "json:\"connector_id\"") // Channel ID + 4: optional AvatarConfig Avatar (agw.key="avatar",go.tag = "json:\"avatar\"") // avatar + 5: optional string Description (agw.key="description",go.tag = "json:\"description\"")// Role Description + 6: optional OnboardingInfo OnboardingInfo (agw.key="onboarding_info",go.tag = "json:\"onboarding_info\"")// opening statement + 7: optional string Name (agw.key="name",go.tag = "json:\"name\"") // role name + 8: optional SuggestReplyInfo SuggestReplyInfo (agw.key="suggest_reply_info",go.tag = "json:\"suggest_reply_info\"")// User Question Suggestions + 9: optional BackgroundImageInfo BackgroundImageInfo (agw.key="background_image_info",go.tag = "json:\"background_image_info\"")// background cover + 10: optional AudioConfig AudioConfig (agw.key="audio_config",go.tag = "json:\"audio_config\"")// Voice configuration: tone, phone, etc + 11: optional UserInputConfig UserInputConfig (agw.key="user_input_config",go.tag = "json:\"user_input_config\"") // user input method + 12: optional string ProjectVersion (agw.key="project_version",go.tag = "json:\"project_version\"") // project version } struct CreateChatFlowRoleRequest{ @@ -1810,7 +1810,7 @@ struct CreateChatFlowRoleRequest{ } struct CreateChatFlowRoleResponse{ - 1: string ID // 数据库中ID + 1: string ID // ID in the database 255: required base.BaseResp BaseResp } @@ -1818,7 +1818,7 @@ struct CreateChatFlowRoleResponse{ struct DeleteChatFlowRoleRequest{ 1: string WorkflowID 2: string ConnectorID - 4: string ID // 数据库中ID + 4: string ID // ID in the database 255: optional base.Base Base } @@ -1854,20 +1854,20 @@ enum NodePanelSearchType { } struct NodePanelSearchRequest { - 1 : NodePanelSearchType search_type, // 搜索的数据类型,传空、不传或者传All表示搜索所有类型 + 1 : NodePanelSearchType search_type, // The data type of the search, pass empty, do not pass, or pass All means search for all types 2 : string space_id, 3 : optional string project_id, 4 : string search_key, - 5 : string page_or_cursor, // 首次请求时值为"", 底层实现时根据数据源的分页模式转换成page or cursor + 5 : string page_or_cursor, // The value is "" on the first request, and the underlying implementation is converted to a page or cursor according to the paging mode of the data source 6 : i32 page_size, - 7 : string exclude_workflow_id, // 排除的workflow_id,用于搜索workflow时排除当前workflow的id + 7 : string exclude_workflow_id, // Excluded workflow_id, used to exclude the id of the current workflow when searching for workflow 255: optional base.Base Base, } struct NodePanelWorkflowData { 1 : list workflow_list, - 2 : string next_page_or_cursor, // 由于workflow的查询使用都是page+size,这里返回 page+1 + 2 : string next_page_or_cursor, // Since the query of workflow is all page + size, page + 1 is returned here. 3 : bool has_more, } @@ -1888,7 +1888,7 @@ struct NodePanelPlugin { struct NodePanelPluginData { 1 : list plugin_list, - 2 : string next_page_or_cursor, // 数据源为page+size的,这里返回 page+1;数据源为cursor模式的,这里返回数据源返回的cursor + 2 : string next_page_or_cursor, // If the data source is page + size, return page + 1 here; if the data source is cursor mode, return the cursor returned by the data source here 3 : bool has_more, } @@ -1916,8 +1916,8 @@ enum OrderByType { struct ListPublishWorkflowRequest{ 2: required i64 space_id(agw.js_conv="str", api.js_conv="true") - 3: optional i64 owner_id(agw.js_conv="str", api.js_conv="true") //筛选项 - 4: optional string name //搜索项:智能体or作者name + 3: optional i64 owner_id(agw.js_conv="str", api.js_conv="true") //filter + 4: optional string name //Search term: agent or author name 5: optional OrderByType order_last_publish_time 6: optional OrderByType order_total_token 7: required i64 size @@ -1928,10 +1928,10 @@ struct ListPublishWorkflowRequest{ } struct PublishBasicWorkflowData { - 1: WorkflowBasicInfo basic_info //最近发布项目的信息 + 1: WorkflowBasicInfo basic_info //Information on recently released projects 2: UserInfo user_info - 3: list connectors //已发布渠道聚合 - 4: string total_token //截止昨天总token消耗 + 3: list connectors //Published channel aggregation + 4: string total_token //Total token consumption as of yesterday } @@ -1970,9 +1970,9 @@ struct ListPublishWorkflowResponse{ } enum PermissionType { - NoDetail = 1 //不能查看详情 - Detail = 2 //可以查看详情 - Operate = 3 //可以查看和操作 + NoDetail = 1 //Can't view details + Detail = 2 //You can check the details. + Operate = 3 //Can be viewed and operated } struct ValidateTreeRequest { @@ -2006,34 +2006,34 @@ struct OpenAPIRunFlowRequest{ 3 : map Ext (go.tag="json:\"ext\"") , 4 : optional string BotID (go.tag="json:\"bot_id\"") , 5 : optional bool IsAsync (go.tag="json:\"is_async\"") , - 6 : optional string ExecuteMode(go.tag="json:\"execute_mode\"") , // 默认为正式运行,试运行需要传入"DEBUG" - 7 : optional string Version (go.tag="json:\"version\"") , // 版本号,可能是workflow版本或者project版本 - 8 : optional string ConnectorID(go.tag="json:\"connector_id\"") , // 渠道ID,比如ui builder、template、商店等 - 9 : optional string AppID (go.tag="json:\"app_id\"") , // 引用workflow 的应用ID - 10 : optional string ProjectID ( go.tag="json:\"project_id\""), // 项目ID,为了兼容ui builder + 6 : optional string ExecuteMode(go.tag="json:\"execute_mode\"") , // Default to official run, practice run needs to pass in "DEBUG" + 7 : optional string Version (go.tag="json:\"version\"") , // Version number, maybe workflow version or project version + 8 : optional string ConnectorID(go.tag="json:\"connector_id\"") , // Channel ID, such as ui builder, template, store, etc + 9 : optional string AppID (go.tag="json:\"app_id\"") , // App ID referencing workflow + 10 : optional string ProjectID ( go.tag="json:\"project_id\""), // Project ID, for compatibility with UI builder 255: optional base.Base Base , } struct OpenAPIRunFlowResponse { - // 通用字段 - 1 : required i64 Code (go.tag="json:\"code\"") , // 调用结果 - 2 : optional string Msg (go.tag="json:\"msg\"") , // 成功为success, 失败为简单的错误信息、 + // generic field + 1 : required i64 Code (go.tag="json:\"code\"") , // call result + 2 : optional string Msg (go.tag="json:\"msg\"") , // Success for success, failure for simple error messages, - // 同步返回字段 - 3 : optional string Data (go.tag="json:\"data\"") , // 执行结果,通常为json序列化字符串,也有可能是非json结构的字符串 + // Synchronized return field + 3 : optional string Data (go.tag="json:\"data\"") , // The execution result, usually a json serialized string, may also be a non-json string. 4 : optional i64 Token (go.tag="json:\"token\""), 5 : optional string Cost (go.tag="json:\"cost\"") , 6 : optional string DebugUrl (go.tag="json:\"debug_url\"") , - // 异步返回字段 + // asynchronous return field 50 : optional string ExecuteID(go.tag="json:\"execute_id\""), 255: required base.BaseResp BaseResp , } -// 这个枚举需要与plugin的PluginInterruptType对齐 +// This enumeration needs to be aligned with the plugin's PluginInterruptType enum InterruptType { LocalPlugin = 1 Question = 2 @@ -2051,25 +2051,25 @@ struct Interrupt { } struct OpenAPIStreamRunFlowResponse { - 1: string id, // 绝对序号 - 2: string Event(go.tag="json:\"event\"") // 事件类型:message,done,error + 1: string id, // absolute serial number + 2: string Event(go.tag="json:\"event\"") // Event type: message, done, error - // 节点信息 - 50 : optional string NodeSeqID(go.tag="json:\"node_seq_id\""), //节点中的序号 - 52 : optional string NodeTitle(go.tag="json:\"node_title\""), // 节点名称 - 54 : optional string Content(go.tag="json:\"content\""), // ContentType为Text时的返回 - 55 : optional bool NodeIsFinish(go.tag="json:\"node_is_finish\""), // 节点是否执行完成 - 56: optional Interrupt InterruptData( go.tag="json:\"interrupt_data\""), //content type为interrupt时传输,中断协议 - 57: optional string ContentType( go.tag="json:\"content_type\""), // 返回的数据类型 - 58: optional string CardBody(go.tag="json:\"card_body\""), // Content Type为Card时返回的卡片内容 - 59: optional string NodeType(go.tag= "json:\"node_type\"" ), // 节点类型 + // Node information + 50 : optional string NodeSeqID(go.tag="json:\"node_seq_id\""), //The serial number in the node + 52 : optional string NodeTitle(go.tag="json:\"node_title\""), // Node name + 54 : optional string Content(go.tag="json:\"content\""), // Return when ContentType is Text + 55 : optional bool NodeIsFinish(go.tag="json:\"node_is_finish\""), // Has the node completed execution? + 56: optional Interrupt InterruptData( go.tag="json:\"interrupt_data\""), //Transmission when content type is interrupt, interrupt protocol + 57: optional string ContentType( go.tag="json:\"content_type\""), // Data type returned + 58: optional string CardBody(go.tag="json:\"card_body\""), // Card Content Returned when Content Type is Card + 59: optional string NodeType(go.tag= "json:\"node_type\"" ), // Node type 60 : optional string NodeID (go.tag= "json:\"node_id\"") , - // 成功时最后一条消息 + // Last message on success 100 : optional map Ext(go.tag= "json:\"ext\""), 101: optional i64 Token(go.tag= "json:\"token\""), 102: optional string Cost (go.tag= "json:\"cost\""), - // 错误信息 + // error message 151: optional i64 ErrorCode( go.tag= "json:\"error_code\""), 152: optional string ErrorMessage(go.tag= "json:\"error_message\""), 153: optional string DebugUrl (go.tag= "json:\"debug_url\"") , @@ -2083,7 +2083,7 @@ struct OpenAPIStreamResumeFlowRequest{ 3: string ResumeData (go.tag= "json:\"resume_data\"" ) 4: map Ext (go.tag= "json:\"ext\"") 5: string WorkflowID (go.tag= "json:\"workflow_id\"") - 6: optional string ConnectorID (go.tag= "json:\"connector_id\""), // 渠道ID,比如ui builder、template、商店等 + 6: optional string ConnectorID (go.tag= "json:\"connector_id\""), // Channel ID, such as ui builder, template, store, etc 255: base.Base Base } @@ -2113,7 +2113,7 @@ struct WorkflowExecuteHistory{ 9: optional i64 UpdateTime (go.tag= "json:\"update_time\"") 10: optional string DebugUrl (go.tag= "json:\"debug_url\"") , - // 执行成功 + // successful execution 51: optional string Input ( go.tag= "json:\"input\"") 52: optional string Output (go.tag= "json:\"output\"") 53: optional i64 Token (go.tag= "json:\"token\"") @@ -2121,7 +2121,7 @@ struct WorkflowExecuteHistory{ 55: optional string CostUnit (go.tag= "json:\"cost_unit\"") 56: optional map Ext (go.tag= "json:\"ext\"") - // 执行失败 + // execution failed 101: optional string ErrorCode (go.tag= "json:\"error_code\"") 102: optional string ErrorMsg (go.tag= "json:\"error_msg\"") } @@ -2136,7 +2136,7 @@ struct GetWorkflowRunHistoryResponse{ struct EnterMessage { 1: required string Role ( go.tag= "json:\"role\"") - 2: string Content (go.tag= "json:\"content\"") // 内容 + 2: string Content (go.tag= "json:\"content\"") // content 3: map MetaData (go.tag= "json:\"meta_data\"") 4: string ContentType (go.tag= "json:\"content_type\"") //text/card/object_string 5: string Type (go.tag= "json:\"type\"") @@ -2147,25 +2147,25 @@ struct ChatFlowRunRequest{ 2: optional string Parameters (go.tag= "json:\"parameters\""), 3: map Ext (go.tag= "json:\"ext\"") , 4: optional string BotID (go.tag= "json:\"bot_id\"") , - 6: optional string ExecuteMode(go.tag= "json:\"execute_mode\"") , // 默认为正式运行,试运行需要传入"DEBUG" - 7: optional string Version (go.tag= "json:\"version\"") , // 版本号,可能是workflow版本或者project版本 - 8: optional string ConnectorID( go.tag= "json:\"connector_id\"") , // 渠道ID,比如ui builder、template、商店等 + 6: optional string ExecuteMode(go.tag= "json:\"execute_mode\"") , // Default to official run, practice run needs to pass in "DEBUG" + 7: optional string Version (go.tag= "json:\"version\"") , // Version number, maybe workflow version or project version + 8: optional string ConnectorID( go.tag= "json:\"connector_id\"") , // Channel ID, such as ui builder, template, store, etc 9: optional string AppID(agw.key="app_id" go.tag= "json:\"app_id\""), - 10:optional string ConversationID ( go.tag= "json:\"conversation_id\""), // 会话ID - 11:optional list AdditionalMessages (api.body = "additional_messages" go.tag= "json:\"additional_messages\""), // 用户希望先写入的消息 - 12:optional string ProjectID ( go.tag= "json:\"project_id\""), // 项目ID,为了兼容ui builder - 13:optional SuggestReplyInfo SuggestReplyInfo (api.body = "suggest_reply_info" go.tag= "json:\"suggest_reply_info\""), // 建议回复信息 + 10:optional string ConversationID ( go.tag= "json:\"conversation_id\""), // Session ID + 11:optional list AdditionalMessages (api.body = "additional_messages" go.tag= "json:\"additional_messages\""), // The message that the user wants to write first + 12:optional string ProjectID ( go.tag= "json:\"project_id\""), // Project ID, for compatibility with UI builder + 13:optional SuggestReplyInfo SuggestReplyInfo (api.body = "suggest_reply_info" go.tag= "json:\"suggest_reply_info\""), // Suggested reply message 255: optional base.Base Base , } struct ChatFlowRunResponse { - 1: string Event(agw.key = "event",agw.target="sse" go.tag= "json:\"event\"") // 事件类型 - 2: string Data(agw.key = "data",agw.target="sse" go.tag= "json:\"data\"") // msg、error等数据,为了对齐不同的消息类型,使用json序列化 -// 2: optional ChatFlowMessageDetail MessageData (api.body = "message_data") // 消息内容 -// 3: optional ChatFlowChatDetail ChatData (api.body = "chat_data") // 对话内容 -// 4: optional LastError ErrorData (api.body = "error_data") // 错误信息 -// 5:optional string DoneMsg (api.body = "done_msg") // 结束信息 + 1: string Event(agw.key = "event",agw.target="sse" go.tag= "json:\"event\"") // event type + 2: string Data(agw.key = "data",agw.target="sse" go.tag= "json:\"data\"") // Msg, error and other data, in order to align different message types, use json serialization +// 2: optional ChatFlowMessageDetail MessageData (api.body = "message_data")//Message content +// 3: optional ChatFlowChatDetail ChatData (api.body = "chat_data")//dialogue content +// 4: optional LastError ErrorData (api.body = "error_data")//Error message +// 5: optional string DoneMsg (api.body = "done_msg")//end information 255: required base.BaseResp BaseResp } @@ -2185,7 +2185,7 @@ struct WorkflowInfo{ } struct OpenAPIGetWorkflowInfoResponse{ - 1 : optional i32 Code (api.body = "code") // 适配api + 1 : optional i32 Code (api.body = "code") // API adaptation 2 : optional string Msg (api.body = "msg") 3 : optional WorkflowInfo WorkflowInfo (api.body = "data") diff --git a/idl/conversation/common.thrift b/idl/conversation/common.thrift index 6a51bbe9..05278be2 100644 --- a/idl/conversation/common.thrift +++ b/idl/conversation/common.thrift @@ -6,10 +6,10 @@ enum Scene{ Explore = 1, BotStore = 2, CozeHome = 3, - Playground = 4, //调试 - Evaluation = 5, // 评测平台 + Playground = 4, //debugging + Evaluation = 5, // evaluation platform AgentAPP = 6, - PromptOptimize = 7, //prompt优化 - GenerateAgentInfo = 8 // createbot的nl2bot功能 + PromptOptimize = 7, //Prompt optimization + GenerateAgentInfo = 8 // Createbot's nl2bot features SceneOpenApi = 9, //openapi } \ No newline at end of file diff --git a/idl/conversation/conversation.thrift b/idl/conversation/conversation.thrift index be143348..51e1b9cb 100644 --- a/idl/conversation/conversation.thrift +++ b/idl/conversation/conversation.thrift @@ -18,7 +18,7 @@ struct ClearConversationHistoryResponse { struct ClearConversationCtxRequest { 1: required i64 conversation_id ( api.js_conv="true") 2: optional common.Scene scene - 3: optional list insert_history_message_list, // 存在需要插入聊天的情况 + 3: optional list insert_history_message_list, // There is a situation that needs to be inserted into the chat. } struct ClearConversationCtxResponse { @@ -39,7 +39,7 @@ struct ConversationData { } struct CreateConversationRequest { - 1: optional map MetaData (api.body = "meta_data") //自定义透传字段 + 1: optional map MetaData (api.body = "meta_data") //custom passthrough field 3: optional i64 BotId (api.body = "bot_id", api.js_conv="true") 4: optional i64 ConnectorId (api.body= "connector_id", api.js_conv="true") } @@ -62,9 +62,9 @@ struct Section { } struct ClearConversationApiResponse { - 1 : i64 code (api.body = "code", agw.key="code") // 错误code - 2 : string msg (api.body = "msg", agw.key = "msg") // 错误消息 - 3 : Section data (api.body = "data", agw.key = "data") // section 信息 + 1 : i64 code (api.body = "code", agw.key="code") // Error code + 2 : string msg (api.body = "msg", agw.key = "msg") // error message + 3 : Section data (api.body = "data", agw.key = "data") // Section information 255: base.BaseResp BaseResp } @@ -72,8 +72,8 @@ struct ClearConversationApiResponse { struct ListConversationsApiRequest { 1 : i64 page_num (api.query = "page_num", agw.key = "page_num") 2 : i64 page_size (api.query = "page_size", agw.key = "page_size") - 3 : string sort_order (api.query = "sort_order", agw.key = "sort_order") // 可选值:ASC、DESC - 4 : string sort_field (api.query = "sort_field", age.key = "sort_field") // 可选值:created_at创建时间 + 3 : string sort_order (api.query = "sort_order", agw.key = "sort_order") // Optional values: ASC, DESC + 4 : string sort_field (api.query = "sort_field", age.key = "sort_field") // Optional value: such as created_at 5 : required i64 bot_id (api.query = "bot_id", agw.key = "bot_id",api.js_conv="true") 6 : optional i64 connector_id (api.query = "connector_id", agw.key = "connector_id",api.js_conv="true") @@ -81,8 +81,8 @@ struct ListConversationsApiRequest { } struct ListConversationsApiResponse { - 1 : i64 code (api.body = "code", agw.key="code") // 错误code - 2 : string msg (api.body = "msg", agw.key = "msg") // 错误消息 + 1 : i64 code (api.body = "code", agw.key="code") // Error code + 2 : string msg (api.body = "msg", agw.key = "msg") // error message 3 : ListConversationData data (api.body = "data", agw.key = "data") 255: base.BaseResp BaseResp } diff --git a/idl/conversation/message.thrift b/idl/conversation/message.thrift index 3bf1a590..2a186aea 100644 --- a/idl/conversation/message.thrift +++ b/idl/conversation/message.thrift @@ -15,14 +15,14 @@ enum MsgParticipantType { Bot = 1 User = 2 } -// follow copilot 定义的枚举 +// Enumeration following copilot definition enum ChatMessageMetaType { Default_0 = 0; // Compatible value - Replaceable = 1; // 端侧直接替换 - Insertable = 2; // 插入引用 - DocumentRef = 3; // 文档引用 - KnowledgeCard = 4; // 知识库引用卡片 - EmbeddedMultimedia = 100; // 嵌入的多媒体信息,只是alice给端上用的,因为全链路复用这一个字段,所以在这儿改了 + Replaceable = 1; // End-to-side direct replacement + Insertable = 2; // insert reference + DocumentRef = 3; // document citation + KnowledgeCard = 4; // Knowledge Base Reference Card + EmbeddedMultimedia = 100; // The embedded multimedia information is only used by Alice for the end. Because full link multiplexing uses this field, it has been changed here. } struct ExtraInfo { @@ -45,8 +45,8 @@ struct ExtraInfo { 17: string new_section_id, 18: string remove_query_id, 19: string execute_display_name, - 20: string task_type, // 对应定时任务task_type,1-预设任务,2-用户任务,3-Plugin后台任务 - 21: string refer_format //agent app使用引用格式 + 20: string task_type, // Corresponding to timed task task_type, 1-preset task, 2-user task, 3-Plugin background task + 21: string refer_format //Agent app uses reference format 22: string call_id, } @@ -61,9 +61,9 @@ struct MsgParticipantInfo{ 8: string user_name 9: bool allow_mention 10: string access_path - 11: bool is_fav // 是否被收藏 -// 12: shortcut_command.ShortcutStruct shortcuts //快捷指令 - 13: bool allow_share // 是否允许被分享 + 11: bool is_fav // Is collected +// 12: shortcut_command ShortcutStruct shortcuts//Shortcuts + 13: bool allow_share // Is it allowed to be shared? } //struct InterruptFunction { @@ -89,7 +89,7 @@ struct SubmitToolOutputs { 1: list tool_calls } -// 和 bot_connector_platform保持同步 +// Keep up with bot_connector_platform struct RequiredAction { 1 : string type 2 :SubmitToolOutputs submit_tool_outputs @@ -110,50 +110,50 @@ struct ChatMessage { 6 : string reply_id , 7 : string section_id , 8 : ExtraInfo extra_info , - 9 : string status , // 正常、打断状态 拉消息列表时使用,chat运行时没有这个字段 - 10: optional i32 broken_pos , // 打断位置 + 9 : string status , // Normal, interrupted state, used when pulling the message list, this field is not available when chat is running. + 10: optional i32 broken_pos , // interrupt position 11: optional string sender_id, 12: optional list mention_list, 13: i64 content_time, 14: i64 message_index (api.js_conv='true' go.tag="json:\"message_index,string\""), - 15: i32 source , // 消息来源,0 普通聊天消息,1 定时任务,2 通知,3 异步结果 - 16: optional ChatMessage reply_message, // 对应回复的query 找不到后端加一个兜底的 - 17: optional RequiredAction required_action // 打断信息 - 18: optional list meta_infos, // 引用、高亮等文本标记 - 19: optional map card_status // 卡片状态 - 20: optional string reasoning_content //模型思维链 + 15: i32 source , // Sources, 0 normal chat messages, 1 scheduled task, 2 notifications, 3 asynchronous results + 16: optional ChatMessage reply_message, // Corresponding to the replied query, the backend cannot be found, and a backend is added. + 17: optional RequiredAction required_action // interrupt message + 18: optional list meta_infos, // Text markup such as quoting, highlighting, etc + 19: optional map card_status // Card Status + 20: optional string reasoning_content //Model Thinking Chain } struct GetMessageListRequest { 1: string conversation_id - 2: required string cursor // 首次传0/-1,0-最后一页,-1-未读第一页 + 2: required string cursor // First pass 0/-1, 0 - last page, -1 - unread first page 3: required i32 count 4: string bot_id 5: optional bool draft_mode - 6: optional string preset_bot // 使用的bot模版 + 6: optional string preset_bot // The bot template used 7: optional common.Scene scene - 8: optional string biz_kind // 同一个bot和uid下面的不同业务情况 - 9: optional list insert_history_message_list // 存在创建聊天记录前需要插入聊天的情况 + 8: optional string biz_kind // Different business situations under the same bot and uid + 9: optional list insert_history_message_list // There are situations where you need to insert a chat before creating a chat history 10: optional LoadDirection load_direction - 11: optional bool must_append // 在已有conversation情况下,是否强制append message - 12: optional i64 share_id (api.js_conv='true' go.tag="json:\"share_id,string\"") // 分享ID + 11: optional bool must_append // Whether to force an appended message in an existing conversation + 12: optional i64 share_id (api.js_conv='true' go.tag="json:\"share_id,string\"") // Share ID } struct GetMessageListResponse { 1: required list message_list - 2: required string cursor // 下一刷存在时的位置(向上翻页),与next_cursor翻页方向相反。兼容旧逻辑,不加prev前缀 - 3: required bool hasmore // 下一刷是否存在(向上翻页),与next_has_more翻页方向相反。兼容旧逻辑,不加prev前缀 + 2: required string cursor // The position when the next brush exists (page up), opposite to the next_cursor page turning direction. Compatible with old logic, no prev prefix + 3: required bool hasmore // Whether the next swipe exists (page up), the opposite direction to the next_has_more page turning. Compatible with old logic, without prev prefix 4: required string conversation_id - 5: optional string last_section_id // 会话最新的section_id 只有第一刷返回 + 5: optional string last_section_id // Session Latest section_id Only First Brush Back 6: i64 code 7: string msg 8: optional map participant_info_map - 9: string next_cursor // 下一刷存在时的位置(向下翻页), - 10: bool next_has_more // 下一刷是否存在(向下翻页) + 9: string next_cursor // The position when the next swipe exists (page down), + 10: bool next_has_more // Does the next swipe exist (page down) 11: i64 read_message_index (api.js_conv='true' go.tag="json:\"read_message_index,string\"") - 12: string connector_conversation_id //botconnector对应的id + 12: string connector_conversation_id //ID for botconnector } struct DeleteMessageRequest { @@ -170,10 +170,10 @@ struct DeleteMessageResponse { } struct BreakMessageRequest { - 1: required i64 conversation_id (api.js_conv='true') //会话id - 2: required i64 query_message_id (api.js_conv='true')// 当前问题id - 3: optional i64 answer_message_id (api.js_conv='true') // 当前问题下哪一条回复被打断了 - 4: optional i32 broken_pos // 打断位置 + 1: required i64 conversation_id (api.js_conv='true') //session id + 2: required i64 query_message_id (api.js_conv='true')// Current issue id + 3: optional i64 answer_message_id (api.js_conv='true') // Which reply was interrupted under the current question? + 4: optional i32 broken_pos // interrupt position 5: optional common.Scene scene } struct BreakMessageResponse { @@ -181,37 +181,37 @@ struct BreakMessageResponse { 2: string msg } -//批量查询 +//batch query struct ListMessageApiRequest { - 1: required i64 conversation_id (api.query = "conversation_id",api.js_conv='true') //会话id - 2: optional i64 limit (api.body = "limit") // 限制条数 - 3: optional string order (api.body = "order") // 排序方式 desc/asc - 4: optional i64 chat_id (api.body = "chat_id",api.js_conv='true') //一次对话的id - 5: optional i64 before_id (api.body = "before_id",api.js_conv='true') // 向前翻页需要传的ID - 6: optional i64 after_id (api.body = "after_id",api.js_conv='true') // 向后返回需要传的ID + 1: required i64 conversation_id (api.query = "conversation_id",api.js_conv='true') //session id + 2: optional i64 limit (api.body = "limit") // limit number of entries + 3: optional string order (api.body = "order") // Sort by desc/asc + 4: optional i64 chat_id (api.body = "chat_id",api.js_conv='true') //ID of a conversation + 5: optional i64 before_id (api.body = "before_id",api.js_conv='true') // The ID you need to pass to turn the page forward. + 6: optional i64 after_id (api.body = "after_id",api.js_conv='true') // Return the ID to be passed backwards. 255: base.Base Base } struct OpenMessageApi { - 1: i64 id (api.js_conv='true')// 主键ID + 1: i64 id (api.js_conv='true')// primary key ID 2: i64 bot_id (api.js_conv='true') // agent id 3: string role // user / assistant/tool - 4: string content //消息内容 - 5: i64 conversation_id //会话id - 6: map meta_data // 自定义字段 - 7: i64 created_at //创建时间 - 8: i64 updated_at //更新时间 - 9: i64 chat_id // 一次对话的id - 10: string content_type // content 类型 ,text/mix - 11: string type //消息类型 answer/question/function_call/tool_response - 12: string section_id // 会话的section_id - 13: optional string reasoning_content //模型思维链 + 4: string content //message content + 5: i64 conversation_id //session id + 6: map meta_data // custom field + 7: i64 created_at //creation time + 8: i64 updated_at //update time + 9: i64 chat_id // ID of a conversation + 10: string content_type // Content type, text/mix + 11: string type //Message Type answer/question/function_call/tool_response + 12: string section_id // The section_id of conversation + 13: optional string reasoning_content //Model Thinking Chain } struct ListMessageApiResponse { 1: optional list messages (api.body = "data") - 2: optional bool has_more (api.body = "has_more") // 是否还有数据,true 有,false 没有 - 3: optional i64 first_id (api.body = "first_id",api.js_conv='true') // 第一条数据的id - 4: optional i64 last_id (api.body = "last_id",api.js_conv='true') // 最后一条数据的id + 2: optional bool has_more (api.body = "has_more") // Is there still data, true yes, false no + 3: optional i64 first_id (api.body = "first_id",api.js_conv='true') // The ID of the first piece of data + 4: optional i64 last_id (api.body = "last_id",api.js_conv='true') // The id of the last piece of data. } diff --git a/idl/conversation/run.thrift b/idl/conversation/run.thrift index 207a3034..dfc1010d 100644 --- a/idl/conversation/run.thrift +++ b/idl/conversation/run.thrift @@ -83,24 +83,24 @@ struct AdditionalContent { struct AgentRunRequest { 1 : i64 bot_id (api.js_conv='true') , //agent id - 2 : required i64 conversation_id (api.js_conv='true') , // 会话id + 2 : required i64 conversation_id (api.js_conv='true') , // session id 5 : required string query , - 7 : map extra , // ext 透传字段 + 7 : map extra , // ext pass-through field 9 : map custom_variables , - 10: optional bool draft_mode , // 草稿bot or 线上bot - 11: optional common.Scene scene , // explore场景 - 12: optional string content_type , // 文件 file 图片 image 等 - 13: optional i64 regen_message_id (api.js_conv='true') , // 重试消息id - 14: optional string local_message_id , // 前端本地的message_id 在extra_info 里面透传返回 - 15: optional string preset_bot , // 使用的bot模版 代替bot_id bot_version draft_mode参数, coze home使用 preset_bot="coze_home" + 10: optional bool draft_mode , // Draft bot or online bot + 11: optional common.Scene scene , // Explore the scene + 12: optional string content_type , // Files files pictures images etc + 13: optional i64 regen_message_id (api.js_conv='true') , // Retry message id + 14: optional string local_message_id , // The local message_id on the front end is passed back in the extra_info + 15: optional string preset_bot , // The bot template used, instead of bot_id bot_version draft_mode parameters, coze home uses preset_bot = "coze_home" 16: optional list insert_history_message_list, 17: optional string device_id, 18: optional i64 space_id (api.js_conv='true'), 19: optional list mention_list, 20: optional list toolList 21: optional string commit_version - 22: optional string sub_scene // scene粒度下进一步区分场景,目前仅给bot模版使用 = bot_template - 23: optional DiffModeIdentifier diff_mode_identifier // diff模式下的聊天配置,仅草稿single bot + 22: optional string sub_scene // Scene granularity further distinguish scenes, currently only used for bot templates = bot_template + 23: optional DiffModeIdentifier diff_mode_identifier // Chat configuration in diff mode, draft only single bot 24: optional i64 shortcut_cmd_id (api.js_conv='true') } @@ -140,22 +140,22 @@ struct BotConfig{ } struct ShortcutCommandDetail { 1: required i64 command_id (api.js_conv='true') - 2: map parameters // key=参数名 value=值 object_string object 数组序列化之后的 JSON String + 2: map parameters // Key = parameter name value = value object_string JSON String after object array serialization } struct ChatV3Request { 1: required i64 BotID (api.body = "bot_id",api.js_conv='true'), //agent_id 2: optional i64 ConversationID (api.query = "conversation_id", api.js_conv='true'), //conversation_id - 3: required string User (api.body = "user_id"), //user_id,数据隔离标识,需要保证唯一 - 4: optional bool Stream (api.body = "stream"), //是否流式,当前仅支持流失 - 5: optional list AdditionalMessages (api.body = "additional_messages"), //本次对话消息,当前仅支持role=user - 6: optional map CustomVariables (api.body = "custom_variables"), //用户自定义变量 + 3: required string User (api.body = "user_id"), //user_id, data isolation identification, need to ensure unique + 4: optional bool Stream (api.body = "stream"), //Whether to stream, currently only supports churn. + 5: optional list AdditionalMessages (api.body = "additional_messages"), //In this conversation message, only role = user is currently supported. + 6: optional map CustomVariables (api.body = "custom_variables"), //user-defined variables 8: optional map MetaData (api.body = "meta_data") 10:optional CustomConfig CustomConfig (api.body = "custom_config") - 11:optional map ExtraParams (api.body = "extra_params") // 透传参数到 plugin/workflow 等下游 - 12:optional i64 ConnectorID (api.body="connector_id", api.js_conv='true') // 手动指定渠道 id 聊天。目前仅支持 websdk(=999) - 13:optional ShortcutCommandDetail ShortcutCommand (api.body="shortcut_command") // 指定快捷指令 + 11:optional map ExtraParams (api.body = "extra_params") // Pass parameters to plugin/workflow etc downstream + 12:optional i64 ConnectorID (api.body="connector_id", api.js_conv='true') // Manually specify channel id chat. Currently only supports websdk (= 999) + 13:optional ShortcutCommandDetail ShortcutCommand (api.body="shortcut_command") // Specify shortcut instructions } struct ChatV3MessageDetail { @@ -177,7 +177,7 @@ struct ChatV3MessageDetail { struct EnterMessage { 1: string Role (api.body = "role"), // user / assistant - 2: string Content (api.body = "content"), // 如果是非 text,需要解析 JSON + 2: string Content (api.body = "content"), // If it is not text, you need to parse JSON. 3: map MetaData (api.body = "meta_data"), 4: string ContentType (api.body = "content_type"), // text, card, object_string 5: optional string Type (api.body = "type") diff --git a/idl/data_engine/dataset/common.thrift b/idl/data_engine/dataset/common.thrift index d9dd950d..cd76f17c 100644 --- a/idl/data_engine/dataset/common.thrift +++ b/idl/data_engine/dataset/common.thrift @@ -1,23 +1,23 @@ namespace go flow.dataengine.dataset -// 类型 +// type enum FormatType { - Text = 0 // 文本 - Table = 1 // 表格 - Image = 2 // 图片 - Database = 3 // 数据库 + Text = 0 // Text + Table = 1 // table + Image = 2 // image + Database = 3 // database } struct ChunkStrategy { - 1: string separator // 分隔符,如句号 - 2: i64 max_tokens // 分片的最大token数 - 3: bool remove_extra_spaces // 替换掉连续的空格、换行符和制表符 - 4: bool remove_urls_emails // 是否去除url和email - 5: ChunkType chunk_type // 如果为0, 则不使用以上字段的配置 - 7: optional CaptionType caption_type // 图片类型,图片描述文字的标注方式 - 8: optional i64 overlap; //分段重叠度 - 9: optional i64 max_level; //最大层级数(按层级分段时生效) - 10: optional bool save_title; //切片保留层级标题(按层级分段时生效) + 1: string separator // A separator, such as a period + 2: i64 max_tokens // Maximum number of tokens for sharding + 3: bool remove_extra_spaces // Replace consecutive spaces, newlines, and tabs + 4: bool remove_urls_emails // Remove URL and email + 5: ChunkType chunk_type // If 0, the configuration of the above fields is not used + 7: optional CaptionType caption_type // Image type, image description text annotation method + 8: optional i64 overlap; //segmented overlap + 9: optional i64 max_level; //Maximum number of levels (effective when segmented by level) + 10: optional bool save_title; //Slice preserves level headers (effective when segmented by level) } enum ChunkType{ @@ -32,67 +32,67 @@ enum ContentSchema{ } enum CaptionType { - Auto = 0 // 智能标注 - Manual = 1 // 人工标注 + Auto = 0 // intelligent annotation + Manual = 1 // manual annotation } enum DocumentStatus { - Processing = 0 // 上传中 - Enable = 1 // 生效 - Disable = 2 // 失效 - Deleted = 3 // 删除 - Resegment = 4 // 重新分片中,调用方不感知该状态 - Refreshing = 5 // 刷新中(刷新成功后会删除) - Failed = 9 // 失败 + Processing = 0 // Uploading + Enable = 1 // take effect + Disable = 2 // failure + Deleted = 3 // delete + Resegment = 4 // In rescaling, the caller is not aware of the state + Refreshing = 5 // Refreshing (will be deleted after successful refresh) + Failed = 9 // fail } enum DocumentSource { - Document = 0 // 本地文件上传 - Custom = 2 // 自定义类型 + Document = 0 // local file upload + Custom = 2 // custom type } struct ParsingStrategy{ - 1: optional ParsingType parsing_type; //解析类型 - 2: optional bool image_extraction; //是否开启图片元素提取(精准解析时生效) - 3: optional bool table_extraction; //是否开启表格元素提取(精准解析时生效) - 4: optional bool image_ocr; //是否开启图片OCR(精准解析时生效) + 1: optional ParsingType parsing_type; //parse type + 2: optional bool image_extraction; //Whether to enable image element extraction (effective when accurately parsing) + 3: optional bool table_extraction; //Whether to enable table element extraction (effective when accurately parsing) + 4: optional bool image_ocr; //Whether to turn on picture OCR (effective when accurate analysis) } enum ParsingType{ - FastParsing = 0 //快速解析 - AccurateParsing = 1 //精准解析 + FastParsing = 0 //fast parse + AccurateParsing = 1 //accurate analysis } struct IndexStrategy{ - 1: optional bool vector_indexing; //是否开启向量索引(默认为true) - 2: optional bool keyword_indexing; //是否开启关键词索引(默认为true) - 3: optional bool hierarchical_indexing; //是否开启分层索引 - 4: optional string model; //向量模型 + 1: optional bool vector_indexing; //Whether to enable vector indexing (default is true) + 2: optional bool keyword_indexing; //Whether to enable keyword indexing (default is true) + 3: optional bool hierarchical_indexing; //Whether to enable hierarchical indexing + 4: optional string model; //vector model } struct FilterStrategy{ - 1: optional list filter_page; //过滤页数 + 1: optional list filter_page; //filter pages } -// 排序字段 +// sort field enum OrderField { CreateTime = 1 UpdateTime = 2 } -// 排序规则 +// OrderType enum OrderType { Desc = 1 Asc = 2 } struct SinkStrategy { - 1: bool check_index // 是否检查索引成功 + 1: bool check_index // Check whether the index was successful } enum ReviewStatus { - Processing = 0 // 处理中 - Enable = 1 // 已完成 - Failed = 2 // 失败 - ForceStop = 3 // 失败 + Processing = 0 // Processing + Enable = 1 // Completed. + Failed = 2 // fail + ForceStop = 3 // fail } \ No newline at end of file diff --git a/idl/data_engine/dataset/dataset.thrift b/idl/data_engine/dataset/dataset.thrift index dd9ee116..7c5e6357 100644 --- a/idl/data_engine/dataset/dataset.thrift +++ b/idl/data_engine/dataset/dataset.thrift @@ -5,13 +5,13 @@ include "common.thrift" namespace go flow.dataengine.dataset struct CreateDatasetRequest { - 1: string name // 知识库名称,长度不超过100个字符 - 2: string description // 知识库描述 - 3: i64 space_id (agw.js_conv="str", api.js_conv="true") // 空间ID - 4: string icon_uri // 知识库头像URI + 1: string name // Knowledge base name, no more than 100 characters in length + 2: string description // Knowledge Base Description + 3: i64 space_id (agw.js_conv="str", api.js_conv="true") // Space ID + 4: string icon_uri // Knowledge Base Avatar URI 5: common.FormatType format_type - 6: i64 biz_id (agw.js_conv="str", api.js_conv="true") // 开放给第三方的业务标识, coze 传 0 或者不传 - 7: i64 project_id (agw.js_conv="str", api.js_conv="true") //新增project ID + 6: i64 biz_id (agw.js_conv="str", api.js_conv="true") // Open to third-party business identity, coze pass 0 or no pass + 7: i64 project_id (agw.js_conv="str", api.js_conv="true") //project ID 255: optional base.Base Base } @@ -25,7 +25,7 @@ struct CreateDatasetResponse { } struct DatasetDetailRequest { 1: list DatasetIDs (agw.js_conv="str", api.body="dataset_ids") - 3: i64 project_id (agw.js_conv="str", api.js_conv="true") //新增project ID + 3: i64 project_id (agw.js_conv="str", api.js_conv="true") // project ID 2: i64 space_id (agw.js_conv="str", api.js_conv="true") 255: optional base.Base Base @@ -42,38 +42,38 @@ struct DatasetDetailResponse { enum DatasetStatus { DatasetProcessing = 0 DatasetReady = 1 - DatasetDeleted = 2 // 软删 - DatasetForbid = 3 // 不启用 + DatasetDeleted = 2 // soft delete + DatasetForbid = 3 // Do not enable DatasetFailed = 9 } struct Dataset { 1: i64 dataset_id(agw.js_conv="str", api.js_conv="true") - 2: string name // 数据集名称 - 3: list file_list // 文件列表 - 4: i64 all_file_size (agw.js_conv="str", api.js_conv="true") // 所有文件大小 - 5: i32 bot_used_count // 使用Bot数 + 2: string name // Dataset name + 3: list file_list // file list + 4: i64 all_file_size (agw.js_conv="str", api.js_conv="true") // All file sizes + 5: i32 bot_used_count // Bot count 6: DatasetStatus status - 7: list processing_file_list // 处理中的文件名称列表,兼容老逻辑 - 8: i32 update_time // 更新时间,秒级时间戳 + 7: list processing_file_list // List of file names in process, compatible with old logic + 8: i32 update_time // Update time, second timestamp 9: string icon_url 10: string description 11: string icon_uri - 12: bool can_edit // 是否可以编辑 - 13: i32 create_time // 创建时间,秒级时间戳 - 14: i64 creator_id (agw.js_conv="str", api.js_conv="true") // 创建者ID - 15: i64 space_id (agw.js_conv="str", api.js_conv="true") // 空间ID - 18: list failed_file_list (agw.js_conv="str") // 处理失败的文件 + 12: bool can_edit // Can it be edited? + 13: i32 create_time // create_time, second timestamp + 14: i64 creator_id (agw.js_conv="str", api.js_conv="true") // creator ID + 15: i64 space_id (agw.js_conv="str", api.js_conv="true") // Space ID + 18: list failed_file_list (agw.js_conv="str") // Processing failed files 19: common.FormatType format_type - 20: i32 slice_count // 分段数量 - 21: i32 hit_count // 命中次数 - 22: i32 doc_count // 文档数量 - 23: common.ChunkStrategy chunk_strategy // 切片规则 + 20: i32 slice_count // number of segments + 21: i32 hit_count // hit count + 22: i32 doc_count // number of documents + 23: common.ChunkStrategy chunk_strategy // slicing rule - 24: list processing_file_id_list // 处理中的文件ID列表 - 25: string project_id //新增project ID + 24: list processing_file_id_list // List of file IDs in process + 25: string project_id //project ID } struct ListDatasetRequest { @@ -82,12 +82,12 @@ struct ListDatasetRequest { 3: optional i32 page 4: optional i32 size 5: i64 space_id (agw.js_conv="str", api.js_conv="true") - 6: optional common.OrderField order_field // 排序字段 - 7: optional common.OrderType order_type // 排序规则 - 8: optional string space_auth // 如果传了指定值, 就放开校验 - 9: optional i64 biz_id (agw.js_conv="str", api.js_conv="true") // 开放给第三方的业务标识 - 10: optional bool need_ref_bots // 是否需要拉取引用bots的数量,会增加响应延时 - 11: optional string project_id //新增project ID + 6: optional common.OrderField order_field // sort field + 7: optional common.OrderType order_type // order_type + 8: optional string space_auth // If the specified value is passed, the verification is released + 9: optional i64 biz_id (agw.js_conv="str", api.js_conv="true") // Business identity open to third parties + 10: optional bool need_ref_bots // Whether the number of reference bots needs to be pulled will increase the response delay + 11: optional string project_id //project ID 255: optional base.Base Base } @@ -99,12 +99,12 @@ struct ListDatasetResponse { 255: required base.BaseResp BaseResp } struct DatasetFilter { - // 如果都设置了,And 关系 - 1: optional string name // 关键字搜索, 按照名称模糊匹配 - 2: optional list dataset_ids (agw.js_conv="str") // 知识库id列表 - 3: optional DatasetSource source_type // 来源 - 4: optional DatasetScopeType scope_type // 搜索类型 - 5: optional common.FormatType format_type // 类型 + // The following conditions are related to and + 1: optional string name // Keyword search, fuzzy match by name + 2: optional list dataset_ids (agw.js_conv="str") // Knowledge id list + 3: optional DatasetSource source_type // source + 4: optional DatasetScopeType scope_type // search type + 5: optional common.FormatType format_type // type } enum DatasetScopeType { @@ -131,10 +131,10 @@ struct DeleteDatasetResponse { } struct UpdateDatasetRequest { - 1: i64 dataset_id (agw.js_conv="str", api.js_conv="true") // 知识库id - 2: string name // 知识库名称,不能为空 - 3: string icon_uri // 知识库icon - 4: string description // 知识库描述 + 1: i64 dataset_id (agw.js_conv="str", api.js_conv="true") // Knowledge ID + 2: string name // Knowledge base name, cannot be empty + 3: string icon_uri // Knowledge base icon + 4: string description // Knowledge Base Description 5: optional DatasetStatus status 255: optional base.Base Base; diff --git a/idl/data_engine/dataset/document.thrift b/idl/data_engine/dataset/document.thrift index 509b560a..eb796109 100644 --- a/idl/data_engine/dataset/document.thrift +++ b/idl/data_engine/dataset/document.thrift @@ -8,7 +8,7 @@ struct ListDocumentRequest { 2: optional list document_ids (agw.js_conv='str') 3: optional i32 page 4: optional i32 size - 5: optional string keyword // 根据名称搜索 + 5: optional string keyword // Search by name 255: optional base.Base Base } @@ -25,59 +25,59 @@ struct ListDocumentResponse { struct DocumentInfo { 1: string name 2: i64 document_id(agw.js_conv='str', api.js_conv='true') - 3: optional string tos_uri // 文件链接 - 5: i32 create_time // 创建时间 - 6: i32 update_time // 更新时间 - 7: optional i64 creator_id (agw.js_conv="str", api.js_conv='true', api.body="creator_id") // 创建人 - 8: i32 slice_count // 包含分段数量 - 9: string type // 文件后缀 csv, pdf 等 - 10: i32 size // 文件大小 字节数 - 11: i32 char_count // 字符数 - 12: common.DocumentStatus status // 状态 - 13: i32 hit_count // 命中次数 - 14: common.DocumentSource source_type // 来源 - 18: common.FormatType format_type // 文件类型 - 19: optional list table_meta // 表格类型元数据 - 20: optional string web_url // url 地址 - 21: optional string status_descript // 状态的详细信息;如果切片失败,返回失败信息 - 24: optional i64 space_id(agw.js_conv="str", api.js_conv="true") // 空间id + 3: optional string tos_uri // file link + 5: i32 create_time // create_time + 6: i32 update_time // update time + 7: optional i64 creator_id (agw.js_conv="str", api.js_conv='true', api.body="creator_id") // creator_id + 8: i32 slice_count // number of segments included + 9: string type // File suffix csv, pdf, etc + 10: i32 size // File size, number of bytes + 11: i32 char_count // character count + 12: common.DocumentStatus status // status + 13: i32 hit_count // hit count + 14: common.DocumentSource source_type // source + 18: common.FormatType format_type // file type + 19: optional list table_meta // Table type metadata + 20: optional string web_url // URL address + 21: optional string status_descript // Details of the status; if the slice fails, return the failure information + 24: optional i64 space_id(agw.js_conv="str", api.js_conv="true") // Space ID - // 以下字段仅针对重构后的表格类型有用,用于前端判断 - 26: optional bool editable_append_content // 仅针对表格类型,是否允许添加内容、修改表结构 - 27: common.ChunkStrategy chunk_strategy // 切片规则 + // The following fields are only useful for the reconstructed table type and are used for front-end judgment + 26: optional bool editable_append_content // Only for table types, are you allowed to add content and modify the table structure? + 27: common.ChunkStrategy chunk_strategy // slicing rule - 28: optional string imagex_uri // imagex 存储的文件链接 - 29: optional string doc_outline // 层级分段文档树Json (未使用) - 30: optional common.ParsingStrategy parsing_strategy // 解析策略 - 32: optional common.FilterStrategy filter_strategy // 过滤策略 - 33: optional string doc_tree_tos_url // 层级分段文档树 tos_url - 34: optional string preview_tos_url // 预览用的原文档 tos_url - 35: optional i64 review_id // 预览用的原文档 tos_url + 28: optional string imagex_uri // File links stored by ImageX + 29: optional string doc_outline // Hierarchical Segmentation Document Tree Json (unused) + 30: optional common.ParsingStrategy parsing_strategy // parsing strategy + 32: optional common.FilterStrategy filter_strategy // filtering strategy + 33: optional string doc_tree_tos_url // Hierarchical segmented document tree tos_url + 34: optional string preview_tos_url // Preview the original document tos_url + 35: optional i64 review_id // Preview the original document tos_url } struct TableColumn { - 1: i64 id(agw.js_conv="str", api.js_conv="true", api.body="id") // 列 id - 2: string column_name // 列名 - 3: bool is_semantic // 是否为语义匹配列 - 4: i64 sequence(agw.js_conv="str", api.js_conv="true", api.body="sequence")// 列原本在 excel 的序号 - 5: optional ColumnType column_type // 列类型 + 1: i64 id(agw.js_conv="str", api.js_conv="true", api.body="id") // Column ID + 2: string column_name // column_name + 3: bool is_semantic // Is it a semantically matched column? + 4: i64 sequence(agw.js_conv="str", api.js_conv="true", api.body="sequence")// List the serial number originally in excel + 5: optional ColumnType column_type // column type 6: optional bool contains_empty_value - 7: optional string desc // 描述 + 7: optional string desc // describe } enum ColumnType { Unknown = 0 - Text = 1 // 文本 - Number = 2 // 数字 - Date = 3 // 时间 + Text = 1 // Text + Number = 2 // number + Date = 3 // time Float = 4 // float Boolean = 5 // bool - Image = 6 // 图片 + Image = 6 // picture } struct DeleteDocumentRequest { - 2: list document_ids // 要删除的文档ID列表 + 2: list document_ids // List of document IDs to delete 255: optional base.Base Base } @@ -91,12 +91,12 @@ struct DeleteDocumentResponse { struct UpdateDocumentRequest{ 1: i64 document_id (agw.js_conv="str", api.js_conv="true") - // 需要更新就传, 更新名称 + // If you need to update, please upload it and update the name. 3: optional string document_name - // 更新表结构 - 5: optional list table_meta // 表格元数据 + // Update table structure + 5: optional list table_meta // Table metadata 255: optional base.Base Base } @@ -109,8 +109,8 @@ struct UpdateDocumentResponse { struct UpdatePhotoCaptionRequest { - 1: required i64 document_id(agw.js_conv='str', api.js_conv='true') // 文档ID - 2: required string caption // 要更新的图片描述信息 + 1: required i64 document_id(agw.js_conv='str', api.js_conv='true') // Document ID + 2: required string caption // Picture description information to be updated 255: optional base.Base Base } @@ -122,18 +122,18 @@ struct UpdatePhotoCaptionResponse { } struct ListPhotoRequest { - 1: required i64 dataset_id(agw.js_conv='str', api.js_conv='true') // 知识库ID - 2: optional i32 page // 页数,从 1 开始 - 3: optional i32 size // 每页大小 + 1: required i64 dataset_id(agw.js_conv='str', api.js_conv='true') // Knowledge ID + 2: optional i32 page // Number of pages, starting from 1 + 3: optional i32 size // page size 4: optional PhotoFilter filter 255: optional base.Base Base } struct PhotoFilter { - 1: optional bool has_caption // true 筛选 “已标注” 的图片,false 筛选 “未标注” 的图片 - 2: optional string keyword // 搜索关键字,对图片名称和图片描述进行搜索 - 3: optional common.DocumentStatus status // 状态 + 1: optional bool has_caption // True to filter "marked" images, false to filter "unmarked" images + 2: optional string keyword // Search keywords, search for image names and picture descriptions + 3: optional common.DocumentStatus status // status } struct ListPhotoResponse { @@ -145,44 +145,44 @@ struct ListPhotoResponse { 255: required base.BaseResp BaseResp(api.none="true") } -struct PhotoInfo { // 图片型知识库一个图片对应一个文档 - 1: string name // 图片名称 - 2: i64 document_id(agw.js_conv='str', api.js_conv='true') // 文档ID - 3: string url // 图片链接 - 4: string caption // 图片描述信息 - 5: i32 create_time // 创建时间 - 6: i32 update_time // 更新时间 - 7: i64 creator_id (agw.js_conv="str", api.js_conv='true', agw.key="creator_id", api.body="creator_id") // 创建人 - 8: string type // 图片后缀 jpg, png 等 - 9: i32 size // 图片大小 - 10: common.DocumentStatus status // 状态 - 11: common.DocumentSource source_type // 来源 +struct PhotoInfo { // Picture Knowledge Base One picture corresponds to one document + 1: string name // image name + 2: i64 document_id(agw.js_conv='str', api.js_conv='true') // Document ID + 3: string url // image link + 4: string caption // picture description information + 5: i32 create_time // create_time + 6: i32 update_time // update time + 7: i64 creator_id (agw.js_conv="str", api.js_conv='true', agw.key="creator_id", api.body="creator_id") // creator_id + 8: string type // Image suffix jpg, png, etc + 9: i32 size // image size + 10: common.DocumentStatus status // status + 11: common.DocumentSource source_type // source } struct PhotoDetailRequest { - 1: required list document_ids (agw.js_conv='str') // 文档ID列表 - 2: required i64 dataset_id(agw.js_conv='str', api.js_conv='true') // 知识库ID + 1: required list document_ids (agw.js_conv='str') // Document ID List + 2: required i64 dataset_id(agw.js_conv='str', api.js_conv='true') // Knowledge ID 255: optional base.Base Base } struct PhotoDetailResponse { - 1: map photo_infos // 文档ID到图片信息的映射 + 1: map photo_infos // Mapping document ID to image information 253: required i64 code 254: required string msg 255: required base.BaseResp BaseResp(api.none="true") } struct ResegmentRequest { - 1: i64 dataset_id (agw.js_conv="str", api.js_conv="true") // 知识库ID - 2: list document_ids // 要重新分段的文档 - 3: common.ChunkStrategy chunk_strategy // 分段策略 - 5: optional common.ParsingStrategy parsing_strategy // 解析策略 - 7: optional common.FilterStrategy filter_strategy; // 过滤策略 + 1: i64 dataset_id (agw.js_conv="str", api.js_conv="true") // Knowledge ID + 2: list document_ids // Document to be re-segmented + 3: common.ChunkStrategy chunk_strategy // segmentation strategy + 5: optional common.ParsingStrategy parsing_strategy // parsing strategy + 7: optional common.FilterStrategy filter_strategy; // filtering strategy 255: optional base.Base Base } struct ResegmentResponse { - 1: list document_infos // 老版需要. 仅返回id 和名称即可 + 1: list document_infos // The old version requires. Just return the id and name. 253: required i64 code 254: required string msg @@ -190,16 +190,16 @@ struct ResegmentResponse { } struct CreateDocumentRequest { - 1: i64 dataset_id(agw.js_conv='str', api.js_conv='true') // 要插入文档的知识库id + 1: i64 dataset_id(agw.js_conv='str', api.js_conv='true') // The knowledge base id of the document to insert. - 4: common.FormatType format_type // 知识库的类型,目前支持文本、表格、图片三种知识库 + 4: common.FormatType format_type // Types of knowledge bases, currently supporting text, tables, and images - // 表格类型一次只能创建一个 - 6: list document_bases // 待创建的文档信息 + // Only one table type can be created at a time + 6: list document_bases // Document information to be created - 17: optional common.ChunkStrategy chunk_strategy // 只在知识库中没有文档时需要传递,已有则从知识库获取.切片规则,为空则自动按段落切片 - 31: optional bool is_append // 为 true 时向已有的 document 追加内容。text 类型不能使用 - 32: optional common.ParsingStrategy parsing_strategy // 解析策略 + 17: optional common.ChunkStrategy chunk_strategy // 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 + 31: optional bool is_append // Appends content to an existing document when true. The text type cannot be used + 32: optional common.ParsingStrategy parsing_strategy // parsing strategy 255: optional base.Base Base } @@ -212,37 +212,37 @@ struct CreateDocumentResponse { 255: required base.BaseResp BaseResp } -// 用于创建文档的基本信息 +// Basic information for creating a document struct DocumentBase{ - 1: string name // 文档名称 + 1: string name // Document name 2: SourceInfo source_info - // 以下参数表格类型需要传递 - 4: optional list table_meta // 表格元数据 - 5: optional TableSheet table_sheet // 表格解析信息 - 6: optional common.FilterStrategy filter_strategy // 过滤策略 - 7: optional string caption // 图片类型知识库,人工标注时的图片描述 + // The following parameter table types need to be passed + 4: optional list table_meta // Table metadata + 5: optional TableSheet table_sheet // Table parsing information + 6: optional common.FilterStrategy filter_strategy // filtering strategy + 7: optional string caption // Image type knowledge base, picture description when manually annotated } -// 支持多种数据源 +// Supports multiple data sources struct SourceInfo { - 1: optional string tos_uri (api.body="tos_uri"); // 本地上传返回的 uri + 1: optional string tos_uri (api.body="tos_uri"); // Upload the returned URI locally. 4: optional common.DocumentSource document_source (api.body="document_source"); - // document_source 自定义原始内容: 表格型知识库需要符合的格式:json list> + // document_source custom raw content: Format required for a tabular knowledge base: json list < map < string, string > > 5: optional string custom_content (api.body="custom_content") - // document_source 本地: 如果不传 tos 地址, 则需要传文件 base64, 类型 - 7: optional string file_base64 // 文件经过 base64 后的字符串 - 8: optional string file_type // 文件类型, 比如 pdf + // document_source local: If you don't send the tos address, you need to send the file base64, type + 7: optional string file_base64 // File string after base64 + 8: optional string file_type // File type, such as PDF - // 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 10: optional string imagex_uri } struct TableSheet { - 1: i64 sheet_id (agw.js_conv="str", agw.key="sheet_id", api.js_conv="true", api.body="sheet_id") , // 用户选择的 sheet id - 2: i64 header_line_idx (agw.js_conv="str", agw.key="header_line_idx", api.js_conv="true", api.body="header_line_idx"), // 用户选择的表头行数,从 0 开始编号 - 3: i64 start_line_idx (agw.js_conv="str", agw.key="start_line_idx", api.js_conv="true", api.body="start_line_idx") , // 用户选择的起始行号,从 0 开始编号 + 1: i64 sheet_id (agw.js_conv="str", agw.key="sheet_id", api.js_conv="true", api.body="sheet_id") , // User selected sheet id + 2: i64 header_line_idx (agw.js_conv="str", agw.key="header_line_idx", api.js_conv="true", api.body="header_line_idx"), // The number of header rows selected by the user, numbered from 0 + 3: i64 start_line_idx (agw.js_conv="str", agw.key="start_line_idx", api.js_conv="true", api.body="start_line_idx") , // User-selected starting line number, numbered from 0 } @@ -261,63 +261,63 @@ struct GetDocumentProgressResponse { struct DocumentProgress { 1: i64 document_id(agw.js_conv="str", api.js_conv='true') - 2: i32 progress // 知识库进度百分比 + 2: i32 progress // Knowledge Base Progress Percentage 3: common.DocumentStatus status - 4: optional string status_descript // 状态的详细描述;如果切片失败,返回失败信息 + 4: optional string status_descript // A detailed description of the status; if the slice fails, a failure message is returned 5: string document_name - 6: optional i64 remaining_time // 剩余时间单位秒 + 6: optional i64 remaining_time // Remaining time in seconds 7: optional i64 size 8: optional string type 9: optional string url } -// 获取 database 上传的表格文件元信息 +// Get the table file meta information uploaded by the database struct GetTableSchemaRequest { - 1: optional TableSheet table_sheet; // 表格解析信息, 默认初始值0,0,1,表示第1个表格,表头行为第1行,数据行从第2行开始 - 2: optional TableDataType table_data_type; // 不传默认返回所有数据 - 3: optional i64 document_id(agw.js_conv="str", agw.key="document_id", api.js_conv="true", api.body="document_id"); // 兼容重构前的版本:如果需要拉取的是当前 document 的 schema 时传递该值 - 4: optional SourceInfo source_file; // source file 的信息,新增 segment / 之前逻辑迁移到这里 - 5: optional list origin_table_meta; // 表格预览前端需要传递原始的数据表结构 - 6: optional list preview_table_meta; // 表格预览前端需要传递用户编辑之后的数据表结构 + 1: optional TableSheet table_sheet; // 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 + 2: optional TableDataType table_data_type; // All data is returned by default without passing it on. + 3: optional i64 document_id(agw.js_conv="str", agw.key="document_id", api.js_conv="true", api.body="document_id"); // Compatible with pre-refactoring versions: pass this value if you need to pull the schema of the current document + 4: optional SourceInfo source_file; // Source file information, add segment/before logic migrate here + 5: optional list origin_table_meta; // The table preview front end needs to pass the original data table structure + 6: optional list preview_table_meta; // The table preview front end needs to pass the data table structure edited by the user 255: optional base.Base Base } enum TableDataType { - AllData = 0 // schema sheets 和 preview data - OnlySchema = 1 // 只需要 schema 结构 & Sheets - OnlyPreview = 2 // 只需要 preview data + AllData = 0 // Schema sheets and preview data + OnlySchema = 1 // Only need schema structure & Sheets + OnlyPreview = 2 // Just preview the data } struct DocTableSheet { - 1: i64 id; // sheet 的编号 - 2: string sheet_name; // sheet 名 - 3: i64 total_row; // 总行数 + 1: i64 id; // Number of sheet + 2: string sheet_name; // Sheet name + 3: i64 total_row; // total number of rows } struct GetTableSchemaResponse { 1: required i32 code 2: required string msg 3: list sheet_list - 4: list table_meta // 选中的 sheet 的 schema, 不选择默认返回第一个 sheet - 5: list> preview_data(api.body="preview_data") // knowledge table 场景中会返回 + 4: list table_meta // The schema of the selected sheet, not selected to return the first sheet by default + 5: list> preview_data(api.body="preview_data") // The knowledge table will return 255: optional base.BaseResp BaseResp(api.none="true") } -// 判断用户配置的 schema 是否和对应 document id 的一致 +// Determine whether the schema configured by the user is consistent with the corresponding document id struct ValidateTableSchemaRequest { - 1: i64 space_id (agw.js_conv="str", agw.key="space_id", api.js_conv="true", api.body="space_id") // 空间ID - 2: i64 document_id (agw.js_conv="str", agw.key="document_id", api.js_conv="true", api.body="document_id") // 要校验的文档ID - 3: SourceInfo source_info (api.body="source_file") // source file 的信息 - 4: TableSheet table_sheet (api.body="table_sheet") // 表格解析信息, 默认初始值0,0,1,表示第1个表格,表头行为第1行,数据行从第2行开始 + 1: i64 space_id (agw.js_conv="str", agw.key="space_id", api.js_conv="true", api.body="space_id") // Space ID + 2: i64 document_id (agw.js_conv="str", agw.key="document_id", api.js_conv="true", api.body="document_id") // Document ID to verify + 3: SourceInfo source_info (api.body="source_file") // Information from the source file + 4: TableSheet table_sheet (api.body="table_sheet") // 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 255: optional base.Base Base } struct ValidateTableSchemaResponse { 1: optional map ColumnValidResult (api.body="column_valid_result"); - // 如果失败会返回错误码 + // If it fails, an error code will be returned. 253: required i64 code 254: required string msg 255: optional base.BaseResp BaseResp(api.none="true") @@ -330,7 +330,7 @@ struct ExtractPhotoCaptionRequest { } struct ExtractPhotoCaptionResponse { - 1: string caption // 图片描述 + 1: string caption // picture description 253: required i64 code 254: required string msg 255: required base.BaseResp BaseResp(api.none="true") diff --git a/idl/data_engine/dataset/flow_dataengine_dataset.thrift b/idl/data_engine/dataset/flow_dataengine_dataset.thrift index 0b64c38e..0dead4f9 100644 --- a/idl/data_engine/dataset/flow_dataengine_dataset.thrift +++ b/idl/data_engine/dataset/flow_dataengine_dataset.thrift @@ -7,14 +7,14 @@ include "review.thrift" namespace go flow.dataengine.dataset service DatasetService { - // 知识库相关 + // Knowledge base related dataset.GetIconResponse GetIconForDataset(1:dataset.GetIconRequest req) (api.post='/api/knowledge/icon/get', api.category="knowledge",agw.preserve_base="true") dataset.CreateDatasetResponse CreateDataset(1:dataset.CreateDatasetRequest req) (api.post='/api/knowledge/create', api.category="knowledge",agw.preserve_base="true") dataset.DatasetDetailResponse DatasetDetail(1:dataset.DatasetDetailRequest req) (api.post='/api/knowledge/detail', api.category="knowledge",agw.preserve_base="true") dataset.ListDatasetResponse ListDataset(1:dataset.ListDatasetRequest req) (api.post='/api/knowledge/list', api.category="knowledge",agw.preserve_base="true") dataset.DeleteDatasetResponse DeleteDataset(1:dataset.DeleteDatasetRequest req) (api.post='/api/knowledge/delete', api.category="knowledge",agw.preserve_base="true") dataset.UpdateDatasetResponse UpdateDataset(1:dataset.UpdateDatasetRequest req) (api.post='/api/knowledge/update', api.category="knowledge",agw.preserve_base="true") - // Document相关 + // Document related document.CreateDocumentResponse CreateDocument(1:document.CreateDocumentRequest req) (api.post='/api/knowledge/document/create', api.category="knowledge",agw.preserve_base="true") document.ListDocumentResponse ListDocument(1:document.ListDocumentRequest req) (api.post='/api/knowledge/document/list', api.category="knowledge",agw.preserve_base="true") document.DeleteDocumentResponse DeleteDocument(1:document.DeleteDocumentRequest req) (api.post='/api/knowledge/document/delete', api.category="knowledge",agw.preserve_base="true") @@ -28,12 +28,12 @@ service DatasetService { document.GetTableSchemaResponse GetTableSchema(1:document.GetTableSchemaRequest req) (api.post='/api/knowledge/table_schema/get', api.category="knowledge",agw.preserve_base="true") document.ValidateTableSchemaResponse ValidateTableSchema(1:document.ValidateTableSchemaRequest req) (api.post='/api/knowledge/table_schema/validate', api.category="knowledge",agw.preserve_base="true") - // slice相关 + // Slice related slice.DeleteSliceResponse DeleteSlice(1:slice.DeleteSliceRequest req) (api.post='/api/knowledge/slice/delete', api.category="knowledge",agw.preserve_base="true") slice.CreateSliceResponse CreateSlice(1:slice.CreateSliceRequest req) (api.post='/api/knowledge/slice/create', api.category="knowledge",agw.preserve_base="true") slice.UpdateSliceResponse UpdateSlice(1:slice.UpdateSliceRequest req) (api.post='/api/knowledge/slice/update', api.category="knowledge",agw.preserve_base="true") slice.ListSliceResponse ListSlice(1:slice.ListSliceRequest req) (api.post='/api/knowledge/slice/list', api.category="knowledge",agw.preserve_base="true") - /** 预分片相关 **/ + /** Pre-sharding related **/ review.CreateDocumentReviewResponse CreateDocumentReview(1:review.CreateDocumentReviewRequest req) (api.post='/api/knowledge/review/create', api.category="knowledge",agw.preserve_base="true") review.MGetDocumentReviewResponse MGetDocumentReview(1:review.MGetDocumentReviewRequest req) (api.post='/api/knowledge/review/mget', api.category="knowledge",agw.preserve_base="true") review.SaveDocumentReviewResponse SaveDocumentReview(1:review.SaveDocumentReviewRequest req) (api.post='/api/knowledge/review/save', api.category="knowledge",agw.preserve_base="true") diff --git a/idl/data_engine/dataset/review.thrift b/idl/data_engine/dataset/review.thrift index c04ce639..e82dc6bc 100644 --- a/idl/data_engine/dataset/review.thrift +++ b/idl/data_engine/dataset/review.thrift @@ -15,7 +15,7 @@ struct Review { 2: string document_name 3: string document_type 4: string tos_url - 5: optional common.ReviewStatus status // 状态 + 5: optional common.ReviewStatus status // status 6: optional string doc_tree_tos_url 7: optional string preview_tos_url } diff --git a/idl/data_engine/dataset/slice.thrift b/idl/data_engine/dataset/slice.thrift index c4a42f2d..10e19cad 100644 --- a/idl/data_engine/dataset/slice.thrift +++ b/idl/data_engine/dataset/slice.thrift @@ -4,7 +4,7 @@ include "common.thrift" namespace go flow.dataengine.dataset struct DeleteSliceRequest { - 4: optional list slice_ids (api.body="slice_ids") // 要删除的分片ID列表 + 4: optional list slice_ids (api.body="slice_ids") // List of sharding IDs to delete 255: optional base.Base Base } @@ -15,14 +15,14 @@ struct DeleteSliceResponse { } struct CreateSliceRequest { - 2: required i64 document_id(agw.js_conv="str", api.js_conv="true") // 新增分片插入的文档ID - 5: optional string raw_text // 新增分片的内容 - 6: optional i64 sequence(agw.js_conv="str", api.js_conv="true") // 分片插入位置,1表示文档开头,最大值为最后一个分片位置+1 + 2: required i64 document_id(agw.js_conv="str", api.js_conv="true") // Add sharding inserted document ID + 5: optional string raw_text // Add sharding content + 6: optional i64 sequence(agw.js_conv="str", api.js_conv="true") // Sharding insertion position, 1 indicates the beginning of the document, and the maximum value is the last sharding position + 1 255: optional base.Base Base } struct CreateSliceResponse { - 1: i64 slice_id (agw.js_conv="str", api.js_conv="true") // 新增分片ID + 1: i64 slice_id (agw.js_conv="str", api.js_conv="true") // Add sharding ID 253: required i64 code 254: required string msg @@ -30,15 +30,15 @@ struct CreateSliceResponse { } struct UpdateSliceRequest { - 2: required i64 slice_id (agw.js_conv="str", api.js_conv="true") // 要更新的分片ID - 7: optional string raw_text // 要更新的内容 + 2: required i64 slice_id (agw.js_conv="str", api.js_conv="true") // The sharding ID to update + 7: optional string raw_text // Content to be updated 255: optional base.Base Base } enum SliceStatus { - PendingVectoring = 0 // 未向量化 - FinishVectoring = 1 // 已向量化 - Deactive = 9 // 禁用 + PendingVectoring = 0 // unvectorized + FinishVectoring = 1 // vectorized + Deactive = 9 // disable } struct UpdateSliceResponse { @@ -48,18 +48,18 @@ struct UpdateSliceResponse { } struct ListSliceRequest { - 2: optional i64 document_id(agw.js_conv="str", api.js_conv="true") // 要list的分片所属的文档ID - 3: optional i64 sequence(agw.js_conv="str", api.js_conv="true") // 分片序号,表示从该序号的分片开始list - 4: optional string keyword // 查询关键字 - 5: optional i64 dataset_id (agw.js_conv="str", api.js_conv="true") // 如果只传 dataset_id,则返回该知识库下的分片 - 21: i64 page_size(agw.js_conv="str", api.js_conv="true") // 每页大小 + 2: optional i64 document_id(agw.js_conv="str", api.js_conv="true") // The document ID of the sharding to list + 3: optional i64 sequence(agw.js_conv="str", api.js_conv="true") // Sharding serial number, indicating that the list starts from the sharding of this serial number + 4: optional string keyword // query keyword + 5: optional i64 dataset_id (agw.js_conv="str", api.js_conv="true") // If only dataset_id, return sharding under that knowledge base + 21: i64 page_size(agw.js_conv="str", api.js_conv="true") // page size 255: optional base.Base Base } struct ListSliceResponse { - 1: list slices // 返回的分片列表 - 2: i64 total(agw.js_conv="str", api.js_conv="true") // 总分片数 - 3: bool hasmore // 是否还有更多分片 + 1: list slices // Returned list of shardings + 2: i64 total(agw.js_conv="str", api.js_conv="true") // Total shardings + 3: bool hasmore // Is there more sharding? 253: required i64 code 254: required string msg @@ -67,12 +67,12 @@ struct ListSliceResponse { } struct SliceInfo { - 1: i64 slice_id (agw.js_conv="str", api.js_conv="true") // 分片ID - 2: string content // 分片内容 - 3: SliceStatus status // 分片状态 - 4: i64 hit_count(agw.js_conv="str", api.js_conv="true") // 命中次数 - 5: i64 char_count(agw.js_conv="str", api.js_conv="true") // 字符数 - 7: i64 sequence(agw.js_conv="str", api.js_conv="true") // 序号 - 8: i64 document_id(agw.js_conv="str", api.js_conv="true") // 分片所属的文档ID - 9: string chunk_info // 分片相关的元信息, 透传 slice 表里的 extra->chunk_info 字段 (json) + 1: i64 slice_id (agw.js_conv="str", api.js_conv="true") // Sharding ID + 2: string content // Sharding content + 3: SliceStatus status // Sharding state + 4: i64 hit_count(agw.js_conv="str", api.js_conv="true") // hit count + 5: i64 char_count(agw.js_conv="str", api.js_conv="true") // character count + 7: i64 sequence(agw.js_conv="str", api.js_conv="true") // serial number + 8: i64 document_id(agw.js_conv="str", api.js_conv="true") // The document ID to which sharding belongs + 9: string chunk_info // Meta information related to sharding, extra- > chunk_info field in the transparent slice table (json) } \ No newline at end of file diff --git a/idl/data_engine/ocean_cloud_memory/knowledge/common.thrift b/idl/data_engine/ocean_cloud_memory/knowledge/common.thrift index 772d1d9a..af71f208 100644 --- a/idl/data_engine/ocean_cloud_memory/knowledge/common.thrift +++ b/idl/data_engine/ocean_cloud_memory/knowledge/common.thrift @@ -1,26 +1,26 @@ struct DocTableSheet { - 1: i64 id; // sheet 的编号 - 2: string sheet_name; // sheet 名 - 3: i64 total_row; // 总行数 + 1: i64 id; // Number of sheet + 2: string sheet_name; // Sheet name + 3: i64 total_row; // total number of rows } enum ColumnType { Unknown = 0 - Text = 1 // 文本 - Number = 2 // 数字 - Date = 3 // 时间 + Text = 1 // Text + Number = 2 // number + Date = 3 // time Float = 4 // float Boolean = 5 // bool - Image = 6 // 图片 + Image = 6 // picture } -// 表格的列信息 +// Table column information struct DocTableColumn { - 1: i64 id(agw.js_conv="str", api.js_conv="true", api.body="id"); // 列 id - 2: string column_name; // 列名 - 3: bool is_semantic; // 是否为语义匹配列 - 4: i64 sequence(agw.js_conv="str", api.js_conv="true", api.body="sequence"); // 列原本在 excel 的序号 - 5: optional ColumnType column_type; // 列类型 + 1: i64 id(agw.js_conv="str", api.js_conv="true", api.body="id"); // Column ID + 2: string column_name; // column_name + 3: bool is_semantic; // Is it a semantically matched column? + 4: i64 sequence(agw.js_conv="str", api.js_conv="true", api.body="sequence"); // List the serial number originally in excel + 5: optional ColumnType column_type; // column type 6: optional bool contains_empty_value - 7: optional string desc; // 描述 + 7: optional string desc; // describe } \ No newline at end of file diff --git a/idl/data_engine/ocean_cloud_memory/knowledge/kdocument.thrift b/idl/data_engine/ocean_cloud_memory/knowledge/kdocument.thrift index 0b1bc049..0f8ae5aa 100644 --- a/idl/data_engine/ocean_cloud_memory/knowledge/kdocument.thrift +++ b/idl/data_engine/ocean_cloud_memory/knowledge/kdocument.thrift @@ -3,11 +3,11 @@ include "common.thrift" namespace go knowledge.document -// 获取表格结构、预览数据 +// Get table structure, preview data struct GetDocumentTableInfoRequest { - 2: optional string tos_uri; // 如果为第一次本地文件上传的表格,传递该值 - 3: optional i64 document_id(agw.js_conv="str", api.js_conv="true", api.body="document_id"); // 如果为已有 document 的表格,传递该值 - 4: i64 creator_id; // 创建人[http接口不需要传递] + 2: optional string tos_uri; // If the table is uploaded for the first local file, pass the value + 3: optional i64 document_id(agw.js_conv="str", api.js_conv="true", api.body="document_id"); // If it is a document with an existing table, pass the value + 4: i64 creator_id; // Creator [http interface does not need to be passed] 255: optional base.Base Base } @@ -25,8 +25,8 @@ struct GetTableSchemaInfoResponse { 1: i32 code 2: string msg 3: list sheet_list - 4: list table_meta // 选中的 sheet 的 schema, 不选择默认返回第一个 sheet - 5: list> preview_data(agw.js_conv="str", agw.key="preview_data") // knowledge table 场景中会返回 + 4: list table_meta // The schema of the selected sheet, not selected to return the first sheet by default + 5: list> preview_data(agw.js_conv="str", agw.key="preview_data") // The knowledge table will return 255: optional base.BaseResp BaseResp(api.none="true") } diff --git a/idl/data_engine/ocean_cloud_memory/kvmemory/kvmemory.thrift b/idl/data_engine/ocean_cloud_memory/kvmemory/kvmemory.thrift index 0a300e8f..90a60e2c 100644 --- a/idl/data_engine/ocean_cloud_memory/kvmemory/kvmemory.thrift +++ b/idl/data_engine/ocean_cloud_memory/kvmemory/kvmemory.thrift @@ -40,7 +40,7 @@ struct SetKvMemoryReq { 2: optional i64 user_id 3: required list data 4: optional i64 connector_id - 5: optional table.RefInfo ref_info // 引用信息 + 5: optional table.RefInfo ref_info // citation information 6: optional string project_id 7: optional i64 ProjectVersion @@ -79,7 +79,7 @@ struct DelProfileMemoryRequest { 2: i64 bot_id(agw.js_conv="str", api.js_conv="true", api.body="bot_id") 3: list keywords 4: optional i64 connector_id - 5: optional table.RefInfo ref_info // 引用信息 + 5: optional table.RefInfo ref_info // citation information 6: string project_id 255: optional base.Base Base @@ -91,7 +91,7 @@ struct GetProfileMemoryRequest { 3: list keywords 4: optional i64 connector_id 5: optional string version - 6: optional table.RefInfo ref_info // 引用信息 + 6: optional table.RefInfo ref_info // citation information 7: optional string ext 8: optional string project_id 9: optional i64 ProjectVersion diff --git a/idl/data_engine/ocean_cloud_memory/kvmemory/project_memory.thrift b/idl/data_engine/ocean_cloud_memory/kvmemory/project_memory.thrift index 6c081410..b31f0e32 100644 --- a/idl/data_engine/ocean_cloud_memory/kvmemory/project_memory.thrift +++ b/idl/data_engine/ocean_cloud_memory/kvmemory/project_memory.thrift @@ -10,7 +10,7 @@ enum VariableChannel{ System = 2 Location = 3 Feishu = 4 - APP = 5 // 项目变量 + APP = 5 // project variable } struct Variable{ @@ -20,8 +20,8 @@ struct Variable{ 4: VariableChannel Channel 5: string Description 6: bool Enable - 7: optional list EffectiveChannelList //生效渠道 - 8: string Schema //新老数据都会有schema,除项目变量外其他默认为string + 7: optional list EffectiveChannelList //effective channel + 8: string Schema //New and old data will have schemas, except for project variables, the default is string. 9: bool IsReadOnly } @@ -81,7 +81,7 @@ struct GetMemoryVariableMetaReq { 255: optional base.Base Base } -//应该是给workflow用的rpc接口,不需要鉴权,VariableChannel +//It should be the rpc interface for workflow, no authentication is required, VariableChannel struct GetMemoryVariableMetaResp { 1: map> VariableMap diff --git a/idl/data_engine/ocean_cloud_memory/table/table.thrift b/idl/data_engine/ocean_cloud_memory/table/table.thrift index 67afbc2f..802ddc2d 100644 --- a/idl/data_engine/ocean_cloud_memory/table/table.thrift +++ b/idl/data_engine/ocean_cloud_memory/table/table.thrift @@ -7,19 +7,19 @@ enum RefType { } struct RefInfo { - 1: RefType ref_type // 引用类型 - 2: string ref_id // 引用 id + 1: RefType ref_type // reference type + 2: string ref_id // reference id } enum BotTableStatus { - Online = 1 // 已上线 - Delete = 2 // 删除 + Online = 1 // online + Delete = 2 // delete } enum FieldItemType { - Text = 1 // 文本 - Number = 2 // 数字 - Date = 3 // 时间 + Text = 1 // Text + Number = 2 // number + Date = 3 // time Float = 4 // float Boolean = 5 // bool } @@ -29,16 +29,16 @@ struct FieldItem { 2: string desc 3: FieldItemType type 4: bool must_required - 5: i64 id // 该字段只用来判断是否发布,不为 0 就是已发布的,前端对已发布的字段不能修改字段类型 - 6: i64 alterId // 修改字段时(alter、publish)用来判断增删改,0 表示新增,非 0 表示修改或删除 - 7: bool is_system_field // 是否是系统字段 + 5: i64 id // This field is only used to determine whether it is published. If it is not 0, it is published. The front end cannot modify the field type for the published field. + 6: i64 alterId // When modifying a field (alter, publish), it is used to judge additions and deletions. 0 means new additions, and non-0 means modification or deletion. + 7: bool is_system_field // Is it a system field? } enum BotTableRWMode { - LimitedReadWrite = 1 // 单用户模式 - ReadOnly = 2 // 只读模式 - UnlimitedReadWrite = 3 // 多用户模式 - RWModeMax = 4 // Max 边界值 + LimitedReadWrite = 1 // single user mode + ReadOnly = 2 // read-only mode + UnlimitedReadWrite = 3 // multi-user mode + RWModeMax = 4 // Max boundary value } struct OrderBy { @@ -57,42 +57,42 @@ struct Criterion{ } struct ListDatabaseRequest { - 1: optional i64 creator_id (api.js_conv="str") // 获取创建者为某个用户的的数据库 - 2: optional i64 project_id (api.js_conv="str") // 获取project下的数据库 - 3: optional i64 space_id (api.js_conv="str") //获取空间下的可见数据库 - 4: optional i64 bot_id (api.js_conv="str") //对bot_id进行过滤,过滤掉已经添加到bot中的database - 5: optional string table_name // 表格名称,模糊搜索 - 6: required TableType table_type // 查草稿态database - 7: optional list order_by // 排序 + 1: optional i64 creator_id (api.js_conv="str") // Get a database created by a user + 2: optional i64 project_id (api.js_conv="str") // Get the database under the project + 3: optional i64 space_id (api.js_conv="str") //Get the visible database under space + 4: optional i64 bot_id (api.js_conv="str") //Filter bot_id to filter out databases that have been added to the bot + 5: optional string table_name // Table name, fuzzy search + 6: required TableType table_type // Draft database + 7: optional list order_by // sort 8: optional i32 offset 9: optional i32 limit - 10: optional Criterion filter_criterion //筛选条件 - 11: optional list order_by_list //排序条件 + 10: optional Criterion filter_criterion //filter criteria + 11: optional list order_by_list //sort condition 255: optional base.Base Base } struct DatabaseInfo { - 1: i64 id (api.js_conv="str", api.key="id") // online_database_info的主键id - 2: i64 space_id (api.js_conv="str") // 空间的id + 1: i64 id (api.js_conv="str", api.key="id") // online_database_info primary key id + 2: i64 space_id (api.js_conv="str") // ID of space 3: i64 project_id (api.js_conv="str") // project id - 4: string datamodel_table_id // datamodel侧的表id - 5: string icon_url // 头像url - 6: string icon_uri // 头像url - 7: string table_name // 表名 - 8: string table_desc // 表描述 - 9: BotTableStatus status // 状态 - 10: i64 creator_id (api.js_conv="str") // 创建者id - 11: i64 create_time // 创建时间 - 12: i64 update_time // 更新时间 - 13: list field_list // 字段信息 - 14: string actual_table_name // 数据表实际名称 - 15: BotTableRWMode rw_mode // 读写模式 - 16: bool prompt_disabled // 是否支持prompt调用 - 17: bool is_visible // 是否可见 - 18: optional i64 draft_id (api.js_conv="str") // 对应草稿态的id - 19: optional i64 bot_id (api.js_conv="str", api.key="bot_id") // 相关id. bot_id,老的有,新的没有 - 20: optional map extra_info // 扩展信息 - 21: optional bool is_added_to_bot // 是否已经添加到bot中 + 4: string datamodel_table_id // Table ID on the datamodel side + 5: string icon_url // avatar url + 6: string icon_uri // avatar url + 7: string table_name // table name + 8: string table_desc // table description + 9: BotTableStatus status // status + 10: i64 creator_id (api.js_conv="str") // creator id + 11: i64 create_time // create_time + 12: i64 update_time // update time + 13: list field_list // Field information + 14: string actual_table_name // Data table actual name + 15: BotTableRWMode rw_mode // read and write mode + 16: bool prompt_disabled // Whether to support prompt calls + 17: bool is_visible // Is it visible? + 18: optional i64 draft_id (api.js_conv="str") // ID corresponding to draft state + 19: optional i64 bot_id (api.js_conv="str", api.key="bot_id") // Related id. bot_id, the old one is available, the new one is not. + 20: optional map extra_info // extended information + 21: optional bool is_added_to_bot // Has it been added to the bot? } struct ListDatabaseResponse{ @@ -106,10 +106,10 @@ struct ListDatabaseResponse{ } struct SingleDatabaseRequest{ - 1: i64 id (api.js_conv="str", api.key="id") // database_info的主键id - 2: bool is_draft (api.key="is_draft") //传入的是否是草稿态数据,默认是false - 3: bool need_sys_fields (api.key="need_sys_fields") //是否需要系统字段 - 4: i64 version (api.js_conv="str") // 版本号,不传默认是最新的 + 1: i64 id (api.js_conv="str", api.key="id") // database_info primary key id + 2: bool is_draft (api.key="is_draft") //Whether the incoming data is in draft form, the default is false. + 3: bool need_sys_fields (api.key="need_sys_fields") //Do you need system fields? + 4: i64 version (api.js_conv="str") // The version number is not passed on, and the default is the latest. 255: optional base.Base Base } @@ -122,33 +122,33 @@ struct SingleDatabaseResponse{ } struct AddDatabaseRequest{ - 1: i64 creator_id (api.js_conv="str") // 创建者id - 2: i64 space_id (api.js_conv="str") // 空间的id + 1: i64 creator_id (api.js_conv="str") // creator id + 2: i64 space_id (api.js_conv="str") // ID of space 3: i64 project_id (api.js_conv="str") // project id - 4: string icon_uri // 头像url - 5: string table_name // 表名 - 6: string table_desc // 表描述 - 7: list field_list // 字段信息 - 8: BotTableRWMode rw_mode // 读写模式,单用户模式/多用户模式 - 9: bool prompt_disabled // 是否支持prompt调用 - 10: optional map extra_info // 扩展信息 + 4: string icon_uri // avatar url + 5: string table_name // table name + 6: string table_desc // table description + 7: list field_list // Field information + 8: BotTableRWMode rw_mode // Read and write mode, single user mode/multi-user mode + 9: bool prompt_disabled // Whether to support prompt calls + 10: optional map extra_info // extended information 255: optional base.Base Base } struct UpdateDatabaseRequest{ - 1: i64 id (api.js_conv="str", api.key="id") // database_info的主键id - 2: string icon_uri // 头像url - 3: string table_name // 表名 - 5: string table_desc // 表描述 - 6: list field_list // 字段信息 - 7: BotTableRWMode rw_mode // 读写模式,单用户模式/多用户模式 - 8: bool prompt_disabled // 是否支持prompt调用 - 9: optional map extra_info // 扩展信息 + 1: i64 id (api.js_conv="str", api.key="id") // database_info primary key id + 2: string icon_uri // avatar url + 3: string table_name // table name + 5: string table_desc // table description + 6: list field_list // Field information + 7: BotTableRWMode rw_mode // Read and write mode, single user mode/multi-user mode + 8: bool prompt_disabled // Whether to support prompt calls + 9: optional map extra_info // extended information 255: optional base.Base Base } struct DeleteDatabaseRequest{ - 1: i64 id (api.js_conv="str", api.key="id") // database_info的主键id + 1: i64 id (api.js_conv="str", api.key="id") // database_info primary key id 255: optional base.Base Base } @@ -159,7 +159,7 @@ struct DeleteDatabaseResponse { } struct BindDatabaseToBotRequest{ - 1: i64 database_id (api.js_conv="str") // 草稿态数据database表主键id,注意是草稿态哈 + 1: i64 database_id (api.js_conv="str") // Draft data database table primary key id, note that it is draft state 2: i64 bot_id (api.js_conv="str") // bot_id 255: optional base.Base Base } @@ -172,31 +172,31 @@ struct BindDatabaseToBotResponse{ struct ListDatabaseRecordsRequest{ 1: required i64 database_id (api.js_conv="str") // database_id - 2: optional i64 bot_id (api.js_conv="str", api.key="bot_id") // bot id,这里是查找bot关联的草稿态数据的时候填这个 - 3: optional i64 workflow_id (api.js_conv="str", api.key="workflow_id") // workflow_id,,这里是查找wk_flow关联的草稿态表的时候填这个 - 4: optional bool not_filter_by_user_id // 为true不根据user_id进行过滤Records - 5: optional bool not_filter_by_connector_id // 为true不根据ConnectorID进行过滤Records - 6: TableType table_type // 要查的是草稿态还是线上态 - 7: i64 limit // 别超过100,建议50 - 8: i64 offset // 偏移量 - 9: optional i64 project_id (api.js_conv="str") // 同个project下数据不隔离 - 10: optional ComplexCondition filter_criterion //筛选条件 - 11: optional list order_by_list //排序条件 + 2: optional i64 bot_id (api.js_conv="str", api.key="bot_id") // bot id, here is to fill in this when looking for the draft state data associated with the bot + 3: optional i64 workflow_id (api.js_conv="str", api.key="workflow_id") // workflow_id,, here is to fill in this when looking up wk_flow associated draft status sheet + 4: optional bool not_filter_by_user_id // Is true does not filter by user_id Records + 5: optional bool not_filter_by_connector_id // Records not filtered by ConnectorID + 6: TableType table_type // Do you want to check the draft state or the online state? + 7: i64 limit // Do not exceed 100, 50 is recommended. + 8: i64 offset // Offset + 9: optional i64 project_id (api.js_conv="str") // Data is not isolated under the same project + 10: optional ComplexCondition filter_criterion //filter criteria + 11: optional list order_by_list //sort condition 255: optional base.Base Base } struct ListDatabaseRecordsRequestRPC{ 1: required i64 database_id (api.js_conv="str") // database_id - 2: TableType table_type // 要查的是草稿态还是线上态 - 3: i64 limit // 别超过100,建议50 - 4: i64 offset // 偏移量 - 5: string user_id // 用户id + 2: TableType table_type // Do you want to check the draft state or the online state? + 3: i64 limit // Do not exceed 100, 50 is recommended. + 4: i64 offset // Offset + 5: string user_id // user id 255: optional base.Base Base } struct ListDatabaseRecordsResponseRPC{ 1: required list> data 2: required bool HasMore=false 3: required i32 TotalNum - 4: list field_list // 字段信息 + 4: list field_list // Field information 255: required base.BaseResp BaseResp } @@ -204,7 +204,7 @@ struct ListDatabaseRecordsResponse{ 1: required list> data 2: required bool HasMore=false 3: required i32 TotalNum - 4: optional list field_list // 字段信息 + 4: optional list field_list // Field information 253: required i64 code 254: required string msg @@ -213,11 +213,11 @@ struct ListDatabaseRecordsResponse{ struct UpdateDatabaseRecordsRequest{ 1: required i64 database_id (api.js_conv="str") // database_id - 2: optional list> record_data_add // 新增的 - 3: optional list> record_data_alter // 修改的 - 4: optional list> record_data_delete // 删除的 - 5: optional TableType table_type // 要更新的的是草稿态还是线上态 - 6: optional string ori_connector_id // 更新时需穿入connector id + 2: optional list> record_data_add // new + 3: optional list> record_data_alter // modified + 4: optional list> record_data_delete // deleted + 5: optional TableType table_type // Is the draft state or online state to be updated? + 6: optional string ori_connector_id // The connector id needs to be inserted when updating. 255: optional base.Base Base } @@ -229,12 +229,12 @@ struct UpdateDatabaseRecordsResponse{ 255: required base.BaseResp BaseResp } struct GetOnlineDatabaseIdRequest{ - 1: required i64 id (api.js_conv="str") // draft 的database_id + 1: required i64 id (api.js_conv="str") // The draft database_id 255: optional base.Base Base } struct GetOnlineDatabaseIdResponse{ - 1: optional i64 id (api.js_conv="str") // 根据草稿的id查询线上的id + 1: optional i64 id (api.js_conv="str") // Check the online id according to the id of the draft. 253: required i64 code 254: required string msg @@ -243,23 +243,23 @@ struct GetOnlineDatabaseIdResponse{ struct BotTable { - 1: i64 id (api.js_conv="str", api.key="id") // 自增id,table id - 2: i64 bot_id (api.js_conv="str", api.key="bot_id") // 相关id. bot_id + 1: i64 id (api.js_conv="str", api.key="id") // Autoincrement id, table id + 2: i64 bot_id (api.js_conv="str", api.key="bot_id") // Related id bot_id 3: string table_id // table_id - 4: string table_name // 表名 - 5: string table_desc // 表描述 - 6: BotTableStatus status // 状态 - 7: i64 creator_id // 创建着id - 8: i64 create_time // 创建时间 - 9: i64 update_time // 更新时间 - 10: list field_list // 字段信息 - 11: string actual_table_name // 数据表实际名称 - 12: BotTableRWMode rw_mode // 读写模式 - 13: optional map extra_info // 扩展信息 + 4: string table_name // table name + 5: string table_desc // table description + 6: BotTableStatus status // status + 7: i64 creator_id // Creating the ID. + 8: i64 create_time // create_time + 9: i64 update_time // update time + 10: list field_list // Field information + 11: string actual_table_name // Data table actual name + 12: BotTableRWMode rw_mode // read and write mode + 13: optional map extra_info // extended information } struct InsertBotTableRequest { - 1: BotTable bot_table // 保存表信息 + 1: BotTable bot_table // Save table information 255: optional base.Base Base } @@ -271,7 +271,7 @@ struct InsertBotTableResponse { } struct AlterBotTableRequest { - 1: BotTable bot_table // 修改表信息 + 1: BotTable bot_table // Modify table information 255: optional base.Base Base } @@ -314,8 +314,8 @@ struct GetBotTableResponse { } struct CopyDatabaseRequest { - 1: required string IdempotentId //ID生成器生成 - 2: required list TableIds //原来的tableId + 1: required string IdempotentId //ID generator generation + 2: required list TableIds //Original tableId 3: required i64 ToSpaceId 4: required i64 ToUserId 5: required i64 ToBotId @@ -331,8 +331,8 @@ struct CopyDatabaseResponse { } struct CopyDatabaseRollbackRequest { - 1: required string IdempotentId // ID生成器生成 - 2: required map TableIdsMapping // CopyDatabaseResponse返回的参数 + 1: required string IdempotentId // ID generator generation + 2: required map TableIdsMapping // Parameters returned CopyDatabaseResponse 255: optional base.Base Base } @@ -344,12 +344,12 @@ struct CopyDatabaseRollbackResponce { } struct GetNL2SQLRequest { - 1: required string text // 数据库请求的自然语言描述 + 1: required string text // Natural language description of database requests 2: required i64 bot_id // bot id - 3: optional i64 connector_id // 业务线id - 4: optional string connector_uid // 业务线用户id - 5: required TableType table_type // table类型,分 draft 和 online 两种 - 6: optional i64 database_id (api.js_conv="str") // 数据库id + 3: optional i64 connector_id // line of business id + 4: optional string connector_uid // line of business user id + 5: required TableType table_type // Table types, draft and online + 6: optional i64 database_id (api.js_conv="str") // Database ID 255: optional base.Base Base } @@ -364,8 +364,8 @@ struct GetNL2SQLResponse { struct GetModeConfigRequest { 1: required i64 bot_id // bot id - 2: optional i64 connector_id // 业务线id - 3: optional string connector_uid // 业务线用户id + 2: optional i64 connector_id // line of business id + 3: optional string connector_uid // line of business user id 255: optional base.Base Base } @@ -388,11 +388,11 @@ struct ResetBotTableRequest { 2: optional i64 bot_id (api.js_conv="str", api.key="bot_id") 3: optional i64 table_id (api.js_conv="str", api.key="table_id") 4: required TableType table_type - 5: optional i64 connector_id // 业务线id - 6: optional string connector_uid // 业务线用户id - 7: optional i64 workflow_id (api.js_conv="str") // 工作流id - 8: optional i64 database_info_id (api.js_conv="str") // 用户id - 9: optional i64 project_id (api.js_conv="str") // 项目id + 5: optional i64 connector_id // line of business id + 6: optional string connector_uid // line of business user id + 7: optional i64 workflow_id (api.js_conv="str") // Workflow ID + 8: optional i64 database_info_id (api.js_conv="str") // user id + 9: optional i64 project_id (api.js_conv="str") // Project ID 255: optional base.Base Base } @@ -407,10 +407,10 @@ struct ResetBotTableResponse { /******** Bytedoc bot_table_info start ********/ struct BatchInsertBotTableInfoRequest { - 1: string db_name // 数据库名称 - 2: string collection_name // 集合名 - 3: list> data // 保存数据 - 4: i64 user_id // 用户id + 1: string db_name // database name + 2: string collection_name // collection name + 3: list> data // save data + 4: i64 user_id // user id 5: i64 bot_id // bot id 255: optional base.Base Base @@ -421,10 +421,10 @@ struct BatchInsertBotTableInfoResponse { } struct UpdateBotTableInfoRequest { - 1: string db_name // 数据库名称 - 2: string collection_name // 集合名 - 3: list> data_list // 更新数据 - 4: i64 user_id // 用户id + 1: string db_name // database name + 2: string collection_name // collection name + 3: list> data_list // update data + 4: i64 user_id // user id 5: i64 bot_id // bot id 255: optional base.Base Base @@ -435,10 +435,10 @@ struct UpdateBotTableInfoResponse { } struct DeleteBotTableInfoRequest { - 1: string db_name // 数据库名称 - 2: string collection_name // 集合名 - 3: list ids // 删除id 列表 - 4: i64 user_id // 用户id + 1: string db_name // database name + 2: string collection_name // collection name + 3: list ids // Delete id list + 4: i64 user_id // user id 5: i64 bot_id // bot id 255: optional base.Base Base @@ -449,15 +449,15 @@ struct DeleteBotTableInfoResponse { } struct SearchBotTableInfoRequest { - 1: string key_word // 搜素词,目前忽略 + 1: string key_word // Search term, currently ignored 2: i64 limit 3: i64 offset - 4: string connector_uid // 用户id + 4: string connector_uid // user id 5: i64 connector_id 6: i64 bot_id(api.js_conv="str", api.key="bot_id") // bot id - 7: string table_name // 目前忽略 + 7: string table_name // Currently ignored 8: i64 table_id(api.js_conv="str", api.key="table_id") - 9: optional RefInfo ref_info // 引用信息 + 9: optional RefInfo ref_info // citation information 255: optional base.Base Base } @@ -471,22 +471,22 @@ struct SearchBotTableInfoResponse { } enum TableType { - DraftTable = 1 // 草稿 - OnlineTable = 2 // 线上 + DraftTable = 1 // draft + OnlineTable = 2 // online } struct ExecuteSqlRequest { - 1: string sql // RunCommand 能执行的sql + 1: string sql // SQL that RunCommand can execute 2: i64 bot_id // bot id - 3: i64 connector_id // 业务线id - 4: string connector_uid // 业务线用户id - 5: TableType table_type // table类型 - 6: string wftest_id // workflow test run 标识 - 7: optional RefInfo ref_info // 引用信息 + 3: i64 connector_id // line of business id + 4: string connector_uid // line of business user id + 5: TableType table_type // Table type + 6: string wftest_id // Workflow test run identification + 7: optional RefInfo ref_info // citation information 8: optional list SqlParams (api.key="sql_params") // SQL params - 9: i64 database_info_id // database info 的id + 9: i64 database_info_id // Database info id 10: i64 workflow_id // workflow id - 11: i64 project_id // 项目id + 11: i64 project_id // Project ID 255: optional base.Base Base } @@ -505,23 +505,23 @@ struct ExecuteSqlResponse { struct BotTablePublishReq { 1: required i64 bot_id - 2: optional i64 connector_id // 业务线id - 3: optional string connector_uid // 业务线用户id + 2: optional i64 connector_id // line of business id + 3: optional string connector_uid // line of business user id 255: optional base.Base Base } struct BotTablePublishResp { - 1: i64 status // 执行状态: 0-执行成功 1-执行全部失败 2-执行部分失败 - 2: string msg // 错误信息 + 1: i64 status // Execution status: 0-successful execution 1-failed execution all 2-failed execution part + 2: string msg // error message 255: optional base.BaseResp BaseResp } struct NL2SQLRequest { - 1: required string text // 数据库请求的自然语言描述 + 1: required string text // Natural language description of database requests 2: required i64 bot_id // bot id - 3: optional i64 connector_id // 业务线id - 4: optional string connector_uid // 业务线用户id - 5: required TableType table_type // table类型,分 draft 和 online 两种 + 3: optional i64 connector_id // line of business id + 4: optional string connector_uid // line of business user id + 5: required TableType table_type // Table types, draft and online 255: optional base.Base Base } @@ -534,13 +534,13 @@ struct NL2SQLResponse { } struct QueryTableByNLRequest { - 1: required string text // 数据库请求的自然语言描述 + 1: required string text // Natural language description of database requests 2: required i64 bot_id // bot id - 3: required i64 connector_id // 业务线id - 4: required string connector_uid // 业务线用户id - 5: required TableType table_type // table类型,分 draft 和 online 两种 - 6: optional string x_aiplugin_tako_bot_history // chat history 透传到 nl2query 服务,由 nl2query 进行解析 - 7: optional string x_aiplugin_bot_system_message // bot_system_message 透传到 nl2query 服务,由 nl2query 进行解析 + 3: required i64 connector_id // line of business id + 4: required string connector_uid // line of business user id + 5: required TableType table_type // Table types, draft and online + 6: optional string x_aiplugin_tako_bot_history // The chat history is passed to the nl2query service, which is parsed by nl2query + 7: optional string x_aiplugin_bot_system_message // bot_system_message passed to the nl2query service, which is parsed by nl2query 255: optional base.Base Base } @@ -552,8 +552,8 @@ struct QueryTableByNLResponse { } enum SceneType { - BotPersona = 1 // bot 个性描述 - ModelDesc = 2 // 开发者给的模型文本描述 + BotPersona = 1 // bot personality description + ModelDesc = 2 // Text description of the model given by the developer } struct RecommendDataModelRequest { @@ -599,9 +599,9 @@ struct MigrateDatabaseResponse{ } struct MigrateOldDataRequest{ - 1: TableType bot_type // 迁移哪个表 - 2: i64 bot_id (api.js_conv="str") // 迁移哪个bot - 3: list table_ids (api.js_conv="str") // 失败重试 + 1: TableType bot_type // Which table to migrate + 2: i64 bot_id (api.js_conv="str") // Which bot to migrate? + 3: list table_ids (api.js_conv="str") // Failed retry 255: optional base.Base Base } @@ -612,8 +612,8 @@ struct MigrateOldDataResponse{ } struct MGetDisplayResourceInfoRequest { - 1 : list ResIDs, // 最大传一页的数量,实现方可以限制最大100个 - 2 : i64 CurrentUserID, // 当前的用户,实现方用于判断权限 + 1 : list ResIDs, // The maximum number of one page can be transferred, and the implementer can limit the maximum to 100. + 2 : i64 CurrentUserID, // The current user, the implementation is used to determine the authority 255: base.Base Base , } @@ -623,41 +623,41 @@ struct MGetDisplayResourceInfoResponse { } enum ActionKey{ - Copy = 1, //复制 - Delete = 2, //删除 - EnableSwitch = 3, //启用/禁用 - Edit = 4, //编辑 - CrossSpaceCopy = 10, // 跨空间复制 + Copy = 1, //copy + Delete = 2, //delete + EnableSwitch = 3, //enable/disable + Edit = 4, //edit + CrossSpaceCopy = 10, // Cross-space copy } enum PublishStatus{ - UnPublished = 1, //未发布 - Published = 2, //已发布 + UnPublished = 1, //unpublished + Published = 2, //Published } -// Library资源操作 +// Library Resource Operations struct ResourceAction{ - // 一个操作对应一个唯一的key,key由资源侧约束 + // An operation corresponds to a unique key, and the key is constrained by the resource side 1 : required ActionKey Key (go.tag = "json:\"key\"", api.key = "key"), - //ture=可以操作该Action,false=置灰 + //ture = can operate this Action, false = grey out 2 : required bool Enable (go.tag = "json:\"enable\"", api.key = "enable"), } -// 展示用,实现方提供展示信息 +// For display, the implementer provides display information struct DisplayResourceInfo{ - 1 : optional i64 ResID, // 资源id - 5 : optional string Desc,// 资源描述 - 6 : optional string Icon,// 资源Icon,完整url - 12 : optional i32 BizResStatus, // 资源状态,各类型资源自身定义 - 13 : optional bool CollaborationEnable, // 是否开启多人编辑 - 16 : optional map BizExtend, // 业务携带的扩展信息,以res_type区分,每个res_type定义的schema和含义不一样,使用前需要判断res_type - 17 : optional list Actions, // 不同类型的不同操作按钮,由资源实现方和前端约定。返回则展示,要隐藏某个按钮,则不要返回; - 18 : optional bool DetailDisable, // 是否禁止进详情页 - 19 : optional string Name // 资源名称 - 20 : optional PublishStatus PublishStatus, // 资源发布状态,1-未发布,2-已发布 - 21 : optional i64 EditTime, // 最近编辑时间, unix秒级时间戳 + 1 : optional i64 ResID, // Resource ID + 5 : optional string Desc,// resource description + 6 : optional string Icon,// Resource Icon, full url + 12 : optional i32 BizResStatus, // Resource status, each type of resource defines itself + 13 : optional bool CollaborationEnable, // Whether to enable multi-person editing + 16 : optional map BizExtend, // Business carry extended information to res_type distinguish, each res_type defined schema and meaning is not the same, need to judge before use res_type + 17 : optional list Actions, // Different types of different operation buttons are agreed upon by the resource implementer and the front end. Return is displayed, if you want to hide a button, do not return; + 18 : optional bool DetailDisable, // Whether to ban entering the details page + 19 : optional string Name // resource name + 20 : optional PublishStatus PublishStatus, // Resource release status, 1 - unpublished, 2 - published + 21 : optional i64 EditTime, // Last edited, unix timestamp } enum OperateType { Insert = 1 @@ -671,7 +671,7 @@ struct SelectFieldList{ } enum Operation { EQUAL = 1, // "=" - NOT_EQUAL = 2, // "<>" 或 "!=" + NOT_EQUAL = 2, // "< >" or "! =" GREATER_THAN = 3, // ">" LESS_THAN = 4, // "<" GREATER_EQUAL = 5, // ">=" @@ -680,20 +680,20 @@ enum Operation { NOT_IN = 8, // "NOT IN" IS_NULL = 9, // "IS NULL" IS_NOT_NULL = 10 // "IS NOT NULL" - LIKE = 11, // "LIKE" 模糊匹配字符串 - NOT_LIKE = 12, // "NOT LIKE" 反向模糊匹配 + LIKE = 11, // "LIKE" fuzzy match string + NOT_LIKE = 12, // "NOT LIKE" inverse fuzzy match } struct Condition { - 1: required string left; // 左值填字段名 + 1: required string left; // Lvalue field name 2: required Operation operation; - 3: required string right; // 右值 + 3: required string right; // rvalue } struct ComplexCondition { 1: optional list conditions; - 2: optional ComplexCondition nestedConditions; // 为了拓展,先不用 - 3: required string logic; // "AND" 或 "OR" + 2: optional ComplexCondition nestedConditions; // In order to expand, we don't need to + 3: required string logic; // "AND" or "OR" } struct UpsertValues { @@ -705,30 +705,30 @@ struct Row { 1: list values } struct CRUDDatabaseRequest { - 1: required i64 database_info_id // database的id - 2: i64 workflow_id // workflow id,wk flow纬度数据隔离 - 3: i64 project_id // 项目id,同project下不隔离 + 1: required i64 database_info_id // Database id + 2: i64 workflow_id // Workflow id, wk flow latitude data isolation + 3: i64 project_id // Project id, not isolated under the same project 4: i64 bot_id // bot id - 5: i64 connector_id // 业务线id - 6: string connector_uid // 业务线用户id - 7: required TableType table_type // table类型 - 8: string wftest_id // workflow test run 标识 - 9: optional RefInfo ref_info // 引用信息 + 5: i64 connector_id // line of business id + 6: string connector_uid // line of business user id + 7: required TableType table_type // Table type + 8: string wftest_id // Workflow test run identification + 9: optional RefInfo ref_info // citation information 10: optional list sql_params (api.key="sql_params") // SQL params - 11: required OperateType operate_type // 操作类型 - 12: optional SelectFieldList field_list // select时要查询的字段列表 - 13: optional list order_by_list // order by 字段列表 + 11: required OperateType operate_type // operation type + 12: optional SelectFieldList field_list // List of fields to query when selected + 13: optional list order_by_list // Order by field list 14: optional i64 limit // limit 15: optional i64 offset // offset - 16: optional ComplexCondition condition // 查询条件 - 17: optional list rows // 需要upsert的数据 + 16: optional ComplexCondition condition // query condition + 17: optional list rows // Data to upsert } struct SourceInfo { - // 本地文件上传的 tos 地址 + // TOS address for local file upload 1: optional string tos_uri (api.key="tos_uri"); - // 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 2: optional string imagex_uri } @@ -736,68 +736,68 @@ struct SourceInfo { struct ValidateTableSchemaRequest { 1: i64 space_id (api.js_conv="str", api.key="space_id") 2: i64 database_id (api.js_conv="str", api.key="database_id") - 3: SourceInfo source_info (api.key="source_file", api.body="source_file") // source file 的信息 + 3: SourceInfo source_info (api.key="source_file", api.body="source_file") // Information from the source file 4: TableSheet table_sheet (api.key="table_sheet") 5: TableType table_type (api.key="table_type") 255: optional base.Base Base } struct TableSheet { - 1: i64 sheet_id (api.js_conv="str", api.key="sheet_id") , // 用户选择的 sheet id - 2: i64 header_line_idx (api.js_conv="str", api.key="header_line_idx"), // 用户选择的表头行数,从 0 开始编号 - 3: i64 start_line_idx (api.js_conv="str", api.key="start_line_idx") , // 用户选择的起始行号,从 0 开始编号 + 1: i64 sheet_id (api.js_conv="str", api.key="sheet_id") , // User selected sheet id + 2: i64 header_line_idx (api.js_conv="str", api.key="header_line_idx"), // The number of header rows selected by the user, numbered from 0 + 3: i64 start_line_idx (api.js_conv="str", api.key="start_line_idx") , // User-selected starting line number, numbered from 0 } struct ValidateTableSchemaResponse { 1: optional map SchemaValidResult (api.key="schema_valid_result"); - // 如果失败会返回错误码 + // If it fails, an error code will be returned. 253: required i64 code 254: required string msg 255: optional base.BaseResp BaseResp(api.none="true") } struct GetTableSchemaRequest { - 1: optional TableSheet table_sheet; // 表格解析信息, 默认初始值0,0,1 - 2: optional TableDataType table_data_type; // 不传默认返回所有数据 - 3: optional i64 database_id(api.js_conv="str", api.key="database_id"); // 兼容重构前的版本:如果需要拉取的是当前 document 的 schema 时传递该值 - 4: optional SourceInfo source_file; // source file 的信息,新增 segment / 之前逻辑迁移到这里 + 1: optional TableSheet table_sheet; // Table parsing information, default initial value 0, 0, 1 + 2: optional TableDataType table_data_type; // All data is returned by default without passing it on. + 3: optional i64 database_id(api.js_conv="str", api.key="database_id"); // Compatible with pre-refactoring versions: pass this value if you need to pull the schema of the current document + 4: optional SourceInfo source_file; // Source file information, add segment/before logic migrate here 255: optional base.Base Base } enum TableDataType { - AllData = 0 // schema sheets 和 preview data - OnlySchema = 1 // 只需要 schema 结构 & Sheets - OnlyPreview = 2 // 只需要 preview data + AllData = 0 // Schema sheets and preview data + OnlySchema = 1 // Only need schema structure & Sheets + OnlyPreview = 2 // Just preview the data } struct DocTableSheet { - 1: i64 id; // sheet 的编号 - 2: string sheet_name; // sheet 名 - 3: i64 total_row; // 总行数 + 1: i64 id; // Number of sheet + 2: string sheet_name; // Sheet name + 3: i64 total_row; // total number of rows } struct TableColumn { - 1: i64 id(api.js_conv="str", api.key="id") // 列 id - 2: string column_name // 列名 - 3: i64 sequence(api.js_conv="str", api.key="sequence")// 列原本在 excel 的序号 - 4: optional ColumnType column_type // 列类型 + 1: i64 id(api.js_conv="str", api.key="id") // Column ID + 2: string column_name // column_name + 3: i64 sequence(api.js_conv="str", api.key="sequence")// List the serial number originally in excel + 4: optional ColumnType column_type // column type 5: optional bool contains_empty_value - 6: optional string desc // 描述 + 6: optional string desc // describe } enum ColumnType { Unknown = 0 - Text = 1 // 文本 - Number = 2 // 数字 - Date = 3 // 时间 + Text = 1 // Text + Number = 2 // number + Date = 3 // time Float = 4 // float Boolean = 5 // bool - Image = 6 // 图片 + Image = 6 // picture } struct GetDatabaseFileProgressRequest { 1: i64 database_id (api.js_conv="str") - 2: required TableType table_type // table类型 + 2: required TableType table_type // Table type 255: optional base.Base Base } struct GetDatabaseFileProgressResponse { @@ -810,15 +810,15 @@ struct GetDatabaseFileProgressResponse { struct DatabaseFileProgressData { 1: string file_name 2: i32 progress - 3: optional string status_descript //描述信息,如果有代表文件处理失败 + 3: optional string status_descript //Describe the information if there is a representative file processing failure } struct SubmitDatabaseInsertRequest { 1: i64 database_id (api.js_conv="str") 2: string file_uri - 3: TableType table_type // table类型,要往草稿表插入还是线上表插入 + 3: TableType table_type // Table type, do you want to insert into the draft table or the online table? 4: optional TableSheet table_sheet - 5: optional i64 connector_id (api.js_conv="str") // 要写入的渠道id + 5: optional i64 connector_id (api.js_conv="str") // Channel ID to write to 255: optional base.Base Base } @@ -865,7 +865,7 @@ struct ConnectorInfo{ typedef GetDatabaseFileProgressRequest GetDatabaseTemplateRequest struct GetDatabaseTemplateResponse { - 1: string TosUrl // 下载地址 + 1: string TosUrl // Download address 253: required i64 code 254: required string msg @@ -875,7 +875,7 @@ struct GetDatabaseTemplateResponse { struct UpdateDatabaseBotSwitchRequest{ 1: required i64 bot_id (api.js_conv="str") 2: required i64 database_id (api.js_conv="str") - 3: required bool prompt_disable // 是否禁用prompt + 3: required bool prompt_disable // Whether to disable prompt 255: optional base.Base Base } diff --git a/idl/developer/developer_api.thrift b/idl/developer/developer_api.thrift index 7bfba2f0..e8f2ec82 100644 --- a/idl/developer/developer_api.thrift +++ b/idl/developer/developer_api.thrift @@ -12,7 +12,7 @@ struct DraftBotCreateRequest { 4: string icon_uri 5: VisibilityType visibility 6: optional MonetizationConf monetization_conf - 7: optional string create_from, // 创建来源 navi:导航栏 space:空间 + 7: optional string create_from, // Create source navi: navbar space: space 9: optional bot_common.BusinessType business_type } @@ -21,14 +21,14 @@ struct MonetizationConf { } enum VisibilityType { - Invisible = 0 // 不可见 - Visible = 1 // 可见 + Invisible = 0 // invisible + Visible = 1 // visible } struct DraftBotCreateData { 1: i64 bot_id (agw.js_conv="str", api.js_conv="true") - 2: bool check_not_pass // true:机审校验不通过 - 3: optional string check_not_pass_msg // 机审校验不通过文案 + 2: bool check_not_pass // True: The machine audit verification failed + 3: optional string check_not_pass_msg // The machine audit verification failed the copy. } struct DraftBotCreateResponse { @@ -66,11 +66,11 @@ struct UserLabel { struct Creator { 1: i64 id (agw.js_conv="str", api.js_conv="true") - 2: string name // 昵称 + 2: string name // nickname 3: string avatar_url - 4: bool self // 是否是自己创建的 - 5: string user_unique_name // 用户名 - 6: UserLabel user_label // 用户标签 + 4: bool self // Did you create it yourself? + 5: string user_unique_name // user name + 6: UserLabel user_label // user tag } struct DuplicateDraftBotData { @@ -148,25 +148,25 @@ struct PublishDraftBotResponse { } struct PublishDraftBotData { - 1: map> connector_bind_result // key代表connector_name 枚举 飞书="feishu" -- 废弃 - 2: map publish_result // key代表connector_id,value是发布结果 - 3: bool check_not_pass // true:机审校验不通过 - 4: optional SubmitBotMarketResult submit_bot_market_result // 上架bot market结果 - 5: optional bool hit_manual_check // 是否命中人审 - 6: optional list not_pass_reason // 机审校验不通过原因的starlingKey列表 - 7: optional bool publish_monetization_result // 发布bot计费结果 + 1: map> connector_bind_result // Key represents connector_name enumeration Feishu = "feishu" -- obsolete + 2: map publish_result // The key represents connector_id, and the value is the published result + 3: bool check_not_pass // True: The machine audit verification failed + 4: optional SubmitBotMarketResult submit_bot_market_result // Added bot marketing results + 5: optional bool hit_manual_check // In human moderation + 6: optional list not_pass_reason // starlingKey list of reasons why the machine audit failed + 7: optional bool publish_monetization_result // Publish bot billing results } struct ConnectorBindResult { 1: Connector connector - 2: i64 code // 发布调用下游返回的状态码,前端不消费 - 3: string msg // 发布状态的附加文案,前端按照markdown格式解析 - 4: optional PublishResultStatus publish_result_status // 发布结果状态 + 2: i64 code // The status code returned downstream of the publish call is not consumed by the front end. + 3: string msg // Additional copy of the release status, the front end is parsed in markdown format + 4: optional PublishResultStatus publish_result_status // post result status } struct Connector { - 1: string name // connector_name 枚举 飞书="feishu" + 1: string name // connector_name enumeration Feishu = "feishu" 2: string app_id 3: string app_secret 4: string share_link @@ -174,14 +174,14 @@ struct Connector { } enum PublishResultStatus { - Success = 1 // 成功 - Failed = 2 // 失败 - InReview = 3 // 审批中 + Success = 1 // success + Failed = 2 // fail + InReview = 3 // in approval } struct SubmitBotMarketResult { - 1: optional i64 result_code // 上架状态,0-成功 - 2: optional string msg // 上架结果的文案 + 1: optional i64 result_code // Shelf status, 0-success + 2: optional string msg // msg } @@ -204,15 +204,15 @@ struct AgentInfo { 8: optional string reference_id 9: optional string first_version 10: optional string current_version - 11: optional ReferenceInfoStatus reference_info_status // 1:有可用更新 2:被删除 + 11: optional ReferenceInfoStatus reference_info_status // 1: Available update 2: Removed 12: optional string description 13: optional ReferenceUpdateType update_type } enum ReferenceInfoStatus { - HasUpdates = 1 // 1:有可用更新 - IsDelete = 2 // 2:被删除 + HasUpdates = 1 // 1: Updates are available + IsDelete = 2 // 2: Deleted } enum ReferenceUpdateType { @@ -232,17 +232,17 @@ struct Intent { 3: optional string next_agent_id } -// agent 工作区间各个模块的信息 +// Information about each module in the agent workspace struct AgentWorkInfo { - 1: optional string prompt // agent prompt 前端信息,server不需要感知 - 2: optional string other_info // 模型配置 - 3: optional string tools // plugin 信息 - 4: optional string dataset // dataset 信息 - 5: optional string workflow // workflow 信息 - 6: optional string system_info_all // 同bot的 system_info_all - 7: optional JumpConfig jump_config // 回溯配置 - 8: optional string suggest_reply , // 推荐回复配置 - 9: optional string hook_info // hook配置 + 1: optional string prompt // The agent prompts the front-end information, the server does not need to perceive + 2: optional string other_info // model configuration + 3: optional string tools // Plugin information + 4: optional string dataset // Dataset information + 5: optional string workflow // Workflow information + 6: optional string system_info_all // system_info_all with bot + 7: optional JumpConfig jump_config // backtrack configuration + 8: optional string suggest_reply , // Referral Configuration + 9: optional string hook_info // Hook configuration } @@ -265,16 +265,16 @@ enum RecognitionMode { } enum IndependentTiming { - Pre = 1 // 判断用户输入(前置) - Post = 2 // 判断节点输出(后置) - PreAndPost = 3 // 前置模式和后置模式支持同时选择 + Pre = 1 // Determine user input (front) + Post = 2 // Determine node output (postfix) + PreAndPost = 3 // Front mode and rear mode support simultaneous selection } enum IndependentRecognitionModelType { - SLM = 0 // 小模型 - LLM = 1 // 大模型 + SLM = 0 // Small model + LLM = 1 // Large model } struct IndependentModeConfig { - 1: IndependentTiming judge_timing // 判断时机 + 1: IndependentTiming judge_timing // Judge timing 2: i32 history_round 3: IndependentRecognitionModelType model_type 4: optional string model_id @@ -294,18 +294,18 @@ struct PublishDraftBotRequest { 1: required i64 space_id (agw.js_conv="str", api.js_conv="true") 2: required i64 bot_id (agw.js_conv="str", api.js_conv="true") 3: WorkInfo work_info - 4: map> connector_list // key代表connector_name 枚举 飞书="feishu" -- 废弃 - 5: map> connectors // key代表connector_id,value是发布的参数 - 6: optional BotMode botMode // 默认0 + 4: map> connector_list // Key represents connector_name enumeration Feishu = "feishu" -- obsolete + 5: map> connectors // The key represents connector_id, and the value is the published parameter + 6: optional BotMode botMode // Default 0 7: optional list agents 8: optional string canvas_data 9: optional list bot_tag_info - 10: optional SubmitBotMarketConfig submit_bot_market_config // 发布到market的配置 + 10: optional SubmitBotMarketConfig submit_bot_market_config // Configuration published to the market 11: optional string publish_id - 12: optional string commit_version // 指定发布某个CommitVersion - 13: optional PublishType publish_type // 发布类型,线上发布/预发布 - 14: optional string pre_publish_ext // 预发布其他信息 - 15: optional string history_info // 替换原workinfo中的 history_info + 12: optional string commit_version // Specify the release of a CommitVersion + 13: optional PublishType publish_type // Release type, online release/pre-release + 14: optional string pre_publish_ext // Pre-release other information + 15: optional string history_info // Replace the history_info in the original workinfo } enum PublishType { @@ -314,9 +314,9 @@ enum PublishType { } struct SubmitBotMarketConfig { - 1: optional bool need_submit // 是否发布到market - 2: optional bool open_source // 是否开源 - 3: optional string category_id // 分类 + 1: optional bool need_submit // Whether to publish to the market + 2: optional bool open_source // Is it open source? + 3: optional string category_id // classification } enum BotMode { @@ -325,7 +325,7 @@ enum BotMode { WorkflowMode = 2 } -// 工作区间各个模块的信息 +// Information for each module in the workspace struct WorkInfo { 1: optional string message_info 2: optional string prompt @@ -343,15 +343,15 @@ struct WorkInfo { 14: optional string suggest_reply 15: optional string tts 16: optional string background_image_info_list - 17: optional shortcut_command.ShortcutStruct shortcuts // 快捷指令 - 18: optional string hook_info // hook配置 - 19: optional UserQueryCollectConf user_query_collect_conf // 用户query收集配置 - 20: optional LayoutInfo layout_info //workflow模式编排数据 + 17: optional shortcut_command.ShortcutStruct shortcuts // Quick Instruction + 18: optional string hook_info // Hook configuration + 19: optional UserQueryCollectConf user_query_collect_conf // User query collection configuration + 20: optional LayoutInfo layout_info //Workflow pattern orchestration data } struct UserQueryCollectConf { - 1: bool IsCollected (api.body="is_collected") , // 是否开启收集开关 - 2: string PrivatePolicy (api.body="private_policy") , // 隐私协议链接 + 1: bool IsCollected (api.body="is_collected") , // Whether to turn on the collection switch + 2: string PrivatePolicy (api.body="private_policy") , // Privacy Policy Link } struct LayoutInfo { @@ -360,10 +360,10 @@ struct LayoutInfo { } enum HistoryType { - SUBMIT = 1 // 废弃 - FLAG = 2 // 发布 - COMMIT = 4 // 提交 - COMMITANDFLAG = 5 // 提交和发布 + SUBMIT = 1 // abandoned + FLAG = 2 // publish + COMMIT = 4 // submit + COMMITANDFLAG = 5 // Submit and publish } @@ -387,16 +387,16 @@ struct ListDraftBotHistoryData { 2: i32 total } -// 如果保存历史信息 +// If historical information is preserved struct HistoryInfo { 1: string version , 2: HistoryType history_type , - 3: string info , // 对历史记录补充的其他信息 + 3: string info , // Additional information added to the historical record 4: string create_time , 5: list connector_infos, 6: Creator creator , 7: optional string publish_id , - 8: optional string commit_remark , // 提交时填写的说明 + 8: optional string commit_remark , // Instructions to fill in when submitting } struct ConnectorInfo { @@ -473,14 +473,14 @@ struct GetUploadAuthTokenRequest { } struct UploadFileRequest { - 1: CommonFileInfo file_head // 文件相关描述 - 2: string data // 文件数据 + 1: CommonFileInfo file_head // Document related description + 2: string data // file data } -// 上传文件,文件头 +// Upload file, file header struct CommonFileInfo { - 1: string file_type // 文件类型,后缀 - 2: FileBizType biz_type // 业务类型 + 1: string file_type // File type, suffix + 2: FileBizType biz_type // business type } enum FileBizType { @@ -500,7 +500,7 @@ enum FileBizType { struct UploadFileResponse { 1: i64 code 2: string msg - 3: UploadFileData data // 数据 + 3: UploadFileData data // data } struct GetTypeListRequest { @@ -508,9 +508,9 @@ struct GetTypeListRequest { 2: optional bool voice 3: optional bool raw_model 4: optional string space_id - 5: optional string cur_model_id // 当前bot使用的模型ID,用于处理cici/doubao同步过来的bot模型不能展示的问题 - 6: optional list cur_model_ids // 兼容MultiAgent,有多个cur_model_id - 7: optional ModelScene model_scene // 模型场景 + 5: optional string cur_model_id // The model ID used by the current bot to handle issues that cannot be displayed by the bot model synchronized by cici/doubao + 6: optional list cur_model_ids // Compatible with MultiAgent, with multiple cur_model_id + 7: optional ModelScene model_scene // model scenario } enum ModelScene { @@ -526,34 +526,34 @@ enum ModelClass { StableDiffusion = 6 ByteArtist = 7 Maas = 9 - QianFan = 10 // 废弃:千帆(百度云) + QianFan = 10 // Abandoned: Qianfan (Baidu Cloud) Gemini = 11 // name:Google Gemini Moonshot = 12 // name: Moonshot - GLM = 13 // name:智谱 - MaaSAutoSync = 14 // name: 火山方舟 - QWen = 15 // name:通义千问 + GLM = 13 // Name: Zhipu + MaaSAutoSync = 14 // Name: Volcano Ark + QWen = 15 // Name: Tongyi Qianwen Cohere = 16 // name: Cohere - Baichuan = 17 // name: 百川智能 - Ernie = 18 // name:文心一言 - DeekSeek = 19 // name: 幻方 + Baichuan = 17 // Name: Baichuan Intelligent + Ernie = 18 // Name: ERNIE Bot + DeekSeek = 19 // Name: Magic Square Llama = 20 // name: Llama StepFun = 23 Other = 999 } struct ModelQuota { - 1: i32 token_limit // 最大总 token 数量 - 2: i32 token_resp // 最终回复最大 token 数量 - 3: i32 token_system // Prompt 系统最大 token 数量 - 4: i32 token_user_in // Prompt 用户输入最大 token 数量 - 5: i32 token_tools_in // Prompt 工具输入最大 token 数量 - 6: i32 token_tools_out // Prompt 工具输出最大 token 数量 - 7: i32 token_data // Prompt 数据最大 token 数量 - 8: i32 token_history // Prompt 历史最大 token 数量 - 9: bool token_cut_switch // Prompt 历史最大 token 数量 - 10: double price_in // 输入成本 - 11: double price_out // 输出成本 - 12: optional i32 system_prompt_limit // systemprompt输入限制,如果没有传,对输入不做限制 + 1: i32 token_limit // Maximum total number of tokens + 2: i32 token_resp // Final reply maximum number of tokens + 3: i32 token_system // Prompt system maximum number of tokens + 4: i32 token_user_in // Prompt user to enter maximum number of tokens + 5: i32 token_tools_in // Prompt tool to enter maximum number of tokens + 6: i32 token_tools_out // Prompt tool output maximum number of tokens + 7: i32 token_data // Prompt data maximum number of tokens + 8: i32 token_history // Prompt history maximum number of tokens + 9: bool token_cut_switch // Prompt history maximum number of tokens + 10: double price_in // input cost + 11: double price_out // output cost + 12: optional i32 system_prompt_limit // Systemprompt input restrictions, if not passed, no input restrictions } enum ModelTagClass { @@ -562,7 +562,7 @@ enum ModelTagClass { ModelFeature = 3 ModelFunction = 4 - Custom = 20 // 本期不做 + Custom = 20 // Do not do this issue Others = 100 } @@ -586,21 +586,21 @@ struct ModelParamClass { } struct Option { - 1: string label // option展示的值 - 2: string value // 填入的值 + 1: string label // The value displayed by the option + 2: string value // Filled in value } struct ModelParameter { - 1: required string name // 配置字段,如max_tokens - 2: string label // 配置字段展示名称 - 3: string desc // 配置字段详情描述 - 4: required ModelParamType type // 类型 - 5: string min // 数值类型参数,允许设置的最小值 - 6: string max // 数值类型参数,允许设置的最大值 - 7: i32 precision // float类型参数的精度 - 8: required ModelParamDefaultValue default_val // 参数默认值{"default": xx, "creative":xx} - 9: list