Integrations
If you need to schedule background tasks or maintain data without user interaction, you can create an integration.py in your agent’s folder. For example:
from datetime import datetime
from apscheduler.schedulers.background import BackgroundScheduler
from utils.codeligence_utils import IntegrationInfo
def get_config():
return IntegrationInfo(
enabled=True,
name="MyScheduledTask",
description="Runs a daily job to refresh data"
)
def refresh_data():
print(f"Refreshing data at {datetime.now()}")
scheduler = BackgroundScheduler()
scheduler.add_job(refresh_data, 'cron', hour=4) # run at 4 AM daily
scheduler.start()
The server automatically loads these integrations if enabled=True.