From 6c89d31d29896c35a613ec0c8d3dd1883ecec8cc Mon Sep 17 00:00:00 2001 From: Taichiro Suzuki Date: Mon, 1 Sep 2025 13:42:05 +0900 Subject: [PATCH 1/2] fix --- packages/common/src/application/model.ts | 9 +- packages/types/src/text.d.ts | 4 +- .../web/public/locales/translation/en.yaml | 7 +- .../web/public/locales/translation/ja.yaml | 7 +- .../web/public/locales/translation/th.yaml | 1 - .../web/public/locales/translation/vi.yaml | 3 +- .../web/public/locales/translation/zh.yaml | 1 - packages/web/src/components/ButtonToggle.tsx | 24 +++++ .../web/src/components/InputChatContent.tsx | 91 +++++++++++++------ .../web/src/components/ModelParameters.tsx | 60 +++--------- packages/web/src/components/Tooltip.tsx | 7 +- packages/web/src/pages/AgentChatPage.tsx | 2 +- packages/web/src/pages/AgentCorePage.tsx | 2 +- packages/web/src/pages/ChatPage.tsx | 36 +++++++- packages/web/src/pages/FlowChatPage.tsx | 2 +- packages/web/src/pages/McpChatPage.tsx | 2 +- .../web/src/pages/RagKnowledgeBasePage.tsx | 2 +- packages/web/src/pages/RagPage.tsx | 2 +- packages/web/src/pages/VoiceChatPage.tsx | 2 +- 19 files changed, 161 insertions(+), 103 deletions(-) create mode 100644 packages/web/src/components/ButtonToggle.tsx diff --git a/packages/common/src/application/model.ts b/packages/common/src/application/model.ts index e63724924..59aec93fc 100644 --- a/packages/common/src/application/model.ts +++ b/packages/common/src/application/model.ts @@ -10,6 +10,13 @@ const MODEL_FEATURE: Record = { // Model Feature Flags TEXT_ONLY: { text: true, doc: false, image: false, video: false }, TEXT_DOC: { text: true, doc: true, image: false, video: false }, + TEXT_DOC_REASONING: { + text: true, + doc: true, + image: false, + video: false, + reasoning: true, + }, TEXT_DOC_IMAGE: { text: true, doc: true, image: true, video: false }, TEXT_DOC_IMAGE_REASONING: { text: true, @@ -375,7 +382,7 @@ export const modelMetadata: Record = { }, // DeepSeek 'us.deepseek.r1-v1:0': { - flags: MODEL_FEATURE.TEXT_DOC, + flags: MODEL_FEATURE.TEXT_DOC_REASONING, displayName: 'DeepSeek-R1', }, // Writer diff --git a/packages/types/src/text.d.ts b/packages/types/src/text.d.ts index 7737872d5..70d9a1827 100644 --- a/packages/types/src/text.d.ts +++ b/packages/types/src/text.d.ts @@ -20,9 +20,9 @@ export type UsecaseConverseInferenceParams = { }; export type AdditionalModelRequestFields = { - reasoningConfig?: { + reasoningConfig: { type: 'enabled' | 'disabled'; - budgetTokens?: number; + budgetTokens: number; }; }; diff --git a/packages/web/public/locales/translation/en.yaml b/packages/web/public/locales/translation/en.yaml index 13179521f..2c8e06687 100644 --- a/packages/web/public/locales/translation/en.yaml +++ b/packages/web/public/locales/translation/en.yaml @@ -447,6 +447,10 @@ generateText: result_placeholder: Generated text will be displayed here source_info: Source information for text title: Text Generation +inputs: + attachment: Attachment + reasoning: Extended thinking + setting: Setting landing: alert: description: >- @@ -719,8 +723,7 @@ meetingMinutes: transcript: Transcript model: parameters: - reasoning: Reasoning - reasoning_budget: Reasoning Budget + reasoning_budget: Token budget for extended thinking navigation: agentChat: Agent Chat chat: Chat diff --git a/packages/web/public/locales/translation/ja.yaml b/packages/web/public/locales/translation/ja.yaml index 63203da20..2c05eeb23 100644 --- a/packages/web/public/locales/translation/ja.yaml +++ b/packages/web/public/locales/translation/ja.yaml @@ -357,6 +357,10 @@ generateText: result_placeholder: 生成された文章がここに表示されます source_info: 文章の元になる情報 title: 文章生成 +inputs: + attachment: 添付ファイル + reasoning: 深く考える + setting: 設定 landing: alert: description: >- @@ -576,8 +580,7 @@ meetingMinutes: transcript: 文字起こし model: parameters: - reasoning: Reasoning - reasoning_budget: Reasoning Budget + reasoning_budget: 深く考えるトークン数上限 navigation: agentChat: Agent チャット chat: チャット diff --git a/packages/web/public/locales/translation/th.yaml b/packages/web/public/locales/translation/th.yaml index 91df40ea6..8c17fc491 100644 --- a/packages/web/public/locales/translation/th.yaml +++ b/packages/web/public/locales/translation/th.yaml @@ -606,7 +606,6 @@ meetingMinutes: transcript: บันทึกการถอดความ model: parameters: - reasoning: การให้เหตุผล reasoning_budget: งบประมาณการให้เหตุผล navigation: agentChat: Agent Chat diff --git a/packages/web/public/locales/translation/vi.yaml b/packages/web/public/locales/translation/vi.yaml index 17fa536f8..ca77b7130 100644 --- a/packages/web/public/locales/translation/vi.yaml +++ b/packages/web/public/locales/translation/vi.yaml @@ -590,8 +590,7 @@ meetingMinutes: transcript: Bản chuyển đổi model: parameters: - reasoning: Reasoning - reasoning_budget: Reasoning Budget + reasoning_budget: Token budget for extended thinking navigation: agentChat: Agent Chat chat: Chat diff --git a/packages/web/public/locales/translation/zh.yaml b/packages/web/public/locales/translation/zh.yaml index 0f8bee7ad..ae39ed5bd 100644 --- a/packages/web/public/locales/translation/zh.yaml +++ b/packages/web/public/locales/translation/zh.yaml @@ -494,7 +494,6 @@ meetingMinutes: transcript: 转录文本 model: parameters: - reasoning: 推理 reasoning_budget: 推理预算 navigation: agentChat: Agent聊天 diff --git a/packages/web/src/components/ButtonToggle.tsx b/packages/web/src/components/ButtonToggle.tsx new file mode 100644 index 000000000..5b1f66b18 --- /dev/null +++ b/packages/web/src/components/ButtonToggle.tsx @@ -0,0 +1,24 @@ +import React from 'react'; +import { BaseProps } from '../@types/common'; + +type Props = BaseProps & { + onSwitch: () => void; + icon: React.ReactNode; + isEnabled: boolean; +}; + +const ButtonToggle: React.FC = (props) => { + return ( + + ); +}; + +export default ButtonToggle; diff --git a/packages/web/src/components/InputChatContent.tsx b/packages/web/src/components/InputChatContent.tsx index 4f6a34fa3..c42e53189 100644 --- a/packages/web/src/components/InputChatContent.tsx +++ b/packages/web/src/components/InputChatContent.tsx @@ -1,5 +1,6 @@ import React, { useCallback, useEffect, useMemo } from 'react'; import ButtonSend from './ButtonSend'; +import ButtonToggle from './ButtonToggle'; import Textarea from './Textarea'; import ZoomUpImage from './ZoomUpImage'; import ZoomUpVideo from './ZoomUpVideo'; @@ -11,12 +12,14 @@ import { PiPaperclip, PiSpinnerGap, PiSlidersHorizontal, + PiClockCountdownLight, } from 'react-icons/pi'; import useFiles from '../hooks/useFiles'; import FileCard from './FileCard'; import { FileLimit } from 'generative-ai-use-cases'; import { useTranslation } from 'react-i18next'; import useUserSetting from '../hooks/useUserSetting'; +import Tooltip from './Tooltip'; type Props = { content: string; @@ -35,6 +38,9 @@ type Props = { fileLimit?: FileLimit; accept?: string[]; canStop?: boolean; + reasoning?: boolean; + onReasoningSwitched?: () => void; + reasoningEnabled?: boolean; } & ( | { hideReset?: false; @@ -123,7 +129,7 @@ const InputChatContent: React.FC = (props) => {

)}
= (props) => { }`}>
{props.fileUpload && uploadedFiles.length > 0 && ( -
+
{uploadedFiles.map((uploadedFile, idx) => { if (uploadedFile.type === 'image') { return ( @@ -190,7 +196,7 @@ const InputChatContent: React.FC = (props) => {
)}