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

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

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -54,7 +54,7 @@ func TestAgentRun(t *testing.T) {
// content := []*entity.InputMetaData{
// {
// Type: entity.InputTypeText,
// Text: "你是谁",
// Text: "Who are you",
// },
// {
// Type: entity.InputTypeImage,

View File

@@ -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

View File

@@ -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
}

View File

@@ -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

View File

@@ -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
}