diff --git a/.github/workflows/summarise_upcoming_events.yml b/.github/workflows/summarise_upcoming_events.yml index f078ecc..23d610e 100644 --- a/.github/workflows/summarise_upcoming_events.yml +++ b/.github/workflows/summarise_upcoming_events.yml @@ -35,7 +35,7 @@ jobs: - name: Run summary script run: | cd tools/llm_meetup_summary - python summarise_events_with_llms.py + python summarise_events_with_llms.py --channel events env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/tools/README.md b/tools/README.md index d8715f1..4b9bac9 100644 --- a/tools/README.md +++ b/tools/README.md @@ -10,7 +10,11 @@ 5) `automation_prepare_adhoc_availability.py`: updates mentors data with specified availability hours in `samples/adhoc-prep.xlsx` in preparation for monthly ad-hoc mentorship. -6) `llm_meetup_summary\summarise_events_with_llms` sends a Slack summary of our upcoming Meetup events. Note - currently set up to use Silke's API key on the GitHub repo. Please don't abuse this :) This can be run with the GitHub Actions workflow `summarise_upcoming_events.yml` OR run manually from the llm_meetup_summary directory. To run locally, you need to create a .env file with OPENAI_API_KEY, SLACK_BOT_TEST_WEBHOOK, and SLACK_BOT_WEBHOOK keys. See .example.env for reference. The secret values can be found in https://github.com/Women-Coding-Community/WomenCodingCommunity.github.io/settings/secrets/actions. +6) `llm_meetup_summary\summarise_events_with_llms` sends a Slack summary of our upcoming Meetup events. +**Note** Currently set up to use Silke's API key on the GitHub repo. Please don't abuse this :) and reach out to her in case you would like to use. + +This can be run with the GitHub Actions workflow `summarise_upcoming_events.yml` OR run manually from the llm_meetup_summary directory. To run locally, you need to create a .env file with `OPENAI_API_KEY`, `SLACK_BOT_TEST_WEBHOOK`, and SLACK_BOT_WEBHOOK keys. See .example.env for reference. The secret are stored in the repository secrets. + Then run the following commands from the terminal: 1. `python -m venv venv` (first time only) diff --git a/tools/llm_meetup_summary/summarise_events_with_llms.py b/tools/llm_meetup_summary/summarise_events_with_llms.py index b3c64e3..28ebdc5 100644 --- a/tools/llm_meetup_summary/summarise_events_with_llms.py +++ b/tools/llm_meetup_summary/summarise_events_with_llms.py @@ -181,15 +181,16 @@ def _post_to_slack(message, slack_webhook_url=SLACK_TEST_WEBHOOK): if __name__ == "__main__": parser = argparse.ArgumentParser(description="Summarise upcoming Meetup events and post to Slack.") parser.add_argument( - "--test", - action="store_true", - help="Post the summary to the test Slack channel #test-meetup-summaries. Otherwise, post to #events." + "--channel", + choices=["test-meetup-summaries", "events"], + default="test-meetup-summaries", + help="Slack channel to post the summary to: 'test-meetup-summaries' or 'events'." ) parser.add_argument("--events_file", help="Path to the events YAML file.", default=EVENTS_FILE) args = parser.parse_args() - - test_mode_activated = args.test + test_mode_activated = args.channel == "test-meetup-summaries" + if test_mode_activated: slack_webhook_url = SLACK_TEST_WEBHOOK else: