tooluniverse.ctg_tool module

tooluniverse.ctg_tool.deepcopy(x, memo=None, _nil=[])[source][source]

Deep copy operation on arbitrary Python objects.

See the module’s __doc__ string for more info.

tooluniverse.ctg_tool.urljoin(base, url, allow_fragments=True)[source][source]

Join a base URL and a possibly relative URL to form an absolute interpretation of the latter.

class tooluniverse.ctg_tool.RESTfulTool(tool_config, endpoint_url)[source][source]

Bases: GraphQLTool

__init__(tool_config, endpoint_url)[source][source]
run(arguments)[source][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.

tooluniverse.ctg_tool.execute_RESTful_query(endpoint_url, variables=None)[source][source]
tooluniverse.ctg_tool.register_tool(tool_type_name=None, config=None)[source][source]

Decorator to automatically register tool classes and their configs.

Usage:

@register_tool(‘CustomToolName’, config={…}) class MyTool:

pass

class tooluniverse.ctg_tool.ClinicalTrialsTool(tool_config)[source][source]

Bases: RESTfulTool

__init__(tool_config)[source][source]
run(arguments)[source][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.

class tooluniverse.ctg_tool.ClinicalTrialsSearchTool(tool_config)[source][source]

Bases: ClinicalTrialsTool

__init__(tool_config)[source][source]
run(arguments)[source][source]

Executes the search query for clinical trials.

Parameters:

arguments (dict) – A dictionary containing parameters provided by the user/LLM

Returns:

The JSON response from the API as a dictionary,

or raw text for non-JSON responses, or an error dictionary.

Return type:

dict or str

class tooluniverse.ctg_tool.ClinicalTrialsDetailsTool(tool_config)[source][source]

Bases: ClinicalTrialsTool

__init__(tool_config)[source][source]
run(arguments)[source][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.