Files
formbricks/packages/lib/utils/ai.ts
T
Matti Nannt 9872d17abe feat: AI-based Open-Text Summary & new Experience page (#3038)
Co-authored-by: Johannes <johannes@formbricks.com>
Co-authored-by: Piyush Gupta <piyushguptaa2z123@gmail.com>
Co-authored-by: pandeymangg <anshuman.pandey9999@gmail.com>
2024-10-20 12:06:46 +02:00

16 lines
734 B
TypeScript

import { TOrganizationBillingPlan } from "@formbricks/types/organizations";
import { IS_AI_CONFIGURED, IS_FORMBRICKS_CLOUD } from "../constants";
export const getPromptText = (questionHeadline: string, response: string) => {
return `**${questionHeadline}**\n${response}`;
};
export const getIsAIEnabled = async (billingPlan: TOrganizationBillingPlan) => {
// This is a temporary workaround to enable AI without checking the ee license validity, as the ee package is not available in the lib package.(but the billing plan check suffices the license check).
return Boolean(
IS_AI_CONFIGURED &&
IS_FORMBRICKS_CLOUD &&
(billingPlan === "startup" || billingPlan === "scale" || billingPlan === "enterprise")
);
};