tooluniverse.efo_tool module¶

class tooluniverse.efo_tool.EFOTool[source]¶

Bases: BaseTool

Tool to lookup Experimental Factor Ontology (EFO) IDs for diseases via the EMBL-EBI OLS API.

__init__(tool_config, base_url='https://www.ebi.ac.uk/ols4/api/search')[source]¶
run(arguments)[source]¶

Execute the tool.

The default BaseTool implementation accepts an optional arguments mapping to align with most concrete tool implementations which expect a dictionary of inputs.

Parameters:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – Whether result caching is enabled

  • validate (bool, optional) – Whether parameter validation was performed

Note

These additional parameters (stream_callback, use_cache, validate) are passed from run_one_function() to provide context about the execution. Tools can use these for optimization or special handling.

For backward compatibility, tools that don’t accept these parameters will still work - they will only receive the arguments parameter.

class tooluniverse.efo_tool.OLSRESTTool[source]¶

Bases: BaseTool

Generic tool for the EMBL-EBI OLS v4 REST API.

This is a JSON-config driven tool. Each tool config supplies: - fields.kind: “search” | “term” | “children” | “ontology” | “ontologies” - fields.base_url: optional override (defaults to OLS4 API root) - fields.ontology_id: optional ontology scope (e.g., “efo”)

DEFAULT_BASE_URL = 'https://www.ebi.ac.uk/ols4/api'¶
static _double_urlencode(value)[source]¶
static _obo_id_to_efo_iri(obo_id)[source]¶
_resolve_term_iri(*, iri=None, obo_id=None)[source]¶
run(arguments)[source]¶

Execute the tool.

The default BaseTool implementation accepts an optional arguments mapping to align with most concrete tool implementations which expect a dictionary of inputs.

Parameters:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – Whether result caching is enabled

  • validate (bool, optional) – Whether parameter validation was performed

Note

These additional parameters (stream_callback, use_cache, validate) are passed from run_one_function() to provide context about the execution. Tools can use these for optimization or special handling.

For backward compatibility, tools that don’t accept these parameters will still work - they will only receive the arguments parameter.