Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ METACULUS_TOKEN=
# Right now only used for free semantic similarity calculation in Deduplicator, but defaults to OpenAI if not filled in
HUGGINGFACE_API_KEY=

# Only needed in Streamlit Cloud in order to save responses to a database and track usage
# Only needed if saving responses to a database (e.g. in Streamlit Cloud)
# Right now its hardcoded for a specific database, later this should be made more interchangeable
CODA_API_KEY=

# Disable if in Streamlit Cloud
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/hourly-run-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ jobs:
EXA_API_KEY: ${{ secrets.EXA_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
HUGGINGFACE_API_KEY: ${{ secrets.HUGGINGFACE_API_KEY }}
CODA_API_KEY: ${{ secrets.CODA_API_KEY }}
PYTHONPATH: .
1 change: 1 addition & 0 deletions .github/workflows/hourly-run-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ jobs:
METACULUS_TOKEN: ${{ secrets.METACULUS_TOKEN }}
PERPLEXITY_API_KEY: ${{ secrets.PERPLEXITY_API_KEY }}
EXA_API_KEY: ${{ secrets.EXA_API_KEY }}
CODA_API_KEY: ${{ secrets.CODA_API_KEY }}
PYTHONPATH: .
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: pre-commit
name: Pre-Commit

on:
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "forecasting-tools"
version = "0.2.1"
version = "0.2.2"
description = "AI forecasting and research tools to help humans reason about and forecast the future"
authors = ["Benjamin Wilson <[email protected]>"]
license = "MIT"
Expand Down
19 changes: 14 additions & 5 deletions scripts/run_forecasts_for_ai_tournament.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
sys.path.append(top_level_dir)
dotenv.load_dotenv()

import logging

from forecasting_tools.forecasting.forecast_bots.main_bot import MainBot
from forecasting_tools.forecasting.forecast_bots.template_bot import (
TemplateBot,
Expand All @@ -24,6 +26,8 @@
from forecasting_tools.forecasting.helpers.metaculus_api import MetaculusApi
from forecasting_tools.util.custom_logger import CustomLogger

logger = logging.getLogger(__name__)


def get_forecaster(bot_type: str, allow_rerun: bool) -> TemplateBot | MainBot:
bot_classes = {
Expand Down Expand Up @@ -59,11 +63,16 @@ async def run_morning_forecasts(bot_type: str, allow_rerun: bool) -> None:
forecaster = get_forecaster(bot_type, allow_rerun)
TOURNAMENT_ID = MetaculusApi.AI_COMPETITION_ID_Q4
reports = await forecaster.forecast_on_tournament(TOURNAMENT_ID)
for report in reports:
await asyncio.sleep(5)
ForecastDatabaseManager.add_forecast_report_to_database(
report, ForecastRunType.REGULAR_FORECAST
)

if os.environ.get("CODA_API_KEY"):
for report in reports:
await asyncio.sleep(5)
try:
ForecastDatabaseManager.add_forecast_report_to_database(
report, ForecastRunType.REGULAR_FORECAST
)
except Exception as e:
logger.error(f"Error adding forecast report to database: {e}")


if __name__ == "__main__":
Expand Down
Loading