From ee9c64a6cfbfc34e6c38283e35e3ca8b207debfa Mon Sep 17 00:00:00 2001 From: aries_ckt <916701291@qq.com> Date: Thu, 18 Jun 2026 22:24:26 +0800 Subject: [PATCH] feat:add ask_question tool --- web/locales/en/chat.ts | 2 ++ web/locales/zh/chat.ts | 2 ++ web/new-components/chat/content/QuestionDock.tsx | 12 +++++++----- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/web/locales/en/chat.ts b/web/locales/en/chat.ts index 9f4be68fe..1f21ee413 100644 --- a/web/locales/en/chat.ts +++ b/web/locales/en/chat.ts @@ -104,6 +104,8 @@ export const ChatEn = { step_type_other: 'Action', waiting_for_user: 'Waiting for User', user_confirmation: 'Needs your confirmation', + confirm: 'Confirm', + or_input_custom: 'Or enter a custom answer...', file_type_spreadsheet: 'Spreadsheet', file_type_pdf: 'PDF', file_type_image: 'Image', diff --git a/web/locales/zh/chat.ts b/web/locales/zh/chat.ts index ddcadf885..632d26e51 100644 --- a/web/locales/zh/chat.ts +++ b/web/locales/zh/chat.ts @@ -112,6 +112,8 @@ export const ChatZh: Resources['translation'] = { step_type_other: '操作', waiting_for_user: '等待用户回答', user_confirmation: '需要您的确认', + confirm: '确认', + or_input_custom: '或输入自定义答案...', file_type_spreadsheet: '电子表格', file_type_pdf: 'PDF', file_type_image: '图片', diff --git a/web/new-components/chat/content/QuestionDock.tsx b/web/new-components/chat/content/QuestionDock.tsx index 948c5c17a..7118be827 100644 --- a/web/new-components/chat/content/QuestionDock.tsx +++ b/web/new-components/chat/content/QuestionDock.tsx @@ -8,6 +8,7 @@ import { CheckOutlined, CloseOutlined, QuestionCircleFilled } from '@ant-design/icons'; import React, { useMemo, useState } from 'react'; +import { useTranslation } from 'react-i18next'; import type { QuestionInfo } from '@/utils/react-sse-parser'; @@ -24,6 +25,7 @@ interface QuestionDockProps { } const QuestionDock: React.FC = ({ request, onReply, onReject }) => { + const { t } = useTranslation(); const [selected, setSelected] = useState( () => request.questions.map(() => []), ); @@ -97,13 +99,13 @@ const QuestionDock: React.FC = ({ request, onReply, onReject - 需要您的确认 + {t('user_confirmation')} @@ -151,7 +153,7 @@ const QuestionDock: React.FC = ({ request, onReply, onReject
setCustom(qi, e.target.value)} className='w-full rounded-lg border border-slate-200 bg-white px-3 py-1.5 text-[13px] leading-4 text-slate-700 placeholder-slate-400 outline-none transition-colors focus:border-sky-400 focus:ring-1 focus:ring-sky-400/30 dark:border-white/10 dark:bg-white/5 dark:text-slate-200 dark:placeholder-slate-500 dark:focus:border-sky-500/50' @@ -168,7 +170,7 @@ const QuestionDock: React.FC = ({ request, onReply, onReject onClick={handleDismiss} className='rounded-lg px-3 py-1.5 text-[13px] text-slate-500 transition-colors hover:bg-slate-100 dark:text-slate-400 dark:hover:bg-white/5' > - 取消 + {t('cancel')}