-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Release/v1.0.0 #3618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release/v1.0.0 #3618
Conversation
* feat: add app attributes to Agent * feat: add actions attribute to Agent * chore: resolve linter issues * refactor: merge the apps and actions parameters into a single one * fix: remove unnecessary print * feat: logging error when CrewaiPlatformTools fails * chore: export CrewaiPlatformTools directly from crewai_tools * style: resolver linter issues * test: fix broken tests * style: solve linter issues * fix: fix broken test
- Add crewai workspace member - Fix vcr cassette paths and restore test dirs - Resolve ci failures and update linter/pytest rules
* feat: add crewai-tools workspace structure * Squashed 'temp-crewai-tools/' content from commit 9bae5633 git-subtree-dir: temp-crewai-tools git-subtree-split: 9bae56339096cb70f03873e600192bd2cd207ac9 * feat: configure crewai-tools workspace package with dependencies * fix: apply ruff auto-formatting to crewai-tools code * chore: update lockfile * fix: don't allow tool tests yet * fix: comment out extra pytest flags for now * fix: remove conflicting conftest.py from crewai-tools tests * fix: resolve dependency conflicts and test issues - Pin vcrpy to 7.0.0 to fix pytest-recording compatibility - Comment out types-requests to resolve urllib3 conflict - Update requests requirement in crewai-tools to >=2.32.0
* chore: update CI workflows and docs for monorepo structure * fix: actions syntax
- Updated version to 1.0.0a1 in pyproject.toml for crewai and crewai-tools - Adjusted version in __init__.py files for consistency
(cherry picked from commit d46e20fa09bcd2f5916282f5553ddeb7183bd92c)
|
|
||
| if "docs" in url.netloc or ("docs" in url.path and url.scheme != "file"): | ||
| return DataType.DOCS_SITE | ||
| if "github.com" in url.netloc: |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 24 days ago
The best way to fix this problem is to avoid substring matching and instead safely check that the hostname is exactly github.com or matches a valid subdomain of github.com. This can be done by parsing the netloc into its hostname—using urlparse—and then checking with either an exact match, or, if allowing subdomains, ensuring the hostname is either github.com or ends with .github.com. This logic should only match valid hosts, not arbitrary hosts that merely contain the substring. The change should be made directly at line 146, replacing the substring check with an explicit, boundary-aware comparison using the parsed hostname.
No new method definitions are needed, but care should be taken to always use the correct element of urlparse (i.e., url.hostname, not url.netloc). The fix should, within the block beginning at line 139, replace the substring check with a secure check.
-
Copy modified line R146
| @@ -143,7 +143,7 @@ | ||
|
|
||
| if "docs" in url.netloc or ("docs" in url.path and url.scheme != "file"): | ||
| return DataType.DOCS_SITE | ||
| if "github.com" in url.netloc: | ||
| if url.hostname == "github.com" or (url.hostname and url.hostname.endswith(".github.com")): | ||
| return DataType.GITHUB | ||
|
|
||
| return DataType.WEBSITE |
| ) | ||
|
|
||
| # Assertions | ||
| assert "https://example.com" in result |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 25 days ago
To fix the problem, the test should not assert that the string "https://example.com" occurs somewhere in the result. Instead, it should parse any URLs from the string and verify the expected value, or—in this mocked context—assert the result equals the expected output string directly. The best fix for this case is to assert equality between result and the expected string "Successfully navigated to https://example.com", rather than that the substring appears somewhere in the result.
Edit the test function test_navigate_command in lib/crewai-tools/tests/tools/stagehand_tool_test.py, changing line 174 from a substring check to an equality check. No new imports are required.
-
Copy modified line R174
| @@ -171,7 +171,7 @@ | ||
| ) | ||
|
|
||
| # Assertions | ||
| assert "https://example.com" in result | ||
| assert result == "Successfully navigated to https://example.com" | ||
|
|
||
|
|
||
| @patch( |
|
You have run out of free Bugbot PR reviews for this billing cycle. This will reset on October 28. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
|
@lorenzejay not sure if this is the right branch for me to have pushed the docs updates |
|
|
||
| result = brave_tool.run(search_query="test") | ||
| assert "Test Title" in result | ||
| assert "http://test.com" in result |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 23 days ago
To fix this issue, we need to remove the substring check "http://test.com" in result on line 35 and instead assert that the expected URL is found in the output in a robust way. Since this is test code and we control the mocked response, the best fix is to parse the URL from the result using a regular expression (or similar precise extraction), and compare it for equality. Alternatively, if the result is JSON or a structured object, parse it properly and compare the URL directly. If the result is a formatted string (e.g., markdown or HTML), extract URLs from it and assert their presence exactly.
Specifically:
- In
test_brave_tool_search, replace the substring assertion with code that extracts URLs from the result and asserts that"http://test.com"is present as an exact-match URL, rather than as a substring. - Import
reto enable safe URL extraction with a regular expression. - Adjust the code to parse and check URLs precisely.
-
Copy modified line R5 -
Copy modified lines R34-R36
| @@ -2,8 +2,8 @@ | ||
|
|
||
| from crewai_tools.tools.brave_search_tool.brave_search_tool import BraveSearchTool | ||
| import pytest | ||
| import re | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def brave_tool(): | ||
| return BraveSearchTool(n_results=2) | ||
| @@ -32,9 +31,10 @@ | ||
|
|
||
| result = brave_tool.run(search_query="test") | ||
| assert "Test Title" in result | ||
| assert "http://test.com" in result | ||
| # Extract all URLs from the result and assert exact match | ||
| urls = re.findall(r'https?://[^\s\)"]+', result) | ||
| assert "http://test.com" in urls | ||
|
|
||
|
|
||
| def test_brave_tool(): | ||
| tool = BraveSearchTool( | ||
| n_results=2, |
Co-authored-by: Greyson Lalonde <[email protected]>
* completely drop litellm and correctly pass config for qdrant * feat: add support for additional embedding models in EmbeddingService - Expanded the list of supported embedding models to include Google Vertex, Hugging Face, Jina, Ollama, OpenAI, Roboflow, Watson X, custom embeddings, Sentence Transformers, Text2Vec, OpenClip, and Instructor. - This enhancement improves the versatility of the EmbeddingService by allowing integration with a wider range of embedding providers. * fix: update collection parameter handling in CrewAIRagAdapter - Changed the condition for setting vectors_config in the CrewAIRagAdapter to check for QdrantConfig instance instead of using hasattr. This improves type safety and ensures proper configuration handling for Qdrant integration.
#3707) * feat: enhance AnthropicCompletion class with additional client parameters and tool handling - Added support for client_params in the AnthropicCompletion class to allow for additional client configuration. - Refactored client initialization to use a dedicated method for retrieving client parameters. - Implemented a new method to handle tool use conversation flow, ensuring proper execution and response handling. - Introduced comprehensive test cases to validate the functionality of the AnthropicCompletion class, including tool use scenarios and parameter handling. * drop print statements * test: add fixture to mock ANTHROPIC_API_KEY for tests - Introduced a pytest fixture to automatically mock the ANTHROPIC_API_KEY environment variable for all tests in the test_anthropic.py module. - This change ensures that tests can run without requiring a real API key, improving test isolation and reliability. * refactor: streamline streaming message handling in AnthropicCompletion class - Removed the 'stream' parameter from the API call as it is set internally by the SDK. - Simplified the handling of tool use events and response construction by extracting token usage from the final message. - Enhanced the flow for managing tool use conversation, ensuring proper integration with the streaming API response. * fix streaming here too * fix: improve error handling in tool conversion for AnthropicCompletion class - Enhanced exception handling during tool conversion by catching KeyError and ValueError. - Added logging for conversion errors to aid in debugging and maintain robustness in tool integration.
…3717) * feat: enhance GeminiCompletion class with client parameter support - Added support for client_params in the GeminiCompletion class to allow for additional client configuration. - Refactored client initialization into a dedicated method for improved parameter handling. - Introduced a new method to retrieve client parameters, ensuring compatibility with the base class. - Enhanced error handling during client initialization to provide clearer messages for missing configuration. - Updated documentation to reflect the changes in client parameter usage. * add optional dependancies * refactor: update test fixture to mock GOOGLE_API_KEY - Renamed the fixture from `mock_anthropic_api_key` to `mock_google_api_key` to reflect the change in the environment variable being mocked. - This update ensures that all tests in the module can run with a mocked GOOGLE_API_KEY, improving test isolation and reliability. * fix tests
* feat: enhance BedrockCompletion class with advanced features and error handling - Added support for guardrail configuration, additional model request fields, and custom response field paths in the BedrockCompletion class. - Improved error handling for AWS exceptions and added token usage tracking with stop reason logging. - Enhanced streaming response handling with comprehensive event management, including tool use and content block processing. - Updated documentation to reflect new features and initialization parameters. - Introduced a new test suite for BedrockCompletion to validate functionality and ensure robust integration with AWS Bedrock APIs. * chore: add boto typing * fix: use typing_extensions.Required for Python 3.10 compatibility --------- Co-authored-by: Greyson Lalonde <[email protected]>
* feat: add Azure AI Inference support and related tests - Introduced the `azure-ai-inference` package with version `1.0.0b9` and its dependencies in `uv.lock` and `pyproject.toml`. - Added new test files for Azure LLM functionality, including tests for Azure completion and tool handling. - Implemented comprehensive test cases to validate Azure-specific behavior and integration with the CrewAI framework. - Enhanced the testing framework to mock Azure credentials and ensure proper isolation during tests. * feat: enhance AzureCompletion class with Azure OpenAI support - Added support for the Azure OpenAI endpoint in the AzureCompletion class, allowing for flexible endpoint configurations. - Implemented endpoint validation and correction to ensure proper URL formats for Azure OpenAI deployments. - Enhanced error handling to provide clearer messages for common HTTP errors, including authentication and rate limit issues. - Updated tests to validate the new endpoint handling and error messaging, ensuring robust integration with Azure AI Inference. - Refactored parameter preparation to conditionally include the model parameter based on the endpoint type.
* fix: enhance OpenAICompletion class base URL handling - Updated the base URL assignment in the OpenAICompletion class to prioritize the new `api_base` attribute and fallback to the environment variable `OPENAI_BASE_URL` if both are not set. - Added `api_base` to the list of parameters in the OpenAICompletion class to ensure proper configuration and flexibility in API endpoint management. * feat: enhance OpenAICompletion class with api_base support - Added the `api_base` parameter to the OpenAICompletion class to allow for flexible API endpoint configuration. - Updated the `_get_client_params` method to prioritize `base_url` over `api_base`, ensuring correct URL handling. - Introduced comprehensive tests to validate the behavior of `api_base` and `base_url` in various scenarios, including environment variable fallback. - Enhanced test coverage for client parameter retrieval, ensuring robust integration with the OpenAI API. * fix: improve OpenAICompletion class configuration handling - Added a debug print statement to log the client configuration parameters during initialization for better traceability. - Updated the base URL assignment logic to ensure it defaults to None if no valid base URL is provided, enhancing robustness in API endpoint configuration. - Refined the retrieval of the `api_base` environment variable to streamline the configuration process. * drop print
* feat: add support for Anthropic provider and enhance logging - Introduced the `anthropic` package with version `0.69.0` in `pyproject.toml` and `uv.lock`, allowing for integration with the Anthropic API. - Updated logging in the LLM class to provide clearer error messages when importing native providers, enhancing debugging capabilities. - Improved error handling in the AnthropicCompletion class to guide users on installation via the updated error message format. - Refactored import error handling in other provider classes to maintain consistency in error messaging and installation instructions. * feat: enhance LLM support with Bedrock provider and update dependencies - Added support for the `bedrock` provider in the LLM class, allowing integration with AWS Bedrock APIs. - Updated `uv.lock` to replace `boto3` with `bedrock` in the dependencies, reflecting the new provider structure. - Introduced `SUPPORTED_NATIVE_PROVIDERS` to include `bedrock` and ensure proper error handling when instantiating native providers. - Enhanced error handling in the LLM class to raise informative errors when native provider instantiation fails. - Added tests to validate the behavior of the new Bedrock provider and ensure fallback mechanisms work correctly for unsupported providers. * test: update native provider fallback tests to expect ImportError * adjust the test with the expected bevaior - raising ImportError * this is exoecting the litellm format, all gemini native tests are in test_google.py --------- Co-authored-by: Greyson LaLonde <[email protected]>
… handling Removed `print` statements from the `LLMStreamChunkEvent` handler to prevent LLM response chunks from being written directly to stdout. The listener now only tracks chunks internally. Fixes #3715 Added explicit return statements for trace-related tests. Updated cassette for `test_failed_evaluation` to reflect new behavior where an empty trace dict is used instead of returning early. Ensured deterministic cleanup order in test fixtures by making `clear_event_bus_handlers` depend on `setup_test_environment`. This guarantees event bus shutdown and file handle cleanup occur before temporary directory deletion, resolving intermittent “Directory not empty” errors in CI.
* feat: enhance task guardrail functionality and validation - Introduced support for multiple guardrails in the Task class, allowing for sequential processing of guardrails. - Added a new `guardrails` field to the Task model to accept a list of callable guardrails or string descriptions. - Implemented validation to ensure guardrails are processed correctly, including handling of retries and error messages. - Enhanced the `_invoke_guardrail_function` method to manage guardrail execution and integrate with existing task output processing. - Updated tests to cover various scenarios involving multiple guardrails, including success, failure, and retry mechanisms. This update improves the flexibility and robustness of task execution by allowing for more complex validation scenarios. * refactor: enhance guardrail type handling in Task model - Updated the Task class to improve guardrail type definitions, introducing GuardrailType and GuardrailsType for better clarity and type safety. - Simplified the validation logic for guardrails, ensuring that both single and multiple guardrails are processed correctly. - Enhanced error messages for guardrail validation to provide clearer feedback when incorrect types are provided. - This refactor improves the maintainability and robustness of task execution by standardizing guardrail handling. * feat: implement per-guardrail retry tracking in Task model - Introduced a new private attribute `_guardrail_retry_counts` to the Task class for tracking retry attempts on a per-guardrail basis. - Updated the guardrail processing logic to utilize the new retry tracking, allowing for independent retry counts for each guardrail. - Enhanced error handling to provide clearer feedback when guardrails fail validation after exceeding retry limits. - Modified existing tests to validate the new retry tracking behavior, ensuring accurate assertions on guardrail retries. This update improves the robustness and flexibility of task execution by allowing for more granular control over guardrail validation and retry mechanisms.
improved linting, pre-commit setup, and internal architecture. Configured Ruff to respect .gitignore, added stricter rules, and introduced a lock pre-commit hook with virtualenv activation. Fixed type shadowing in EXASearchTool using a type_ alias to avoid PEP 563 conflicts and resolved circular imports in agent executor and guardrail modules. Removed agent-ops attributes, deprecated watson alias, and dropped crewai-enterprise tools with corresponding test updates. Refactored cache and memoization for thread safety and cleaned up structured output adapters and related logic.
* Adding MCP implementation * New tests for MCP implementation * fix tests * update docs * Revert "New tests for MCP implementation" This reverts commit 0bbe6de. * linter * linter * fix * verify mcp pacakge exists * adjust docs to be clear only remote servers are supported * reverted * ensure args schema generated properly * properly close out --------- Co-authored-by: lorenzejay <[email protected]> Co-authored-by: Greyson Lalonde <[email protected]>
experimental a2a support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💥
No description provided.