Introduce highlights option

This commit is contained in:
2025-06-13 22:47:05 +03:00
parent 6911cfaaa4
commit 7b6369fa0f
6 changed files with 42 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
import { chain, draw, get, isEmpty, omit, pick, tryit } from "radash";
import { safeDestr } from "destr";
import { User } from "./drizzle";
import { availableTones } from "~/shared/constants";
import { availableHighlights, availableTones } from "~/shared/constants";
const promo = "Written by https://ghostwriter.rocks 👻";
@@ -120,21 +120,19 @@ export const createActivityContent = async ({
? (draw(availableTones) as string)
: draw(user.preferences.data!.tone!);
const length = draw([
"short",
"short",
"short",
"medium",
"a-little-more-than-medium",
]);
const highlight = isEmpty(user.preferences.data?.highlights)
? (draw(availableHighlights) as string)
: draw(user.preferences.data!.highlights!);
const length = draw(["short", "medium", "a-little-more-than-medium"]);
const prompt = `
Generate a short title and a ${length}-lengthed description for my strava activity. Use my preferred language and unit system.
Try to not exaggerate as I am using Strava often and I want my activites to be unique and easy to read. Don't say things like nothing too fancy or wild.
Use a little bit of ${tone} tone to make things less boring. Highlight any PR only if available, do not mention them if no PRs.
Use a little bit of ${tone} tone to make things less boring. Highlight ${highlight} properties if available.
Maybe comment if any interesting fact in comparison to previous activities.
Add #${tone} at the end of the description. Depending the length of the description, maybe add more hashtags.
Add #${tone} and #${highlight} at the end of the description. Depending the length of the description, maybe add more hashtags.
Language: ${user?.preferences.data.language}
Unit system: ${user?.preferences.data.units}