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,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 {

View File

@@ -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
// createbotnl2bot功能
// Createbot's nl2bot features
Scene_GenerateAgentInfo Scene = 8
//openapi
Scene_SceneOpenApi Scene = 9

View File

@@ -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"`
// 可选值:ASCDESC
// 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"`

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"`
}

View File

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