chore: replace all cn comments of fe to en version by volc api (#320)
This commit is contained in:
@@ -55,49 +55,49 @@ export const getDefaultBotInfoStore = (): BotInfoStore => ({
|
||||
raw: {},
|
||||
});
|
||||
|
||||
/** 定义bot的基础信息*/
|
||||
/** Define the basic information of the bot*/
|
||||
export interface BotInfoStore {
|
||||
botId: string;
|
||||
/** 发布的业务线详情 */
|
||||
/** Published business line details */
|
||||
connectors: Array<ConnectorInfo>;
|
||||
/** for前端,发布时间 */
|
||||
/** For frontend, release time */
|
||||
publish_time: string;
|
||||
/** 空间id */
|
||||
/** Space ID */
|
||||
space_id: string;
|
||||
/** 是否已发布 */
|
||||
/** Has it been published? */
|
||||
has_publish: boolean;
|
||||
mode: BotMode;
|
||||
/** 最新发布版本时传发布人 */
|
||||
/** Publisher of the latest release */
|
||||
publisher: UserInfo;
|
||||
/** bot上架后的商品状态 */
|
||||
/** The product status after the bot is put on the shelves */
|
||||
botMarketStatus: BotMarketStatus;
|
||||
/** bot名称 */
|
||||
/** bot name */
|
||||
name: string;
|
||||
/** bot描述 */
|
||||
/** Bot description */
|
||||
description: string;
|
||||
/** bot 图标uri */
|
||||
/** Bot icon uri */
|
||||
icon_uri: string;
|
||||
/** bot 图标url */
|
||||
/** Bot icon url */
|
||||
icon_url: string;
|
||||
/** 创建时间 */
|
||||
/** creation time */
|
||||
create_time: string;
|
||||
/** 创建人id */
|
||||
/** creator id */
|
||||
creator_id: string;
|
||||
/** 更新时间 */
|
||||
/** update time */
|
||||
update_time: string;
|
||||
/** 业务线 */
|
||||
/** line of business */
|
||||
connector_id: string;
|
||||
/** multi agent mode agent信息 */
|
||||
/** Multi agent mode agent information */
|
||||
// agents?: Array<Agent>;
|
||||
/** 版本,毫秒 */
|
||||
/** Version, ms */
|
||||
version: string;
|
||||
/** multi_agent结构体 */
|
||||
/** multi_agent structure */
|
||||
// multi_agent_info?: MultiAgentInfo;
|
||||
/** @ 保存了原始bot数据, readonly **/
|
||||
/** @Save the original bot data, readonly **/
|
||||
raw: BotInfo;
|
||||
/** 抖音分身应用id */
|
||||
/** Douyin doppelganger app id */
|
||||
appId?: string;
|
||||
/** 业务类型 默认0 分身业务1 */
|
||||
/** Business Type, Default 0 Clone Business 1 */
|
||||
businessType?: BusinessType;
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ export const useBotInfoStore = create<BotInfoStore & BotInfoAction>()(
|
||||
set(produce<BotInfoStore>(state => update(state))),
|
||||
// eslint-disable-next-line complexity
|
||||
transformVo2Dto: data => {
|
||||
// 将botData转化为botInfoStore, 只取BotInfoStore中的固定字段
|
||||
// Convert botData to botInfoStore, taking only the fixed fields in BotInfoStore
|
||||
const botInfo = data.bot_info ?? {};
|
||||
return {
|
||||
botId: botInfo?.bot_id ?? '',
|
||||
|
||||
@@ -85,7 +85,7 @@ export const DEFAULT_TTS_CONFIG = (): TTSInfo => ({
|
||||
|
||||
export const DEFAULT_TIME_CAPSULE_CONFIG = (): TimeCapsuleConfig => ({
|
||||
time_capsule_mode: 0,
|
||||
disable_prompt_calling: 0, // 默认支持在prompt调用
|
||||
disable_prompt_calling: 0, // Default support for prompt calls
|
||||
time_capsule_time_to_live: '0',
|
||||
});
|
||||
|
||||
|
||||
@@ -96,57 +96,57 @@ export const getDefaultBotSkillStore = (): BotSkillStore => ({
|
||||
devHooks: {},
|
||||
});
|
||||
|
||||
/** Persona & Prompt 区域 */
|
||||
/** Persona & Prompted Areas */
|
||||
export interface BotSkillStore {
|
||||
// region Bot 和 Agent 维度共有 skills
|
||||
/** 已选的 plugin api */
|
||||
// Region Bot and Agent dimension common skills
|
||||
/** Selected plugin api */
|
||||
pluginApis: EnabledPluginApi[];
|
||||
/** 已选 workflow */
|
||||
/** Selected workflow */
|
||||
workflows: WorkFlowItemType[];
|
||||
/** Knowledge 配置 */
|
||||
/** Knowledge Allocation */
|
||||
knowledge: KnowledgeConfig;
|
||||
// endregion
|
||||
|
||||
// region Bot 维度独有 skills
|
||||
// Region Bot Dimension Unique skills
|
||||
/**
|
||||
* task 配置
|
||||
* Task configuration
|
||||
*
|
||||
* 不含已添加的 task,已添加的在组件内独立管理
|
||||
* No added tasks are included, and those added are managed independently within the component
|
||||
*/
|
||||
taskInfo: TaskManageInfo;
|
||||
/**
|
||||
* variable 默认值配置
|
||||
* Variable default configuration
|
||||
*
|
||||
* 不含右上角现值,现值为打开弹窗后请求获得的组件状态
|
||||
* The present value in the upper right corner is not included. The present value is the component state requested after opening the pop-up window.
|
||||
*/
|
||||
variables: VariableItem[];
|
||||
/**
|
||||
* database 默认值配置
|
||||
* Database default configuration
|
||||
*
|
||||
* 不含右上角现值,现值为打开弹窗后请求获得的组件状态
|
||||
* The present value in the upper right corner is not included. The present value is the component state requested after opening the pop-up window.
|
||||
*/
|
||||
database: DatabaseInfo;
|
||||
/**
|
||||
* database 多表默认值配置
|
||||
* Database multi-table default configuration
|
||||
*
|
||||
* 不含右上角现值,现值为打开弹窗后请求获得的组件状态
|
||||
* The present value in the upper right corner is not included. The present value is the component state requested after opening the pop-up window.
|
||||
*/
|
||||
databaseList: DatabaseList;
|
||||
/** 开场白配置 */
|
||||
/** Opener configuration */
|
||||
onboardingContent: ExtendOnboardingContent;
|
||||
/** 用户问题建议配置 */
|
||||
/** User Questions Suggested Configuration */
|
||||
suggestionConfig: BotSuggestionConfig;
|
||||
// endregion
|
||||
/** 文字转语音 */
|
||||
/** Text to Speech */
|
||||
tts: TTSInfo;
|
||||
/** 语音设置 上面 tts 在命名和含义划分上已经不准确了 但是牵扯甚广 */
|
||||
/** Voice settings, the above tts are no longer accurate in naming and meaning division, but they are very involved */
|
||||
voicesInfo: VoicesInfo;
|
||||
// 时间胶囊
|
||||
// Time Capsule
|
||||
timeCapsule: TimeCapsuleConfig;
|
||||
filebox: FileboxConfig;
|
||||
// 聊天背景图
|
||||
// Chat background cover
|
||||
backgroundImageInfoList: BackgroundImageInfo[];
|
||||
// 快捷指令
|
||||
// Quick Instruction
|
||||
shortcut: ShortCutStruct;
|
||||
// hooks
|
||||
devHooks?: HookInfo;
|
||||
|
||||
@@ -74,7 +74,7 @@ import {
|
||||
DEFAULT_TTS_CONFIG,
|
||||
} from './defaults';
|
||||
|
||||
// 结构化 BotInfo 接口后的 数据转换
|
||||
// After the structured BotInfo interface, data transformation
|
||||
export const transformDto2Vo = {
|
||||
plugin: (
|
||||
data?: PluginInfo[],
|
||||
@@ -96,12 +96,12 @@ export const transformDto2Vo = {
|
||||
parameters:
|
||||
api?.parameters?.map(i => ({
|
||||
...i,
|
||||
// 兼容开源页接口字段命名不同
|
||||
// Compatible with open-source pages. Interface fields are named differently
|
||||
desc: i.description,
|
||||
required: i.is_required,
|
||||
})) || [],
|
||||
is_official: plugin?.is_official,
|
||||
// 这个类型历史原因 在服务端侧各服务不统一,实际业务使用为 枚举类型
|
||||
// The historical reason for this type is that each service on the server level is not unified, and the actual business use is the enumeration type
|
||||
plugin_type: plugin?.plugin_type as unknown as PluginType,
|
||||
status: plugin?.plugin_status as unknown as PluginStatus,
|
||||
};
|
||||
@@ -130,7 +130,7 @@ export const transformDto2Vo = {
|
||||
})) || [],
|
||||
};
|
||||
}) ?? [],
|
||||
// 知识库
|
||||
// Knowledge Base
|
||||
knowledge: (
|
||||
data?: Knowledge,
|
||||
config?: Record<string, KnowledgeDetail>,
|
||||
@@ -212,7 +212,7 @@ export const transformDto2Vo = {
|
||||
i => ({
|
||||
...i,
|
||||
nanoid: nanoid(),
|
||||
// 服务端 rpc 已使用 string 的 id 难以修改,这里兼容一下后续链路需要的 number
|
||||
// Server level rpc has used the id of the string, which is difficult to modify. Here is compatible with the number required for subsequent links.
|
||||
id: Number(i.id),
|
||||
}),
|
||||
),
|
||||
@@ -224,7 +224,7 @@ export const transformDto2Vo = {
|
||||
},
|
||||
|
||||
timeCapsule: (data?: TimeCapsuleInfo): TimeCapsuleConfig => ({
|
||||
//@ts-expect-error 接口枚举类型取值重定义
|
||||
// @ts-expect-error interface enumeration type value redefinition
|
||||
time_capsule_mode: data?.time_capsule_mode ?? TimeCapsuleMode.Off,
|
||||
disable_prompt_calling:
|
||||
data?.disable_prompt_calling ?? DisablePromptCalling.Off,
|
||||
@@ -253,7 +253,7 @@ export const transformDto2Vo = {
|
||||
const defaultSuggestionConfig: BotSuggestionConfig = isBotNode
|
||||
? DEFAULT_BOT_NODE_SUGGESTION_CONFIG()
|
||||
: DEFAULT_SUGGESTION_CONFIG();
|
||||
//@ts-expect-error xxxxxxxxxxxxx SuggestReplyMode 两个文件定义不一致
|
||||
// @ts-expect-error xxxxxxxxxxx SuggestReplyMode The two file definitions are inconsistent
|
||||
const suggestionConfig: BotSuggestionConfig = isNumber(
|
||||
data?.suggest_reply_mode,
|
||||
)
|
||||
@@ -301,7 +301,7 @@ export const transformDto2Vo = {
|
||||
config?: ShortcutCommand[],
|
||||
): ShortCutStruct => ({
|
||||
shortcut_sort: shortcutSortList,
|
||||
//@ts-expect-error ShortCutCommand 前后端定义不一致,前端分化做了类型约束
|
||||
// @ts-expect-error ShortCutCommand The definition of the front and back ends is inconsistent, and the front-end differentiation is subject to type constraints
|
||||
shortcut_list: config,
|
||||
}),
|
||||
|
||||
@@ -427,6 +427,6 @@ export const transformVo2Dto = {
|
||||
shortcut.shortcut_sort,
|
||||
|
||||
layoutInfo: (info: LayoutInfo): BotInfoForUpdate['layout_info'] =>
|
||||
// undefined 会被 axios 过滤,这里后端需要有 key
|
||||
// Undefined will be filtered by axios, where the backend needs to have a key.
|
||||
mapValues(info, (val?: string) => val ?? ''),
|
||||
};
|
||||
|
||||
@@ -42,13 +42,13 @@ export const collaborateQuota = async () => {
|
||||
bot_id: botId,
|
||||
});
|
||||
setCollaboration({
|
||||
// 多人协作模式,或非多人协作模式有额度时可启用
|
||||
// Multiplayer collaboration mode, or non-multiplayer collaboration mode can be enabled when there is a quota
|
||||
openCollaboratorsEnable:
|
||||
(!inCollaboration && collaborationQuota?.open_collaborators_enable) ||
|
||||
inCollaboration,
|
||||
// 非多人协作模式 && 可以升级套餐,则展示升级套餐按钮
|
||||
// Non-multiplayer collaboration mode & & If the package can be upgraded, the upgrade package button will be displayed.
|
||||
canUpgrade: collaborationQuota?.can_upgrade || false,
|
||||
// 用户最大开启多人协作bot的数量限制
|
||||
// Limit on the maximum number of user-enabled multiplayer collaborative bots
|
||||
maxCollaborationBotCount:
|
||||
collaborationQuota?.max_collaboration_bot_count || 0,
|
||||
maxCollaboratorsCount: collaborationQuota?.max_collaborators_count || 0,
|
||||
|
||||
@@ -49,33 +49,33 @@ export const getDefaultCollaborationStore = (): CollaborationStore => ({
|
||||
maxCollaboratorsCount: 0,
|
||||
});
|
||||
export enum EditLockStatus {
|
||||
Lose, // 无编辑锁
|
||||
Holder, // 有编辑锁
|
||||
Offline, // 断网状态,可编辑,但是不可保存。避免联网后覆盖掉断网期间其他页面的编辑
|
||||
Lose, // No edit lock
|
||||
Holder, // There is edit lock.
|
||||
Offline, // The network disconnection status can be edited, but cannot be saved. Avoid overwriting the editing of other pages during the disconnection period after networking.
|
||||
}
|
||||
/**多人协作*/
|
||||
/**multiplayer collaboration*/
|
||||
export interface CollaborationStore {
|
||||
editLockStatus: EditLockStatus;
|
||||
inCollaboration: boolean;
|
||||
collaboratorStatus: BotCollaboratorStatus;
|
||||
sameWithOnline: boolean;
|
||||
baseVersion: string;
|
||||
/** for前端,最近一次的提交人 */
|
||||
/** For the front end, the most recent author */
|
||||
committer_name: string;
|
||||
/** 获取的是什么分支的内容 */
|
||||
/** What branch did you get the content of? */
|
||||
branch?: Branch;
|
||||
/** for前端,提交时间 */
|
||||
/** For frontend, commit time */
|
||||
commit_time: string;
|
||||
commit_version: string;
|
||||
/** 能否开启协作开关 false不可开启 */
|
||||
/** Can it be turned on? The cooperation switch is false and cannot be turned on. */
|
||||
openCollaboratorsEnable: boolean;
|
||||
/** 是否可升级套餐 顶级付费账号不可升级 */
|
||||
/** Whether the package can be upgraded, the top paid account cannot be upgraded */
|
||||
canUpgrade: boolean;
|
||||
// 当前开启的协作bot数量
|
||||
// The current number of active collaboration bots
|
||||
currentCollaborationBotCount: number;
|
||||
/** 用户最大开启多人协作bot的数量限制 */
|
||||
/** Limit on the maximum number of user-enabled multiplayer collaborative bots */
|
||||
maxCollaborationBotCount: number;
|
||||
/** 协作者数量上限 */
|
||||
/** maximum number of collaborators */
|
||||
maxCollaboratorsCount: number;
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ export const useCollaborationStore = create<
|
||||
set(produce<CollaborationStore>(state => update(state))),
|
||||
getBaseVersion: () => {
|
||||
const { baseVersion, inCollaboration } = get();
|
||||
// FG开启且单人模式下,不提供 base_version
|
||||
// FG is on and in single mode, no base_version is provided
|
||||
if (!inCollaboration) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -36,15 +36,15 @@ export const getDefaultDiffTaskStore = (): DiffTaskStore => ({
|
||||
},
|
||||
});
|
||||
|
||||
/** diff任务相关信息 */
|
||||
/** Diff task related information */
|
||||
export interface DiffTaskStore {
|
||||
/** 当前diff任务类型 */
|
||||
/** Current diff task type */
|
||||
diffTask: DiffTaskType;
|
||||
/** 是否有继续任务 */
|
||||
/** Is there a continuation mission? */
|
||||
hasContinueTask: boolean;
|
||||
/** 继续任务信息 */
|
||||
/** Continue task information */
|
||||
continueTask: DiffTaskType;
|
||||
/** 当前diff任务信息 */
|
||||
/** Current diff task information */
|
||||
promptDiffInfo: {
|
||||
diffPromptResourceId: string;
|
||||
diffPrompt: string;
|
||||
|
||||
@@ -15,15 +15,15 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* 用来满足一个神奇的功能
|
||||
* multi agent 模式下 正在回复中
|
||||
* 用户手动切换了 agent
|
||||
* 基于新的 agent 重新生成对话
|
||||
* 需要记录 agent 的切换是「手动」|「自动」
|
||||
* To fulfill a miraculous function
|
||||
* In multi agent mode, replying.
|
||||
* The user switched agents manually
|
||||
* Regenerate the conversation based on the new agent
|
||||
* It is necessary to record that the switch of the agent is "manual" | "automatic"
|
||||
*/
|
||||
|
||||
/**
|
||||
* !! 不和 Bot Detail 搅合在一起了。
|
||||
* !! Not mixed with Bot Details.
|
||||
*/
|
||||
|
||||
import { devtools } from 'zustand/middleware';
|
||||
|
||||
@@ -64,10 +64,10 @@ export const getDefaultModelStore = (): ModelStore => ({
|
||||
modelList: [],
|
||||
});
|
||||
|
||||
/** Persona & Prompt 区域 */
|
||||
/** Persona & Prompted Areas */
|
||||
export interface ModelStore {
|
||||
config: ModelInfoConfig;
|
||||
/** 全部可选模型 */
|
||||
/** All optional models */
|
||||
modelList: Model[];
|
||||
}
|
||||
|
||||
|
||||
@@ -23,11 +23,11 @@ import {
|
||||
} from '@coze-arch/idl/benefit';
|
||||
|
||||
export interface MonetizeConfigState {
|
||||
/** 是否开启付费 */
|
||||
/** Whether to start payment */
|
||||
isOn: boolean;
|
||||
/** 开启付费后,用户免费体验的次数 */
|
||||
/** The number of free user experiences after starting payment */
|
||||
freeCount: number;
|
||||
/** 刷新周期 */
|
||||
/** refresh cycle */
|
||||
refreshCycle: BotMonetizationRefreshPeriod;
|
||||
}
|
||||
|
||||
|
||||
@@ -68,16 +68,16 @@ export interface MultiAgentStore {
|
||||
agents: Agent[];
|
||||
edges: WorkflowEdgeJSON[];
|
||||
connector_type: LineType;
|
||||
/** 用于保存 bot 类型节点的 bot 信息 */
|
||||
/** Use to save bot information for bot type nodes */
|
||||
botAgentInfos: DraftBotVo[];
|
||||
/**
|
||||
* 会话接管方式配置
|
||||
* 默认为 flow 模式
|
||||
* Session takeover configuration
|
||||
* Default to flow mode
|
||||
*/
|
||||
chatModeConfig: ChatModeConfig;
|
||||
/** 当前agent id **/
|
||||
/** Current agent id **/
|
||||
currentAgentID: string;
|
||||
/**muti 左右展开状态**/
|
||||
/**Muti left and right expanded state **/
|
||||
multiSheetViewOpen: MultiSheetViewOpenState;
|
||||
}
|
||||
|
||||
@@ -102,12 +102,12 @@ export interface MultiAgentAction {
|
||||
setMultiAgentByImmer: (update: (state: MultiAgentStore) => void) => void;
|
||||
setMultiSheetViewOpen: (state: Partial<MultiSheetViewOpenState>) => void;
|
||||
updatedCurrentAgentIdWithConnectStart: () => void;
|
||||
/** 重置 host 节点为 start 相连的节点 */
|
||||
/** Reset host node to start connected node */
|
||||
resetHostAgent: () => void;
|
||||
/**
|
||||
* 设置sourceAgentId的portId的intent的next_agent_id为nextAgentId
|
||||
* Set the intent of sourceAgentId's portId to next_agent_id nextAgentId
|
||||
*
|
||||
* @deprecated 这是旧版画布的方法,新版为 addAgentIntent
|
||||
* @Deprecated This is the method of the old canvas, the new version is addAgentIntent
|
||||
*/
|
||||
setAgentIntentNextID: (
|
||||
sourceAgentId?: string,
|
||||
@@ -117,8 +117,8 @@ export interface MultiAgentAction {
|
||||
addAgentIntent: (sourceAgentId: string, targetAgentId: string) => void;
|
||||
deleteAgentIntent: (sourceAgentId: string, targetAgentId: string) => void;
|
||||
/**
|
||||
* 根据agentId找到当前agent的source的agent,也就是上游agent
|
||||
* 将上游agent中找到某个intent,next_agent_id === agentId。将该intent的next_agent_id清空
|
||||
* The agent that finds the source of the current agent according to the agentId, that is, the upstream agent
|
||||
* Find an intent in the upstream agent, next_agent_id === agentId. Clear the next_agent_id of the intent
|
||||
*/
|
||||
clearEdgesByTargetAgentId: (agentId?: string) => void;
|
||||
updateAgentSkillKnowledgeDatasetInfo: (
|
||||
@@ -137,13 +137,13 @@ export interface MultiAgentAction {
|
||||
/** @default AgentType.LLM_Agent */
|
||||
type?: AgentType;
|
||||
position?: IPoint;
|
||||
/** 是否使用struct版本 - 便于写单测即将删除*/
|
||||
/** Whether to use the struct version - easy to write single test will be deleted soon*/
|
||||
structFlag?: boolean;
|
||||
}) => Promise<Agent | undefined>;
|
||||
batchAddBotAgent: (config: {
|
||||
bots: AgentReferenceInfo[];
|
||||
positions: IPoint[];
|
||||
/** 是否使用struct版本 - 便于写单测即将删除*/
|
||||
/** Whether to use the struct version - easy to write single test will be deleted soon*/
|
||||
structFlag?: boolean;
|
||||
}) => Promise<Agent[]>;
|
||||
updateBotNodeInfo: (
|
||||
@@ -156,16 +156,16 @@ export interface MultiAgentAction {
|
||||
apiId?: string,
|
||||
) => void;
|
||||
/**
|
||||
* 清除一条 intent 的 next_id(也就是 edge)
|
||||
* Clears the next_id of an intent (i.e. edge)
|
||||
*
|
||||
* - Q1:为什么不直接使用 intent id 来找 intent?
|
||||
* - A1:将一条已有的连线拖拽连接到另一个节点时,SDK 会先触发这个 intent 的 addEdge 事件,随后再触发 deleteEdge 事件。
|
||||
* 导致 deleteEdge 事件会通过 intent id 覆盖 addEdge 刚刚更新过的 intent。
|
||||
* - Q1: Why not use the intent id directly to find the intent?
|
||||
* A1: When dragging and dropping an existing connection to another node, the SDK fires the addEdge event for that intent first, followed by the deleteEdge event.
|
||||
* Causes the deleteEdge event to overwrite the newly updated intent of addEdge with the intent id.
|
||||
*
|
||||
* - Q2:那通过 targetAgentId 来找 intent 不够吗,为什么还需要 intent id?
|
||||
* - A2:当同一个节点的两个 intent 都指向同一个目标,这时删除其中一条连线,无法确定删除的是哪条,必须配合 intent id 来判断
|
||||
* - Q2: Is it not enough to find the intent by the target AgentId, why do you need the intent id?
|
||||
* - A2: When both intents of the same node point to the same target, one of the connections is deleted. It is impossible to determine which one is deleted. It must be judged with the intent id.
|
||||
*
|
||||
* @deprecated 旧版画布的方法,新版为 deleteAgentIntent
|
||||
* @Deprecated the method of the old canvas, the new version is deleteAgentIntent
|
||||
*/
|
||||
clearIntentNextId: (
|
||||
sourceAgentId: string,
|
||||
@@ -321,7 +321,7 @@ export const useMultiAgentStore = create<MultiAgentStore & MultiAgentAction>()(
|
||||
if (sourceAgent) {
|
||||
const { intents } = sourceAgent;
|
||||
|
||||
// 执行第一步指令。将上游agent的next_agent_id清空
|
||||
// Execute the first step instruction. Clear the upstream agent's next_agent_id
|
||||
intents?.forEach(item => {
|
||||
if (item.next_agent_id === targetAgentId) {
|
||||
item.next_agent_id = undefined;
|
||||
@@ -554,9 +554,9 @@ export const useMultiAgentStore = create<MultiAgentStore & MultiAgentAction>()(
|
||||
);
|
||||
const isMultiAgent = botInfo?.bot_mode === BotMode.MultiMode;
|
||||
if (isMultiAgent) {
|
||||
// 设置初始的对话agent id
|
||||
// Set the initial conversation agent id
|
||||
updatedCurrentAgentIdWithConnectStart();
|
||||
// 获取agent节点为子bot的子bot信息,并赋值入store
|
||||
// Get the information of the sub-bot whose agent node is a child bot, and assign it to the store.
|
||||
updateBotNodeInfo(botInfo?.agents || []);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -76,7 +76,7 @@ export const transformDto2Vo = {
|
||||
model,
|
||||
prompt,
|
||||
description: data?.description || DEFAULT_AGENT_DESCRIPTION(),
|
||||
// 默认的业务状态bizInfo
|
||||
// Default business state bizInfo
|
||||
bizInfo: DEFAULT_AGENT_BIZ_INFO(),
|
||||
system_info_all: [],
|
||||
skills: {
|
||||
@@ -188,7 +188,7 @@ export const transformVo2Dto = {
|
||||
|
||||
current_version:
|
||||
targetAgent.update_type === ReferenceUpdateType.AutoUpdate
|
||||
? // 如果当前agent是自动更新,则将current_version置为"0"
|
||||
? // If the current agent is automatically updated, set the current_version to "0"
|
||||
'0'
|
||||
: targetAgent.current_version,
|
||||
};
|
||||
|
||||
@@ -60,28 +60,28 @@ export const getDefaultPageRuntimeStore = (): PageRuntime => ({
|
||||
hasUnpublishChange: false,
|
||||
});
|
||||
|
||||
// bot的编辑器状态控制
|
||||
// Editor state control for bot
|
||||
export interface PageRuntime {
|
||||
/** 初始化 **/
|
||||
/** Initialization **/
|
||||
init: boolean;
|
||||
/** 当前用户是否是bot的创建者 **/
|
||||
/** Is the current user the creator of the bot?*/
|
||||
isSelf: boolean;
|
||||
/** 是否是预览状态isPreview = typeof version !== 'undefined'; **/
|
||||
/** Is it preview status isPreview = typeof version! == 'undefined'; **/
|
||||
isPreview: boolean;
|
||||
/** 服务端透传 **/
|
||||
/** Server level passthrough **/
|
||||
editable: boolean;
|
||||
/**控制bot 历史版本展示 **/
|
||||
/**Control bot history version display **/
|
||||
historyVisible?: boolean;
|
||||
|
||||
/** 记录用户主动展开/收起bot能力模块的状态 **/
|
||||
/** Record the status of the user actively expanding/retracting the bot capability module **/
|
||||
botSkillBlockCollapsibleState: TabDisplayItems;
|
||||
/** 页面来源 **/
|
||||
/** Page Source **/
|
||||
pageFrom?: BotPageFromEnum;
|
||||
/** 保存信息 **/
|
||||
/** Save information **/
|
||||
savingInfo: SavingInfo;
|
||||
/** 划词插件id, 一个chat-area一个 **/
|
||||
/** Dashword plugin id, one chat-area one **/
|
||||
grabPluginId: string;
|
||||
/** 是否有未发布的修改, header头部展示**/
|
||||
/** Are there any unpublished changes, header display **/
|
||||
hasUnpublishChange: boolean;
|
||||
}
|
||||
|
||||
@@ -108,8 +108,8 @@ export const usePageRuntimeStore = create<PageRuntime & PageRuntimeAction>()(
|
||||
set(produce<PageRuntime>(state => update(state))),
|
||||
|
||||
/**
|
||||
* 获取用户主动展开/收起bot能力模块的状态
|
||||
* ⚠️ 仅在首次打开本人 bot 编辑页时调用
|
||||
* Get the status of the user's active expand/collapse bot capability module
|
||||
* ⚠️ Called only when opening my bot edit page for the first time
|
||||
* @see
|
||||
*/
|
||||
getBotSkillBlockCollapsibleState: async () => {
|
||||
@@ -136,8 +136,8 @@ export const usePageRuntimeStore = create<PageRuntime & PageRuntimeAction>()(
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 存储用户主动展开/收起bot能力模块的状态
|
||||
* ⚠️ 仅限主动操作时记录
|
||||
* Stores the status of the user's active expand/retract bot capability module
|
||||
* ⚠️ Only record when active
|
||||
* @see
|
||||
*/
|
||||
setBotSkillBlockCollapsibleState: (
|
||||
@@ -145,7 +145,7 @@ export const usePageRuntimeStore = create<PageRuntime & PageRuntimeAction>()(
|
||||
disableUpdateService?: boolean,
|
||||
) => {
|
||||
if (size($params) > 0) {
|
||||
// 记录到本地状态机
|
||||
// Record to local finite-state machine
|
||||
set({
|
||||
...get(),
|
||||
botSkillBlockCollapsibleState: {
|
||||
@@ -158,7 +158,7 @@ export const usePageRuntimeStore = create<PageRuntime & PageRuntimeAction>()(
|
||||
return;
|
||||
}
|
||||
|
||||
// 同步到服务端
|
||||
// Synchronize to server level
|
||||
DeveloperApi.UpdateDraftBotDisplayInfo({
|
||||
bot_id: useBotInfoStore.getState().botId,
|
||||
display_info: { tab_display_info: $params },
|
||||
|
||||
@@ -47,7 +47,7 @@ export interface RequiredBotPrompt extends BotPrompt {
|
||||
record_id?: string;
|
||||
}
|
||||
|
||||
/** Persona & Prompt 区域 */
|
||||
/** Persona & Prompted Areas */
|
||||
export interface PersonaStore {
|
||||
systemMessage: RequiredBotPrompt;
|
||||
optimizePrompt: string;
|
||||
|
||||
Reference in New Issue
Block a user