Gemini Stats Lambda
AWS Lambda app that will query the Gemini API for purchases and send an email with the amount bought, money spent, and the USD value of tokens current holdings.
- Create a Python 3.8 AWS Lambda function and upload
gemini_stats_lambda.py
as the source code. - Create a GMail App Password with the appropiate permissions and store it in Secrets Manager as
gmail_app_password
. - Create a Gemini API Key with the appropiate permissions and store the
secret
andkey
in Secrets Manager asgemini_api_secret
andgemini_api_key
. - Set the following environment variables
REGION_NAME
(ex. us-east-1)SECRET_NAME
(ex. gemini_lambda_emailer_secrets)SENDER_GMAIL_ADDRESS
(ex. [email protected])RECIPIENT_GMAIL_ADDRESS
(ex. [email protected])
- Schedule Lambda with CloudWatch Events.
- I followed least privilege when creating my Gemini API key and GMail app password. I recommend you do the same.