Files
formbricks/packages/lib/utils/ai.ts
Piyush Gupta 88847a153b fix: resolve recalls properly in document (#3943)
Co-authored-by: Dhruwang Jariwala <67850763+Dhruwang@users.noreply.github.com>
Co-authored-by: Matti Nannt <mail@matthiasnannt.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2024-11-08 08:25:02 +00:00

18 lines
810 B
TypeScript

import { TOrganization } from "@formbricks/types/organizations";
import { IS_AI_CONFIGURED, IS_FORMBRICKS_CLOUD } from "../constants";
export const getPromptText = (questionHeadline: string, response: string) => {
return `**${questionHeadline.trim()}**\n${response.trim()}`;
};
export const getIsAIEnabled = async (organization: TOrganization) => {
// 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).
const billingPlan = organization.billing.plan;
return Boolean(
organization.isAIEnabled &&
IS_AI_CONFIGURED &&
IS_FORMBRICKS_CLOUD &&
(billingPlan === "startup" || billingPlan === "scale" || billingPlan === "enterprise")
);
};