From b5b20234e93ad31b190a22b4072c263a72f2e84d Mon Sep 17 00:00:00 2001 From: Joel Date: Wed, 13 Dec 2023 16:41:40 +0800 Subject: [PATCH] feat: update pricing (#1749) --- .../components/base/tooltip-plus/index.tsx | 4 +- web/app/components/billing/config.ts | 10 ++- .../components/billing/pricing/plan-item.tsx | 65 ++++++++++++++++--- web/app/components/billing/type.ts | 2 + web/i18n/lang/billing.en.ts | 13 ++++ web/i18n/lang/billing.zh.ts | 13 ++++ 6 files changed, 95 insertions(+), 12 deletions(-) diff --git a/web/app/components/base/tooltip-plus/index.tsx b/web/app/components/base/tooltip-plus/index.tsx index 6fc791596e..56faabab10 100644 --- a/web/app/components/base/tooltip-plus/index.tsx +++ b/web/app/components/base/tooltip-plus/index.tsx @@ -13,7 +13,7 @@ const arrow = ( ) -const Tooltip: FC< TooltipProps> = ({ +const Tooltip: FC = ({ position = 'top', triggerMethod = 'hover', popupContent, @@ -36,7 +36,7 @@ const Tooltip: FC< TooltipProps> = ({ {children}
{popupContent} diff --git a/web/app/components/billing/config.ts b/web/app/components/billing/config.ts index 67b7a1753f..c995502917 100644 --- a/web/app/components/billing/config.ts +++ b/web/app/components/billing/config.ts @@ -13,9 +13,11 @@ export const ALL_PLANS: Record = { modelProviders: supportModelProviders, teamMembers: 1, buildApps: 10, - vectorSpace: 10, + vectorSpace: 5, documentProcessingPriority: Priority.standard, logHistory: 30, + messageRequest: 500, + annotatedResponse: 10, }, professional: { level: 2, @@ -26,6 +28,8 @@ export const ALL_PLANS: Record = { vectorSpace: 200, documentProcessingPriority: Priority.priority, logHistory: NUM_INFINITE, + messageRequest: NUM_INFINITE, + annotatedResponse: 2000, }, team: { level: 3, @@ -36,6 +40,8 @@ export const ALL_PLANS: Record = { vectorSpace: 1000, documentProcessingPriority: Priority.topPriority, logHistory: NUM_INFINITE, + messageRequest: NUM_INFINITE, + annotatedResponse: 5000, }, enterprise: { level: 4, @@ -46,6 +52,8 @@ export const ALL_PLANS: Record = { vectorSpace: NUM_INFINITE, documentProcessingPriority: Priority.topPriority, logHistory: NUM_INFINITE, + messageRequest: NUM_INFINITE, + annotatedResponse: NUM_INFINITE, }, } diff --git a/web/app/components/billing/pricing/plan-item.tsx b/web/app/components/billing/pricing/plan-item.tsx index db6a64ec86..7dd16f1460 100644 --- a/web/app/components/billing/pricing/plan-item.tsx +++ b/web/app/components/billing/pricing/plan-item.tsx @@ -6,7 +6,9 @@ import cn from 'classnames' import { Plan } from '../type' import { ALL_PLANS, NUM_INFINITE, contactSalesUrl } from '../config' import Toast from '../../base/toast' +import TooltipPlus from '../../base/tooltip-plus' import { PlanRange } from './select-plan-range' +import { HelpCircle } from '@/app/components/base/icons/src/vender/line/general' import { useAppContext } from '@/context/app-context' import { fetchSubscriptionUrls } from '@/service/billing' @@ -16,10 +18,21 @@ type Props = { planRange: PlanRange } -const KeyValue = ({ label, value }: { label: string; value: string | number | JSX.Element }) => { +const KeyValue = ({ label, value, tooltip }: { label: string; value: string | number | JSX.Element; tooltip?: string }) => { return (
-
{label}
+
+
{label}
+ {tooltip && ( + {tooltip}
+ } + > + + + )} +
{value}
) @@ -84,7 +97,33 @@ const PlanItem: FC = ({ case Plan.sandbox: return t('billing.plansCommon.supportItems.communityForums') case Plan.professional: - return t('billing.plansCommon.supportItems.emailSupport') + return ( +
+
{t('billing.plansCommon.supportItems.emailSupport')}
+
+
+ {t('billing.plansCommon.supportItems.logoChange')}
+
{comingSoon}
+
+
+
+ + +
 {t('billing.plansCommon.supportItems.ragAPIRequest')}
+ {t('billing.plansCommon.ragAPIRequestTooltip')}
+ } + > + + +
+
{comingSoon}
+
+
+
+ {t('billing.plansCommon.supportItems.agentModel')}
+
{comingSoon}
+
+ + ) case Plan.team: return (
@@ -94,7 +133,7 @@ const PlanItem: FC = ({
{comingSoon}
-
+ {t('billing.plansCommon.supportItems.personalizedSupport')}
+
+ {t('billing.plansCommon.supportItems.SSOAuthentication')}
{comingSoon}
@@ -103,9 +142,6 @@ const PlanItem: FC = ({ return (
{t('billing.plansCommon.supportItems.personalizedSupport')}
-
-
+ {t('billing.plansCommon.supportItems.dedicatedAPISupport')}
-
+ {t('billing.plansCommon.supportItems.customIntegration')}
@@ -149,11 +185,11 @@ const PlanItem: FC = ({ } } return ( -
+
{isMostPopularPlan && (
{t('billing.plansCommon.mostPopular')}
)} -
+
{t(`${i18nPrefix}.name`)}
{t(`${i18nPrefix}.description`)}
@@ -201,11 +237,22 @@ const PlanItem: FC = ({ = 1000 ? `${planInfo.vectorSpace / 1000}G` : `${planInfo.vectorSpace}MB`)} + tooltip={t('billing.plansCommon.vectorSpaceBillingTooltip') as string} /> + + diff --git a/web/i18n/lang/billing.en.ts b/web/i18n/lang/billing.en.ts index fc90198661..c43f4650ce 100644 --- a/web/i18n/lang/billing.en.ts +++ b/web/i18n/lang/billing.en.ts @@ -28,6 +28,7 @@ const translation = { teamMembers: 'Team Members', buildApps: 'Build Apps', vectorSpace: 'Vector Space', + vectorSpaceBillingTooltip: 'Each 1MB can store about 1.2million characters of vectorized data(estimated using OpenAI Embeddings, varies across models).', vectorSpaceTooltip: 'Vector Space is the long-term memory system required for LLMs to comprehend your data.', documentProcessingPriority: 'Document Processing Priority', documentProcessingPriorityTip: 'For higher document processing priority, please upgrade your plan.', @@ -50,10 +51,22 @@ const translation = { personalizedSupport: 'Personalized support', dedicatedAPISupport: 'Dedicated API support', customIntegration: 'Custom integration and support', + ragAPIRequest: 'RAG API Requests', + agentModel: 'Agent Model', }, comingSoon: 'Coming soon', member: 'Member', memberAfter: 'Member', + messageRequest: { + title: 'Message Requests', + unit: 'per day', + tooltip: 'Includes all messages from your apps, whether via APIs or web sessions. (Not LLM resource usage)', + }, + annotatedResponse: { + title: 'Annotation Quota Limits', + tooltip: 'Manual editing and annotation of responses provides customizable high-quality question-answering abilities for apps. (Applicable only in chat apps)', + }, + ragAPIRequestTooltip: 'Refers to the number of API calls invoking only the knowledge base processing capabilities of Dify.', }, plans: { sandbox: { diff --git a/web/i18n/lang/billing.zh.ts b/web/i18n/lang/billing.zh.ts index 9dc105b2ee..9c2c68860a 100644 --- a/web/i18n/lang/billing.zh.ts +++ b/web/i18n/lang/billing.zh.ts @@ -29,6 +29,7 @@ const translation = { buildApps: '构建应用程序数', vectorSpace: '向量空间', vectorSpaceTooltip: '向量空间是 LLMs 理解您的数据所需的长期记忆系统。', + vectorSpaceBillingTooltip: '向量存储是将知识库向量化处理后为让 LLMs 理解数据而使用的长期记忆存储,1MB 大约能满足1.2 million character 的向量化后数据存储(以 OpenAI Embedding 模型估算,不同模型计算方式有差异)。在向量化过程中,实际的压缩或尺寸减小取决于内容的复杂性和冗余性。', documentProcessingPriority: '文档处理优先级', documentProcessingPriorityTip: '如需更高的文档处理优先级,请升级您的套餐', documentProcessingPriorityUpgrade: '以更快的速度、更高的精度处理更多的数据。', @@ -50,10 +51,22 @@ const translation = { personalizedSupport: '个性化支持', dedicatedAPISupport: '专用 API 支持', customIntegration: '自定义集成和支持', + ragAPIRequest: 'RAG API 请求', + agentModel: 'Agent 模型', }, comingSoon: '即将推出', member: '成员', memberAfter: '个成员', + messageRequest: { + title: '信息限制', + unit: '条每天', + tooltip: '指每日应用会话调用 Dify API 的次数(而非 LLMs 的 API 资源调用),它包含你所有应用中通过 API 或者在 WebApp 会话中产生的消息数。', + }, + annotatedResponse: { + title: '标注回复数', + tooltip: '标注回复功能通过人工编辑标注为应用提供了可定制的高质量问答回复能力', + }, + ragAPIRequestTooltip: '指单独调用 Dify 知识库数据处理能力的 API。', }, plans: { sandbox: {