Skip to content
Open
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN pip install \
requests \
google-generativeai \
PyYAML \
adhoc-api~=1.0.0 \
adhoc-api~=2.0.2 \
idc-index \
seaborn \
biopython \
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies = [
"requests",
"google-generativeai",
"PyYAML",
"adhoc-api~=1.0.0",
"adhoc-api~=2.0.2",
"idc-index",
"seaborn",
"biopython",
Expand Down
15 changes: 12 additions & 3 deletions src/biome/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from pathlib import Path
from adhoc_api.tool import AdhocApi
from adhoc_api.loader import load_yaml_api
from adhoc_api.uaii import gpt_4o, o3_mini, claude_35_sonnet, gemini_pro

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -82,8 +83,10 @@ def __init__(self, context: BaseContext = None, tools: list = None, **kwargs):

# Note: not all providers support ttl_seconds
ttl_seconds = 1800
drafter_config_gemini={'provider': 'google', 'model': 'gemini-1.5-pro-001', 'ttl_seconds': ttl_seconds, 'api_key': os.environ.get("GEMINI_API_KEY", "")}
drafter_config_anthropic={'provider': 'anthropic', 'model': 'claude-3-5-sonnet-latest', 'api_key': os.environ.get("ANTHROPIC_API_KEY")}
drafter_config_gemini = {**gemini_pro, 'ttl_seconds': ttl_seconds, 'api_key': os.environ.get("GEMINI_API_KEY", "")}
drafter_config_anthropic = {**claude_35_sonnet, 'api_key': os.environ.get("ANTHROPIC_API_KEY")}
curator_config = {**o3_mini, 'api_key': os.environ.get("OPENAI_API_KEY")}
contextualizer_config = {**gpt_4o, 'api_key': os.environ.get("OPENAI_API_KEY")}
specs = self.api_specs

instructions_dir = os.path.join(self.root_folder, 'instructions')
Expand All @@ -102,7 +105,13 @@ def __init__(self, context: BaseContext = None, tools: list = None, **kwargs):
self.logger = MessageLogger(self.context)

try:
self.api = AdhocApi(logger=logger, drafter_config=[drafter_config_anthropic, drafter_config_gemini], apis=specs)
self.api = AdhocApi(
apis=specs,
drafter_config=[drafter_config_anthropic, drafter_config_gemini],
curator_config=curator_config,
contextualizer_config=contextualizer_config,
logger=logger,
)
except ValueError as e:
self.add_context(f"The APIs failed to load for this reason: {str(e)}. Please inform the user immediately.")
self.api = None
Expand Down
2 changes: 1 addition & 1 deletion src/biome/api_agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ drafter:
ttl_seconds: 1800
finalizer:
model: gpt-4o
default_cache_body: |
default_cache_body: !fill |
You will be given the entire API documentation.
When you write code against this API, you should avail yourself of the appropriate query parameters,
your understanding of the response model, and be cognizant that not all data is public and thus may require a token, etc.
Expand Down
11 changes: 4 additions & 7 deletions src/biome/api_definitions/cbioportal/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ description: |
Institute, Princess Margaret Cancer Centre in Toronto, Children's
Hospital of Philadelphia, Caris Life Sciences, The Hyve and SE4BIO
in the Netherlands, and Bilkent University in Ankara, Turkey.
raw_documentation: !load documentation/cbioportal.json
examples: !load documentation/examples.md
raw_documentation: !load_txt documentation/cbioportal.json
examples: !load_yaml documentation/examples.yaml
cache_body:
default: true
documentation: |
documentation: !fill |
{raw_documentation}

# Additional Instructions:
Expand All @@ -24,7 +24,4 @@ documentation: |
That is the base URL for all requests. There are not very many studies (less than 1000)
so if the user is searching for a specific study, you can just fetch all studies
and then filter the list yourself since cbioportals filters are tricky. It is often most
productive to simply filter based on the study name.

Here are some examples of how to use the API:
{examples}
productive to simply filter based on the study name.
Loading