chore: replace all cn comments of fe to en version by volc api (#320)
This commit is contained in:
@@ -111,7 +111,7 @@ export default function useRelated({
|
||||
|
||||
const isBot = relatedEntityValue?.type === IntelligenceType.Bot;
|
||||
|
||||
// 由于分页限制 选中的 botId 可能找不到对应的 option 需要额外添加
|
||||
// Due to paging restrictions, the selected botId may not find the corresponding option and needs to be added
|
||||
const extraBotOption = useExtraBotOption(
|
||||
baseRelatedEntities,
|
||||
relatedEntityValue?.id,
|
||||
|
||||
@@ -191,7 +191,7 @@ export const Bots: React.FC<BotsProps & DisableExtraOptions> = ({
|
||||
onChange?.(_value);
|
||||
};
|
||||
|
||||
// 由于分页限制 选中的 botId 可能找不到对应的 option 需要额外添加
|
||||
// Due to paging restrictions, the selected botId may not find the corresponding option and needs to be added
|
||||
const extraBotOption = useExtraBotOption(
|
||||
selectList,
|
||||
idValue,
|
||||
@@ -199,7 +199,7 @@ export const Bots: React.FC<BotsProps & DisableExtraOptions> = ({
|
||||
handleChange,
|
||||
);
|
||||
|
||||
// 接口得到的总数并非真实的总数,前端可能会拼接 options
|
||||
// The total number obtained by the interface is not the real total, and the front end may splice options.
|
||||
const listMaxHeight = useMemo(() => {
|
||||
const realTotal = extraBotOption ? searchTotal + 1 : searchTotal;
|
||||
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
||||
@@ -216,7 +216,7 @@ export const Bots: React.FC<BotsProps & DisableExtraOptions> = ({
|
||||
{ disableBot, disableProject },
|
||||
findItem?.type,
|
||||
);
|
||||
// 禁用状态下清空选中值
|
||||
// Clear the selected value when disabled
|
||||
if (value && findItem?.type && disabled) {
|
||||
onChange?.(undefined);
|
||||
}
|
||||
@@ -236,11 +236,11 @@ export const Bots: React.FC<BotsProps & DisableExtraOptions> = ({
|
||||
setIsLoading(true);
|
||||
}
|
||||
if (isReset) {
|
||||
// 如果是重新搜索,需要清空上一次的游标
|
||||
// If it is a re-search, you need to clear the previous cursor
|
||||
nextCursorRef.current = undefined;
|
||||
}
|
||||
|
||||
// project 内部使用新接口查询列表
|
||||
// Query the list using the new interface within the project
|
||||
const res = await intelligenceApi.GetDraftIntelligenceList({
|
||||
space_id:
|
||||
globalState.spaceId === PUBLIC_SPACE_ID
|
||||
@@ -313,7 +313,7 @@ export const Bots: React.FC<BotsProps & DisableExtraOptions> = ({
|
||||
itemSize: 32,
|
||||
}}
|
||||
onChange={newValue => {
|
||||
// 设置选中项类型(bot / project)
|
||||
// Set the selected item type (bot/project)
|
||||
const findItem = selectList.find(item => item.value === newValue);
|
||||
|
||||
if (useNewGlobalVariableCache && findItem?.type) {
|
||||
|
||||
@@ -69,7 +69,7 @@ export const BotProjectSelect: React.FC<BotSelectProps> = ({
|
||||
...props
|
||||
}) => {
|
||||
let value = originValue;
|
||||
// 兼容历史数据
|
||||
// Compatible with historical data
|
||||
if (typeof originValue === 'string') {
|
||||
value = {
|
||||
id: originValue,
|
||||
@@ -109,7 +109,7 @@ export const BotProjectSelect: React.FC<BotSelectProps> = ({
|
||||
(hasVariableNode || hasVariableAssignNode) &&
|
||||
!hideVariblesForce;
|
||||
|
||||
// 试运行都是临时搞了一个会话,这里把 bot 聊天历史展示可能会误导,先隐藏
|
||||
// Practice running is a temporary session, here the bot chat history display may be misleading, first hide
|
||||
const showChatHistory = false;
|
||||
// const showChatHistory =
|
||||
// botSelected && !isChatHistoryLoading && hasChatHistoryEnabledLLM;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
//后端无定义 根据 bot_info 中的 workflow_info.profile_memory 推导而来
|
||||
//Backend undefined, derived from workflow_info profile_memory in bot_info
|
||||
import { type IntelligenceType } from '@coze-arch/idl/intelligence_api';
|
||||
|
||||
export interface Variable {
|
||||
|
||||
@@ -43,12 +43,12 @@ export const useBotInfo = (botId?: string) => {
|
||||
return { isLoading, botInfo };
|
||||
};
|
||||
|
||||
// 为 wf 使用 bot 信息做数据转换
|
||||
// Data conversion using bot information for wf
|
||||
export const transformBotInfo = {
|
||||
// 模型数据
|
||||
// model data
|
||||
model: (data?: GetDraftBotInfoAgwData): ModelInfo =>
|
||||
data?.bot_info?.model_info ?? {},
|
||||
// 基本信息数据
|
||||
// Basic information data
|
||||
basicInfo: (
|
||||
botInfo?: GetDraftBotInfoAgwData,
|
||||
): IBotSelectOption | undefined => {
|
||||
@@ -62,10 +62,10 @@ export const transformBotInfo = {
|
||||
type: IntelligenceType.Bot,
|
||||
};
|
||||
},
|
||||
// 数据库信息
|
||||
// database information
|
||||
database: (botInfo?: GetDraftBotInfoAgwData): BotTable[] | undefined =>
|
||||
botInfo?.bot_info?.database_list,
|
||||
// 变量信息
|
||||
// Variable information
|
||||
variable: (botInfo?: GetDraftBotInfoAgwData) =>
|
||||
botInfo?.bot_info?.variable_list,
|
||||
};
|
||||
|
||||
@@ -28,7 +28,7 @@ export const useLTMInfo = (botId?: string) => {
|
||||
);
|
||||
|
||||
return {
|
||||
// 是否开启长期记忆
|
||||
// Is long-term memory switched on?
|
||||
ltmEnabled: timeCapsuleMode === TimeCapsuleMode.On,
|
||||
isLoading,
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@ import { type BotTable, BotTableRWMode } from '@coze-arch/bot-api/memory';
|
||||
|
||||
import { transformBotInfo, useBotInfo } from './use-bot-info';
|
||||
|
||||
// 多人模式下产品希望前端展示uuid & id 目前这两个字段会被后端过滤 先由前端补充这两个字段 后端充分评估过再移除过滤逻辑
|
||||
// In multiplayer mode, the product hopes that the front-end will display uuid & id. At present, these two fields will be filtered by the back-end. The front-end will supplement these two fields first, and the back-end will fully evaluate and then remove the filtering logic.
|
||||
function addUidAndIdToBotFieldsIfIsUnlimitedReadWriteMode(
|
||||
tableInfo: BotTable[],
|
||||
): BotTable[] {
|
||||
|
||||
Reference in New Issue
Block a user