diff --git a/ops b/ops index 304150880..b33997f9d 160000 --- a/ops +++ b/ops @@ -1 +1 @@ -Subproject commit 304150880e7114bb4e32342788d3efe4fa3bd7d5 +Subproject commit b33997f9d875e2c57c9c83ce0a86082318dc896b diff --git a/package.json b/package.json index 599dffbb9..8fd917cb5 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "private": "true", "scripts": { "start": "concurrently -n frontend,backend \"npm run start:frontend\" \"npm run start:backend\"", + "start:with-ml": "concurrently -n frontend,backend,ml \"npm run start:frontend\" \"npm run start:backend\" \"npm run start:ml\"", "start:frontend": "npm -w packages/frontend run start", "start:backend": "npm -w packages/backend run start", "start:radar": "npm -w packages/backend run start:radar", diff --git a/packages/backend/src/utils/playground.ts b/packages/backend/src/utils/playground.ts index cd879fde9..28a431808 100644 --- a/packages/backend/src/utils/playground.ts +++ b/packages/backend/src/utils/playground.ts @@ -203,7 +203,10 @@ export async function runAImodel( const [{ stripeCustomer }] = await sql`select stripe_customer from org where id = ${orgId}` - if (process.env.NODE_ENV === "production") { + if ( + process.env.NODE_ENV === "production" && + process.env.STRIPE_SECRET_KEY + ) { stripe.billing.meterEvents .create({ event_name: "ai_playground", diff --git a/packages/frontend/components/layout/Sidebar.tsx b/packages/frontend/components/layout/Sidebar.tsx index 505b043d0..e26618d9c 100644 --- a/packages/frontend/components/layout/Sidebar.tsx +++ b/packages/frontend/components/layout/Sidebar.tsx @@ -134,14 +134,14 @@ export default function Sidebar() { icon: IconShieldBolt, link: "/radars", resource: "radars", - disabled: isSelfHosted ? org.license && !org.license.radarEnabled : false, + disabled: isSelfHosted ? org.license?.radarEnabled : false, }, { label: "Evaluations", icon: IconFlask2Filled, link: "/evaluations", resource: "evaluations", - disabled: isSelfHosted ? org.license && !org.license.evalEnabled : false, + disabled: isSelfHosted ? org.license?.evalEnabled : false, subMenu: [ { label: "Playground",