Skip to content

Commit

Permalink
Ignore null / very low relative effort scores on AI prompts.
Browse files Browse the repository at this point in the history
  • Loading branch information
igoramadas committed Aug 22, 2024
1 parent 9c60bad commit 93c2e8f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/ai/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,14 @@ export class AI {
const verb = sportType.includes("ride") ? "rode" : sportType.includes("run") ? "ran" : "did"

// Add relative effort context.
if (activity.relativeEffort > 600) {
arrPrompt.push("That was one of the hardest workouts I've ever done.")
} else if (activity.relativeEffort > 300) {
arrPrompt.push("The workout felt pretty hard.")
} else if (activity.relativeEffort < 40) {
arrPrompt.push("The workout was very easy.")
if (activity.relativeEffort && activity.relativeEffort > 5) {
if (activity.relativeEffort > 600) {
arrPrompt.push("That was one of the hardest workouts I've ever done.")
} else if (activity.relativeEffort > 300) {
arrPrompt.push("The workout felt pretty hard.")
} else if (activity.relativeEffort < 40) {
arrPrompt.push("The workout was very easy.")
}
}

// Only add distance if moving time was also set.
Expand Down

0 comments on commit 93c2e8f

Please sign in to comment.