tooluniverse 1.0.10__py3-none-any.whl → 1.0.11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of tooluniverse might be problematic. Click here for more details.
- tooluniverse/__init__.py +57 -1
- tooluniverse/blast_tool.py +132 -0
- tooluniverse/boltz_tool.py +2 -2
- tooluniverse/cbioportal_tool.py +42 -0
- tooluniverse/clinvar_tool.py +268 -74
- tooluniverse/compose_scripts/tool_discover.py +1941 -443
- tooluniverse/data/agentic_tools.json +0 -370
- tooluniverse/data/alphafold_tools.json +6 -6
- tooluniverse/data/blast_tools.json +112 -0
- tooluniverse/data/cbioportal_tools.json +87 -0
- tooluniverse/data/clinvar_tools.json +235 -0
- tooluniverse/data/compose_tools.json +0 -89
- tooluniverse/data/dbsnp_tools.json +275 -0
- tooluniverse/data/emdb_tools.json +61 -0
- tooluniverse/data/ensembl_tools.json +259 -0
- tooluniverse/data/file_download_tools.json +275 -0
- tooluniverse/data/geo_tools.json +200 -48
- tooluniverse/data/gnomad_tools.json +109 -0
- tooluniverse/data/gtopdb_tools.json +68 -0
- tooluniverse/data/gwas_tools.json +32 -0
- tooluniverse/data/interpro_tools.json +199 -0
- tooluniverse/data/jaspar_tools.json +70 -0
- tooluniverse/data/kegg_tools.json +356 -0
- tooluniverse/data/mpd_tools.json +87 -0
- tooluniverse/data/ols_tools.json +314 -0
- tooluniverse/data/package_discovery_tools.json +64 -0
- tooluniverse/data/packages/categorized_tools.txt +0 -1
- tooluniverse/data/packages/machine_learning_tools.json +0 -47
- tooluniverse/data/paleobiology_tools.json +91 -0
- tooluniverse/data/pride_tools.json +62 -0
- tooluniverse/data/pypi_package_inspector_tools.json +158 -0
- tooluniverse/data/python_executor_tools.json +341 -0
- tooluniverse/data/regulomedb_tools.json +50 -0
- tooluniverse/data/remap_tools.json +89 -0
- tooluniverse/data/screen_tools.json +89 -0
- tooluniverse/data/tool_discovery_agents.json +428 -0
- tooluniverse/data/tool_discovery_agents.json.backup +1343 -0
- tooluniverse/data/uniprot_tools.json +77 -0
- tooluniverse/data/web_search_tools.json +250 -0
- tooluniverse/data/worms_tools.json +55 -0
- tooluniverse/dbsnp_tool.py +196 -58
- tooluniverse/default_config.py +35 -2
- tooluniverse/emdb_tool.py +30 -0
- tooluniverse/ensembl_tool.py +140 -47
- tooluniverse/execute_function.py +74 -14
- tooluniverse/file_download_tool.py +269 -0
- tooluniverse/geo_tool.py +81 -28
- tooluniverse/gnomad_tool.py +100 -52
- tooluniverse/gtopdb_tool.py +41 -0
- tooluniverse/interpro_tool.py +72 -0
- tooluniverse/jaspar_tool.py +30 -0
- tooluniverse/kegg_tool.py +230 -0
- tooluniverse/mpd_tool.py +42 -0
- tooluniverse/ncbi_eutils_tool.py +96 -0
- tooluniverse/ols_tool.py +435 -0
- tooluniverse/package_discovery_tool.py +217 -0
- tooluniverse/paleobiology_tool.py +30 -0
- tooluniverse/pride_tool.py +30 -0
- tooluniverse/pypi_package_inspector_tool.py +593 -0
- tooluniverse/python_executor_tool.py +711 -0
- tooluniverse/regulomedb_tool.py +30 -0
- tooluniverse/remap_tool.py +44 -0
- tooluniverse/remote/depmap_24q2/depmap_24q2_mcp_tool.py +1 -1
- tooluniverse/screen_tool.py +44 -0
- tooluniverse/smcp_server.py +3 -3
- tooluniverse/tool_finder_embedding.py +3 -1
- tooluniverse/tool_finder_keyword.py +3 -1
- tooluniverse/tool_finder_llm.py +6 -2
- tooluniverse/tools/{UCSC_get_genes_by_region.py → BLAST_nucleotide_search.py} +22 -26
- tooluniverse/tools/BLAST_protein_search.py +63 -0
- tooluniverse/tools/ClinVar_search_variants.py +26 -15
- tooluniverse/tools/CodeQualityAnalyzer.py +3 -3
- tooluniverse/tools/EMDB_get_structure.py +46 -0
- tooluniverse/tools/GtoPdb_get_targets.py +52 -0
- tooluniverse/tools/InterPro_get_domain_details.py +46 -0
- tooluniverse/tools/InterPro_get_protein_domains.py +49 -0
- tooluniverse/tools/InterPro_search_domains.py +52 -0
- tooluniverse/tools/JASPAR_get_transcription_factors.py +52 -0
- tooluniverse/tools/MPD_get_phenotype_data.py +59 -0
- tooluniverse/tools/PRIDE_search_proteomics.py +52 -0
- tooluniverse/tools/PackageAnalyzer.py +55 -0
- tooluniverse/tools/Paleobiology_get_fossils.py +52 -0
- tooluniverse/tools/PyPIPackageInspector.py +59 -0
- tooluniverse/tools/ReMap_get_transcription_factor_binding.py +59 -0
- tooluniverse/tools/ReferenceInfoAnalyzer.py +55 -0
- tooluniverse/tools/RegulomeDB_query_variant.py +46 -0
- tooluniverse/tools/SCREEN_get_regulatory_elements.py +59 -0
- tooluniverse/tools/{ArgumentDescriptionOptimizer.py → TestResultsAnalyzer.py} +13 -13
- tooluniverse/tools/ToolDiscover.py +11 -11
- tooluniverse/tools/UniProt_id_mapping.py +63 -0
- tooluniverse/tools/UniProt_search.py +63 -0
- tooluniverse/tools/UnifiedToolGenerator.py +59 -0
- tooluniverse/tools/WoRMS_search_species.py +49 -0
- tooluniverse/tools/XMLToolOptimizer.py +55 -0
- tooluniverse/tools/__init__.py +119 -29
- tooluniverse/tools/alphafold_get_annotations.py +3 -3
- tooluniverse/tools/alphafold_get_prediction.py +3 -3
- tooluniverse/tools/alphafold_get_summary.py +3 -3
- tooluniverse/tools/cBioPortal_get_cancer_studies.py +46 -0
- tooluniverse/tools/cBioPortal_get_mutations.py +52 -0
- tooluniverse/tools/{gnomAD_query_variant.py → clinvar_get_clinical_significance.py} +8 -11
- tooluniverse/tools/clinvar_get_variant_details.py +49 -0
- tooluniverse/tools/dbSNP_get_variant_by_rsid.py +7 -7
- tooluniverse/tools/dbsnp_get_frequencies.py +46 -0
- tooluniverse/tools/dbsnp_search_by_gene.py +52 -0
- tooluniverse/tools/download_binary_file.py +66 -0
- tooluniverse/tools/download_file.py +71 -0
- tooluniverse/tools/download_text_content.py +55 -0
- tooluniverse/tools/dynamic_package_discovery.py +59 -0
- tooluniverse/tools/ensembl_get_sequence.py +52 -0
- tooluniverse/tools/{Ensembl_lookup_gene_by_symbol.py → ensembl_get_variants.py} +11 -11
- tooluniverse/tools/ensembl_lookup_gene.py +46 -0
- tooluniverse/tools/geo_get_dataset_info.py +46 -0
- tooluniverse/tools/geo_get_sample_info.py +46 -0
- tooluniverse/tools/geo_search_datasets.py +67 -0
- tooluniverse/tools/gnomad_get_gene_constraints.py +49 -0
- tooluniverse/tools/kegg_find_genes.py +52 -0
- tooluniverse/tools/kegg_get_gene_info.py +46 -0
- tooluniverse/tools/kegg_get_pathway_info.py +46 -0
- tooluniverse/tools/kegg_list_organisms.py +44 -0
- tooluniverse/tools/kegg_search_pathway.py +46 -0
- tooluniverse/tools/ols_find_similar_terms.py +63 -0
- tooluniverse/tools/{get_hyperopt_info.py → ols_get_ontology_info.py} +13 -10
- tooluniverse/tools/ols_get_term_ancestors.py +67 -0
- tooluniverse/tools/ols_get_term_children.py +67 -0
- tooluniverse/tools/{TestCaseGenerator.py → ols_get_term_info.py} +12 -9
- tooluniverse/tools/{CodeOptimizer.py → ols_search_ontologies.py} +22 -14
- tooluniverse/tools/ols_search_terms.py +71 -0
- tooluniverse/tools/python_code_executor.py +79 -0
- tooluniverse/tools/python_script_runner.py +79 -0
- tooluniverse/tools/web_api_documentation_search.py +63 -0
- tooluniverse/tools/web_search.py +71 -0
- tooluniverse/uniprot_tool.py +219 -16
- tooluniverse/url_tool.py +18 -0
- tooluniverse/utils.py +2 -2
- tooluniverse/web_search_tool.py +229 -0
- tooluniverse/worms_tool.py +64 -0
- {tooluniverse-1.0.10.dist-info → tooluniverse-1.0.11.dist-info}/METADATA +3 -2
- {tooluniverse-1.0.10.dist-info → tooluniverse-1.0.11.dist-info}/RECORD +143 -54
- tooluniverse/data/genomics_tools.json +0 -174
- tooluniverse/tools/ToolDescriptionOptimizer.py +0 -67
- tooluniverse/tools/ToolImplementationGenerator.py +0 -67
- tooluniverse/tools/ToolOptimizer.py +0 -59
- tooluniverse/tools/ToolSpecificationGenerator.py +0 -67
- tooluniverse/tools/ToolSpecificationOptimizer.py +0 -63
- tooluniverse/ucsc_tool.py +0 -60
- {tooluniverse-1.0.10.dist-info → tooluniverse-1.0.11.dist-info}/WHEEL +0 -0
- {tooluniverse-1.0.10.dist-info → tooluniverse-1.0.11.dist-info}/entry_points.txt +0 -0
- {tooluniverse-1.0.10.dist-info → tooluniverse-1.0.11.dist-info}/licenses/LICENSE +0 -0
- {tooluniverse-1.0.10.dist-info → tooluniverse-1.0.11.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ols_get_term_children
|
|
3
|
+
|
|
4
|
+
Get child terms of a specific term in an ontology
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from typing import Any, Optional, Callable
|
|
8
|
+
from ._shared_client import get_shared_client
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def ols_get_term_children(
|
|
12
|
+
operation: str,
|
|
13
|
+
term_iri: str,
|
|
14
|
+
ontology: str,
|
|
15
|
+
include_obsolete: Optional[bool] = False,
|
|
16
|
+
size: Optional[int] = 20,
|
|
17
|
+
*,
|
|
18
|
+
stream_callback: Optional[Callable[[str], None]] = None,
|
|
19
|
+
use_cache: bool = False,
|
|
20
|
+
validate: bool = True,
|
|
21
|
+
) -> Any:
|
|
22
|
+
"""
|
|
23
|
+
Get child terms of a specific term in an ontology
|
|
24
|
+
|
|
25
|
+
Parameters
|
|
26
|
+
----------
|
|
27
|
+
operation : str
|
|
28
|
+
The operation to perform (get_term_children)
|
|
29
|
+
term_iri : str
|
|
30
|
+
The IRI of the term to retrieve children for
|
|
31
|
+
ontology : str
|
|
32
|
+
The ontology ID
|
|
33
|
+
include_obsolete : bool
|
|
34
|
+
Include obsolete terms (default: false)
|
|
35
|
+
size : int
|
|
36
|
+
Number of results to return (default: 20)
|
|
37
|
+
stream_callback : Callable, optional
|
|
38
|
+
Callback for streaming output
|
|
39
|
+
use_cache : bool, default False
|
|
40
|
+
Enable caching
|
|
41
|
+
validate : bool, default True
|
|
42
|
+
Validate parameters
|
|
43
|
+
|
|
44
|
+
Returns
|
|
45
|
+
-------
|
|
46
|
+
Any
|
|
47
|
+
"""
|
|
48
|
+
# Handle mutable defaults to avoid B006 linting error
|
|
49
|
+
|
|
50
|
+
return get_shared_client().run_one_function(
|
|
51
|
+
{
|
|
52
|
+
"name": "ols_get_term_children",
|
|
53
|
+
"arguments": {
|
|
54
|
+
"operation": operation,
|
|
55
|
+
"term_iri": term_iri,
|
|
56
|
+
"ontology": ontology,
|
|
57
|
+
"include_obsolete": include_obsolete,
|
|
58
|
+
"size": size,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
stream_callback=stream_callback,
|
|
62
|
+
use_cache=use_cache,
|
|
63
|
+
validate=validate,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
__all__ = ["ols_get_term_children"]
|
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
"""
|
|
2
|
-
|
|
2
|
+
ols_get_term_info
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
Get detailed information about a specific term in OLS
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
7
|
from typing import Any, Optional, Callable
|
|
8
8
|
from ._shared_client import get_shared_client
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
def
|
|
12
|
-
|
|
11
|
+
def ols_get_term_info(
|
|
12
|
+
operation: str,
|
|
13
|
+
id: str,
|
|
13
14
|
*,
|
|
14
15
|
stream_callback: Optional[Callable[[str], None]] = None,
|
|
15
16
|
use_cache: bool = False,
|
|
16
17
|
validate: bool = True,
|
|
17
18
|
) -> Any:
|
|
18
19
|
"""
|
|
19
|
-
|
|
20
|
+
Get detailed information about a specific term in OLS
|
|
20
21
|
|
|
21
22
|
Parameters
|
|
22
23
|
----------
|
|
23
|
-
|
|
24
|
-
The
|
|
24
|
+
operation : str
|
|
25
|
+
The operation to perform (get_term_info)
|
|
26
|
+
id : str
|
|
27
|
+
The ID or IRI of the term to retrieve
|
|
25
28
|
stream_callback : Callable, optional
|
|
26
29
|
Callback for streaming output
|
|
27
30
|
use_cache : bool, default False
|
|
@@ -36,11 +39,11 @@ def TestCaseGenerator(
|
|
|
36
39
|
# Handle mutable defaults to avoid B006 linting error
|
|
37
40
|
|
|
38
41
|
return get_shared_client().run_one_function(
|
|
39
|
-
{"name": "
|
|
42
|
+
{"name": "ols_get_term_info", "arguments": {"operation": operation, "id": id}},
|
|
40
43
|
stream_callback=stream_callback,
|
|
41
44
|
use_cache=use_cache,
|
|
42
45
|
validate=validate,
|
|
43
46
|
)
|
|
44
47
|
|
|
45
48
|
|
|
46
|
-
__all__ = ["
|
|
49
|
+
__all__ = ["ols_get_term_info"]
|
|
@@ -1,30 +1,36 @@
|
|
|
1
1
|
"""
|
|
2
|
-
|
|
2
|
+
ols_search_ontologies
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
Search for ontologies in OLS
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
7
|
from typing import Any, Optional, Callable
|
|
8
8
|
from ._shared_client import get_shared_client
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
def
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
def ols_search_ontologies(
|
|
12
|
+
operation: str,
|
|
13
|
+
search: Optional[str] = None,
|
|
14
|
+
page: Optional[int] = 0,
|
|
15
|
+
size: Optional[int] = 20,
|
|
14
16
|
*,
|
|
15
17
|
stream_callback: Optional[Callable[[str], None]] = None,
|
|
16
18
|
use_cache: bool = False,
|
|
17
19
|
validate: bool = True,
|
|
18
20
|
) -> Any:
|
|
19
21
|
"""
|
|
20
|
-
|
|
22
|
+
Search for ontologies in OLS
|
|
21
23
|
|
|
22
24
|
Parameters
|
|
23
25
|
----------
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
operation : str
|
|
27
|
+
The operation to perform (search_ontologies)
|
|
28
|
+
search : str
|
|
29
|
+
Search query for ontologies (optional)
|
|
30
|
+
page : int
|
|
31
|
+
Page number (default: 0)
|
|
32
|
+
size : int
|
|
33
|
+
Number of results per page (default: 20)
|
|
28
34
|
stream_callback : Callable, optional
|
|
29
35
|
Callback for streaming output
|
|
30
36
|
use_cache : bool, default False
|
|
@@ -40,10 +46,12 @@ def CodeOptimizer(
|
|
|
40
46
|
|
|
41
47
|
return get_shared_client().run_one_function(
|
|
42
48
|
{
|
|
43
|
-
"name": "
|
|
49
|
+
"name": "ols_search_ontologies",
|
|
44
50
|
"arguments": {
|
|
45
|
-
"
|
|
46
|
-
"
|
|
51
|
+
"operation": operation,
|
|
52
|
+
"search": search,
|
|
53
|
+
"page": page,
|
|
54
|
+
"size": size,
|
|
47
55
|
},
|
|
48
56
|
},
|
|
49
57
|
stream_callback=stream_callback,
|
|
@@ -52,4 +60,4 @@ def CodeOptimizer(
|
|
|
52
60
|
)
|
|
53
61
|
|
|
54
62
|
|
|
55
|
-
__all__ = ["
|
|
63
|
+
__all__ = ["ols_search_ontologies"]
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ols_search_terms
|
|
3
|
+
|
|
4
|
+
Search for terms in OLS (Ontology Lookup Service)
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from typing import Any, Optional, Callable
|
|
8
|
+
from ._shared_client import get_shared_client
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def ols_search_terms(
|
|
12
|
+
operation: str,
|
|
13
|
+
query: str,
|
|
14
|
+
rows: Optional[int] = 10,
|
|
15
|
+
ontology: Optional[str] = None,
|
|
16
|
+
exact_match: Optional[bool] = False,
|
|
17
|
+
include_obsolete: Optional[bool] = False,
|
|
18
|
+
*,
|
|
19
|
+
stream_callback: Optional[Callable[[str], None]] = None,
|
|
20
|
+
use_cache: bool = False,
|
|
21
|
+
validate: bool = True,
|
|
22
|
+
) -> Any:
|
|
23
|
+
"""
|
|
24
|
+
Search for terms in OLS (Ontology Lookup Service)
|
|
25
|
+
|
|
26
|
+
Parameters
|
|
27
|
+
----------
|
|
28
|
+
operation : str
|
|
29
|
+
The operation to perform (search_terms)
|
|
30
|
+
query : str
|
|
31
|
+
The search query for terms
|
|
32
|
+
rows : int
|
|
33
|
+
Number of results to return (default: 10)
|
|
34
|
+
ontology : str
|
|
35
|
+
Filter by specific ontology (optional)
|
|
36
|
+
exact_match : bool
|
|
37
|
+
Search for exact matches only (default: false)
|
|
38
|
+
include_obsolete : bool
|
|
39
|
+
Include obsolete terms (default: false)
|
|
40
|
+
stream_callback : Callable, optional
|
|
41
|
+
Callback for streaming output
|
|
42
|
+
use_cache : bool, default False
|
|
43
|
+
Enable caching
|
|
44
|
+
validate : bool, default True
|
|
45
|
+
Validate parameters
|
|
46
|
+
|
|
47
|
+
Returns
|
|
48
|
+
-------
|
|
49
|
+
Any
|
|
50
|
+
"""
|
|
51
|
+
# Handle mutable defaults to avoid B006 linting error
|
|
52
|
+
|
|
53
|
+
return get_shared_client().run_one_function(
|
|
54
|
+
{
|
|
55
|
+
"name": "ols_search_terms",
|
|
56
|
+
"arguments": {
|
|
57
|
+
"operation": operation,
|
|
58
|
+
"query": query,
|
|
59
|
+
"rows": rows,
|
|
60
|
+
"ontology": ontology,
|
|
61
|
+
"exact_match": exact_match,
|
|
62
|
+
"include_obsolete": include_obsolete,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
stream_callback=stream_callback,
|
|
66
|
+
use_cache=use_cache,
|
|
67
|
+
validate=validate,
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
__all__ = ["ols_search_terms"]
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"""
|
|
2
|
+
python_code_executor
|
|
3
|
+
|
|
4
|
+
Execute Python code snippets safely in sandboxed environment with timeout and resource limits. Su...
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from typing import Any, Optional, Callable
|
|
8
|
+
from ._shared_client import get_shared_client
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def python_code_executor(
|
|
12
|
+
code: str,
|
|
13
|
+
arguments: Optional[dict[str, Any]] = None,
|
|
14
|
+
timeout: Optional[int] = 30,
|
|
15
|
+
return_variable: Optional[str] = "result",
|
|
16
|
+
allowed_imports: Optional[list[Any]] = None,
|
|
17
|
+
dependencies: Optional[list[Any]] = None,
|
|
18
|
+
auto_install_dependencies: Optional[bool] = False,
|
|
19
|
+
require_confirmation: Optional[bool] = True,
|
|
20
|
+
*,
|
|
21
|
+
stream_callback: Optional[Callable[[str], None]] = None,
|
|
22
|
+
use_cache: bool = False,
|
|
23
|
+
validate: bool = True,
|
|
24
|
+
) -> dict[str, Any]:
|
|
25
|
+
"""
|
|
26
|
+
Execute Python code snippets safely in sandboxed environment with timeout and resource limits. Su...
|
|
27
|
+
|
|
28
|
+
Parameters
|
|
29
|
+
----------
|
|
30
|
+
code : str
|
|
31
|
+
Python code to execute. Can use variables from 'arguments' parameter. Use 're...
|
|
32
|
+
arguments : dict[str, Any]
|
|
33
|
+
Variables to pass into execution environment as dictionary. Keys become varia...
|
|
34
|
+
timeout : int
|
|
35
|
+
Execution timeout in seconds
|
|
36
|
+
return_variable : str
|
|
37
|
+
Variable name to extract as result from the executed code
|
|
38
|
+
allowed_imports : list[Any]
|
|
39
|
+
Additional allowed modules beyond the default safe set (math, json, datetime,...
|
|
40
|
+
dependencies : list[Any]
|
|
41
|
+
List of Python packages that the code depends on. Will be checked and optiona...
|
|
42
|
+
auto_install_dependencies : bool
|
|
43
|
+
Whether to automatically install missing dependencies without user confirmation
|
|
44
|
+
require_confirmation : bool
|
|
45
|
+
Whether to require user confirmation before installing packages
|
|
46
|
+
stream_callback : Callable, optional
|
|
47
|
+
Callback for streaming output
|
|
48
|
+
use_cache : bool, default False
|
|
49
|
+
Enable caching
|
|
50
|
+
validate : bool, default True
|
|
51
|
+
Validate parameters
|
|
52
|
+
|
|
53
|
+
Returns
|
|
54
|
+
-------
|
|
55
|
+
dict[str, Any]
|
|
56
|
+
"""
|
|
57
|
+
# Handle mutable defaults to avoid B006 linting error
|
|
58
|
+
|
|
59
|
+
return get_shared_client().run_one_function(
|
|
60
|
+
{
|
|
61
|
+
"name": "python_code_executor",
|
|
62
|
+
"arguments": {
|
|
63
|
+
"code": code,
|
|
64
|
+
"arguments": arguments,
|
|
65
|
+
"timeout": timeout,
|
|
66
|
+
"return_variable": return_variable,
|
|
67
|
+
"allowed_imports": allowed_imports,
|
|
68
|
+
"dependencies": dependencies,
|
|
69
|
+
"auto_install_dependencies": auto_install_dependencies,
|
|
70
|
+
"require_confirmation": require_confirmation,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
stream_callback=stream_callback,
|
|
74
|
+
use_cache=use_cache,
|
|
75
|
+
validate=validate,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
__all__ = ["python_code_executor"]
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"""
|
|
2
|
+
python_script_runner
|
|
3
|
+
|
|
4
|
+
Run Python script files in isolated subprocess with resource limits and timeout. Supports command...
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from typing import Any, Optional, Callable
|
|
8
|
+
from ._shared_client import get_shared_client
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def python_script_runner(
|
|
12
|
+
script_path: str,
|
|
13
|
+
script_args: Optional[list[Any]] = None,
|
|
14
|
+
timeout: Optional[int] = 60,
|
|
15
|
+
working_directory: Optional[str] = None,
|
|
16
|
+
env_vars: Optional[dict[str, Any]] = None,
|
|
17
|
+
dependencies: Optional[list[Any]] = None,
|
|
18
|
+
auto_install_dependencies: Optional[bool] = False,
|
|
19
|
+
require_confirmation: Optional[bool] = True,
|
|
20
|
+
*,
|
|
21
|
+
stream_callback: Optional[Callable[[str], None]] = None,
|
|
22
|
+
use_cache: bool = False,
|
|
23
|
+
validate: bool = True,
|
|
24
|
+
) -> dict[str, Any]:
|
|
25
|
+
"""
|
|
26
|
+
Run Python script files in isolated subprocess with resource limits and timeout. Supports command...
|
|
27
|
+
|
|
28
|
+
Parameters
|
|
29
|
+
----------
|
|
30
|
+
script_path : str
|
|
31
|
+
Path to Python script file (.py) to execute
|
|
32
|
+
script_args : list[Any]
|
|
33
|
+
Command-line arguments to pass to the script
|
|
34
|
+
timeout : int
|
|
35
|
+
Execution timeout in seconds
|
|
36
|
+
working_directory : str
|
|
37
|
+
Working directory for script execution (defaults to script directory)
|
|
38
|
+
env_vars : dict[str, Any]
|
|
39
|
+
Environment variables to set for script execution
|
|
40
|
+
dependencies : list[Any]
|
|
41
|
+
List of Python packages that the script depends on. Will be checked and optio...
|
|
42
|
+
auto_install_dependencies : bool
|
|
43
|
+
Whether to automatically install missing dependencies without user confirmation
|
|
44
|
+
require_confirmation : bool
|
|
45
|
+
Whether to require user confirmation before installing packages
|
|
46
|
+
stream_callback : Callable, optional
|
|
47
|
+
Callback for streaming output
|
|
48
|
+
use_cache : bool, default False
|
|
49
|
+
Enable caching
|
|
50
|
+
validate : bool, default True
|
|
51
|
+
Validate parameters
|
|
52
|
+
|
|
53
|
+
Returns
|
|
54
|
+
-------
|
|
55
|
+
dict[str, Any]
|
|
56
|
+
"""
|
|
57
|
+
# Handle mutable defaults to avoid B006 linting error
|
|
58
|
+
|
|
59
|
+
return get_shared_client().run_one_function(
|
|
60
|
+
{
|
|
61
|
+
"name": "python_script_runner",
|
|
62
|
+
"arguments": {
|
|
63
|
+
"script_path": script_path,
|
|
64
|
+
"script_args": script_args,
|
|
65
|
+
"timeout": timeout,
|
|
66
|
+
"working_directory": working_directory,
|
|
67
|
+
"env_vars": env_vars,
|
|
68
|
+
"dependencies": dependencies,
|
|
69
|
+
"auto_install_dependencies": auto_install_dependencies,
|
|
70
|
+
"require_confirmation": require_confirmation,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
stream_callback=stream_callback,
|
|
74
|
+
use_cache=use_cache,
|
|
75
|
+
validate=validate,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
__all__ = ["python_script_runner"]
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"""
|
|
2
|
+
web_api_documentation_search
|
|
3
|
+
|
|
4
|
+
Specialized web search for API documentation, Python packages, and technical resources using DDGS...
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from typing import Any, Optional, Callable
|
|
8
|
+
from ._shared_client import get_shared_client
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def web_api_documentation_search(
|
|
12
|
+
query: str,
|
|
13
|
+
max_results: Optional[int] = 10,
|
|
14
|
+
focus: Optional[str] = "api_docs",
|
|
15
|
+
backend: Optional[str] = "auto",
|
|
16
|
+
*,
|
|
17
|
+
stream_callback: Optional[Callable[[str], None]] = None,
|
|
18
|
+
use_cache: bool = False,
|
|
19
|
+
validate: bool = True,
|
|
20
|
+
) -> dict[str, Any]:
|
|
21
|
+
"""
|
|
22
|
+
Specialized web search for API documentation, Python packages, and technical resources using DDGS...
|
|
23
|
+
|
|
24
|
+
Parameters
|
|
25
|
+
----------
|
|
26
|
+
query : str
|
|
27
|
+
Search query string (e.g., tool name, library name, API name)
|
|
28
|
+
max_results : int
|
|
29
|
+
Maximum number of results to return
|
|
30
|
+
focus : str
|
|
31
|
+
Focus area for the search
|
|
32
|
+
backend : str
|
|
33
|
+
Search engine backend to use
|
|
34
|
+
stream_callback : Callable, optional
|
|
35
|
+
Callback for streaming output
|
|
36
|
+
use_cache : bool, default False
|
|
37
|
+
Enable caching
|
|
38
|
+
validate : bool, default True
|
|
39
|
+
Validate parameters
|
|
40
|
+
|
|
41
|
+
Returns
|
|
42
|
+
-------
|
|
43
|
+
dict[str, Any]
|
|
44
|
+
"""
|
|
45
|
+
# Handle mutable defaults to avoid B006 linting error
|
|
46
|
+
|
|
47
|
+
return get_shared_client().run_one_function(
|
|
48
|
+
{
|
|
49
|
+
"name": "web_api_documentation_search",
|
|
50
|
+
"arguments": {
|
|
51
|
+
"query": query,
|
|
52
|
+
"max_results": max_results,
|
|
53
|
+
"focus": focus,
|
|
54
|
+
"backend": backend,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
stream_callback=stream_callback,
|
|
58
|
+
use_cache=use_cache,
|
|
59
|
+
validate=validate,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
__all__ = ["web_api_documentation_search"]
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"""
|
|
2
|
+
web_search
|
|
3
|
+
|
|
4
|
+
General web search using DDGS (Dux Distributed Global Search) supporting multiple search engines ...
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from typing import Any, Optional, Callable
|
|
8
|
+
from ._shared_client import get_shared_client
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def web_search(
|
|
12
|
+
query: str,
|
|
13
|
+
max_results: Optional[int] = 10,
|
|
14
|
+
search_type: Optional[str] = "general",
|
|
15
|
+
backend: Optional[str] = "auto",
|
|
16
|
+
region: Optional[str] = "us-en",
|
|
17
|
+
safesearch: Optional[str] = "moderate",
|
|
18
|
+
*,
|
|
19
|
+
stream_callback: Optional[Callable[[str], None]] = None,
|
|
20
|
+
use_cache: bool = False,
|
|
21
|
+
validate: bool = True,
|
|
22
|
+
) -> dict[str, Any]:
|
|
23
|
+
"""
|
|
24
|
+
General web search using DDGS (Dux Distributed Global Search) supporting multiple search engines ...
|
|
25
|
+
|
|
26
|
+
Parameters
|
|
27
|
+
----------
|
|
28
|
+
query : str
|
|
29
|
+
Search query string
|
|
30
|
+
max_results : int
|
|
31
|
+
Maximum number of results to return
|
|
32
|
+
search_type : str
|
|
33
|
+
Type of search to perform
|
|
34
|
+
backend : str
|
|
35
|
+
Search engine backend to use
|
|
36
|
+
region : str
|
|
37
|
+
Search region/locale
|
|
38
|
+
safesearch : str
|
|
39
|
+
Safe search level
|
|
40
|
+
stream_callback : Callable, optional
|
|
41
|
+
Callback for streaming output
|
|
42
|
+
use_cache : bool, default False
|
|
43
|
+
Enable caching
|
|
44
|
+
validate : bool, default True
|
|
45
|
+
Validate parameters
|
|
46
|
+
|
|
47
|
+
Returns
|
|
48
|
+
-------
|
|
49
|
+
dict[str, Any]
|
|
50
|
+
"""
|
|
51
|
+
# Handle mutable defaults to avoid B006 linting error
|
|
52
|
+
|
|
53
|
+
return get_shared_client().run_one_function(
|
|
54
|
+
{
|
|
55
|
+
"name": "web_search",
|
|
56
|
+
"arguments": {
|
|
57
|
+
"query": query,
|
|
58
|
+
"max_results": max_results,
|
|
59
|
+
"search_type": search_type,
|
|
60
|
+
"backend": backend,
|
|
61
|
+
"region": region,
|
|
62
|
+
"safesearch": safesearch,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
stream_callback=stream_callback,
|
|
66
|
+
use_cache=use_cache,
|
|
67
|
+
validate=validate,
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
__all__ = ["web_search"]
|