mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-03 02:59:07 +08:00
feat(agent): add tooltip for model selection and improve i18n (#11738)
* refactor(settings): rename actions prop to contentAfter for clarity The prop name 'actions' was misleading as it could imply functionality rather than layout. 'contentAfter' better describes its purpose of displaying content after the title. * feat(agent): add tooltip for model selection in agent settings Add tooltip to explain that only Anthropic endpoint models are supported for agents * feat(i18n): add model tooltip and translate upload strings Add tooltip message about Anthropic endpoint model requirement for Agent feature Translate previously untranslated upload-related strings in multiple languages
This commit is contained in:
parent
516b8479d6
commit
bba7ecae6e
@ -1,5 +1,6 @@
|
|||||||
import { loggerService } from '@logger'
|
import { loggerService } from '@logger'
|
||||||
import { ErrorBoundary } from '@renderer/components/ErrorBoundary'
|
import { ErrorBoundary } from '@renderer/components/ErrorBoundary'
|
||||||
|
import { HelpTooltip } from '@renderer/components/TooltipIcons'
|
||||||
import { TopView } from '@renderer/components/TopView'
|
import { TopView } from '@renderer/components/TopView'
|
||||||
import { permissionModeCards } from '@renderer/config/agent'
|
import { permissionModeCards } from '@renderer/config/agent'
|
||||||
import { useAgents } from '@renderer/hooks/agents/useAgents'
|
import { useAgents } from '@renderer/hooks/agents/useAgents'
|
||||||
@ -340,9 +341,12 @@ const PopupContainer: React.FC<Props> = ({ agent, afterSubmit, resolve }) => {
|
|||||||
</FormRow>
|
</FormRow>
|
||||||
|
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<Label>
|
<div className="flex items-center gap-2">
|
||||||
{t('common.model')} <RequiredMark>*</RequiredMark>
|
<Label>
|
||||||
</Label>
|
{t('common.model')} <RequiredMark>*</RequiredMark>
|
||||||
|
</Label>
|
||||||
|
<HelpTooltip title={t('agent.add.model.tooltip')} />
|
||||||
|
</div>
|
||||||
<SelectAgentBaseModelButton
|
<SelectAgentBaseModelButton
|
||||||
agentBase={tempAgentBase}
|
agentBase={tempAgentBase}
|
||||||
onSelect={handleModelSelect}
|
onSelect={handleModelSelect}
|
||||||
|
|||||||
@ -6,6 +6,9 @@
|
|||||||
"failed": "Failed to add a agent",
|
"failed": "Failed to add a agent",
|
||||||
"invalid_agent": "Invalid Agent"
|
"invalid_agent": "Invalid Agent"
|
||||||
},
|
},
|
||||||
|
"model": {
|
||||||
|
"tooltip": "Currently, only models that support Anthropic endpoints are available for the Agent feature."
|
||||||
|
},
|
||||||
"title": "Add Agent",
|
"title": "Add Agent",
|
||||||
"type": {
|
"type": {
|
||||||
"placeholder": "Select an agent type"
|
"placeholder": "Select an agent type"
|
||||||
|
|||||||
@ -6,6 +6,9 @@
|
|||||||
"failed": "添加 Agent 失败",
|
"failed": "添加 Agent 失败",
|
||||||
"invalid_agent": "无效的 Agent"
|
"invalid_agent": "无效的 Agent"
|
||||||
},
|
},
|
||||||
|
"model": {
|
||||||
|
"tooltip": "目前,只有支持 Anthropic 端点的模型可用于 Agent 功能。"
|
||||||
|
},
|
||||||
"title": "添加 Agent",
|
"title": "添加 Agent",
|
||||||
"type": {
|
"type": {
|
||||||
"placeholder": "选择 Agent 类型"
|
"placeholder": "选择 Agent 类型"
|
||||||
|
|||||||
@ -6,6 +6,9 @@
|
|||||||
"failed": "無法新增代理人",
|
"failed": "無法新增代理人",
|
||||||
"invalid_agent": "無效的 Agent"
|
"invalid_agent": "無效的 Agent"
|
||||||
},
|
},
|
||||||
|
"model": {
|
||||||
|
"tooltip": "目前,僅支援 Anthropic 端點的模型可供代理功能使用。"
|
||||||
|
},
|
||||||
"title": "新增代理",
|
"title": "新增代理",
|
||||||
"type": {
|
"type": {
|
||||||
"placeholder": "選擇 Agent 類型"
|
"placeholder": "選擇 Agent 類型"
|
||||||
@ -2220,8 +2223,8 @@
|
|||||||
"untitled_folder": "新資料夾",
|
"untitled_folder": "新資料夾",
|
||||||
"untitled_note": "無標題筆記",
|
"untitled_note": "無標題筆記",
|
||||||
"upload_failed": "筆記上傳失敗",
|
"upload_failed": "筆記上傳失敗",
|
||||||
"upload_files": "[to be translated]:Upload Files",
|
"upload_files": "上傳檔案",
|
||||||
"upload_folder": "[to be translated]:Upload Folder",
|
"upload_folder": "上傳資料夾",
|
||||||
"upload_success": "筆記上傳成功",
|
"upload_success": "筆記上傳成功",
|
||||||
"uploading_files": "正在上傳 {{count}} 個檔案..."
|
"uploading_files": "正在上傳 {{count}} 個檔案..."
|
||||||
},
|
},
|
||||||
|
|||||||
@ -6,6 +6,9 @@
|
|||||||
"failed": "Agent hinzufügen fehlgeschlagen",
|
"failed": "Agent hinzufügen fehlgeschlagen",
|
||||||
"invalid_agent": "Ungültiger Agent"
|
"invalid_agent": "Ungültiger Agent"
|
||||||
},
|
},
|
||||||
|
"model": {
|
||||||
|
"tooltip": "Derzeit sind für die Agent-Funktion nur Modelle verfügbar, die Anthropic-Endpunkte unterstützen."
|
||||||
|
},
|
||||||
"title": "Agent hinzufügen",
|
"title": "Agent hinzufügen",
|
||||||
"type": {
|
"type": {
|
||||||
"placeholder": "Agent-Typ auswählen"
|
"placeholder": "Agent-Typ auswählen"
|
||||||
@ -2220,10 +2223,10 @@
|
|||||||
"untitled_folder": "Neuer Ordner",
|
"untitled_folder": "Neuer Ordner",
|
||||||
"untitled_note": "Unbenannte Notiz",
|
"untitled_note": "Unbenannte Notiz",
|
||||||
"upload_failed": "Notizen-Upload fehlgeschlagen",
|
"upload_failed": "Notizen-Upload fehlgeschlagen",
|
||||||
"upload_files": "[to be translated]:Upload Files",
|
"upload_files": "Dateien hochladen",
|
||||||
"upload_folder": "[to be translated]:Upload Folder",
|
"upload_folder": "Ordner hochladen",
|
||||||
"upload_success": "Notizen erfolgreich hochgeladen",
|
"upload_success": "Notizen erfolgreich hochgeladen",
|
||||||
"uploading_files": "[to be translated]:Uploading {{count}} files..."
|
"uploading_files": "Lade {{count}} Dateien hoch..."
|
||||||
},
|
},
|
||||||
"notification": {
|
"notification": {
|
||||||
"assistant": "Assistenten-Antwort",
|
"assistant": "Assistenten-Antwort",
|
||||||
|
|||||||
@ -6,6 +6,9 @@
|
|||||||
"failed": "Αποτυχία προσθήκης πράκτορα",
|
"failed": "Αποτυχία προσθήκης πράκτορα",
|
||||||
"invalid_agent": "Μη έγκυρος Agent"
|
"invalid_agent": "Μη έγκυρος Agent"
|
||||||
},
|
},
|
||||||
|
"model": {
|
||||||
|
"tooltip": "Προς το παρόν, μόνο μοντέλα που υποστηρίζουν τελικά σημεία Anthropic είναι διαθέσιμα για τη λειτουργία Agent."
|
||||||
|
},
|
||||||
"title": "Προσθήκη Agent",
|
"title": "Προσθήκη Agent",
|
||||||
"type": {
|
"type": {
|
||||||
"placeholder": "Επιλέξτε τύπο Agent"
|
"placeholder": "Επιλέξτε τύπο Agent"
|
||||||
@ -2220,10 +2223,10 @@
|
|||||||
"untitled_folder": "Νέος φάκελος",
|
"untitled_folder": "Νέος φάκελος",
|
||||||
"untitled_note": "σημείωση χωρίς τίτλο",
|
"untitled_note": "σημείωση χωρίς τίτλο",
|
||||||
"upload_failed": "Η σημείωση δεν ανέβηκε",
|
"upload_failed": "Η σημείωση δεν ανέβηκε",
|
||||||
"upload_files": "[to be translated]:Upload Files",
|
"upload_files": "Ανέβασμα Αρχείων",
|
||||||
"upload_folder": "[to be translated]:Upload Folder",
|
"upload_folder": "Ανέβασμα Φακέλου",
|
||||||
"upload_success": "Οι σημειώσεις μεταφορτώθηκαν με επιτυχία",
|
"upload_success": "Οι σημειώσεις μεταφορτώθηκαν με επιτυχία",
|
||||||
"uploading_files": "[to be translated]:Uploading {{count}} files..."
|
"uploading_files": "Ανεβάζονται {{count}} αρχεία..."
|
||||||
},
|
},
|
||||||
"notification": {
|
"notification": {
|
||||||
"assistant": "Απάντηση Βοηθού",
|
"assistant": "Απάντηση Βοηθού",
|
||||||
|
|||||||
@ -6,6 +6,9 @@
|
|||||||
"failed": "Error al añadir agente",
|
"failed": "Error al añadir agente",
|
||||||
"invalid_agent": "Agent inválido"
|
"invalid_agent": "Agent inválido"
|
||||||
},
|
},
|
||||||
|
"model": {
|
||||||
|
"tooltip": "Actualmente, solo los modelos que admiten puntos finales de Anthropic están disponibles para la función Agente."
|
||||||
|
},
|
||||||
"title": "Agregar Agente",
|
"title": "Agregar Agente",
|
||||||
"type": {
|
"type": {
|
||||||
"placeholder": "Seleccionar tipo de Agente"
|
"placeholder": "Seleccionar tipo de Agente"
|
||||||
@ -2220,10 +2223,10 @@
|
|||||||
"untitled_folder": "Nueva carpeta",
|
"untitled_folder": "Nueva carpeta",
|
||||||
"untitled_note": "Nota sin título",
|
"untitled_note": "Nota sin título",
|
||||||
"upload_failed": "Error al cargar la nota",
|
"upload_failed": "Error al cargar la nota",
|
||||||
"upload_files": "[to be translated]:Upload Files",
|
"upload_files": "Subir archivos",
|
||||||
"upload_folder": "[to be translated]:Upload Folder",
|
"upload_folder": "Carpeta de subida",
|
||||||
"upload_success": "Nota cargada con éxito",
|
"upload_success": "Nota cargada con éxito",
|
||||||
"uploading_files": "[to be translated]:Uploading {{count}} files..."
|
"uploading_files": "Subiendo {{count}} archivos..."
|
||||||
},
|
},
|
||||||
"notification": {
|
"notification": {
|
||||||
"assistant": "Respuesta del asistente",
|
"assistant": "Respuesta del asistente",
|
||||||
|
|||||||
@ -6,6 +6,9 @@
|
|||||||
"failed": "Échec de l'ajout de l'agent",
|
"failed": "Échec de l'ajout de l'agent",
|
||||||
"invalid_agent": "Agent invalide"
|
"invalid_agent": "Agent invalide"
|
||||||
},
|
},
|
||||||
|
"model": {
|
||||||
|
"tooltip": "Actuellement, seuls les modèles qui prennent en charge les points de terminaison Anthropic sont disponibles pour la fonctionnalité Agent."
|
||||||
|
},
|
||||||
"title": "Ajouter un agent",
|
"title": "Ajouter un agent",
|
||||||
"type": {
|
"type": {
|
||||||
"placeholder": "Sélectionner le type d'Agent"
|
"placeholder": "Sélectionner le type d'Agent"
|
||||||
@ -2220,10 +2223,10 @@
|
|||||||
"untitled_folder": "nouveau dossier",
|
"untitled_folder": "nouveau dossier",
|
||||||
"untitled_note": "Note sans titre",
|
"untitled_note": "Note sans titre",
|
||||||
"upload_failed": "Échec du téléchargement de la note",
|
"upload_failed": "Échec du téléchargement de la note",
|
||||||
"upload_files": "[to be translated]:Upload Files",
|
"upload_files": "Télécharger des fichiers",
|
||||||
"upload_folder": "[to be translated]:Upload Folder",
|
"upload_folder": "Puis dossier de téléchargement",
|
||||||
"upload_success": "Note téléchargée avec succès",
|
"upload_success": "Note téléchargée avec succès",
|
||||||
"uploading_files": "[to be translated]:Uploading {{count}} files..."
|
"uploading_files": "Téléchargement de {{count}} fichiers..."
|
||||||
},
|
},
|
||||||
"notification": {
|
"notification": {
|
||||||
"assistant": "Réponse de l'assistant",
|
"assistant": "Réponse de l'assistant",
|
||||||
|
|||||||
@ -6,6 +6,9 @@
|
|||||||
"failed": "エージェントの追加に失敗しました",
|
"failed": "エージェントの追加に失敗しました",
|
||||||
"invalid_agent": "無効なエージェント"
|
"invalid_agent": "無効なエージェント"
|
||||||
},
|
},
|
||||||
|
"model": {
|
||||||
|
"tooltip": "現在、エージェント機能では、Anthropicエンドポイントをサポートするモデルのみが利用可能です。"
|
||||||
|
},
|
||||||
"title": "エージェントを追加",
|
"title": "エージェントを追加",
|
||||||
"type": {
|
"type": {
|
||||||
"placeholder": "エージェントタイプを選択"
|
"placeholder": "エージェントタイプを選択"
|
||||||
@ -2220,10 +2223,10 @@
|
|||||||
"untitled_folder": "新ファイル夹",
|
"untitled_folder": "新ファイル夹",
|
||||||
"untitled_note": "無題のメモ",
|
"untitled_note": "無題のメモ",
|
||||||
"upload_failed": "ノートのアップロードに失敗しました",
|
"upload_failed": "ノートのアップロードに失敗しました",
|
||||||
"upload_files": "[to be translated]:Upload Files",
|
"upload_files": "ファイルをアップロード",
|
||||||
"upload_folder": "[to be translated]:Upload Folder",
|
"upload_folder": "アップロードフォルダ",
|
||||||
"upload_success": "ノートのアップロードが成功しました",
|
"upload_success": "ノートのアップロードが成功しました",
|
||||||
"uploading_files": "[to be translated]:Uploading {{count}} files..."
|
"uploading_files": "{{count}} 個のファイルをアップロード中..."
|
||||||
},
|
},
|
||||||
"notification": {
|
"notification": {
|
||||||
"assistant": "助手回應",
|
"assistant": "助手回應",
|
||||||
|
|||||||
@ -6,6 +6,9 @@
|
|||||||
"failed": "Falha ao adicionar agente",
|
"failed": "Falha ao adicionar agente",
|
||||||
"invalid_agent": "Agent inválido"
|
"invalid_agent": "Agent inválido"
|
||||||
},
|
},
|
||||||
|
"model": {
|
||||||
|
"tooltip": "Atualmente, apenas modelos que suportam endpoints da Anthropic estão disponíveis para o recurso Agente."
|
||||||
|
},
|
||||||
"title": "Adicionar Agente",
|
"title": "Adicionar Agente",
|
||||||
"type": {
|
"type": {
|
||||||
"placeholder": "Selecionar tipo de Agente"
|
"placeholder": "Selecionar tipo de Agente"
|
||||||
@ -2220,10 +2223,10 @@
|
|||||||
"untitled_folder": "Nova pasta",
|
"untitled_folder": "Nova pasta",
|
||||||
"untitled_note": "Nota sem título",
|
"untitled_note": "Nota sem título",
|
||||||
"upload_failed": "Falha ao carregar a nota",
|
"upload_failed": "Falha ao carregar a nota",
|
||||||
"upload_files": "[to be translated]:Upload Files",
|
"upload_files": "Carregar Ficheiros",
|
||||||
"upload_folder": "[to be translated]:Upload Folder",
|
"upload_folder": "Carregar Pasta",
|
||||||
"upload_success": "Nota carregada com sucesso",
|
"upload_success": "Nota carregada com sucesso",
|
||||||
"uploading_files": "[to be translated]:Uploading {{count}} files..."
|
"uploading_files": "A enviar {{count}} ficheiros..."
|
||||||
},
|
},
|
||||||
"notification": {
|
"notification": {
|
||||||
"assistant": "Resposta do assistente",
|
"assistant": "Resposta do assistente",
|
||||||
|
|||||||
@ -6,6 +6,9 @@
|
|||||||
"failed": "Не удалось добавить агента",
|
"failed": "Не удалось добавить агента",
|
||||||
"invalid_agent": "Недействительный агент"
|
"invalid_agent": "Недействительный агент"
|
||||||
},
|
},
|
||||||
|
"model": {
|
||||||
|
"tooltip": "В настоящее время для функции агента доступны только модели, поддерживающие конечные точки Anthropic."
|
||||||
|
},
|
||||||
"title": "Добавить агента",
|
"title": "Добавить агента",
|
||||||
"type": {
|
"type": {
|
||||||
"placeholder": "Выбор типа агента"
|
"placeholder": "Выбор типа агента"
|
||||||
@ -2220,10 +2223,10 @@
|
|||||||
"untitled_folder": "Новая папка",
|
"untitled_folder": "Новая папка",
|
||||||
"untitled_note": "Незаглавленная заметка",
|
"untitled_note": "Незаглавленная заметка",
|
||||||
"upload_failed": "Не удалось загрузить заметку",
|
"upload_failed": "Не удалось загрузить заметку",
|
||||||
"upload_files": "[to be translated]:Upload Files",
|
"upload_files": "Загрузить файлы",
|
||||||
"upload_folder": "[to be translated]:Upload Folder",
|
"upload_folder": "Загрузить папку",
|
||||||
"upload_success": "Заметка успешно загружена",
|
"upload_success": "Заметка успешно загружена",
|
||||||
"uploading_files": "[to be translated]:Uploading {{count}} files..."
|
"uploading_files": "Загрузка {{count}} файлов..."
|
||||||
},
|
},
|
||||||
"notification": {
|
"notification": {
|
||||||
"assistant": "Ответ ассистента",
|
"assistant": "Ответ ассистента",
|
||||||
|
|||||||
@ -64,7 +64,7 @@ export const AccessibleDirsSetting = ({ base, update }: AccessibleDirsSettingPro
|
|||||||
return (
|
return (
|
||||||
<SettingsItem>
|
<SettingsItem>
|
||||||
<SettingsTitle
|
<SettingsTitle
|
||||||
actions={
|
contentAfter={
|
||||||
<Tooltip title={t('agent.session.accessible_paths.add')}>
|
<Tooltip title={t('agent.session.accessible_paths.add')}>
|
||||||
<Button type="text" icon={<Plus size={16} />} shape="circle" onClick={addAccessiblePath} />
|
<Button type="text" icon={<Plus size={16} />} shape="circle" onClick={addAccessiblePath} />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|||||||
@ -69,7 +69,7 @@ export const AdvancedSettings: React.FC<AdvancedSettingsProps> = ({ agentBase, u
|
|||||||
<SettingsContainer>
|
<SettingsContainer>
|
||||||
<SettingsItem divider={false}>
|
<SettingsItem divider={false}>
|
||||||
<SettingsTitle
|
<SettingsTitle
|
||||||
actions={
|
contentAfter={
|
||||||
<Tooltip title={t('agent.settings.advance.maxTurns.description')} placement="left">
|
<Tooltip title={t('agent.settings.advance.maxTurns.description')} placement="left">
|
||||||
<Info size={16} className="text-foreground-400" />
|
<Info size={16} className="text-foreground-400" />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import { HelpTooltip } from '@renderer/components/TooltipIcons'
|
||||||
import SelectAgentBaseModelButton from '@renderer/pages/home/components/SelectAgentBaseModelButton'
|
import SelectAgentBaseModelButton from '@renderer/pages/home/components/SelectAgentBaseModelButton'
|
||||||
import type { AgentBaseWithId, ApiModel, UpdateAgentFunctionUnion } from '@renderer/types'
|
import type { AgentBaseWithId, ApiModel, UpdateAgentFunctionUnion } from '@renderer/types'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
@ -22,7 +23,9 @@ export const ModelSetting = ({ base, update, isDisabled }: ModelSettingProps) =>
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<SettingsItem inline>
|
<SettingsItem inline>
|
||||||
<SettingsTitle id="model">{t('common.model')}</SettingsTitle>
|
<SettingsTitle id="model" contentAfter={<HelpTooltip title={t('agent.add.model.tooltip')} />}>
|
||||||
|
{t('common.model')}
|
||||||
|
</SettingsTitle>
|
||||||
<SelectAgentBaseModelButton
|
<SelectAgentBaseModelButton
|
||||||
agentBase={base}
|
agentBase={base}
|
||||||
onSelect={async (model) => {
|
onSelect={async (model) => {
|
||||||
|
|||||||
@ -10,14 +10,14 @@ import styled from 'styled-components'
|
|||||||
import { SettingDivider } from '..'
|
import { SettingDivider } from '..'
|
||||||
|
|
||||||
export interface SettingsTitleProps extends React.ComponentPropsWithRef<'div'> {
|
export interface SettingsTitleProps extends React.ComponentPropsWithRef<'div'> {
|
||||||
actions?: ReactNode
|
contentAfter?: ReactNode
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SettingsTitle: React.FC<SettingsTitleProps> = ({ children, actions }) => {
|
export const SettingsTitle: React.FC<SettingsTitleProps> = ({ children, contentAfter }) => {
|
||||||
return (
|
return (
|
||||||
<div className={cn(actions ? 'justify-between' : undefined, 'mb-1 flex items-center gap-2')}>
|
<div className={cn(contentAfter ? 'justify-between' : undefined, 'mb-1 flex items-center gap-2')}>
|
||||||
<span className="flex items-center gap-1 font-bold">{children}</span>
|
<span className="flex items-center gap-1 font-bold">{children}</span>
|
||||||
{actions !== undefined && actions}
|
{contentAfter !== undefined && contentAfter}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user