Commit Graph

485 Commits

Author SHA1 Message Date
Lorenze Jay
b4786d86b0 refactor: enhance schema handling in EnterpriseActionTool (#355)
* refactor: enhance schema handling in EnterpriseActionTool

- Extracted schema property and required field extraction into separate methods for better readability and maintainability.
- Introduced methods to analyze field types and create Pydantic field definitions based on nullability and requirement status.
- Updated the _run method to handle required nullable fields, ensuring they are set to None if not provided in kwargs.

* refactor: streamline nullable field handling in EnterpriseActionTool

- Removed commented-out code related to handling required nullable fields for clarity.
- Simplified the logic in the _run method to focus on processing parameters without unnecessary comments.
2025-07-02 12:54:09 -07:00
Emmanuel Ferdman
d53e96fcd7 fix: update Pydantic schema access (#337)
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
2025-07-02 09:25:26 -07:00
Thiago Moretto
26652e5e24 Mapping required env vars of more tools (#353) 2025-07-01 14:08:30 -04:00
Lorenze Jay
180cc38330 refactor: update Firecrawl tools to improve configuration and error handling (#351)
- Added TYPE_CHECKING imports for FirecrawlApp to enhance type safety.
- Updated configuration keys in FirecrawlCrawlWebsiteTool and FirecrawlScrapeWebsiteTool to camelCase for consistency.
- Introduced error handling in the _run methods of both tools to ensure FirecrawlApp is properly initialized before usage.
- Adjusted parameters passed to crawl_url and scrape_url methods to use 'params' instead of unpacking the config dictionary directly.
2025-06-27 11:27:48 -07:00
Lorenze Jay
8723e66807 feat: add support for parsing actions list from environment variables (#346)
* feat: add support for parsing actions list from environment variables

This commit introduces a new function, _parse_actions_list, to handle the parsing of a string representation of a list of tool names from environment variables. The CrewaiEnterpriseTools now utilizes this function to filter tools based on the parsed actions list, enhancing flexibility in tool selection. Additionally, a new test case is added to verify the correct usage of the environment actions list.

* test: simplify environment actions list test setup

This commit refactors the test for CrewaiEnterpriseTools to streamline the setup of environment variables. The environment token and actions list are now set in a single patch.dict call, improving readability and reducing redundancy in the test code.
2025-06-25 11:14:41 -07:00
Lorenze Jay
e4cb8bf797 Lorenze/better env vars setup enterprise tools (#343)
* refactor: remove token validation from EnterpriseActionKitToolAdapter and CrewaiEnterpriseTools

This commit simplifies the initialization of the EnterpriseActionKitToolAdapter and CrewaiEnterpriseTools by removing the explicit validation for the enterprise action token. The token can now be set to None without raising an error, allowing for more flexible usage.

* added loggers for monitoring

* fixed typo

* fix: enhance token handling in EnterpriseActionKitToolAdapter and CrewaiEnterpriseTools

This commit improves the handling of the enterprise action token by allowing it to be fetched from environment variables if not provided. It adds checks to ensure the token is set before making API requests, enhancing robustness and flexibility.

* removed redundancy

* test: add new test for environment token fallback in CrewaiEnterpriseTools

This update introduces a new test case to verify that the environment token is used when no token is provided during the initialization of CrewaiEnterpriseTools. Additionally, minor formatting adjustments were made to existing assertions for consistency.

* test: update environment token test to clear environment variables

This change modifies the test for CrewaiEnterpriseTools to ensure that the environment variables are cleared before setting the test token. This ensures a clean test environment and prevents potential interference from other tests.

* drop redundancy
2025-06-25 10:17:26 -07:00
Lucas Gomide
03917411b4 Support to filter available MCP Tools (#345)
* feat: support to complex filter on ToolCollection

* refactor: use proper tool collection methot to filter tool in CrewAiEnterpriseTools

* feat: allow to filter available MCP tools
2025-06-25 12:32:22 -04:00
Lucas Gomide
e8825d071a feat: support api_key fallback to EXA_API_KEY env-var (#341) 2025-06-24 14:47:39 -04:00
Rostyslav Borovyk
78a062a907 Add Oxylabs Web Scraping tools (#312)
* Add Oxylabs tools

* Review updates

* Add package_dependencies attribute
2025-06-24 09:56:47 -04:00
Lucas Gomide
c13b08de2e fix: add support for case-insensitive Enterprise filter (#340) 2025-06-20 11:09:45 -04:00
Lucas Gomide
31b3dd2b94 feat: Add ToolCollection class for named tool access (#339)
This change allows accessing tools by name (tools["tool_name"]) in addition to
index (tools[0]), making it more intuitive and convenient to work with multiple
tools without needing to remember their position in the list
2025-06-20 09:27:10 -04:00
Lucas Gomide
9e92b84bcc feat: mapping explicitly tool environment variables (#338) 2025-06-20 08:06:11 -04:00
Lucas Gomide
2cca45b45a refactor: renaming init_params and run_params to reflect their schema. (#332) (#333)
We’re currently using the JSON Schema standard for these fields
2025-06-17 07:52:51 -04:00
Lucas Gomide
fac32d9503 Support to collect extra package dependencies of Tools (#330)
* feat: add explictly package_dependencies in the Tools

* feat: collect package_dependencies from Tool to add in tool.specs.json

* feat: add default value in run_params Tool' specs

* fix: support get boolean values

This commit also refactor test to make easier define newest attributes into a Tool
2025-06-16 10:09:19 -04:00
Lorenze Jay
5a99f07765 refactor: remove token validation from EnterpriseActionKitToolAdapter… (#331)
* refactor: remove token validation from EnterpriseActionKitToolAdapter and CrewaiEnterpriseTools

This commit simplifies the initialization of the EnterpriseActionKitToolAdapter and CrewaiEnterpriseTools by removing the explicit validation for the enterprise action token. The token can now be set to None without raising an error, allowing for more flexible usage.

* added loggers for monitoring

* fixed typo
2025-06-14 12:21:18 -07:00
Lucas Gomide
dc2d4af8ea fix: ensure the entire file will be read when the start_line is None (#325) 2025-06-11 09:02:56 -04:00
Lucas Gomide
748f438232 Support to generate a tool spec file for each published released (#313)
* feat: generate tool specs file based on their schema definition

* generate tool spec after publishing a new release

* feat: support add available env-vars to tool.specs.json

* refactor: use better identifier names on tool specs

* feat: change tool specs generation to run daily

* feat: add auth token to notify api about tool changes

* refactor: use humanized_name instead of verbose_name

* refactor: generate tool spec after pushing to main

This commit also fix the remote upstream & updated the notify api
2025-06-03 10:11:17 -04:00
Lucas Gomide
72b3a8c70a feat: allow to provide the driver and options to be used by Selenium (#316) 2025-05-30 08:13:11 -04:00
Lorenze Jay
5d5377cfb9 feat: add ZapierActionTool and ZapierActionsAdapter for integrating with Zapier actions (#311)
* feat: add ZapierActionTool and ZapierActionsAdapter for integrating with Zapier actions

- Introduced ZapierActionTool to execute Zapier actions with dynamic parameter handling.
- Added ZapierActionsAdapter to fetch available Zapier actions and convert them into BaseTool instances.
- Updated __init__.py files to include new tools and ensure proper imports.
- Created README.md for ZapierActionTools with installation instructions and usage examples.

* fix: restore ZapierActionTool import and enhance logging in Zapier adapter

- Reintroduced the import of ZapierActionTool in __init__.py for proper accessibility.
- Added logging for error handling in ZapierActionsAdapter to improve debugging.
- Updated ZapierActionTools factory function to include logging for missing API key.
2025-05-27 09:54:35 -07:00
Lucas Gomide
0dbcbde119 fix: remove logging.basicConfig definition from Tool (#305) 2025-05-14 14:38:11 -04:00
Ranuga Disansa
ba6a85d342 Add TavilyExtractorTool and TavilySearchTool with documentation (#279)
* feat(tavily): add TavilyExtractorTool and TavilySearchTool with documentation

* feat(tavily): enhance TavilyExtractorTool and TavilySearchTool with additional parameters and improved error handling

* fix(tavily): update installation instructions for 'tavily-python' package in TavilyExtractorTool and TavilySearchTool

---------

Co-authored-by: lorenzejay <lorenzejaytech@gmail.com>
2025-05-14 09:45:12 -07:00
Mark McDonald
8b887b4eb3 Fix Callable reference in QdrantVectorSearchTool (#304)
The built-in `callable` type is not subscriptable, and thus not usable
in a type annotation. When this tool is used, this warning is generated:

```
.../_generate_schema.py:623: UserWarning: <built-in function callable> is not a Python type (it may be an instance of an object), Pydantic will allow any object with no validation since we cannot even enforce that the input is an instance of the given type. To get rid of this error wrap the type with `pydantic.SkipValidation`.
```

This change fixes the warning.
2025-05-13 17:13:07 -04:00
Filip Michalsky
8ecc958e4c stagehand tool (#277)
* stagehand tool

* update import paths

* updates

* improve example

* add tests

* revert init

* imports

* add context manager

* update tests

* update example to run again

* update context manager docs

* add to pyproject.toml and run uv sync

* run uv sync

* update lazy import

* update test mock

* fixing tests

* attempt to fix tests
2025-05-10 09:53:20 -04:00
Harikrishnan K
64f6f998d8 FileCompressorTool with support for files and subdirectories (#282)
* FileCompressorTool with support for files and subdirectories

* README.md

* Updated files_compressor_tool.py

* Enhanced FileCompressorTool different compression formats

* Update README.md

* Updated with lookup tables

* Updated files_compressor_tool.py

* Added Test Cases

* Removing Test_Cases.md inorder to update with correct test case as per the review

* Added Test Cases

* Test Cases with patch,MagicMock

* Empty lines Removed

* Updated Test Case,Ensured Maximum Scenarios

* Deleting old one

* Updated __init__.py to include FileCompressorTool

* Update __init__.py to add FileCompressorTool
2025-05-08 13:17:17 -04:00
nicoferdi96
edd4e5bef9 Fix FirecrawlScrapeWebsiteTool (#298)
* fix FirecrawlScrapeWebsiteTool: add missing config parameter and correct Dict type annotation

- Add required config parameter when creating the tool
- Change type hint from `dict` to `Dict` to resolve Pydantic validation issues

* Update firecrawl_scrape_website_tool.py

- removing optional config
- removing timeout from Pydantic model

* Removing config from __init__

- removing config from __init__

* Update firecrawl_scrape_website_tool.py

- removing timeout
2025-05-07 12:34:15 -04:00
Lucas Gomide
fd4ef4f47a fix: Remove kwargs from all RagTools (#285)
* fix: remove kwargs from all (except mysql & pg) RagTools

The agent uses the tool description to decide what to propagate when a tool with **kwargs is found, but this often leads to failures during the tool invocation step.

This happens because the final description ends up like this:

```
CrewStructuredTool(name='Knowledge base', description='Tool Name: Knowledge base
Tool Arguments: {'query': {'description': None, 'type': 'str'}, 'kwargs': {'description': None, 'type': 'Any'}}
Tool Description: A knowledge base that can be used to answer questions.')
```

The agent then tries to infer and pass a kwargs parameter, which isn’t supported by the schema at all.

* feat: adding test to search tools

* feat: add db (chromadb folder) to .gitignore

* fix: fix github search integration

A few attributes were missing when calling the .add method: data_type and loader.

Also, update the query search according to the EmbedChain documentation, the query must include the type and repo keys

* fix: rollback YoutubeChannel paramenter

* chore: fix type hinting for CodeDocs search

* fix: ensure proper configuration when call `add`

According to the documentation, some search methods must be defined as either a loader or a data_type. This commit ensures that.

* build: add optional-dependencies for github and xml search

* test: mocking external requests from search_tool tests

* build: add pytest-recording as devDependencie
2025-05-05 14:15:50 -04:00
Lorenze Jay
93d043bcd4 Enhance EnterpriseActionKitToolAdapter to support custom project IDs (#297)
* Enhance EnterpriseActionKitToolAdapter to support custom project IDs

- Updated the EnterpriseActionKitToolAdapter and EnterpriseActionTool classes to accept an optional project_id parameter, allowing for greater flexibility in API interactions.
- Modified API URL construction to utilize the provided project_id instead of a hardcoded default.
- Updated the CrewaiEnterpriseTools factory function to accept and pass the project_id to the adapter.

* for factory in mind
2025-05-04 10:41:54 -07:00
Daniel Barreto
67be0c674d Allow setting custom LLM for the vision tool (#294)
* Allow setting custom LLM for the vision tool

Defaults to gpt-4o-mini otherwise

* Enhance VisionTool with model management and improved initialization

- Added support for setting a custom model identifier with a default of "gpt-4o-mini".
- Introduced properties for model management, allowing dynamic updates and resetting of the LLM instance.
- Updated the initialization method to accept an optional LLM and model parameter.
- Refactored the image processing logic for clarity and efficiency.

* docstrings

* Add stop config

---------

Co-authored-by: lorenzejay <lorenzejaytech@gmail.com>
2025-04-28 19:53:00 -03:00
benzakritesteur
82d0209ce2 Fix firecrawl tool (Too many positional arguments) (#275)
* Corrected to adapt to firecrawl package use

Was leading to an error too many arguments when calling the craw_url() function

* Corrected to adapt to firecrawl package use

Corrected to avoid too many arguments error when calling firecrawl scrape_url function

* Corrected to adapt to firecrawl package use

Corrected to avoid error too many arguments when calling firecrawl search() function

* fix: fix firecrawl integration

* feat: support define Firecrawl using any config

Currently we pre-defined the available paramenters to call Firecrawl, this commit adds support to receive any parameter and propagate them

* docs: added doc string to Firecrawls classes

---------

Co-authored-by: Lucas Gomide <lucaslg200@gmail.com>
2025-04-28 13:57:03 -04:00
João Moura
6909c587c2 Merge pull request #286 from crewAIInc/joaodmmoura/crewai-enterprise-tool
new tool around adapter
2025-04-27 23:18:34 -07:00
João Moura
7c1a87e5ab new tool around adapter 2025-04-24 23:05:50 -07:00
João Moura
af5a605f31 Merge pull request #284 from crewAIInc/lorenze/enterprise-integrations
Lorenze/enterprise tools integrations
2025-04-24 14:48:02 -07:00
lorenzejay
40dd22ce2c refactor: remove main execution block from EnterpriseActionKitToolAdapter
- Removed the main execution block that included token validation and agent/task setup for testing.
- This change streamlines the adapter's code, focusing on its core functionality without execution logic.
2025-04-24 14:39:55 -07:00
lorenzejay
4d86da80c3 feat: add EnterpriseActionKitToolAdapter and EnterpriseActionTool for enterprise action execution
- Introduced EnterpriseActionTool to execute specific enterprise actions with dynamic parameter validation.
- Added EnterpriseActionKitToolAdapter to manage and create tool instances for available enterprise actions.
- Implemented methods for fetching action schemas from the API and creating corresponding tools.
- Enhanced error handling and provided detailed descriptions for tool parameters.
- Included a main execution block for testing the adapter with a sample agent and task setup.
2025-04-24 14:20:40 -07:00
Lucas Gomide
edc9b44c47 Add secure Python Sandbox and Enhanced Logging in CodeInterpreterTool (#281)
* feat: add a safety sandbox to run Python code

This sandbox blocks a bunch of dangerous imports and built-in functions

* feat: add more logs and warning about code execution

* test: add tests to cover sandbox code execution

* docs: add Google-style docstrings and type hints to printer and code_interpreter

* chore: renaming globals and locals paramenters

---------

Co-authored-by: Greyson Lalonde <greyson.r.lalonde@gmail.com>
2025-04-23 15:42:05 -04:00
Lucas Gomide
78d0ec501d fix: do not use deprecated distutils in FileWriterTool (#280) 2025-04-23 10:29:07 -04:00
Milad Noroozi
7973c163f3 Add chunk reading functionality to FileReadTool (#266)
* Add chunk reading functionality to FileReadTool

- Added start_line parameter to specify which line to start reading from
- Added line_count parameter to specify how many lines to read
- Updated documentation with new parameters and examples

* [FIX] Bugs and Disscutions

Fixed: start_line negative value
Improved: File Reading Operations

* [IMPROVE] Simplify line selection

* [REFACTOR] use mock_open while preserving essential filesystem tests
2025-04-22 10:18:29 -04:00
Guillaume Raille
a270742319 mcp server proposal (#267)
* mcp server proposal

* Refactor MCP server implementation: rename MCPServer to MCPServerAdapter and update usage examples. Adjust error message for optional dependencies installation.

* Update MCPServerAdapter usage examples to remove unnecessary parameters in context manager instantiation.

* Refactor MCPServerAdapter to move optional dependency imports inside the class constructor, improving error handling for missing dependencies.

* Enhance MCPServerAdapter by adding type hinting for server parameters and improving error handling during server startup. Optional dependency imports are now conditionally loaded, ensuring clearer error messages for missing packages.

* Refactor MCPServerAdapter to improve error handling for missing 'mcp' package. Conditional imports are now used, prompting users to install the package if not found, enhancing user experience during server initialization.

* Refactor MCPServerAdapter to ensure proper cleanup after usage. Removed redundant exception handling and ensured that the server stops in a finally block, improving resource management.

* add documentation

* fix typo close -> stop

* add tests and fix double call with context manager

* Enhance MCPServerAdapter with logging capabilities and improved error handling during initialization. Added logging for cleanup errors and refined the structure for handling missing 'mcp' package dependencies.

---------

Co-authored-by: lorenzejay <lorenzejaytech@gmail.com>
2025-04-16 10:18:07 -07:00
Lucas Gomide
8cbdaeaff5 refactor(selenium): improve driver management and add headless mode (#268)
- Refactor Selenium scraping tool to use single driver instance
- Add headless mode configuration for Chrome
- Improve error handling with try/finally
- Simplify code structure and improve maintainability
2025-04-15 10:50:40 -04:00
Lucas Gomide
a95be24865 Merge pull request #262 from GibsonAI/tool-typo-fixes
Fix typo "seach" -> "search" in tools
2025-04-11 10:05:17 -03:00
Nathan Chapman
c2cb8e06be Fix typo seach -> search in tools 2025-04-10 17:38:28 -05:00
Vini Brasil
257f4bf385 Test optional dependencies are not required in runtime (#260)
* Test optional dependencies are not required in runtime

* Add dynamic imports to S3 tools

* Setup CI
2025-04-08 13:20:11 -04:00
Lucas Gomide
6f95572e18 Merge pull request #237 from SHIXOOM/Fix-FireCrawl-Crawler-Tool
Fix: FirecrawlCrawlWebsiteTool update parameters for FireCrawl API v1 and update run arguments for agents
2025-04-06 14:06:32 -04:00
lorenzejay
89394ef3e3 Refactor: Clean up FirecrawlCrawlWebsiteTool schema field descriptions and formatting for improved readability 2025-04-04 11:42:32 -07:00
Lucas Gomide
90c9d5d71d Merge pull request #250 from parthbs/feat/local-qdrant-client-support
#249 feat: add support for local qdrant client
2025-04-02 10:16:14 -03:00
Lorenze Jay
5b06a0c189 Merge pull request #253 from crewAIInc/fix/clear-more-warnings-databricks
cleanup more warnings from tools
2025-04-01 10:47:25 -07:00
lorenzejay
6b4453e1b1 refactor: rename schema to db_schema in DatabricksQueryTool for clarity 2025-04-01 10:42:36 -07:00
Lorenze Jay
d842e9df97 Merge pull request #252 from crewAIInc/feature-cleanup-pydatic-issues
feat: cleanup Pydantic warning
2025-04-01 09:27:41 -07:00
lucasgomide
47acb5c3e4 feat: cleanup Pydantic warning
A several warnings were addressed following by  https://docs.pydantic.dev/2.10/migration
2025-04-01 09:55:01 -03:00
Shady Ali
e0adb4695c Addressed review comments and made further improvements 2025-03-28 16:58:47 +02:00