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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ coverage.xml
.hypothesis/
.tox/
htmlcov/
scratchpad.ipynb

# Documentation
docs/_build/
Expand Down
25 changes: 16 additions & 9 deletions robin/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ def get_default_llm_config():
return copy.deepcopy(_DEFAULT_LLM_CONFIG_DATA)


DEFAULT_DISEASE_NAME = "dry age-related macular degeneration"
DEFAULT_FOLDER_NAME = f"{DEFAULT_DISEASE_NAME[:70].replace(" ", "_")}_{datetime.now().strftime("%Y-%m-%d_%H-%M")}"


def _get_prompt_args(template_string: str) -> set[str]:
"""
Extracts root variable names from f-string like placeholders (e.g., {variable})
Expand Down Expand Up @@ -276,20 +272,31 @@ class Config:
default=5, description="Number of candidates to generate for each query."
)
disease_name: str = Field(
default=DEFAULT_DISEASE_NAME, description="Name of the disease to focus on."
default="input_disease", description="Name of the disease to focus on."
)
run_folder_name: str = Field(
default=DEFAULT_FOLDER_NAME,
description="Name of the folder where results will be stored.",
run_folder_name: str | None = Field(
default=None,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you briefly mention in the description what happens for the default of None, something like: ", default of None will autogenerate this from disease_name."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed! thanks james

description=(
"Name of the folder where results will be stored. "
"If not provided or None, it will be auto-generated "
"using the disease_name and the timestamp."
),
)

futurehouse_api_key: str = "insert_futurehouse_api_key_here"
llm_name: str = "o4-mini"
llm_config: dict | None = Field(default_factory=get_default_llm_config)
agent_settings: AgentConfig = Field(default_factory=AgentConfig)
_fh_client: FutureHouseClient | None = PrivateAttr(default=None)
_llm_client: LiteLLMModel | None = PrivateAttr(default=None)

@model_validator(mode="after")
def set_run_folder_name_default(self) -> "RobinConfiguration":
if self.run_folder_name is None:
disease_part = self.disease_name[:70].replace(" ", "_")
timestamp_part = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
self.run_folder_name = f"{disease_part}_{timestamp_part}"
return self

@property
def fh_client(self) -> FutureHouseClient:
if self._fh_client is None:
Expand Down
6 changes: 5 additions & 1 deletion robin/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ def save_crow_files(
query_text = item.get("query", "").strip()
answer_text = item.get("answer", "").strip()
sources_text = item.get("sources", "").strip()
task_id_text = item.get("task_run_id", "").strip()

file_number = i + 1

Expand All @@ -274,6 +275,7 @@ def save_crow_files(
content = f"Hypothesis: {hypothesis_text}\n\n"
content += f"Query: {query_text}\n\n"
content += f"{answer_text}\n\n"
content += f"Full trajectory link: https://platform.futurehouse.org/trajectories/{task_id_text}\n\n"
content += f"References:\n{sources_text}\n"

try:
Expand All @@ -297,6 +299,7 @@ def save_falcon_files(
for i, item in enumerate(data_list):
hypothesis_text = item.get("hypothesis", "").strip()
formatted_output_text = item.get("formatted_output", "").strip()
task_id_text = item.get("task_run_id", "").strip()

file_number = i + 1

Expand All @@ -316,7 +319,8 @@ def save_falcon_files(
filepath = run_dir_path / filename

content = f"Proposal for {hypothesis_text}\n\n"
content += f"{formatted_output_text}"
content += f"{formatted_output_text}\n\n"
content += f"Full trajectory link: https://platform.futurehouse.org/trajectories/{task_id_text}\n"

try:
filepath.write_text(content, encoding="utf-8")
Expand Down