diff --git a/src/fhda/notebook_env.py b/src/fhda/notebook_env.py index ee02ec2..081ee30 100644 --- a/src/fhda/notebook_env.py +++ b/src/fhda/notebook_env.py @@ -141,7 +141,7 @@ def __init__( directories from the aviary-storage GCS bucket. Should only be enabled if the task requires data on GCS. Disabled by default. run_notebook_on_edit: If True (default), the whole notebook will be rerun - after each edit. If False, only a the cell that was edited will be rerun. + after each edit. If False, only the cell that was edited will be rerun. """ self.work_dir = Path(work_dir) self.nb_path = Path(nb_path) if nb_path else self.work_dir / self.NOTEBOOK_NAME diff --git a/src/fhda/utils.py b/src/fhda/utils.py index b7ea77e..f06f3e6 100644 --- a/src/fhda/utils.py +++ b/src/fhda/utils.py @@ -32,6 +32,25 @@ } +def configure_logging(): + """Configure logging for the application.""" + logging.basicConfig( + level=logging.INFO, + format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", + ) + + loggers_config = { + "LiteLLM": logging.WARNING, + "LiteLLM Router": logging.WARNING, + "LiteLLM Proxy": logging.WARNING, + "httpx": logging.WARNING, + "httpcore.http11": logging.WARNING, + } + + for logger_name, level in loggers_config.items(): + logging.getLogger(logger_name).setLevel(level) + + class NBLanguage(StrEnum): PYTHON = auto() R = auto() diff --git a/src/scripts/platform_eval.py b/src/scripts/platform_eval.py index 50e4f4c..6a6096a 100644 --- a/src/scripts/platform_eval.py +++ b/src/scripts/platform_eval.py @@ -7,8 +7,8 @@ import pandas as pd import logging from pathlib import Path -from crow_client import CrowClient, JobResponseVerbose -from crow_client.models import AuthType, Stage +from futurehouse_client import FutureHouseClient, JobResponseVerbose +from futurehouse_client.models import AuthType, Stage from aviary.utils import MultipleChoiceQuestion, eval_answer, EvalAnswerMode @@ -33,9 +33,9 @@ def create_client( api_key: Optional[str] = None, stage: Stage = getattr(Stage, ENV), organization: str = "FutureHouse", -) -> CrowClient: - """Create and return a CrowClient instance.""" - return CrowClient( +) -> FutureHouseClient: + """Create and return a FutureHouseClient instance.""" + return FutureHouseClient( stage=stage, organization=organization, auth_type=AuthType.API_KEY, @@ -64,12 +64,12 @@ def load_job_data(file_path: Union[str, Path]) -> List[Dict[str, Any]]: async def fetch_jobs_batch( - client: CrowClient, job_ids: List[str], batch_size: int = 10 + client: FutureHouseClient, job_ids: List[str], batch_size: int = 10 ) -> List[Dict[str, Any]]: """Fetch jobs in batches to avoid memory issues. Args: - client: CrowClient instance + client: FutureHouseClient instance job_ids: List of job IDs to fetch batch_size: Number of jobs to fetch in each batch diff --git a/src/scripts/platform_run_jobs.py b/src/scripts/platform_run_jobs.py index 364b72d..b7ebca1 100644 --- a/src/scripts/platform_run_jobs.py +++ b/src/scripts/platform_run_jobs.py @@ -9,9 +9,9 @@ import datasets from ldp.agent import AgentConfig from aviary.core import MultipleChoiceQuestion -from crow_client import CrowClient -from crow_client.models import Stage, JobRequest, RuntimeConfig -from crow_client.models.app import AuthType +from futurehouse_client import FutureHouseClient +from futurehouse_client.models import Stage, JobRequest, RuntimeConfig +from futurehouse_client.models.app import AuthType import src.fhda.prompts as prompts logger = logging.getLogger(__name__) @@ -187,7 +187,7 @@ async def submit_jobs( The answer string from the agent """ - client = CrowClient( + client = FutureHouseClient( stage=CROW_STAGE, auth_type=AuthType.API_KEY, api_key=API_KEY,