This commit is contained in:
hailin 2025-04-18 22:37:06 +08:00
parent 431584fa4f
commit 900bbe8fea
4 changed files with 197 additions and 47 deletions

View File

@ -467,15 +467,15 @@ export const ProfileSettings: FC<ProfileSettingsProps> = ({}) => {
onClick={() => setUseAzureOpenai(!useAzureOpenai)}
>
{useAzureOpenai
? "Switch To Standard OpenAI"
: "Switch To Azure OpenAI"}
? t("profile.switchToStandardOpenAI")
: t("profile.switchToAzureOpenAI")}
</Button>
</Label>
{useAzureOpenai ? (
<>
{envKeyMap["azure"] ? (
<Label>Azure OpenAI API key set by admin.</Label>
<Label>{t("profile.azureOpenAIKeySetByAdmin")}</Label>
) : (
<Input
placeholder="Azure OpenAI API Key"
@ -488,7 +488,7 @@ export const ProfileSettings: FC<ProfileSettingsProps> = ({}) => {
) : (
<>
{envKeyMap["openai"] ? (
<Label>OpenAI API key set by admin.</Label>
<Label>{t("profile.openAIAPIKeySetByAdmin")}</Label>
) : (
<Input
placeholder="OpenAI API Key"
@ -508,14 +508,14 @@ export const ProfileSettings: FC<ProfileSettingsProps> = ({}) => {
<div className="space-y-1">
{envKeyMap["azure_openai_endpoint"] ? (
<Label className="text-xs">
Azure endpoint set by admin.
<Label>{t("profile.azureEndpointSetByAdmin")}</Label>
</Label>
) : (
<>
<Label>Azure Endpoint</Label>
<Label>{t("profile.azureEndpointLabel")}</Label>
<Input
placeholder="https://your-endpoint.openai.azure.com"
placeholder={t("profile.azureEndpointPlaceholder")}
value={azureOpenaiEndpoint}
onChange={e =>
setAzureOpenaiEndpoint(e.target.value)
@ -530,14 +530,14 @@ export const ProfileSettings: FC<ProfileSettingsProps> = ({}) => {
<div className="space-y-1">
{envKeyMap["azure_gpt_35_turbo_name"] ? (
<Label className="text-xs">
Azure GPT-3.5 Turbo deployment name set by admin.
{t("profile.azureGpt35TurboDeploymentNameSetByAdmin")}
</Label>
) : (
<>
<Label>Azure GPT-3.5 Turbo Deployment Name</Label>
<Label>{t("profile.azureGpt35TurboDeploymentName")}</Label>
<Input
placeholder="Azure GPT-3.5 Turbo Deployment Name"
placeholder={t("profile.azureGpt35TurboDeploymentNamePlaceholder")}
value={azureOpenai35TurboID}
onChange={e =>
setAzureOpenai35TurboID(e.target.value)
@ -552,14 +552,14 @@ export const ProfileSettings: FC<ProfileSettingsProps> = ({}) => {
<div className="space-y-1">
{envKeyMap["azure_gpt_45_turbo_name"] ? (
<Label className="text-xs">
Azure GPT-4.5 Turbo deployment name set by admin.
{t("profile.azureGpt45TurboDeploymentNameSetByAdmin")}
</Label>
) : (
<>
<Label>Azure GPT-4.5 Turbo Deployment Name</Label>
<Label>{t("profile.azureGpt45TurboDeploymentName")}</Label>
<Input
placeholder="Azure GPT-4.5 Turbo Deployment Name"
placeholder={t("profile.azureGpt45TurboDeploymentNamePlaceholder")}
value={azureOpenai45TurboID}
onChange={e =>
setAzureOpenai45TurboID(e.target.value)
@ -574,14 +574,14 @@ export const ProfileSettings: FC<ProfileSettingsProps> = ({}) => {
<div className="space-y-1">
{envKeyMap["azure_gpt_45_vision_name"] ? (
<Label className="text-xs">
Azure GPT-4.5 Vision deployment name set by admin.
{t("profile.azureGpt45VisionDeploymentNameSetByAdmin")}
</Label>
) : (
<>
<Label>Azure GPT-4.5 Vision Deployment Name</Label>
<Label>{t("profile.azureGpt45VisionDeploymentName")}</Label>
<Input
placeholder="Azure GPT-4.5 Vision Deployment Name"
placeholder={t("profile.azureGpt45VisionDeploymentNamePlaceholder")}
value={azureOpenai45VisionID}
onChange={e =>
setAzureOpenai45VisionID(e.target.value)
@ -596,14 +596,14 @@ export const ProfileSettings: FC<ProfileSettingsProps> = ({}) => {
<div className="space-y-1">
{envKeyMap["azure_embeddings_name"] ? (
<Label className="text-xs">
Azure Embeddings deployment name set by admin.
{t("profile.azureEmbeddingsDeploymentNameSetByAdmin")}
</Label>
) : (
<>
<Label>Azure Embeddings Deployment Name</Label>
<Label>{t("profile.azureEmbeddingsDeploymentName")}</Label>
<Input
placeholder="Azure Embeddings Deployment Name"
placeholder={t("profile.azureEmbeddingsDeploymentNamePlaceholder")}
value={azureEmbeddingsID}
onChange={e =>
setAzureEmbeddingsID(e.target.value)
@ -619,14 +619,14 @@ export const ProfileSettings: FC<ProfileSettingsProps> = ({}) => {
<div className="space-y-1">
{envKeyMap["openai_organization_id"] ? (
<Label className="text-xs">
OpenAI Organization ID set by admin.
{t("profile.openaiOrgIdSetByAdmin")}
</Label>
) : (
<>
<Label>OpenAI Organization ID</Label>
<Label>{t("profile.openaiOrgIdLabel")}</Label>
<Input
placeholder="OpenAI Organization ID (optional)"
placeholder={t("profile.openaiOrgIdPlaceholder")}
disabled={
!!process.env.NEXT_PUBLIC_OPENAI_ORGANIZATION_ID
}
@ -643,12 +643,12 @@ export const ProfileSettings: FC<ProfileSettingsProps> = ({}) => {
<div className="space-y-1">
{envKeyMap["anthropic"] ? (
<Label>Anthropic API key set by admin.</Label>
<Label>{t("profile.anthropicApiKeySetByAdmin")}</Label>
) : (
<>
<Label>Anthropic API Key</Label>
<Label>{t("profile.anthropicApiKeyLabel")}</Label>
<Input
placeholder="Anthropic API Key"
placeholder={t("profile.anthropicApiKeyPlaceholder")}
type="password"
value={anthropicAPIKey}
onChange={e => setAnthropicAPIKey(e.target.value)}
@ -659,12 +659,12 @@ export const ProfileSettings: FC<ProfileSettingsProps> = ({}) => {
<div className="space-y-1">
{envKeyMap["google"] ? (
<Label>Google Gemini API key set by admin.</Label>
<Label>{t("profile.geminiAPIKeySetByAdmin")}</Label>
) : (
<>
<Label>Google Gemini API Key</Label>
<Label>{t("profile.googleGeminiApiKeyLabel")}</Label>
<Input
placeholder="Google Gemini API Key"
placeholder={t("profile.googleGeminiApiKeyPlaceholder")}
type="password"
value={googleGeminiAPIKey}
onChange={e => setGoogleGeminiAPIKey(e.target.value)}
@ -675,12 +675,12 @@ export const ProfileSettings: FC<ProfileSettingsProps> = ({}) => {
<div className="space-y-1">
{envKeyMap["mistral"] ? (
<Label>Mistral API key set by admin.</Label>
<Label>{t("profile.mistralAPIKeySetByAdmin")}</Label>
) : (
<>
<Label>Mistral API Key</Label>
<Label>{t("profile.mistralApiKeyLabel")}</Label>
<Input
placeholder="Mistral API Key"
placeholder={t("profile.mistralApiKeyPlaceholder")}
type="password"
value={mistralAPIKey}
onChange={e => setMistralAPIKey(e.target.value)}
@ -691,12 +691,12 @@ export const ProfileSettings: FC<ProfileSettingsProps> = ({}) => {
<div className="space-y-1">
{envKeyMap["groq"] ? (
<Label>Groq API key set by admin.</Label>
<Label>{t("profile.groqAPIKeySetByAdmin")}</Label>
) : (
<>
<Label>Groq API Key</Label>
<Label>{t("profile.groqApiKeyLabel")}</Label>
<Input
placeholder="Groq API Key"
placeholder={t("profile.groqApiKeyPlaceholder")}
type="password"
value={groqAPIKey}
onChange={e => setGroqAPIKey(e.target.value)}
@ -707,12 +707,12 @@ export const ProfileSettings: FC<ProfileSettingsProps> = ({}) => {
<div className="space-y-1">
{envKeyMap["perplexity"] ? (
<Label>Perplexity API key set by admin.</Label>
<Label>{t("profile.perplexityAPIKeySetByAdmin")}</Label>
) : (
<>
<Label>Perplexity API Key</Label>
<Label>{t("profile.perplexityApiKeyLabel")}</Label>
<Input
placeholder="Perplexity API Key"
placeholder={t("profile.perplexityApiKeyPlaceholder")}
type="password"
value={perplexityAPIKey}
onChange={e => setPerplexityAPIKey(e.target.value)}
@ -723,12 +723,12 @@ export const ProfileSettings: FC<ProfileSettingsProps> = ({}) => {
<div className="space-y-1">
{envKeyMap["openrouter"] ? (
<Label>OpenRouter API key set by admin.</Label>
<Label>{t("profile.openRouterAPIKeySetByAdmin")}</Label>
) : (
<>
<Label>OpenRouter API Key</Label>
<Label>{t("profile.openRouterApiKeyLabel")}</Label>
<Input
placeholder="OpenRouter API Key"
placeholder={t("profile.openRouterApiKeyPlaceholder")}
type="password"
value={openrouterAPIKey}
onChange={e => setOpenrouterAPIKey(e.target.value)}
@ -747,7 +747,7 @@ export const ProfileSettings: FC<ProfileSettingsProps> = ({}) => {
<WithTooltip
display={
<div>
Download Chatbot UI 1.0 data as JSON. Import coming soon!
{t("profile.downloadTooltip")}
</div>
}
trigger={

View File

@ -53,6 +53,56 @@
"instructionsPlaceholder": "Profile context... (optional)",
"profileImageLabel": "Profile Image",
"cancel": "Cancel",
"save": "Save"
}
"save": "Save",
"profileUpdated": "Profile updated!",
"imageAlt": "Profile Image",
"apiKeyLabel": "API Key",
"switchToStandardOpenAI": "Switch To Standard OpenAI",
"switchToAzureOpenAI": "Switch To Azure OpenAI",
"downloadTooltip": "Download Chatbot UI 1.0 data as JSON. Import coming soon!",
"azureOpenAIKeySetByAdmin": "Azure OpenAI API key set by admin.",
"openAIAPIKeySetByAdmin": "OpenAI API key set by admin.",
"azureEndpointSetByAdmin": "Azure endpoint set by admin.",
"azureDeploymentNameSetByAdmin": "Azure deployment name set by admin.",
"geminiAPIKeySetByAdmin": "Google Gemini API key set by admin.",
"mistralAPIKeySetByAdmin": "Mistral API key set by admin.",
"groqAPIKeySetByAdmin": "Groq API key set by admin.",
"perplexityAPIKeySetByAdmin": "Perplexity API key set by admin.",
"openRouterAPIKeySetByAdmin": "OpenRouter API key set by admin.",
"azureEndpointLabel": "Azure Endpoint",
"azureGpt35TurboDeploymentName": "Azure GPT-3.5 Turbo Deployment Name",
"azureGpt45TurboDeploymentName": "Azure GPT-4.5 Turbo Deployment Name",
"azureGpt45VisionDeploymentName": "Azure GPT-4.5 Vision Deployment Name",
"azureEmbeddingsDeploymentName": "Azure Embeddings Deployment Name",
"openaiOrgIdLabel": "OpenAI Organization ID",
"anthropicApiKeyLabel": "Anthropic API Key",
"googleGeminiApiKeyLabel": "Google Gemini API Key",
"mistralApiKeyLabel": "Mistral API Key",
"groqApiKeyLabel": "Groq API Key",
"perplexityApiKeyLabel": "Perplexity API Key",
"openRouterApiKeyLabel": "OpenRouter API Key",
"azureEndpointPlaceholder": "https://your-endpoint.openai.azure.com",
"azureGpt35TurboDeploymentNamePlaceholder": "Azure GPT-3.5 Turbo Deployment Name",
"azureGpt45TurboDeploymentNamePlaceholder": "Azure GPT-4.5 Turbo Deployment Name",
"azureGpt45VisionDeploymentNamePlaceholder": "Azure GPT-4.5 Vision Deployment Name",
"azureEmbeddingsDeploymentNamePlaceholder": "Azure Embeddings Deployment Name",
"openaiOrgIdPlaceholder": "OpenAI Organization ID (optional)",
"anthropicApiKeyPlaceholder": "Anthropic API Key",
"googleGeminiApiKeyPlaceholder": "Google Gemini API Key",
"mistralApiKeyPlaceholder": "Mistral API Key",
"groqApiKeyPlaceholder": "Groq API Key",
"perplexityApiKeyPlaceholder": "Perplexity API Key",
"openRouterApiKeyPlaceholder": "OpenRouter API Key",
"azureGpt35TurboDeploymentNameSetByAdmin": "Azure GPT-3.5 Turbo Deployment Name set by admin.",
"azureGpt45TurboDeploymentNameSetByAdmin": "Azure GPT-4.5 Turbo Deployment Name set by admin.",
"azureGpt45VisionDeploymentNameSetByAdmin": "Azure GPT-4.5 Vision Deployment Name set by admin.",
"azureEmbeddingsDeploymentNameSetByAdmin": "Azure Embeddings Deployment Name set by admin.",
"openaiOrgIdSetByAdmin": "OpenAI Organization ID set by admin.",
"anthropicApiKeySetByAdmin": "Anthropic API Key set by admin.",
"googleGeminiApiKeySetByAdmin": "Google Gemini API Key set by admin.",
"mistralApiKeySetByAdmin": "Mistral API Key set by admin.",
"groqApiKeySetByAdmin": "Groq API Key set by admin.",
"perplexityApiKeySetByAdmin": "Perplexity API Key set by admin.",
"openRouterApiKeySetByAdmin": "OpenRouter API Key set by admin."
}
}

View File

@ -52,7 +52,57 @@
"instructionsPlaceholder": "プロフィールの説明...(オプション)",
"profileImageLabel": "プロフィール画像",
"cancel": "キャンセル",
"save": "保存"
}
"save": "保存",
"profileUpdated": "プロフィールが更新されました!",
"imageAlt": "プロフィール画像",
"apiKeyLabel": "APIキー",
"switchToStandardOpenAI": "標準のOpenAIに切り替え",
"switchToAzureOpenAI": "Azure OpenAIに切り替え",
"downloadTooltip": "Chatbot UI 1.0のデータをJSONとしてダウンロード。インポート機能は近日公開予定",
"azureOpenAIKeySetByAdmin": "Azure OpenAI API キーは管理者によって設定されました。",
"openAIAPIKeySetByAdmin": "OpenAI API キーは管理者によって設定されました。",
"azureEndpointSetByAdmin": "Azure エンドポイントは管理者によって設定されました。",
"azureDeploymentNameSetByAdmin": "Azure デプロイメント名は管理者によって設定されました。",
"geminiAPIKeySetByAdmin": "Google Gemini API キーは管理者によって設定されました。",
"mistralAPIKeySetByAdmin": "Mistral API キーは管理者によって設定されました。",
"groqAPIKeySetByAdmin": "Groq API キーは管理者によって設定されました。",
"perplexityAPIKeySetByAdmin": "Perplexity API キーは管理者によって設定されました。",
"openRouterAPIKeySetByAdmin": "OpenRouter API キーは管理者によって設定されました。",
"azureEndpointLabel": "Azure エンドポイント",
"azureGpt35TurboDeploymentName": "Azure GPT-3.5 Turbo デプロイメント名",
"azureGpt45TurboDeploymentName": "Azure GPT-4.5 Turbo デプロイメント名",
"azureGpt45VisionDeploymentName": "Azure GPT-4.5 Vision デプロイメント名",
"azureEmbeddingsDeploymentName": "Azure Embeddings デプロイメント名",
"openaiOrgIdLabel": "OpenAI 組織 ID",
"anthropicApiKeyLabel": "Anthropic API キー",
"googleGeminiApiKeyLabel": "Google Gemini API キー",
"mistralApiKeyLabel": "Mistral API キー",
"groqApiKeyLabel": "Groq API キー",
"perplexityApiKeyLabel": "Perplexity API キー",
"openRouterApiKeyLabel": "OpenRouter API キー",
"azureEndpointPlaceholder": "https://your-endpoint.openai.azure.com",
"azureGpt35TurboDeploymentNamePlaceholder": "Azure GPT-3.5 Turbo デプロイメント名",
"azureGpt45TurboDeploymentNamePlaceholder": "Azure GPT-4.5 Turbo デプロイメント名",
"azureGpt45VisionDeploymentNamePlaceholder": "Azure GPT-4.5 Vision デプロイメント名",
"azureEmbeddingsDeploymentNamePlaceholder": "Azure Embeddings デプロイメント名",
"openaiOrgIdPlaceholder": "OpenAI 組織 IDオプション",
"anthropicApiKeyPlaceholder": "Anthropic API キー",
"googleGeminiApiKeyPlaceholder": "Google Gemini API キー",
"mistralApiKeyPlaceholder": "Mistral API キー",
"groqApiKeyPlaceholder": "Groq API キー",
"perplexityApiKeyPlaceholder": "Perplexity API キー",
"openRouterApiKeyPlaceholder": "OpenRouter API キー",
"azureGpt35TurboDeploymentNameSetByAdmin": "Azure GPT-3.5 Turbo デプロイメント名は管理者によって設定されました。",
"azureGpt45TurboDeploymentNameSetByAdmin": "Azure GPT-4.5 Turbo デプロイメント名は管理者によって設定されました。",
"azureGpt45VisionDeploymentNameSetByAdmin": "Azure GPT-4.5 Vision デプロイメント名は管理者によって設定されました。",
"azureEmbeddingsDeploymentNameSetByAdmin": "Azure Embeddings デプロイメント名は管理者によって設定されました。",
"openaiOrgIdSetByAdmin": "OpenAI 組織 ID は管理者によって設定されました。",
"anthropicApiKeySetByAdmin": "Anthropic API キーは管理者によって設定されました。",
"googleGeminiApiKeySetByAdmin": "Google Gemini API キーは管理者によって設定されました。",
"mistralApiKeySetByAdmin": "Mistral API キーは管理者によって設定されました。",
"groqApiKeySetByAdmin": "Groq API キーは管理者によって設定されました。",
"perplexityApiKeySetByAdmin": "Perplexity API キーは管理者によって設定されました。",
"openRouterApiKeySetByAdmin": "OpenRouter API キーは管理者によって設定されました。"
}
}

View File

@ -52,6 +52,56 @@
"instructionsPlaceholder": "个人资料描述...(可选)",
"profileImageLabel": "个人资料图片",
"cancel": "取消",
"save": "保存"
"save": "保存",
"profileUpdated": "个人资料已更新!",
"imageAlt": "个人资料图片",
"apiKeyLabel": "API 密钥",
"switchToStandardOpenAI": "切换到标准 OpenAI",
"switchToAzureOpenAI": "切换到 Azure OpenAI",
"downloadTooltip": "下载 Chatbot UI 1.0 数据为 JSON。导入功能即将推出",
"azureOpenAIKeySetByAdmin": "Azure OpenAI API 密钥由管理员设置。",
"openAIAPIKeySetByAdmin": "OpenAI API 密钥由管理员设置。",
"azureEndpointSetByAdmin": "Azure 端点由管理员设置。",
"azureDeploymentNameSetByAdmin": "Azure 部署名称由管理员设置。",
"geminiAPIKeySetByAdmin": "Google Gemini API 密钥由管理员设置。",
"mistralAPIKeySetByAdmin": "Mistral API 密钥由管理员设置。",
"groqAPIKeySetByAdmin": "Groq API 密钥由管理员设置。",
"perplexityAPIKeySetByAdmin": "Perplexity API 密钥由管理员设置。",
"openRouterAPIKeySetByAdmin": "OpenRouter API 密钥由管理员设置。",
"azureEndpointLabel": "Azure 端点",
"azureGpt35TurboDeploymentName": "Azure GPT-3.5 Turbo 部署名称",
"azureGpt45TurboDeploymentName": "Azure GPT-4.5 Turbo 部署名称",
"azureGpt45VisionDeploymentName": "Azure GPT-4.5 Vision 部署名称",
"azureEmbeddingsDeploymentName": "Azure Embeddings 部署名称",
"openaiOrgIdLabel": "OpenAI 组织 ID",
"anthropicApiKeyLabel": "Anthropic API 密钥",
"googleGeminiApiKeyLabel": "Google Gemini API 密钥",
"mistralApiKeyLabel": "Mistral API 密钥",
"groqApiKeyLabel": "Groq API 密钥",
"perplexityApiKeyLabel": "Perplexity API 密钥",
"openRouterApiKeyLabel": "OpenRouter API 密钥",
"azureEndpointPlaceholder": "https://your-endpoint.openai.azure.com",
"azureGpt35TurboDeploymentNamePlaceholder": "Azure GPT-3.5 Turbo 部署名称",
"azureGpt45TurboDeploymentNamePlaceholder": "Azure GPT-4.5 Turbo 部署名称",
"azureGpt45VisionDeploymentNamePlaceholder": "Azure GPT-4.5 Vision 部署名称",
"azureEmbeddingsDeploymentNamePlaceholder": "Azure Embeddings 部署名称",
"openaiOrgIdPlaceholder": "OpenAI 组织 ID可选",
"anthropicApiKeyPlaceholder": "Anthropic API 密钥",
"googleGeminiApiKeyPlaceholder": "Google Gemini API 密钥",
"mistralApiKeyPlaceholder": "Mistral API 密钥",
"groqApiKeyPlaceholder": "Groq API 密钥",
"perplexityApiKeyPlaceholder": "Perplexity API 密钥",
"openRouterApiKeyPlaceholder": "OpenRouter API 密钥",
"azureGpt35TurboDeploymentNameSetByAdmin": "Azure GPT-3.5 Turbo 部署名称由管理员设置。",
"azureGpt45TurboDeploymentNameSetByAdmin": "Azure GPT-4.5 Turbo 部署名称由管理员设置。",
"azureGpt45VisionDeploymentNameSetByAdmin": "Azure GPT-4.5 Vision 部署名称由管理员设置。",
"azureEmbeddingsDeploymentNameSetByAdmin": "Azure Embeddings 部署名称由管理员设置。",
"openaiOrgIdSetByAdmin": "OpenAI 组织 ID 由管理员设置。",
"anthropicApiKeySetByAdmin": "Anthropic API 密钥由管理员设置。",
"googleGeminiApiKeySetByAdmin": "Google Gemini API 密钥由管理员设置。",
"mistralApiKeySetByAdmin": "Mistral API 密钥由管理员设置。",
"groqApiKeySetByAdmin": "Groq API 密钥由管理员设置。",
"perplexityApiKeySetByAdmin": "Perplexity API 密钥由管理员设置。",
"openRouterApiKeySetByAdmin": "OpenRouter API 密钥由管理员设置。"
}
}