Skip to content

Commit fa753b9

Browse files
authored
Deprecate crow client (#10)
1 parent d58a72b commit fa753b9

File tree

4 files changed

+31
-12
lines changed

4 files changed

+31
-12
lines changed

src/fhda/notebook_env.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def __init__(
141141
directories from the aviary-storage GCS bucket. Should only be enabled if the
142142
task requires data on GCS. Disabled by default.
143143
run_notebook_on_edit: If True (default), the whole notebook will be rerun
144-
after each edit. If False, only a the cell that was edited will be rerun.
144+
after each edit. If False, only the cell that was edited will be rerun.
145145
"""
146146
self.work_dir = Path(work_dir)
147147
self.nb_path = Path(nb_path) if nb_path else self.work_dir / self.NOTEBOOK_NAME

src/fhda/utils.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,25 @@
3232
}
3333

3434

35+
def configure_logging():
36+
"""Configure logging for the application."""
37+
logging.basicConfig(
38+
level=logging.INFO,
39+
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
40+
)
41+
42+
loggers_config = {
43+
"LiteLLM": logging.WARNING,
44+
"LiteLLM Router": logging.WARNING,
45+
"LiteLLM Proxy": logging.WARNING,
46+
"httpx": logging.WARNING,
47+
"httpcore.http11": logging.WARNING,
48+
}
49+
50+
for logger_name, level in loggers_config.items():
51+
logging.getLogger(logger_name).setLevel(level)
52+
53+
3554
class NBLanguage(StrEnum):
3655
PYTHON = auto()
3756
R = auto()

src/scripts/platform_eval.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import pandas as pd
88
import logging
99
from pathlib import Path
10-
from crow_client import CrowClient, JobResponseVerbose
11-
from crow_client.models import AuthType, Stage
10+
from futurehouse_client import FutureHouseClient, JobResponseVerbose
11+
from futurehouse_client.models import AuthType, Stage
1212
from aviary.utils import MultipleChoiceQuestion, eval_answer, EvalAnswerMode
1313

1414

@@ -33,9 +33,9 @@ def create_client(
3333
api_key: Optional[str] = None,
3434
stage: Stage = getattr(Stage, ENV),
3535
organization: str = "FutureHouse",
36-
) -> CrowClient:
37-
"""Create and return a CrowClient instance."""
38-
return CrowClient(
36+
) -> FutureHouseClient:
37+
"""Create and return a FutureHouseClient instance."""
38+
return FutureHouseClient(
3939
stage=stage,
4040
organization=organization,
4141
auth_type=AuthType.API_KEY,
@@ -64,12 +64,12 @@ def load_job_data(file_path: Union[str, Path]) -> List[Dict[str, Any]]:
6464

6565

6666
async def fetch_jobs_batch(
67-
client: CrowClient, job_ids: List[str], batch_size: int = 10
67+
client: FutureHouseClient, job_ids: List[str], batch_size: int = 10
6868
) -> List[Dict[str, Any]]:
6969
"""Fetch jobs in batches to avoid memory issues.
7070
7171
Args:
72-
client: CrowClient instance
72+
client: FutureHouseClient instance
7373
job_ids: List of job IDs to fetch
7474
batch_size: Number of jobs to fetch in each batch
7575

src/scripts/platform_run_jobs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
import datasets
1010
from ldp.agent import AgentConfig
1111
from aviary.core import MultipleChoiceQuestion
12-
from crow_client import CrowClient
13-
from crow_client.models import Stage, JobRequest, RuntimeConfig
14-
from crow_client.models.app import AuthType
12+
from futurehouse_client import FutureHouseClient
13+
from futurehouse_client.models import Stage, JobRequest, RuntimeConfig
14+
from futurehouse_client.models.app import AuthType
1515
import src.fhda.prompts as prompts
1616

1717
logger = logging.getLogger(__name__)
@@ -187,7 +187,7 @@ async def submit_jobs(
187187
The answer string from the agent
188188
"""
189189

190-
client = CrowClient(
190+
client = FutureHouseClient(
191191
stage=CROW_STAGE,
192192
auth_type=AuthType.API_KEY,
193193
api_key=API_KEY,

0 commit comments

Comments
 (0)