This commit is contained in:
parent
c7208f0680
commit
2ac04f9d92
|
|
@ -13,6 +13,8 @@ import { Tabs, TabsList, TabsTrigger } from "../ui/tabs"
|
|||
import { ModelIcon } from "./model-icon"
|
||||
import { ModelOption } from "./model-option"
|
||||
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
interface ModelSelectProps {
|
||||
selectedModelId: string
|
||||
onSelectModel: (modelId: LLMID) => void
|
||||
|
|
@ -22,6 +24,9 @@ export const ModelSelect: FC<ModelSelectProps> = ({
|
|||
selectedModelId,
|
||||
onSelectModel
|
||||
}) => {
|
||||
|
||||
const { t } = useTranslation()
|
||||
|
||||
const {
|
||||
profile,
|
||||
models,
|
||||
|
|
@ -97,7 +102,7 @@ export const ModelSelect: FC<ModelSelectProps> = ({
|
|||
>
|
||||
{allModels.length === 0 ? (
|
||||
<div className="rounded text-sm font-bold">
|
||||
Unlock models by entering API keys in your profile settings.
|
||||
{t("chat.unlockModelsMessage")}
|
||||
</div>
|
||||
) : (
|
||||
<Button
|
||||
|
|
@ -118,7 +123,7 @@ export const ModelSelect: FC<ModelSelectProps> = ({
|
|||
</div>
|
||||
</>
|
||||
) : (
|
||||
<div className="flex items-center">Select a model</div>
|
||||
<div className="flex items-center">{t("chat.selectModel")}</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
|
|
@ -135,9 +140,9 @@ export const ModelSelect: FC<ModelSelectProps> = ({
|
|||
<Tabs value={tab} onValueChange={(value: any) => setTab(value)}>
|
||||
{availableLocalModels.length > 0 && (
|
||||
<TabsList defaultValue="hosted" className="grid grid-cols-2">
|
||||
<TabsTrigger value="hosted">Hosted</TabsTrigger>
|
||||
<TabsTrigger value="hosted">{t("chat.hosted")}</TabsTrigger>
|
||||
|
||||
<TabsTrigger value="local">Local</TabsTrigger>
|
||||
<TabsTrigger value="local">{t("chat.local")}</TabsTrigger>
|
||||
</TabsList>
|
||||
)}
|
||||
</Tabs>
|
||||
|
|
|
|||
|
|
@ -6,11 +6,16 @@ import {
|
|||
import { IconChevronDown, IconChevronRight } from "@tabler/icons-react"
|
||||
import { FC, useState } from "react"
|
||||
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
interface AdvancedSettingsProps {
|
||||
children: React.ReactNode
|
||||
}
|
||||
|
||||
export const AdvancedSettings: FC<AdvancedSettingsProps> = ({ children }) => {
|
||||
|
||||
const { t } = useTranslation()
|
||||
|
||||
const [isOpen, setIsOpen] = useState(
|
||||
false
|
||||
// localStorage.getItem("advanced-settings-open") === "true"
|
||||
|
|
@ -25,7 +30,7 @@ export const AdvancedSettings: FC<AdvancedSettingsProps> = ({ children }) => {
|
|||
<Collapsible className="pt-2" open={isOpen} onOpenChange={handleOpenChange}>
|
||||
<CollapsibleTrigger className="hover:opacity-50">
|
||||
<div className="flex items-center font-bold">
|
||||
<div className="mr-1">Advanced Settings</div>
|
||||
<div className="mr-1">{t("chat.advancedSettings")}</div>
|
||||
{isOpen ? (
|
||||
<IconChevronDown size={20} stroke={3} />
|
||||
) : (
|
||||
|
|
|
|||
|
|
@ -39,7 +39,9 @@
|
|||
"loadingAssistant": "Loading assistant...",
|
||||
"noItemsFound": "No items found.",
|
||||
"modelLabel": "Model",
|
||||
"unlockModelsMessage": "Unlock models by entering API keys in your profile settings.",
|
||||
"promptLabel": "Prompt",
|
||||
"promptPlaceholder": "You are a friendly, helpful AI assistant.",
|
||||
"temperatureLabel": "Temperature",
|
||||
"contextLengthLabel": "Context Length",
|
||||
"includeProfileContextLabel": "Chats Include Profile Context",
|
||||
|
|
@ -49,7 +51,10 @@
|
|||
"embeddingsProviderLabel": "Embeddings Provider",
|
||||
"azureOpenAI": "Azure OpenAI",
|
||||
"openAI": "OpenAI",
|
||||
"local": "Local"
|
||||
"local": "Local",
|
||||
"selectModel": "Select a model",
|
||||
"hosted": "Hosted",
|
||||
"advancedSettings": "Advanced Settings"
|
||||
},
|
||||
|
||||
"profile": {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,9 @@
|
|||
"loadingAssistant": "アシスタントを読み込み中...",
|
||||
"noItemsFound": "アイテムが見つかりません",
|
||||
"modelLabel": "モデル",
|
||||
"unlockModelsMessage": "プロフィール設定にAPIキーを入力してモデルをアンロックします。",
|
||||
"promptLabel": "プロンプト",
|
||||
"promptPlaceholder": "あなたは親しみやすく、役立つ AI アシスタントです。",
|
||||
"temperatureLabel": "温度",
|
||||
"contextLengthLabel": "コンテキスト長",
|
||||
"includeProfileContextLabel": "チャットにプロフィールコンテキストを含める",
|
||||
|
|
@ -48,7 +50,10 @@
|
|||
"embeddingsProviderLabel": "埋め込み提供者",
|
||||
"azureOpenAI": "Azure OpenAI",
|
||||
"openAI": "OpenAI",
|
||||
"local": "ローカル"
|
||||
"local": "ローカル",
|
||||
"selectModel": "モデルを選択",
|
||||
"hosted": "ホステッド",
|
||||
"advancedSettings": "高度な設定"
|
||||
},
|
||||
|
||||
"profile": {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,9 @@
|
|||
"loadingAssistant": "正在加载助手...",
|
||||
"noItemsFound": "未找到任何项目",
|
||||
"modelLabel": "模型",
|
||||
"unlockModelsMessage": "通过在您的个人资料设置中输入 API 密钥来解锁模型。",
|
||||
"promptLabel": "提示词",
|
||||
"promptPlaceholder": "你是一个友善的、乐于助人的 AI 助手。",
|
||||
"temperatureLabel": "温度",
|
||||
"contextLengthLabel": "上下文长度",
|
||||
"includeProfileContextLabel": "聊天包含个人资料上下文",
|
||||
|
|
@ -48,7 +50,10 @@
|
|||
"embeddingsProviderLabel": "嵌入提供者",
|
||||
"azureOpenAI": "Azure OpenAI",
|
||||
"openAI": "OpenAI",
|
||||
"local": "本地"
|
||||
"local": "本地",
|
||||
"selectModel": "选择一个模型",
|
||||
"hosted": "托管的",
|
||||
"advancedSettings": "高级设置"
|
||||
},
|
||||
|
||||
"profile": {
|
||||
|
|
|
|||
Loading…
Reference in New Issue