This commit is contained in:
hailin 2025-04-21 09:50:01 +08:00
parent 3727af3d1c
commit 4817e75d1f
4 changed files with 91 additions and 45 deletions

View File

@ -3,10 +3,14 @@ import { ChatbotUIContext } from "@/context/context"
import { IconInfoCircle, IconMessagePlus } from "@tabler/icons-react" import { IconInfoCircle, IconMessagePlus } from "@tabler/icons-react"
import { FC, useContext } from "react" import { FC, useContext } from "react"
import { WithTooltip } from "../ui/with-tooltip" import { WithTooltip } from "../ui/with-tooltip"
import { useTranslation } from 'react-i18next'
interface ChatSecondaryButtonsProps {} interface ChatSecondaryButtonsProps {}
export const ChatSecondaryButtons: FC<ChatSecondaryButtonsProps> = ({}) => { export const ChatSecondaryButtons: FC<ChatSecondaryButtonsProps> = ({}) => {
const { t } = useTranslation()
const { selectedChat } = useContext(ChatbotUIContext) const { selectedChat } = useContext(ChatbotUIContext)
const { handleNewChat } = useChatHandler() const { handleNewChat } = useChatHandler()
@ -19,31 +23,31 @@ export const ChatSecondaryButtons: FC<ChatSecondaryButtonsProps> = ({}) => {
delayDuration={200} delayDuration={200}
display={ display={
<div> <div>
<div className="text-xl font-bold">Chat Info</div> <div className="text-xl font-bold">{t("chatInfo.title")}</div>
<div className="mx-auto mt-2 max-w-xs space-y-2 sm:max-w-sm md:max-w-md lg:max-w-lg"> <div className="mx-auto mt-2 max-w-xs space-y-2 sm:max-w-sm md:max-w-md lg:max-w-lg">
<div>Model: {selectedChat.model}</div> <div>{t("chatInfo.model")}: {selectedChat.model}</div>
<div>Prompt: {selectedChat.prompt}</div> <div>{t("chatInfo.prompt")}: {selectedChat.prompt}</div>
<div>Temperature: {selectedChat.temperature}</div> <div>{t("chatInfo.temperature")}: {selectedChat.temperature}</div>
<div>Context Length: {selectedChat.context_length}</div> <div>{t("chatInfo.contextLength")}: {selectedChat.context_length}</div>
<div> <div>
Profile Context:{" "} {t("chatInfo.profileContext")}:{" "}
{selectedChat.include_profile_context {selectedChat.include_profile_context
? "Enabled" ? t("chatInfo.enabled")
: "Disabled"} : t("chatInfo.disabled")}
</div> </div>
<div> <div>
{" "} {" "}
Workspace Instructions:{" "} {t("chatInfo.workspaceInstructions")}:{" "}
{selectedChat.include_workspace_instructions {selectedChat.include_workspace_instructions
? "Enabled" ? t("chatInfo.enabled")
: "Disabled"} : t("chatInfo.disabled")}
</div> </div>
<div> <div>
Embeddings Provider: {selectedChat.embeddings_provider} {t("chatInfo.embeddingsProvider")}: {selectedChat.embeddings_provider}
</div> </div>
</div> </div>
</div> </div>
@ -60,7 +64,7 @@ export const ChatSecondaryButtons: FC<ChatSecondaryButtonsProps> = ({}) => {
<WithTooltip <WithTooltip
delayDuration={200} delayDuration={200}
display={<div>Start a new chat</div>} display={<div>{t("chat.startNewChat")}</div>}
trigger={ trigger={
<div className="mt-1"> <div className="mt-1">
<IconMessagePlus <IconMessagePlus

View File

@ -230,21 +230,35 @@
}, },
"help": { "help": {
"showHelp": "Show Help", "showHelp": "Show Help",
"showWorkspaces": "Show Workspaces", "showWorkspaces": "Show Workspaces",
"newChat": "New Chat", "newChat": "New Chat",
"focusChat": "Focus Chat", "focusChat": "Focus Chat",
"toggleFiles": "Toggle Files", "toggleFiles": "Toggle Files",
"toggleRetrieval": "Toggle Retrieval", "toggleRetrieval": "Toggle Retrieval",
"openSettings": "Open Settings", "openSettings": "Open Settings",
"openQuickSettings": "Open Quick Settings", "openQuickSettings": "Open Quick Settings",
"toggleSidebar": "Toggle Sidebar", "toggleSidebar": "Toggle Sidebar",
"updates": "Updates", "updates": "Updates",
"markAsRead": "Mark as Read", "markAsRead": "Mark as Read",
"markAllAsRead": "Mark All as Read", "markAllAsRead": "Mark All as Read",
"demo": "Demo", "demo": "Demo",
"youAreAllCaughtUp": "You are all caught up!", "youAreAllCaughtUp": "You are all caught up!",
"showRecentUpdates": "Show recent updates" "showRecentUpdates": "Show recent updates"
} },
"chatInfo": {
"title": "Chat Info",
"model": "Model",
"prompt": "Prompt",
"temperature": "Temperature",
"contextLength": "Context Length",
"profileContext": "Profile Context",
"workspaceInstructions": "Workspace Instructions",
"embeddingsProvider": "Embeddings Provider",
"enabled": "Enabled",
"disabled": "Disabled",
"startNewChat": "Start a new chat"
}
} }

View File

@ -244,6 +244,20 @@
"demo": "デモ", "demo": "デモ",
"youAreAllCaughtUp": "すべて確認済みです!", "youAreAllCaughtUp": "すべて確認済みです!",
"showRecentUpdates": "最近の更新を表示" "showRecentUpdates": "最近の更新を表示"
},
"chatInfo": {
"title": "チャット情報",
"model": "モデル",
"prompt": "プロンプト",
"temperature": "温度",
"contextLength": "コンテキスト長",
"profileContext": "プロフィールコンテキスト",
"workspaceInstructions": "ワークスペース指示",
"embeddingsProvider": "ベクトルプロバイダ",
"enabled": "有効",
"disabled": "無効",
"startNewChat": "新しいチャットを開始"
} }
} }

