Skip to content

Commit bfa6798

Browse files
committed
fix: remove duplicated Exa tool
1 parent 431100d commit bfa6798

4 files changed

Lines changed: 13 additions & 220 deletions

File tree

lib/crewai-tools/src/crewai_tools/generate_tool_specs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ def extract_all_tools(self) -> list[dict[str, Any]]:
3232
if name.endswith("Tool") and name not in self.processed_tools:
3333
obj = getattr(tools, name, None)
3434
if inspect.isclass(obj) and issubclass(obj, BaseTool):
35+
if getattr(obj, "is_deprecated_alias", False):
36+
continue
3537
self.extract_tool_info(obj)
3638
self.processed_tools.add(name)
3739
return self.tools_spec

lib/crewai-tools/src/crewai_tools/tools/exa_tools/exa_search_tool.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from builtins import type as type_
44
import os
5-
from typing import Any, TypedDict
5+
from typing import Any, ClassVar, TypedDict
66
import warnings
77

88
from crewai.tools import BaseTool, EnvVar
@@ -160,6 +160,8 @@ def _run(
160160
class EXASearchTool(ExaSearchTool):
161161
"""Deprecated alias for :class:`ExaSearchTool`. Kept for backwards compatibility."""
162162

163+
is_deprecated_alias: ClassVar[bool] = True
164+
163165
name: str = "ExaSearchTool"
164166

165167
def __init__(self, *args: Any, **kwargs: Any) -> None:

lib/crewai-tools/tests/tools/exa_search_tool_test.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,11 @@ def test_exasearchtool_alias_is_deprecated():
111111
with pytest.warns(DeprecationWarning, match="ExaSearchTool"):
112112
tool = EXASearchTool(api_key="test_api_key")
113113
assert isinstance(tool, ExaSearchTool)
114+
115+
116+
def test_deprecated_alias_excluded_from_tool_specs():
117+
from crewai_tools.generate_tool_specs import ToolSpecExtractor
118+
119+
names = {tool["name"] for tool in ToolSpecExtractor().extract_all_tools()}
120+
assert "ExaSearchTool" in names
121+
assert "EXASearchTool" not in names

lib/crewai-tools/tool.specs.json

Lines changed: 0 additions & 219 deletions
Original file line numberDiff line numberDiff line change
@@ -9622,225 +9622,6 @@
96229622
"type": "object"
96239623
}
96249624
},
9625-
{
9626-
"description": "Search the web with Exa, the fastest and most accurate web search API.",
9627-
"env_vars": [
9628-
{
9629-
"default": null,
9630-
"description": "API key for Exa services",
9631-
"name": "EXA_API_KEY",
9632-
"required": false
9633-
},
9634-
{
9635-
"default": null,
9636-
"description": "API url for the Exa services",
9637-
"name": "EXA_BASE_URL",
9638-
"required": false
9639-
}
9640-
],
9641-
"humanized_name": "ExaSearchTool",
9642-
"init_params_schema": {
9643-
"$defs": {
9644-
"EnvVar": {
9645-
"properties": {
9646-
"default": {
9647-
"anyOf": [
9648-
{
9649-
"type": "string"
9650-
},
9651-
{
9652-
"type": "null"
9653-
}
9654-
],
9655-
"default": null,
9656-
"title": "Default"
9657-
},
9658-
"description": {
9659-
"title": "Description",
9660-
"type": "string"
9661-
},
9662-
"name": {
9663-
"title": "Name",
9664-
"type": "string"
9665-
},
9666-
"required": {
9667-
"default": true,
9668-
"title": "Required",
9669-
"type": "boolean"
9670-
}
9671-
},
9672-
"required": [
9673-
"name",
9674-
"description"
9675-
],
9676-
"title": "EnvVar",
9677-
"type": "object"
9678-
}
9679-
},
9680-
"description": "Deprecated alias for :class:`ExaSearchTool`. Kept for backwards compatibility.",
9681-
"properties": {
9682-
"api_key": {
9683-
"anyOf": [
9684-
{
9685-
"type": "string"
9686-
},
9687-
{
9688-
"type": "null"
9689-
}
9690-
],
9691-
"description": "API key for Exa services",
9692-
"required": false,
9693-
"title": "Api Key"
9694-
},
9695-
"base_url": {
9696-
"anyOf": [
9697-
{
9698-
"type": "string"
9699-
},
9700-
{
9701-
"type": "null"
9702-
}
9703-
],
9704-
"description": "API server url",
9705-
"required": false,
9706-
"title": "Base Url"
9707-
},
9708-
"client": {
9709-
"anyOf": [
9710-
{},
9711-
{
9712-
"type": "null"
9713-
}
9714-
],
9715-
"default": null,
9716-
"title": "Client"
9717-
},
9718-
"content": {
9719-
"anyOf": [
9720-
{
9721-
"type": "boolean"
9722-
},
9723-
{
9724-
"additionalProperties": true,
9725-
"type": "object"
9726-
},
9727-
{
9728-
"type": "null"
9729-
}
9730-
],
9731-
"default": false,
9732-
"title": "Content"
9733-
},
9734-
"highlights": {
9735-
"anyOf": [
9736-
{
9737-
"type": "boolean"
9738-
},
9739-
{
9740-
"additionalProperties": true,
9741-
"type": "object"
9742-
},
9743-
{
9744-
"type": "null"
9745-
}
9746-
],
9747-
"default": true,
9748-
"title": "Highlights"
9749-
},
9750-
"summary": {
9751-
"anyOf": [
9752-
{
9753-
"type": "boolean"
9754-
},
9755-
{
9756-
"additionalProperties": true,
9757-
"type": "object"
9758-
},
9759-
{
9760-
"type": "null"
9761-
}
9762-
],
9763-
"default": false,
9764-
"title": "Summary"
9765-
},
9766-
"type": {
9767-
"anyOf": [
9768-
{
9769-
"type": "string"
9770-
},
9771-
{
9772-
"type": "null"
9773-
}
9774-
],
9775-
"default": "auto",
9776-
"title": "Type"
9777-
}
9778-
},
9779-
"required": [],
9780-
"title": "EXASearchTool",
9781-
"type": "object"
9782-
},
9783-
"name": "EXASearchTool",
9784-
"package_dependencies": [
9785-
"exa_py"
9786-
],
9787-
"run_params_schema": {
9788-
"properties": {
9789-
"end_published_date": {
9790-
"anyOf": [
9791-
{
9792-
"type": "string"
9793-
},
9794-
{
9795-
"type": "null"
9796-
}
9797-
],
9798-
"default": null,
9799-
"description": "End date for the search",
9800-
"title": "End Published Date"
9801-
},
9802-
"include_domains": {
9803-
"anyOf": [
9804-
{
9805-
"items": {
9806-
"type": "string"
9807-
},
9808-
"type": "array"
9809-
},
9810-
{
9811-
"type": "null"
9812-
}
9813-
],
9814-
"default": null,
9815-
"description": "List of domains to include in the search",
9816-
"title": "Include Domains"
9817-
},
9818-
"search_query": {
9819-
"description": "Mandatory search query you want to use to search the internet",
9820-
"title": "Search Query",
9821-
"type": "string"
9822-
},
9823-
"start_published_date": {
9824-
"anyOf": [
9825-
{
9826-
"type": "string"
9827-
},
9828-
{
9829-
"type": "null"
9830-
}
9831-
],
9832-
"default": null,
9833-
"description": "Start date for the search",
9834-
"title": "Start Published Date"
9835-
}
9836-
},
9837-
"required": [
9838-
"search_query"
9839-
],
9840-
"title": "ExaBaseToolSchema",
9841-
"type": "object"
9842-
}
9843-
},
98449625
{
98459626
"description": "Search the web with Exa, the fastest and most accurate web search API.",
98469627
"env_vars": [

0 commit comments

Comments
 (0)