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