View File

@ -229,21 +229,35 @@
}, },
"help": { "help": {
"showHelp": "显示帮助", "showHelp": "显示帮助",
"showWorkspaces": "显示工作区", "showWorkspaces": "显示工作区",
"newChat": "新建对话", "newChat": "新建对话",
"focusChat": "聚焦当前对话", "focusChat": "聚焦当前对话",
"toggleFiles": "切换文件面板", "toggleFiles": "切换文件面板",
"toggleRetrieval": "切换检索模式", "toggleRetrieval": "切换检索模式",
"openSettings": "打开设置", "openSettings": "打开设置",
"openQuickSettings": "快速设置", "openQuickSettings": "快速设置",
"toggleSidebar": "切换侧边栏", "toggleSidebar": "切换侧边栏",
"updates": "更新", "updates": "更新",
"markAsRead": "标记为已读", "markAsRead": "标记为已读",
"markAllAsRead": "全部标记为已读", "markAllAsRead": "全部标记为已读",
"demo": "演示", "demo": "演示",
"youAreAllCaughtUp": "你已阅读所有内容!", "youAreAllCaughtUp": "你已阅读所有内容!",
"showRecentUpdates": "显示最近更新" "showRecentUpdates": "显示最近更新"
} },
"chatInfo": {
"title": "对话信息",
"model": "模型",
"prompt": "提示词",
"temperature": "温度系数",
"contextLength": "上下文长度",
"profileContext": "用户上下文",
"workspaceInstructions": "工作区说明",
"embeddingsProvider": "向量引擎提供方",
"enabled": "启用",
"disabled": "禁用",
"startNewChat": "开始新的对话"
}
} }