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

@@ -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_type1-预设任务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/-10-最后一页,-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"`
}