mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-04 09:29:42 -06:00
17 lines
760 B
TypeScript
17 lines
760 B
TypeScript
import { TOrganization } from "@formbricks/types/organizations";
|
|
import { IS_AI_CONFIGURED } 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 &&
|
|
(billingPlan === "startup" || billingPlan === "scale" || billingPlan === "enterprise")
|
|
);
|
|
};
|