From d5860b0339f4e02f20ce9e843f537743bd5d1cd1 Mon Sep 17 00:00:00 2001 From: Marios Antonoudiou Date: Tue, 24 Jun 2025 10:00:52 +0300 Subject: [PATCH] Fix issue with invalid highlights --- server/utils/create-content.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/utils/create-content.ts b/server/utils/create-content.ts index 6d1e044..c994d59 100644 --- a/server/utils/create-content.ts +++ b/server/utils/create-content.ts @@ -117,7 +117,8 @@ export const createActivityContent = async ({ () => "Focus on how mood was swinging through the activity, ie I was feeling exhausted because of climb, I was feeling super happy on that descent!", ) - .with({ highlight: "Conditions" }, () => "Highlight on weather conditions"); + .with({ highlight: "Conditions" }, () => "Highlight on weather conditions") + .otherwise(() => ""); const length = match({ tone }) .with({ tone: "Minimalist" }, () => "short") @@ -146,7 +147,7 @@ export const createActivityContent = async ({ ${stringifyActivity({ activity: currentActivity })} The recent previous activities in json format: - ${previousActivities.map((activity) => stringifyActivity({ activity, shouldKeepNames: true }))} + [${previousActivities.map((activity) => stringifyActivity({ activity, shouldKeepNames: true }))}] `; const [aiError, aiResponse] = await openai("/responses", {