From 8399391aaa45d4dd8df4ed33523db262fa5b48ee Mon Sep 17 00:00:00 2001 From: Piyush Gupta <56182734+gupta-piyush19@users.noreply.github.com> Date: Wed, 15 Jan 2025 10:42:02 +0530 Subject: [PATCH] fix: ai feature check (#4597) Co-authored-by: Anshuman Pandey <54475686+pandeymangg@users.noreply.github.com> --- apps/web/modules/ee/license-check/lib/utils.ts | 7 +------ packages/lib/utils/ai.ts | 3 +-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/apps/web/modules/ee/license-check/lib/utils.ts b/apps/web/modules/ee/license-check/lib/utils.ts index c87f77128f..7ea33654ed 100644 --- a/apps/web/modules/ee/license-check/lib/utils.ts +++ b/apps/web/modules/ee/license-check/lib/utils.ts @@ -376,12 +376,7 @@ export const getIsOrganizationAIReady = async (billingPlan: TOrganizationBilling const license = await getEnterpriseLicense(); if (IS_FORMBRICKS_CLOUD) { - return Boolean( - license.features?.ai && - (billingPlan === PROJECT_FEATURE_KEYS.STARTUP || - billingPlan === PROJECT_FEATURE_KEYS.SCALE || - billingPlan === PROJECT_FEATURE_KEYS.ENTERPRISE) - ); + return Boolean(license.features?.ai && billingPlan !== PROJECT_FEATURE_KEYS.FREE); } return Boolean(license.features?.ai); diff --git a/packages/lib/utils/ai.ts b/packages/lib/utils/ai.ts index de38a0d7b5..18d639f9cf 100644 --- a/packages/lib/utils/ai.ts +++ b/packages/lib/utils/ai.ts @@ -1,5 +1,5 @@ import { TOrganization } from "@formbricks/types/organizations"; -import { IS_AI_CONFIGURED, IS_FORMBRICKS_CLOUD } from "../constants"; +import { IS_AI_CONFIGURED } from "../constants"; export const getPromptText = (questionHeadline: string, response: string) => { return `**${questionHeadline.trim()}**\n${response.trim()}`; @@ -11,7 +11,6 @@ export const getIsAIEnabled = async (organization: TOrganization) => { return Boolean( organization.isAIEnabled && IS_AI_CONFIGURED && - IS_FORMBRICKS_CLOUD && (billingPlan === "startup" || billingPlan === "scale" || billingPlan === "enterprise") ); };