Skip to content

Commit

Permalink
Merge pull request #29 from asapdiscovery/schedule_update
Browse files Browse the repository at this point in the history
Add periodic update
  • Loading branch information
hmacdope authored Sep 20, 2024
2 parents 967dd6c + 9ed3c1f commit b325b8e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions falcbot/falcbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@
from asapdiscovery.ml.models import ASAPMLModelRegistry
import llm
import util

import schedule
import time


# logger in a global context
logging.basicConfig(level=logging.DEBUG)

# update the registry every 4 hours
schedule.every(4).hour.do(ASAPMLModelRegistry.update_registry())


class SlackSettings(BaseSettings):
SLACK_BOT_TOKEN: str = Field(
Expand Down Expand Up @@ -60,8 +64,6 @@ def pred_matcher(event, logger, context):

@app.event("app_mention", matchers=[pred_matcher])
def make_pic50_pred(event, say, context, logger):
# refresh the registry every time a prediction is made
ASAPMLModelRegistry.update_registry()

content = event.get("text")
# parse with LLM
Expand Down

0 comments on commit b325b8e

Please sign in to comment.