Would you like to say your workouts are created by AI? Cool, me too! And now we can!
Using the OpenAI API, this solution will query ChatGPT to build workouts for you that use equipment you have at your disposal.
For more details, please refer to this blog post.
This solution is powered by two Step Functions:
- Generate Weekly Schedule - Randomizes which muscle groups, workout types, and equipment will be on each day and gets the workout from ChatGPT
- Daily Workout Notifier - Sends an email in the evening with the workout details for the next day
This solution is written in SAM and can be deployed to your AWS account with the following two commands:
sam build
sam deploy --guided
To successfully deploy the solution, you must provide the following deployment variables
- TableName - Name of the table in DynamoDB, defaults to ai-fitness
- OpenAIApiKey - API Key used to interact with ChatGPT. More on this here
- MomentoAuthToken - Auth token used to cache ChatGPT responses. Generate your token
- ContactEmail - The email address you wish to send workouts to
NOTE - This solution relies on the email configuration from this repo to send emails. The stack from that repo must be deployed for emails to be sent. An alternative would be to copy the SendEmailFunction from that repo into this one.
You can configure several aspects of this application.
- Muscle groups, workout types, and available equipment
- When weekly workouts are generated (see the
schedule
trigger onBuildWeeklyWorkoutsStateMachine
) - When daily email reminders are sent (see the
schedule
trigger onSendWorkoutEmailStateMachine
)
For the most part, this solution is free. It falls under the free tier for the AWS infrastructure, Momento cache, and SendGrid email allowance. However, this will cost a few cents per month in OpenAI.