Compare commits

..

596 Commits

Author SHA1 Message Date
Greyson Lalonde
2b85244b36 dont cache deps 2025-09-27 20:37:48 -04:00
Greyson Lalonde
2b6fba8390 fix: try install project 2025-09-27 20:34:13 -04:00
Greyson Lalonde
37b49756b5 fix: try from root 2025-09-27 20:31:47 -04:00
Greyson Lalonde
6fd2d8e19b fix: change ref, lint 2025-09-27 17:25:15 -04:00
Greyson Lalonde
4d79c41a06 feat: move core functionality to lib workspace structure 2025-09-27 17:22:46 -04:00
Greyson Lalonde
f0762473d0 chore: update CI workflows and dependencies for workspace structure 2025-09-27 16:37:08 -04:00
Greyson Lalonde
aca826c553 refactor: move rag package to lib/core and extract standalone utilities 2025-09-27 16:31:54 -04:00
Greyson LaLonde
1d1f5f455c test: fix lite agent guardrail test assertions 2025-09-26 23:15:37 -04:00
Greyson LaLonde
58b72c3948 test: mark tracing tests requiring API connections to skip in CI 2025-09-26 23:10:45 -04:00
Greyson LaLonde
3b18e7d971 test: fix task interpolation test assertion and update cassette 2025-09-26 23:07:51 -04:00
Greyson LaLonde
c062992806 test: mark tests requiring external APIs to skip in CI 2025-09-26 23:03:38 -04:00
Greyson LaLonde
9d3fe72e75 test: fix evaluation tests and update cassettes 2025-09-26 22:59:43 -04:00
Greyson LaLonde
d2249e621d test: mark converter tests requiring local services to skip in CI 2025-09-26 22:50:26 -04:00
Greyson LaLonde
03a711c365 rerecord cassetes 2025-09-26 22:44:04 -04:00
Greyson LaLonde
72366e846e fix: handle source code extraction errors for lambda guardrails
- Fix OSError when trying to get source code of lambda functions in guardrail events
- Gracefully handle lambdas and built-in functions by showing placeholder text
2025-09-26 22:37:31 -04:00
Greyson LaLonde
0a09beca03 fix: improve VCR configuration and skip local service tests in CI
- Update VCR config to exclude body matching for more reliable cassette playback
- Add pytest marker for tests requiring local services (Ollama, etc)
- Configure CI to skip tests marked as requiring local services
- Re-record async tool test cassettes with telemetry calls only
2025-09-26 22:30:34 -04:00
Greyson LaLonde
76ad0e0a10 test: re-record async tool test cassettes with proper mocking 2025-09-26 22:21:46 -04:00
Greyson LaLonde
6cf7da6d13 fix: remove broken VCR cassettes for async tool tests
These cassettes need to be re-recorded with proper API mocking
2025-09-26 22:18:37 -04:00
Greyson LaLonde
02267c1435 fix: specify tests directory in pytest command to avoid import conflicts 2025-09-26 22:14:02 -04:00
Greyson LaLonde
a717f44011 refactor: move src and tests from lib/crewai to root 2025-09-26 22:10:31 -04:00
Greyson LaLonde
b88f065ad8 feat: sync with upstream crewai-tools changes 2025-09-26 15:37:34 -04:00
Greyson LaLonde
e2270456c4 feat: add crewai-tools library to workspace
- Migrate crewai-tools as standalone package in lib/tools
- Configure UV workspace for monorepo structure
- Move assets to repository root
- Clean up duplicate README files
- Focus pre-commit hooks on lib/crewai/src only
2025-09-26 15:05:41 -04:00
Greyson LaLonde
3eeb9b8f6c chore: prepare for crewai-tools migration 2025-09-26 14:52:25 -04:00
Greyson LaLonde
14a1bf6317 feat: add crewai-tools library to workspace 2025-09-26 14:37:51 -04:00
Greyson LaLonde
98a8607c87 chore: update workspace configuration and lock file 2025-09-26 14:32:15 -04:00
Greyson LaLonde
daf6f679ff feat: restructure project as UV workspace with crewai in lib/ 2025-09-26 14:29:28 -04:00
Greyson LaLonde
74b5c88834 Merge branch 'main' into release/v1.0.0-alpha.1 2025-09-26 13:32:05 -04:00
Lorenze Jay
7d5cd4d3e2 chore: bump CrewAI version to 0.201.1 and update dependencies in project templates (#3605)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Update Test Durations / update-durations (3.10) (push) Has been cancelled
Update Test Durations / update-durations (3.11) (push) Has been cancelled
Update Test Durations / update-durations (3.12) (push) Has been cancelled
Update Test Durations / update-durations (3.13) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
- Update version in __init__.py to 0.201.1
- Modify dependency versions in pyproject.toml for crew, flow, and tool templates to require CrewAI 0.201.1
2025-09-26 09:58:00 -07:00
Greyson LaLonde
73e932bfee fix: update embedding functions to inherit from chromadb callable 2025-09-26 12:25:19 -04:00
Greyson LaLonde
12fa7e2ff1 fix: rename watson to watsonx embedding provider and prefix env vars
- prefix provider env vars with embeddings_  
- rename watson → watsonx in providers  
- add deprecation warning and alias for legacy 'watson' key (to be removed in v1.0.0)
2025-09-26 10:57:18 -04:00
Greyson LaLonde
091d1267d8 fix: prefix embedding provider env vars with EMBEDDINGS_ 2025-09-26 10:50:45 -04:00
Lorenze Jay
b5b10a8cde chore: update version and dependencies to 0.201.0 (#3593)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Update Test Durations / update-durations (3.10) (push) Has been cancelled
Update Test Durations / update-durations (3.11) (push) Has been cancelled
Update Test Durations / update-durations (3.12) (push) Has been cancelled
Update Test Durations / update-durations (3.13) (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
- Bump CrewAI version to 0.201.0 in __init__.py
- Update dependency versions in pyproject.toml for crew, flow, and tool templates to require CrewAI 0.201.0
- Remove unnecessary blank line in pyproject.toml
2025-09-25 18:04:12 -07:00
Greyson LaLonde
2485ed93d6 feat: upgrade chromadb to v1.1.0, improve types
- update imports and include handling for chromadb v1.1.0  
- fix mypy and typing_compat issues (required, typeddict, voyageai)  
- refine embedderconfig typing and allow base provider instances  
- handle mem0 as special case for external memory storage  
- bump tools and clean up redundant deps
2025-09-25 20:48:37 -04:00
Greyson LaLonde
ce5ea9be6f feat: add custom embedding types and migrate providers
- introduce baseembeddingsprovider and helper for embedding functions  
- add core embedding types and migrate providers, factory, and storage modules  
- remove unused type aliases and fix pydantic schema error  
- update providers with env var support and related fixes
2025-09-25 18:28:39 -04:00
Lucas Gomide
13e5ec711d feat: add apps & actions attributes to Agent (#3504)
* 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
2025-09-25 16:46:51 -04:00
Greyson LaLonde
e350817b8d fix: remove debug logging (#462) 2025-09-25 08:00:41 -04:00
Greyson LaLonde
e070c1400c feat: update pydantic, add pydantic-settings, migrate to dependency-groups
Some checks failed
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Update Test Durations / update-durations (3.10) (push) Has been cancelled
Update Test Durations / update-durations (3.11) (push) Has been cancelled
Update Test Durations / update-durations (3.12) (push) Has been cancelled
Update Test Durations / update-durations (3.13) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
- Add pydantic-settings>=2.10.1 dependency for configuration management
- Update pydantic to 2.11.9 and python-dotenv to 1.1.1
- Migrate from deprecated tool.uv.dev-dependencies to dependency-groups.dev format
- Remove unnecessary dev dependencies: pillow, cairosvg
- Update all dev tooling to latest versions
- Remove duplicate python-dotenv from dev dependencies
2025-09-24 14:42:18 -04:00
Thiago Moretto
2a927933f2 Add OPENAI_API_KEY as required by QdrantSearchTool (#461) 2025-09-24 12:34:37 -04:00
Greyson LaLonde
6537e3737d fix: correct directory name in quickstart documentation 2025-09-24 11:41:33 -04:00
Greyson LaLonde
346faf229f feat: add pydantic-compatible import validation and deprecate old utilities 2025-09-24 11:36:02 -04:00
Lorenze Jay
a0b757a12c Lorenze/traces mark as failed (#3586)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Update Test Durations / update-durations (3.10) (push) Has been cancelled
Update Test Durations / update-durations (3.11) (push) Has been cancelled
Update Test Durations / update-durations (3.12) (push) Has been cancelled
Update Test Durations / update-durations (3.13) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* marking trace batch as failed if its failed

* fix test
2025-09-23 22:02:27 -07:00
Greyson LaLonde
1dbe8aab52 fix: add batch_size support to prevent embedder token limit errors
- add batch_size field to baseragconfig (default=100)  
- update chromadb/qdrant clients and factories to use batch_size  
- extract and filter batch_size from embedder config in knowledgestorage  
- fix large csv files exceeding embedder token limits (#3574)  
- remove unneeded conditional for type  

Co-authored-by: Vini Brasil <vini@hey.com>
2025-09-24 00:05:43 -04:00
Greyson LaLonde
4ac65eb0a6 fix: support nested config format for embedder configuration
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Update Test Durations / update-durations (3.10) (push) Has been cancelled
Update Test Durations / update-durations (3.11) (push) Has been cancelled
Update Test Durations / update-durations (3.12) (push) Has been cancelled
Update Test Durations / update-durations (3.13) (push) Has been cancelled
- support nested config format with embedderconfig typeddict  
- fix parsing for model/model_name compatibility  
- add validation, typing_extensions, and improved type hints  
- enhance embedding factory with env var injection and provider support  
- add tests for openai, azure, and all embedding providers  
- misc fixes: test file rename, updated mocking patterns
2025-09-23 11:57:46 -04:00
Greyson LaLonde
3e97393f58 chore: improve typing and consolidate utilities
- add type annotations across utility modules  
- refactor printer system, agent utils, and imports for consistency  
- remove unused modules, constants, and redundant patterns  
- improve runtime type checks, exception handling, and guardrail validation  
- standardize warning suppression and logging utilities  
- fix llm typing, threading/typing edge cases, and test behavior
2025-09-23 11:33:46 -04:00
Heitor Carvalho
34bed359a6 feat: add crewai uv wrapper for uv commands (#3581) 2025-09-23 10:55:15 -04:00
Greyson LaLonde
7c2aa2f923 fix: remove circular deps
- Remove embedchain and resolve circular deps with ChromaDB  
- Adjust lockfile to match crewai requirements  
- Mock embeddings and vector DB in RAG tool tests
2025-09-22 19:35:08 -04:00
Tony Kipkemboi
feeed505bb docs(changelog): add releases 0.193.2, 0.193.1, 0.193.0, 0.186.1, 0.186.0 across en/ko/pt-BR (#3577)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
2025-09-22 16:19:55 -07:00
Greyson LaLonde
cb0efd05b4 chore: fix ruff linting issues in tools module
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Update Test Durations / update-durations (3.13) (push) Has been cancelled
Update Test Durations / update-durations (3.10) (push) Has been cancelled
Update Test Durations / update-durations (3.11) (push) Has been cancelled
Update Test Durations / update-durations (3.12) (push) Has been cancelled
linting, args_schema default, and validator check
2025-09-22 13:13:23 -04:00
Greyson LaLonde
db5f565dea fix: apply ruff linting fixes to tasks module 2025-09-22 13:09:53 -04:00
Greyson LaLonde
58413b663a chore: fix ruff linting issues in rag module
linting, list embedding handling, and test update
2025-09-22 13:06:22 -04:00
Greyson LaLonde
37636f0dd7 chore: fix ruff linting and mypy issues in flow module 2025-09-22 13:03:06 -04:00
Greyson LaLonde
0e370593f1 chore: resolve all ruff and mypy issues in experimental module
resolve linting, typing, and import issues; update Okta test
2025-09-22 12:56:28 -04:00
Ryan
1bd10bb254 Add base_url param to exa search tool (#454) 2025-09-22 12:19:56 -04:00
Vini Brasil
aa8dc9d77f Add source to LLM Guardrail events (#3572)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Update Test Durations / update-durations (3.10) (push) Has been cancelled
Update Test Durations / update-durations (3.11) (push) Has been cancelled
Update Test Durations / update-durations (3.12) (push) Has been cancelled
Update Test Durations / update-durations (3.13) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
This commit adds the source attribute to LLM Guardrail event calls to
identify the Lite Agent or Task that executed the guardrail.
2025-09-22 11:58:00 +09:00
Jonathan Hill
9c1096dbdc fix: Make 'ready' parameter optional in _create_reasoning_plan function (#3561)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Update Test Durations / update-durations (3.10) (push) Has been cancelled
Update Test Durations / update-durations (3.11) (push) Has been cancelled
Update Test Durations / update-durations (3.12) (push) Has been cancelled
Update Test Durations / update-durations (3.13) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* fix: Make 'ready' parameter optional in _create_reasoning_plan function

This PR fixes Issue #3466 where the _create_reasoning_plan function was missing
the 'ready' parameter when called by the LLM. The fix makes the 'ready' parameter
optional with a default value of False, which allows the function to be called
with only the 'plan' argument.

Fixes #3466

* Change default value of 'ready' parameter to True

---------

Co-authored-by: João Moura <joaomdmoura@gmail.com>
2025-09-20 22:57:18 -03:00
João Moura
47044450c0 Adding fallback to crew settings (#3562)
* Adding fallback to crew settings

* fix: resolve ruff and mypy issues in cli/config.py

---------

Co-authored-by: Greyson Lalonde <greyson.r.lalonde@gmail.com>
2025-09-20 22:54:36 -03:00
João Moura
0ee438c39d fix version (#3557) 2025-09-20 17:14:28 -03:00
Joao Moura
cbb9965bf7 preparing new version 2025-09-20 12:27:25 -07:00
João Moura
4951d30dd9 Dix issues with getting id (#3556)
* fix issues with getting id

* ignore linter

* fix: resolve ruff linting issues in tracing utils

---------

Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
2025-09-20 15:29:25 -03:00
Greyson LaLonde
7426969736 chore: apply ruff linting fixes and type annotations to memory module
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Update Test Durations / update-durations (3.10) (push) Has been cancelled
Update Test Durations / update-durations (3.11) (push) Has been cancelled
Update Test Durations / update-durations (3.12) (push) Has been cancelled
Update Test Durations / update-durations (3.13) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Co-authored-by: Lorenze Jay <63378463+lorenzejay@users.noreply.github.com>
2025-09-19 22:20:13 -04:00
Greyson LaLonde
d879be8b66 chore: fix ruff linting issues in agents module
fix(agents): linting, import paths, cache key alignment, and static method
2025-09-19 22:11:21 -04:00
Greyson LaLonde
24b84a4b68 chore: apply ruff linting fixes to crews module 2025-09-19 22:02:22 -04:00
Greyson LaLonde
8e571ea8a7 chore: fix ruff linting and mypy issues in knowledge module
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Update Test Durations / update-durations (3.10) (push) Has been cancelled
Update Test Durations / update-durations (3.11) (push) Has been cancelled
Update Test Durations / update-durations (3.12) (push) Has been cancelled
Update Test Durations / update-durations (3.13) (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
2025-09-19 21:39:15 -04:00
Greyson LaLonde
2cfc4d37b8 chore: apply ruff linting fixes to events module
fix: apply ruff linting to events
2025-09-19 20:10:55 -04:00
Greyson LaLonde
f4abc41235 chore: apply ruff linting fixes to CLI module
fix: apply ruff fixes to CLI and update Okta provider test
2025-09-19 19:55:55 -04:00
Greyson LaLonde
de5d3c3ad1 chore: add pydantic.mypy plugin for better type checking 2025-09-19 19:23:33 -04:00
Lorenze Jay
c062826779 chore: update dependencies and versioning for CrewAI 0.193.0 (#3542)
* chore: update dependencies and versioning for CrewAI

- Bump `crewai-tools` dependency version from `0.71.0` to `0.73.0` in `pyproject.toml`.
- Update CrewAI version from `0.186.1` to `0.193.0` in `__init__.py`.
- Adjust dependency versions in CLI templates for crew, flow, and tool to reflect the new CrewAI version.

This update ensures compatibility with the latest features and improvements in CrewAI.

* remove embedchain mock

* fix: remove last embedchain mocks

* fix: remove langchain_openai from tests

---------

Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
2025-09-19 16:01:55 -03:00
João Moura
9491fe8334 Adding Ability for user to get deeper observability (#3541)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Update Test Durations / update-durations (3.10) (push) Has been cancelled
Update Test Durations / update-durations (3.11) (push) Has been cancelled
Update Test Durations / update-durations (3.12) (push) Has been cancelled
Update Test Durations / update-durations (3.13) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* feat(tracing): enhance first-time trace display and auto-open browser

* avoinding line breaking

* set tracing if user enables it

* linted

---------

Co-authored-by: lorenzejay <lorenzejaytech@gmail.com>
2025-09-18 21:47:09 -03:00
Greyson LaLonde
6f2ea013a7 docs: update RagTool references from EmbedChain to CrewAI native RAG (#3537)
* docs: update RagTool references from EmbedChain to CrewAI native RAG

* change ref to qdrant

* docs: update RAGTool to use Qdrant and add embedding_model example
2025-09-18 16:06:44 -07:00
Greyson LaLonde
e29ca9ec28 feat: replace embedchain with native crewai adapter (#451)
- Remove embedchain adapter; add crewai rag adapter and update all search tools  
- Add loaders: pdf, youtube (video & channel), github, docs site, mysql, postgresql  
- Add configurable similarity threshold, limit params, and embedding_model support  
- Improve chromadb compatibility (sanitize metadata, convert columns, fix chunking)  
- Fix xml encoding, Python 3.10 issues, and youtube url spoofing  
- Update crewai dependency and instructions; refresh uv.lock  
- Update tests for new rag adapter and search params
2025-09-18 19:02:22 -04:00
Greyson LaLonde
39e8792ae5 fix: add l2 distance metric support for backward compatibility (#3540) 2025-09-18 18:36:33 -04:00
Lorenze Jay
2f682e1564 feat: update ChromaDB embedding function to use OpenAI API (#3538)
- Refactor the default embedding function to utilize OpenAI's embedding function with API key support.
- Import necessary OpenAI embedding function and configure it with the environment variable for the API key.
- Ensure compatibility with existing ChromaDB configuration model.
2025-09-18 14:50:35 -07:00
Greyson LaLonde
d4aa676195 feat: add configurable search parameters for RAG, knowledge, and memory (#3531)
- Add limit and score_threshold to BaseRagConfig, propagate to clients  
- Update default search params in RAG storage, knowledge, and memory (limit=5, threshold=0.6)  
- Fix linting (ruff, mypy, PERF203) and refactor save logic  
- Update tests for new defaults and ChromaDB behavior
2025-09-18 16:58:03 -04:00
Lorenze Jay
578fa8c2e4 Lorenze/ephemeral trace ask (#3530)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Update Test Durations / update-durations (3.10) (push) Has been cancelled
Update Test Durations / update-durations (3.11) (push) Has been cancelled
Update Test Durations / update-durations (3.12) (push) Has been cancelled
Update Test Durations / update-durations (3.13) (push) Has been cancelled
* feat(tracing): implement first-time trace handling and improve event management

- Added FirstTimeTraceHandler for managing first-time user trace collection and display.
- Enhanced TraceBatchManager to support ephemeral trace URLs and improved event buffering.
- Updated TraceCollectionListener to utilize the new FirstTimeTraceHandler.
- Refactored type annotations across multiple files for consistency and clarity.
- Improved error handling and logging for trace-related operations.
- Introduced utility functions for trace viewing prompts and first execution checks.

* brought back crew finalize batch events

* refactor(trace): move instance variables to __init__ in TraceBatchManager

- Refactored TraceBatchManager to initialize instance variables in the constructor instead of as class variables.
- Improved clarity and encapsulation of the class state.

* fix(tracing): improve error handling in user data loading and saving

- Enhanced error handling in _load_user_data and _save_user_data functions to log warnings for JSON decoding and file access issues.
- Updated documentation for trace usage to clarify the addition of tracing parameters in Crew and Flow initialization.
- Refined state management in Flow class to ensure proper handling of state IDs when persistence is enabled.

* add some tests

* fix test

* fix tests

* refactor(tracing): enhance user input handling for trace viewing

- Replaced signal-based timeout handling with threading for user input in prompt_user_for_trace_viewing function.
- Improved user experience by allowing a configurable timeout for viewing execution traces.
- Updated tests to mock threading behavior and verify timeout handling correctly.

* fix(tracing): improve machine ID retrieval with error handling

- Added error handling to the _get_machine_id function to log warnings when retrieving the machine ID fails.
- Ensured that the function continues to provide a stable, privacy-preserving machine fingerprint even in case of errors.

* refactor(flow): streamline state ID assignment in Flow class

- Replaced direct attribute assignment with setattr for improved flexibility in handling state IDs.
- Enhanced code readability by simplifying the logic for setting the state ID when persistence is enabled.
2025-09-18 10:17:34 -07:00
Rip&Tear
6f5af2b27c Update CodeQL workflow to ignore specific paths (#3534)
Code QL, when configured through the GUI, does not allow for advanced configuration. This PR upgrades from an advanced file-based config which allows us to exclude certain paths.
2025-09-18 23:26:15 +08:00
Greyson LaLonde
8ee3cf4874 test: fix flaky agent repeated tool usage test (#3533)
Some checks failed
Notify Downstream / notify-downstream (push) Has been cancelled
Update Test Durations / update-durations (3.10) (push) Has been cancelled
Update Test Durations / update-durations (3.11) (push) Has been cancelled
Update Test Durations / update-durations (3.12) (push) Has been cancelled
Update Test Durations / update-durations (3.13) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
- Make assertion resilient to race condition with max iterations in CI  
- Add investigation notes and TODOs for deterministic executor flow
2025-09-17 22:00:32 -04:00
Greyson LaLonde
f2d3fd0c0f fix(events): add missing event exports to __init__.py (#3532) 2025-09-17 21:50:27 -04:00
Greyson LaLonde
f28e78c5ba refactor: unify rag storage with instance-specific client support (#3455)
Some checks failed
Notify Downstream / notify-downstream (push) Has been cancelled
Update Test Durations / update-durations (3.10) (push) Has been cancelled
Update Test Durations / update-durations (3.11) (push) Has been cancelled
Update Test Durations / update-durations (3.12) (push) Has been cancelled
Update Test Durations / update-durations (3.13) (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
- ignore line length errors globally
- migrate knowledge/memory and crew query_knowledge to `SearchResult`
- remove legacy chromadb utils; fix empty metadata handling
- restore openai as default embedding provider; support instance-specific clients
- update and fix tests for `SearchResult` migration and rag changes
2025-09-17 14:46:54 -04:00
Lucas Gomide
8d9cee45f2 feat: attempt to make embedchain optional (#450)
* fix: attempt to make embedchain optional

* fix: drop pydantic_settings dependency

* fix: ensure the package is importable without any extra dependency

After making embedchain option many packages were unstalled which caused errors in some tools due to failing import directives
2025-09-12 13:35:17 -04:00
Lucas Gomide
f9925887aa Add CrewAIPlatformTools (#449)
* chore: add deprecation warning in CrewaiEnterpriseTools

* feat: add CrewAI Platform Tool

* feat: drop support to oldest env-var token
2025-09-12 12:04:26 -04:00
Vini Brasil
6f2301c945 Clarify tool support for both local and remote URLs (#447)
This commit updates tool prompts to explicitly highlight that some tools
can accept both local file paths and remote URLs.

The improved prompts ensure LLMs understand they may pass remote
resources.
2025-09-10 09:38:14 -03:00
Tony Kipkemboi
cb8a1da730 feat(parallel): add ParallelSearchTool (Search API v1beta) (#445)
* docs: add BUILDING_TOOLS.md

* feat(parallel): add ParallelSearchTool (Search API v1beta), tests, README; register exports; regenerate tool.specs.json

* test(parallel): replace URL substring assertion with hostname allowlist (CodeQL)
2025-09-08 10:53:06 -04:00
Lucas Gomide
47b64d3507 fix: use explicit DeprecationWarning for legacy token detection (#440) 2025-09-02 16:28:22 -04:00
Lucas Gomide
33241ef363 refactor: fetch & execute enterprise tool actions from platform (#437)
* refactor: fetch enterprise tool actions from platform

* chore: logging legacy token detected
2025-09-02 15:41:00 -04:00
Vini Brasil
93b841fc86 Create tool for generating automations in Studio (#438)
* Create tool for generating automations in Studio

This commit creates a tool to use CrewAI Enterprise API to generate
crews using CrewAI Studio.

* Replace CREWAI_BASE_URL with CREWAI_PLUS_URL

* Add missing /crewai_plus in URL
2025-09-02 11:46:18 -03:00
Jinash Rouniyar
cb84d2ddfa feat: Add modular contextual AI tools with async functionality (#431)
* Add contextual AI tools with async support

* Fix package version issues and update README

* Rename contextual tools to contextualai and update contents

* Update tools init for contextualai tools

* feat: Resolved no module found error for nest_asyncio

* Updated nest_asyncio import

---------

Co-authored-by: QJ <qj@QJs-MacBook-Pro.local>
Co-authored-by: Qile-Jiang <qile.jiang@contextual.ai>
2025-08-28 08:56:53 -04:00
Mike Plachta
1f581fa9ac fix: add OCRTool to crewai_tools package exports (#433) 2025-08-27 14:11:57 -07:00
Mike Plachta
6562587cba feat: add InvokeCrewAIAutomationTool for external crew API integration (#430)
* feat: add InvokeCrewAIAutomationTool for external crew API integration

* feat: add InvokeCrewAIAutomationTool class for executing CrewAI tasks programmatically
2025-08-27 10:42:19 -07:00
Erika Shorten
992cd726c4 Weaviate hybrid search (#428)
* Update tool to use hybrid search

* Set default alpha to 0.75
2025-08-27 10:33:16 -04:00
Mike Plachta
403bb7e208 feat: add descriptive header to scraped website content output (#426)
* feat: add descriptive header to scraped website content output

* fix: correct typo in scraped website content header text
2025-08-26 08:10:24 -07:00
Lucas Gomide
dc039cfac8 Adds RAG feature (#406)
* feat: initialize rag

* refactor: using cosine distance metric for chromadb

* feat: use RecursiveCharacterTextSplitter as chunker strategy

* feat: support chucker and loader per data_type

* feat: adding JSON loader

* feat: adding CSVLoader

* feat: adding loader for DOCX files

* feat: add loader for MDX files

* feat: add loader for XML files

* feat: add loader for parser Webpage

* feat: support to load files from an entire directory

* feat: support to auto-load the loaders for additional DataType

* feat: add chuckers for some specific data type

- Each chunker uses separators specific to its content type

* feat: prevent document duplication and centralize content management

- Implement document deduplication logic in RAG
  * Check for existing documents by source reference
  * Compare doc IDs to detect content changes
  * Automatically replace outdated content while preventing duplicates

- Centralize common functionality for better maintainability
  * Create SourceContent class to handle URLs, files, and text uniformly
  * Extract shared utilities (compute_sha256) to misc.py
  * Standardize doc ID generation across all loaders

- Improve RAG system architecture
  * All loaders now inherit consistent patterns from centralized BaseLoader
  * Better separation of concerns with dedicated content management classes
  * Standardized LoaderResult structure across all loader implementations

* chore: split text loaders file

* test: adding missing tests about RAG loaders

* refactor: QOL

* fix: add missing uv syntax on DOCXLoader
2025-08-19 18:30:35 -04:00
Joao Moura
1ce016df8b Revert "working around OAI new update for now"
This reverts commit 23a16eb446.
2025-08-19 00:09:25 -07:00
Joao Moura
23a16eb446 working around OAI new update for now 2025-08-18 22:40:30 -07:00
Gabe Milani
16d613488b fix: use json_schema_extra instead of deprecated Field extra args (#417) 2025-08-14 17:52:56 -04:00
nicoferdi96
99e174e575 Stagehand tool improvements (#415)
* Stagehand tool improvements

This commit significantly improves the StagehandTool reliability and usability when working with CrewAI agents by addressing several critical
  issues:

  ## Key Improvements

  ### 1. Atomic Action Support
  - Added _extract_steps() method to break complex instructions into individual steps
  - Added _simplify_instruction() method for intelligent error recovery
  - Sequential execution of micro-actions with proper DOM settling between steps
  - Prevents token limit issues on complex pages by encouraging scoped actions

  ### 2. Enhanced Schema Design
  - Made instruction field optional to handle navigation-only commands
  - Added smart defaults for missing instructions based on command_type
  - Improved field descriptions to guide agents toward atomic actions with location context
  - Prevents "instruction Field required" validation errors

  ### 3. Intelligent API Key Management
  - Added _get_model_api_key() method with automatic detection based on model type
  - Support for OpenAI (GPT), Anthropic (Claude), and Google (Gemini) API keys
  - Removes need for manual model API key configuration

  ### 4. Robust Error Recovery
  - Step-by-step execution with individual error handling per atomic action
  - Automatic retry with simplified instructions when complex actions fail
  - Comprehensive error logging and reporting for debugging
  - Graceful degradation instead of complete failure

  ### 5. Token Management & Performance
  - Tool descriptions encourage atomic, scoped actions (e.g., "click search box in header")
  - Prevents "prompt too long" errors on complex pages like Wikipedia
  - Location-aware instruction patterns for better DOM targeting
  - Reduced observe-act cycles through better instruction decomposition

  ### 6. Enhanced Testing Support
  - Comprehensive async mock objects for testing mode
  - Proper async/sync compatibility for different execution contexts
  - Enhanced resource cleanup and session management

* Update stagehand_tool.py

removeing FixedStagehandTool in favour of StagehandTool

* removed comment

* Cleanup

Revoved unused class
Improved tool description
2025-08-13 08:57:11 -04:00
meirk-brd
41ce4981ac feat: Add Bright Data tools (#314)
* Initial commit of BrightData tools

* Renamed the BrightData test file names

* Refactored and improved the overall BrightData tools

* Add BrightData tools

* Add tools to init

* Added config class

* Fix test failures and add missing __init__.py files

- Remove problematic brightdata_dataset_tool_test.py that referenced non-existent classes
- Fix brightdata_serp_tool_test.py to expect string responses instead of dict
- Fix brightdata_webunlocker_tool_test.py to expect string responses instead of dict
- Add missing tests/tools/__init__.py for proper test imports

---------

Co-authored-by: Ranjan Dailata <ranjancse@gmail.com>
Co-authored-by: Tony Kipkemboi <iamtonykipkemboi@gmail.com>
2025-08-07 10:29:51 -04:00
Volodymyr Tkachuk
d00c9764fc feat: Adding SingleStoreSearchTool (#349)
* initial commit

* Add actual SinglesStore Search Tool implementation

* add the implementation

* update readme

* add tool's description

* add tests

* fix tests

* review comments

* remove schema from public exports

* fix test failure

* revert tools.specs.json

* added dependencies and env vars descriptions
2025-08-07 09:51:37 -04:00
Lucas Gomide
4daf18256d feat: allow custom client_timeout for MCPAdapter (#409) 2025-08-05 09:53:57 -04:00
Lucas Gomide
9220cfba28 fix: use proper ArxivPaperTool import (#408) 2025-08-05 09:46:11 -04:00
Lucas Gomide
707c8583f4 chore: make tavily tools exportable (#400) 2025-07-29 14:56:20 -04:00
Harikrishnan K
30df46445b Adding Arxiv Paper tool (#310)
* arxiv_paper_tool.py

* Updating as per the review

* Update __init__.py

* Update __init__.py

* Update arxiv_paper_tool.py

* added test cases

* Create README.md

* Create Examples.md

* Update Examples.md

* Updated logger

* Updated with package_dependencies,env_vars
2025-07-29 12:53:30 -04:00
Vini Brasil
b8bd3000c6 Make RagTool processs-safe (#399)
This commit adds a file lock to `RagTool`. As it uses Embedchain and
Chroma internally, this tool was not process-safe.
2025-07-28 17:09:53 -03:00
Steven Silvester
e6ec6cc332 Fix MongoDBVectorSearchTool serialization and schema (#389)
* Fix MongoDBVectorSearchTool serialization

* fix base class
2025-07-23 10:28:07 -07:00
Mike Plachta
104485d18b feat: add SerperScrapeWebsiteTool for extracting clean content from URLs (#392)
* feat: add SerperScrapeWebsiteTool for extracting clean content from URLs

* feat: add required SERPER_API_KEY env var validation to SerperScrapeWebsiteTool
2025-07-23 10:22:47 -07:00
Filip Michalsky
c3e87fc31f Fm/update stagehand (#387)
* Update tool specifications for

* Update stagehand dependency from stagehand-py to stagehand v0.4.1

* uv add

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-22 07:05:29 -07:00
Piyush Jain
2c38d1d448 Bedrock AgentCore browser and code interpreter toolkits (#385)
* Added browser and code tools

* Added dependencies, moved imports inside class

* Added instructions in README

* Updated imports

* Updated imports

* Updated dependencies

* Fix 'get_current_page' utilities for Browser tools

* Support browser session cleanup from synchronous code

* Update browser tool examples for new changes

* Manually override _run->_arun and set nested loop when in crew event loop

* Browser async example

* update examples with uv

* Fix toolkit fields for code interpreter

* Update code interpreter examples

* update uv.lock

* Move nest_asyncio import

---------

Co-authored-by: Michael Chin <mchin188@yahoo.com>
2025-07-18 14:33:39 -07:00
Thiago Moretto
9f6002a9dd Declaring and make some tool configurable using env vars (#376) 2025-07-14 09:48:36 -04:00
Lorenze Jay
78f5144bde Enhance EnterpriseActionTool with improved schema processing and erro… (#371)
* Enhance EnterpriseActionTool with improved schema processing and error handling

- Added methods for sanitizing names and processing schema types, including support for nested models and nullable types.
- Improved error handling during schema creation and processing, with warnings for failures.
- Updated parameter handling in the `_run` method to clean up `kwargs` before sending requests.
- Introduced a detailed description generation for nested schema structures to enhance tool documentation.

* Add tests for EnterpriseActionTool schema conversion and validation

- Introduced a new test class for validating complex nested schemas in EnterpriseActionTool.
- Added tests for schema conversion, optional fields, enum validation, and required nested fields.
- Implemented execution tests to ensure the tool can handle complex validated input correctly.
- Verified model naming conventions and added tests for simpler schemas with basic enum validation.
- Enhanced overall test coverage for the EnterpriseActionTool functionality.

* Update chromadb dependency version in pyproject.toml and uv.lock

- Changed chromadb version from >=0.4.22 to ==0.5.23 in both pyproject.toml and uv.lock to ensure compatibility and stability.

* Update test workflow configuration

- Changed EMBEDCHAIN_DB_URI to point to a temporary test database location.
- Added CHROMA_PERSIST_PATH for specifying the path to the Chroma test database.
- Cleaned up the test run command in the workflow file.

* reverted
2025-07-11 10:18:54 -07:00
Vini Brasil
eb09f2718f Use environment variable to initialize scrapegraph_py.Client (#362)
This commit fixes a bug where `SCRAPEGRAPH_API_KEY` were never used to
initialize `scrapegraph_py.Client`.
2025-07-09 15:03:16 -03:00
Steven Silvester
e0de166592 Add MongoDB Vector Search Tool (#319)
* INTPYTHON-580 Design and Implement MongoDBVectorSearchTool

* add implementation

* wip

* wip

* finish tests

* add todo

* refactor to wrap langchain-mongodb

* cleanup

* address review

* Fix usage of EnvVar class

* inline code

* lint

* lint

* fix usage of SearchIndexModel

* Refactor: Update EnvVar import path and remove unused tests.utils module

- Changed import of EnvVar from tests.utils to crewai.tools in multiple files.
- Updated README.md for MongoDB vector search tool with additional context.
- Modified subprocess command in vector_search.py for package installation.
- Cleaned up test_generate_tool_specs.py to improve mock patching syntax.
- Deleted unused tests/utils.py file.

* update the crewai dep and the lockfile

* chore: update package versions and dependencies in uv.lock

- Removed `auth0-python` package.
- Updated `crewai` version to 0.140.0 and adjusted its dependencies.
- Changed `json-repair` version to 0.25.2.
- Updated `litellm` version to 1.72.6.
- Modified dependency markers for several packages to improve compatibility with Python versions.

* refactor: improve MongoDB vector search tool with enhanced error handling and new dimensions field

- Added logging for error handling in the _run method and during client cleanup.
- Introduced a new 'dimensions' field in the MongoDBVectorSearchConfig for embedding vector size.
- Refactored the _run method to return JSON formatted results and handle exceptions gracefully.
- Cleaned up import statements and improved code readability.

* address review

* update tests

* debug

* fix test

* fix test

* fix test

* support azure openai

---------

Co-authored-by: lorenzejay <lorenzejaytech@gmail.com>
2025-07-09 08:44:23 -07:00
gautham
c45e92bd17 Add Couchbase as a tool (#264)
* - Added CouchbaseFTSVectorStore as a CrewAI tool.
- Wrote a README to setup the tool.
- Wrote test cases.
- Added Couchbase as an optional dependency in the project.

* Fixed naming in some places. Added docstrings. Added instructions on how to create a vector search index.

* Fixed pyproject.toml

* error handling and response format

- Removed unnecessary ImportError for missing 'couchbase' package.
- Changed response format from a concatenated string to a JSON array for search results.
- Updated error handling to return error messages instead of raising exceptions in certain cases.
- Adjusted tests to reflect changes in response format and error handling.

* Update dependencies in pyproject.toml and uv.lock

- Changed pydantic version from 2.6.1 to 2.10.6 in both pyproject.toml and uv.lock.
- Updated crewai-tools version from 0.42.2 to 0.42.3 in uv.lock.
- Adjusted pydantic-core version from 2.33.1 to 2.27.2 in uv.lock, reflecting the new pydantic version.

* Removed restrictive pydantic version and updated uv.lock

* synced lockfile

* regenerated lockfile

* updated lockfile

* regenerated lockfile

* Update tool specifications for

* Fix test cases

---------

Co-authored-by: AayushTyagi1 <tyagiaayush5@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-08 10:54:54 -04:00
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
Parth Patel
4fd7db2e53 #249: update QdrantVectorSearchTool README 2025-03-25 19:16:18 +00:00
Parth Patel
5ded394e43 #249 feat: add support for local qdrant client 2025-03-25 19:01:01 +00:00
João Moura
baea6dc8a4 Merge pull request #197 from beowolx/bugfix/serperdev-missing-country
fix(serper-dev): restore search localization parameters
2025-03-21 14:54:50 -03:00
João Moura
5cfcb5c74a new version 2025-03-19 11:30:26 -07:00
João Moura
865930da78 Merge pull request #239 from raju-rangan/main
Amazon Bedrock Knowledge Bases Retriever and Agents support
2025-03-19 15:18:26 -03:00
Raju Rangan
319423b70a added __init__ files as suggested. 2025-03-18 10:24:08 -04:00
João Moura
658c23547e prep new version 2025-03-17 18:58:45 -07:00
João Moura
568aace62e fix 2025-03-17 18:58:09 -07:00
Vini Brasil
9e68cbbb3d Conditionally import Databricks library (#243)
Databricks is an optional dependency, but the tool package is imported by
default, leading to ImportError exceptions.

Related: crewAIInc/crewAI#2390
2025-03-17 15:13:28 -03:00
Brandon Hancock (bhancock_ai)
c06076280e Merge pull request #228 from MQ37/feat/apify
feat: apify actors
2025-03-16 12:28:13 -04:00
João Moura
0c3140e758 new version 2025-03-14 07:39:52 -07:00
Raju Rangan
db309ca1ae - Add custom exceptions for better error handling
- Add parameter validation for Bedrock tools
- Improve response processing and debug information
- Maintain backward compatibility with existing implementations
2025-03-11 16:46:12 -04:00
Jakub Kopecký
292adef7ba Update README.md 2025-03-11 18:02:15 +01:00
Raju Rangan
d47adfc34a Adding tooling to use Amazon Bedrock Agents as enternal agent, enbaling distributed agentic capabilities 2025-03-11 10:21:30 -04:00
Raju Rangan
e8326f134f Adding tooling to use Amazon Bedrock Knowledge Base as a knowledge retreiver 2025-03-11 10:20:42 -04:00
João Moura
c19591a689 updatign readme 2025-03-09 04:01:12 -07:00
Shady Ali
5af2108307 Fix: FireCrawl FirecrawlCrawlWebsiteTool for crawling. FireCrawl API does not recognize sent paramters (HTTPError: Unexpected error during start crawl job: Status code 400. Bad Request -
[{'code': 'unrecognized_keys', 'keys': ['crawlerOptions', 'timeout'], 'path': [], 'message': 'Unrecognized key in body -- please review the v1 API documentation for request body changes'}]) because it has been updated to v1. I updated the sent parameters to match v1 and updated their description in the readme file
2025-03-08 09:35:23 +02:00
MQ
cad804e87b update readme 2025-03-07 11:00:54 +01:00
MQ
7718df5437 minor consistency improvements 2025-03-04 12:45:52 +01:00
MQ
9c7c7d3d75 apify_actors -> apify_actors_tool, refactor readme 2025-03-04 11:10:41 +01:00
MQ
3df25e65d5 fix 2025-02-28 15:40:08 +01:00
MQ
7148c52bf6 format 2025-02-28 12:43:52 +01:00
MQ
f329b0d9d2 improve readme, add link to template 2025-02-28 12:35:23 +01:00
MQ
975c71a920 fix example 2025-02-28 10:29:50 +01:00
MQ
884ea63b49 other improvements 2025-02-28 10:22:56 +01:00
MQ
35aff6e84e improve code, lazy import, improve readme 2025-02-28 10:10:56 +01:00
MQ
867305540c improve 2025-02-27 21:27:05 +01:00
MQ
5bcb598f75 fix readme 2025-02-27 21:14:42 +01:00
MQ
3fcc7b42cb fix docstring 2025-02-27 21:12:38 +01:00
MQ
13bad2bb69 initial implementation 2025-02-27 21:08:05 +01:00
Brandon Hancock (bhancock_ai)
6d8d30178d Merge pull request #227 from mplachta/aws_s3_tools
S3 Tools
2025-02-27 12:49:02 -05:00
Mike Plachta
f1187c5469 S3 Tools 2025-02-27 08:44:43 -08:00
Lorenze Jay
7c16b7d284 Merge pull request #200 from crewAIInc/feat/add-qdrant-tools
enable qdrant as vector search tool for crew agents
2025-02-07 10:25:29 -08:00
Lorenze Jay
837198ae08 Add interactive Qdrant client installation prompt 2025-02-07 10:03:37 -08:00
Lorenze Jay
554bba8036 clearer docs 2025-02-03 16:22:09 -08:00
Lorenze Jay
12927ba79d cleanup 2025-02-03 16:19:53 -08:00
Lorenze Jay
96c3fbdddf remove ollama from here 2025-02-03 16:19:33 -08:00
Lorenze Jay
5a9bb24b63 default openai 2025-02-03 16:19:03 -08:00
Lorenze Jay
05982aeef2 set default vectorizer 2025-02-01 23:44:40 -08:00
Lorenze Jay
d6a6325b55 set vectorizer 2025-02-01 23:43:09 -08:00
Lorenze Jay
6b19a3d156 default set 2025-02-01 23:40:37 -08:00
Lorenze Jay
052a07ddc7 setup common default model 2025-02-01 23:38:24 -08:00
Lorenze Jay
aff40529a5 updated docs 2025-02-01 23:32:31 -08:00
Lorenze Jay
dcd4481ae2 enable qdrant as vector search tool for crew agents 2025-02-01 23:31:15 -08:00
Lorenze Jay
6b93ebb97b Merge pull request #198 from crewAIInc/add/updated-exa
latest version of exa supported
2025-01-31 09:40:32 -08:00
Lorenze Jay
9a09ea7703 better docs and download missing packaged 2025-01-30 16:04:33 -08:00
Lorenze Jay
bcfe015d9d ensure works on agent 2025-01-30 15:53:57 -08:00
Lorenze Jay
90cdb48db0 latest version of exa 2025-01-30 15:09:47 -08:00
João Moura
199044f866 fixing test 2025-01-28 10:11:37 -03:00
Luis Cardoso
3808f98c14 fix(serper-dev): restore search localization parameters
- Re-add country (gl), location, and locale (hl) parameters to SerperDevTool class
- Update payload construction in _make_api_request to include localization params
- Add schema validation for localization parameters
- Update documentation and examples to demonstrate parameter usage

These parameters were accidentally removed in the previous enhancement PR and are crucial for:
- Getting region-specific search results (via country/gl)
- Targeting searches to specific cities (via location)
- Getting results in specific languages (via locale/hl)

BREAKING CHANGE: None - This restores previously available functionality
2025-01-28 10:46:40 +01:00
Brandon Hancock (bhancock_ai)
060671983d Merge pull request #195 from crewAIInc/bugfix/make-tooling-optional
Fix for Gui
2025-01-23 23:29:19 -05:00
Brandon Hancock
bcb72a9305 Clean up and follow auto import pattern 2025-01-23 15:23:12 -05:00
Brandon Hancock
141ff864f2 clean up 2025-01-23 15:11:45 -05:00
Brandon Hancock
43d045f542 Fix for GUI 2025-01-23 14:43:52 -05:00
Brandon Hancock (bhancock_ai)
88785f4a74 Merge pull request #194 from mplachta/ocr-tool
OCR Tool v1
2025-01-23 10:40:03 -05:00
Mike Plachta
b4d98bbb86 OCR Tool v1 2025-01-22 20:22:57 -08:00
Brandon Hancock (bhancock_ai)
df3842ed88 Merge pull request #181 from crewAIInc/fix/optional-dependencies
make extra dependencies optional for our tools (making most tools an opt in)
2025-01-22 13:06:48 -05:00
Lorenze Jay
4af3724ec2 fix selenium tool 2025-01-21 15:55:05 -08:00
Lorenze Jay
0bd6006b27 Merge branch 'main' of github.com:crewAIInc/crewAI-tools into fix/optional-dependencies 2025-01-21 15:53:14 -08:00
João Moura
4774b996d0 Merge pull request #168 from MinuraPunchihewa/feature/ai_minds_tool
Added the MindsDB AIMind Tool
2025-01-19 02:29:11 -03:00
João Moura
717edbba19 Merge pull request #177 from VinciGit00/main
fix: scrapegraph tool
2025-01-19 02:28:04 -03:00
João Moura
755a9ed055 Merge branch 'main' into main 2025-01-19 02:27:52 -03:00
João Moura
d824f3bb3b Merge pull request #183 from NikhilShahi/feature/add-hyperbrowser
added HyperbrowserLoadTool
2025-01-19 02:25:04 -03:00
João Moura
14ecab7365 Merge branch 'main' into feature/add-hyperbrowser 2025-01-19 02:24:51 -03:00
João Moura
b03d74abe5 Merge pull request #185 from MahlerTom/fix/code-interpreter
Fix/code interpreter
2025-01-19 02:11:10 -03:00
João Moura
bee8fda006 Merge branch 'main' into fix/code-interpreter 2025-01-19 02:10:57 -03:00
João Moura
ef611a9dcd Merge pull request #188 from meerkat-citronella/bugfix/fix-description-on-file_read_tool
Fix description on FileReadTool
2025-01-19 02:08:46 -03:00
João Moura
fb4423c91d Merge branch 'main' into bugfix/fix-description-on-file_read_tool 2025-01-19 02:08:27 -03:00
João Moura
fe3f0bda81 Merge pull request #189 from chethanuk/snowflake
Adding Snowflake search tool
2025-01-19 02:07:02 -03:00
João Moura
3f2161efdb Merge branch 'main' into snowflake 2025-01-19 01:22:42 -03:00
João Moura
cef86f73d9 Merge pull request #191 from KhanhSaypien/fix/HTTPError-import-issue
FIX: Fix HTTPError cannot be found in serperai
2025-01-19 00:10:23 -03:00
ArchiusVuong-sudo
659cb6279e fix: Fixed all from urllib.error import HTTPError 2025-01-18 23:01:01 +07:00
ArchiusVuong-sudo
a606f48b70 FIX: Fix HTTPError cannot be found in serperai 2025-01-18 21:58:50 +07:00
ChethanUK
9c4c4219cd Adding Snowflake search tool 2025-01-17 02:29:35 +05:30
Carter Chen
fe2a5abf8d restructure init statement to remove duplicate call to _generate_description 2025-01-14 21:16:11 -05:00
Carter Chen
1568008db6 remove _generate_description on file_read_tool 2025-01-14 19:22:28 -05:00
Tom Mahler
1bd87f514e changed == None to is None 2025-01-14 21:07:08 +02:00
Tom Mahler
334beda181 added missing import 2025-01-14 21:06:42 +02:00
Lorenze Jay
5cb5f4f1a6 use private attr 2025-01-14 08:48:28 -08:00
Lorenze Jay
14bc8de774 fix browserbase tool here 2025-01-14 08:48:09 -08:00
Nikhil Shahi
e343f26c03 add docstring 2025-01-13 16:08:11 -06:00
Nikhil Shahi
1a824cf432 added HyperbrowserLoadTool 2025-01-13 15:48:45 -06:00
Lorenze Jay
78aff9dbdc fix no client err 2025-01-13 10:45:12 -08:00
Lorenze Jay
50779582ed Merge branch 'main' of github.com:crewAIInc/crewAI-tools into fix/optional-dependencies 2025-01-13 10:32:06 -08:00
Lorenze Jay
31192bcdda fixed multion 2025-01-10 18:31:03 -08:00
Lorenze Jay
d882818d6c fixed serpapi 2025-01-10 18:24:07 -08:00
Lorenze Jay
e26667ea40 removing serpapi from dependenices 2025-01-10 18:17:27 -08:00
Brandon Hancock (bhancock_ai)
71f3ed9ef9 Merge pull request #180 from crewAIInc/bugfix/improve-firecrawl-and-serper
Fix firecrawl errors
2025-01-10 19:47:13 -05:00
Lorenze Jay
d3d3cc4c28 remove y/n as it comes with it within click.confirm and fixed firecrawl tools 2025-01-10 15:56:54 -08:00
Lorenze Jay
41cec25ad9 fix client init on scrapegraph tool 2025-01-10 14:26:03 -08:00
Lorenze Jay
40dcf63a70 optional deps for most 2025-01-10 13:51:39 -08:00
Brandon Hancock
ecbf550be9 Fix firecrawl errors 2025-01-08 16:38:38 -05:00
Brandon Hancock (bhancock_ai)
06f99fc6cd Merge pull request #179 from crewAIInc/bugfix/improve-firecrawl-and-serper
improve serper and firecrawl
2025-01-08 15:15:02 -05:00
Brandon Hancock
90a335de46 Fix patronus issues as well 2025-01-08 15:12:29 -05:00
Brandon Hancock
e5aabe05e1 improve serper and firecrawl 2025-01-08 14:56:12 -05:00
Brandon Hancock (bhancock_ai)
4388235846 Merge pull request #165 from patronus-ai/feat/add-patronus-api-tool
Feat/add patronus api tool
2025-01-07 12:48:08 -05:00
Marco Vinciguerra
91bff42398 Merge branch 'main' of https://github.com/VinciGit00/crewAI-tools 2025-01-07 16:15:50 +01:00
Marco Vinciguerra
4f4b061907 fix: scrapegraph-tool 2025-01-07 16:13:50 +01:00
Marco Vinciguerra
c27727b16e Update scrapegraph_scrape_tool.py 2025-01-07 15:51:52 +01:00
Devin AI
ad4c711223 feat: implement reviewer suggestions for StagehandTool
Co-Authored-By: Joe Moura <joao@crewai.com>
2025-01-03 22:56:38 +00:00
Devin AI
2f8c07320b feat: add new StagehandTool for stagehand integration
This commit adds a new StagehandTool that integrates Stagehand's AI-powered web automation capabilities into CrewAI. The tool provides access to Stagehand's three core APIs:
- act: Perform web interactions
- extract: Extract information from web pages
- observe: Monitor web page changes

Each function takes atomic instructions to increase reliability.

Co-Authored-By: Joe Moura <joao@crewai.com>
2025-01-03 22:38:55 +00:00
Lorenze Jay
4360adc725 Merge pull request #174 from crewAIInc/extra_deps
add optional dependencies for all deps that we have
2025-01-03 14:19:00 -08:00
Lorenze Jay
dab8f648cb leave ignore 2025-01-03 13:48:21 -08:00
Lorenze Jay
9f8529eab2 add optional dependencies for all deps that we have 2025-01-03 13:43:50 -08:00
Brandon Hancock (bhancock_ai)
513c156c4b Merge pull request #173 from mplachta/vision-tool-improvement
Vision Tool Refactoring and Simplify the code
2025-01-03 13:31:23 -05:00
Mike Plachta
9a20c3952f Merge branch 'main' into vision-tool-improvement 2025-01-03 09:36:13 -08:00
Mike Plachta
66dee007b7 Vision Tool Improvement 2025-01-03 09:33:59 -08:00
João Moura
aafcf992ab fix weviate tool 2025-01-03 10:03:53 -03:00
João Moura
c31a8d6ee2 fix 2025-01-03 10:00:25 -03:00
Eduardo Chiarotti
a5d19e3ec3 Merge pull request #172 from crewAIInc/fix/weaviate-init
fix: weaviate init parameters
2025-01-03 08:56:45 -03:00
Eduardo Chiarotti
7efc092873 fix: weaviate init parameters 2025-01-03 08:47:52 -03:00
João Moura
fa901453fe new version 2025-01-03 04:15:39 -03:00
João Moura
8047ee067c treating for uninstalled dependencies 2025-01-03 03:34:34 -03:00
Minura Punchihewa
ea85f02e03 refactored the logic for accessing the API key 2025-01-03 11:49:58 +05:30
Minura Punchihewa
d1be5a937f moved constants like the base URL to a class 2025-01-03 11:48:11 +05:30
Minura Punchihewa
d360906f57 renamed the pkg and module 2025-01-03 11:41:59 +05:30
Minura Punchihewa
29a7961ca8 refined the content in the README 2025-01-03 11:26:16 +05:30
João Moura
16cdabbf35 bumping verison fixing tests 2025-01-03 02:53:24 -03:00
Minura Punchihewa
94cce06044 updated the initialization logic to allow the API key to be passed as env var 2025-01-03 11:08:38 +05:30
João Moura
e0c6ec5bd3 fix imports 2025-01-02 20:51:14 -03:00
João Moura
fc68b9f6bf Merge pull request #167 from Priyanshupareek/patch-1
Update browserbase_load_tool.py | Fix for Browserbase Tool Initialization Issue
2025-01-02 20:45:05 -03:00
Minura Punchihewa
3c29a6cc11 added an example of running the tool to the README 2025-01-03 02:25:14 +05:30
Minura Punchihewa
64d54bd423 updated the content in the README 2025-01-03 01:55:51 +05:30
Minura Punchihewa
faff58ba1c fixed a few bugs, type hints and imports 2025-01-03 01:17:11 +05:30
Minura Punchihewa
555638a654 added the main import statements 2025-01-03 00:37:12 +05:30
Minura Punchihewa
0b5f0841bf implemented the run function for the tool 2025-01-03 00:32:24 +05:30
Minura Punchihewa
55f669989b completed the initialization logic for the tool 2025-01-03 00:28:30 +05:30
Minura Punchihewa
29da6659cf added the skeleton for the AIMind tool 2025-01-02 19:40:56 +05:30
Priyanshupareek
954dd43c17 Update browserbase_load_tool.py 2025-01-02 01:34:42 +05:30
Priyanshupareek
4c7ce3a945 Update browserbase_load_tool.py 2025-01-02 00:54:48 +05:30
Rebecca Qian
10f8a87317 update local evaluator 2024-12-31 04:05:46 -05:00
Rebecca Qian
a7316a86bf fix bug in local evaluator tool 2024-12-31 04:01:26 -05:00
Rebecca Qian
15d6314379 Create separate tool classes 2024-12-31 03:02:15 -05:00
Rebecca Qian
62ddb6c9bd Merge pull request #1 from DarshanDeshpande/feat/add-patronus-api-tool
Update Patronus AI evaluator tool and example
2024-12-31 00:32:52 -05:00
João Moura
0d94a8f7d9 Merge pull request #153 from VinciGit00/main
feat: integration of scrapegraph APIs
2024-12-29 12:26:01 -03:00
João Moura
029afd3e14 Update __init__.py 2024-12-29 12:23:08 -03:00
João Moura
20e852bffc Merge pull request #155 from juliette0704/feat/add_linkup_tool
add linkup tool
2024-12-29 12:21:00 -03:00
João Moura
dd3fea748f Merge pull request #162 from crewAIInc/devin/1735422935-file-read-tool-fix
Fix FileReadTool infinite loop by maintaining original schema
2024-12-28 21:23:17 -03:00
Devin AI
d3391d9ba4 Add comprehensive documentation and type hints to FileReadTool
Co-Authored-By: Joe Moura <joao@crewai.com>
2024-12-28 23:10:51 +00:00
Devin AI
aaf2641cc8 Add comprehensive tests for FileReadTool
Co-Authored-By: Joe Moura <joao@crewai.com>
2024-12-28 22:29:46 +00:00
Devin AI
5e2c38c349 Improve FileReadTool error handling and validation
Co-Authored-By: Joe Moura <joao@crewai.com>
2024-12-28 22:26:37 +00:00
Devin AI
63e23c06c5 Fix FileReadTool infinite loop by maintaining original schema
Co-Authored-By: Joe Moura <joao@crewai.com>
2024-12-28 21:55:35 +00:00
juliette_sivan
e5c47e46a8 add import tools 2024-12-28 10:59:06 -05:00
Marco Vinciguerra
b404439aa9 Merge branch 'main' into main 2024-12-28 09:12:50 +01:00
Marco Vinciguerra
c3ebbba8ae Update __init__.py 2024-12-28 09:11:32 +01:00
João Moura
0674b397f7 Merge pull request #145 from caike/fix-firecrawler-crawl-args
Fix url and api_key args on crawler tool
2024-12-28 00:32:52 -03:00
João Moura
8dd4388c49 Merge pull request #148 from HammamWahab/main
Enabled connection to docker daemon with manual setting of docker base url for code interpreter tool. (Issue #1555)
2024-12-27 23:34:37 -03:00
João Moura
2ad99c04d3 Merge branch 'main' into main 2024-12-27 23:33:36 -03:00
João Moura
cc509a363e Merge pull request #160 from crewAIInc/feature/selenium-scraping-tool-can-return-html
feat: add URL validation and return_html examples
2024-12-27 22:09:01 -03:00
João Moura
ed261892df Merge pull request #156 from pedropereira/feature/selenium-scraping-tool-can-return-html
Feat(SeleniumScrapingTool): Provide capability to return HTML
2024-12-27 22:02:58 -03:00
Devin AI
c7c8cd0a3c feat: add URL validation and return_html examples
- Add comprehensive URL validation in schema and _create_driver
- Add URL format, length, and character validation
- Add meaningful error messages for validation failures
- Add return_html usage examples in README.md

Co-Authored-By: Joe Moura <joao@crewai.com>
2024-12-28 00:54:49 +00:00
João Moura
38a7b1e4da Merge pull request #149 from tanys123/feat/serpapi-tools
feat: Add Google Search and Google Shopping tools
2024-12-27 21:48:20 -03:00
João Moura
7b7327c168 Merge pull request #150 from gbertb/fix/spidertool_fixes
Fix(SpiderTool): Improve Tool Reliability and Performance
2024-12-27 18:37:48 -03:00
João Moura
97a4a348ff Merge pull request #151 from hienhayho/main
fix: fix pydantic validation error
2024-12-27 18:30:18 -03:00
João Moura
078120e548 Merge pull request #159 from MahlerTom/main
[BUG] `CodeInterpreterTool` cannot handle mutli-line code
2024-12-27 18:03:47 -03:00
DarshanDeshpande
7da783ef0e Minor formatting changes 2024-12-26 17:44:04 -05:00
DarshanDeshpande
0ac6f915fb Add all Patronus eval tools and update example 2024-12-26 17:37:22 -05:00
Tom Mahler
ba8f95964f added unit testing for multi-line output 2024-12-24 14:14:09 +02:00
Tom Mahler
64b98667a3 fixed code interpreter tests 2024-12-24 14:13:51 +02:00
Tom Mahler
331840e6cc improved imports from docker for better type hinting 2024-12-24 12:17:57 +02:00
Tom Mahler
bb19f1c74c using command list instead of string to avoid parsing issues 2024-12-24 12:12:18 +02:00
Pedro Pereira
f11756387d chore: add tests for SeleniumScrapingTool 2024-12-19 21:06:51 +00:00
Tony Kipkemboi
b7a132db89 Merge pull request #147 from crewAIInc/feature/enhanced-serper-search
feat(serper-dev): implement enhanced search capabilities and error ha…
2024-12-19 13:15:11 -05:00
Pedro Pereira
5e00b74cd4 chore: update readme 2024-12-19 17:38:30 +00:00
juliette_sivan
4c5f1962ac add linkup tool 2024-12-19 14:07:36 +01:00
Pedro Pereira
8d8c3677ff feat: add optional return_html flag to SeleniumScrapingTool 2024-12-18 18:23:18 +01:00
Marco Vinciguerra
b58d80dcf9 update documents according to suggestions 2024-12-18 14:42:37 +01:00
Marco Vinciguerra
7608944e7f Update README.md 2024-12-18 14:38:34 +01:00
Marco Vinciguerra
c070ba002c feat: integration of scrapegraph APIs 2024-12-18 14:34:40 +01:00
Gilbert Bagaoisan
1bbac87e70 Improved readme based on recommendations—added more advanced usage examples 2024-12-17 21:00:40 -08:00
Gilbert Bagaoisan
73b803ddc3 various improvements for PR based on recommendations 2024-12-17 21:00:34 -08:00
Ho Trong Hien
c7624e1f57 Merge pull request #1 from hienhayho/hienhayho-fix-llamaindex-result-as-answer
fix: fix pydantic validation error
2024-12-17 22:29:19 +07:00
Ho Trong Hien
059d635f02 fix: fix pydantic validation error
- When passing result_as_answer=True, it will return ToolOutput so it won't pass pydantic validation as a string

- Get content of ToolOutput before return
2024-12-17 22:28:41 +07:00
Gilbert Bagaoisan
3795d7dd8e Reversed order of url validation 2024-12-16 22:19:46 -08:00
Gilbert Bagaoisan
4551b8c625 Updated readme 2024-12-16 22:05:46 -08:00
Gilbert Bagaoisan
cd37ede869 lint fixes 2024-12-16 22:05:28 -08:00
Terry Tan Yongsheng
81981e43b6 Add type hints 2024-12-17 13:45:50 +08:00
Terry Tan Yongsheng
2effe9a7d2 Add README 2024-12-17 11:09:38 +08:00
Terry Tan Yongsheng
56a9060840 Add SerpApi tools - google search, google shopping 2024-12-17 11:09:28 +08:00
Rip&Tear
e40ca38daf Merge branch 'main' into feature/enhanced-serper-search 2024-12-16 22:53:55 +08:00
Hammam Abdelwahab
b6bb5dbd53 Enabled manual setting of docker base url for code interpreter tool. Goal is to avoid the error: CodeInterpreterTool Error while fetching server API version: 2024-12-15 10:38:56 +01:00
Hammam Abdelwahab
c26e962d17 Enabled manual setting of docker base url for code interpreter tool. Goal is to avoid the error: CodeInterpreterTool Error while fetching server API version: 2024-12-15 10:34:07 +01:00
DarshanDeshpande
d94f7e03dc Update Patronus AI evaluator tool and example 2024-12-14 15:46:10 -05:00
Rebecca Qian
c76e0f3445 Add patronus evaluation tools
remove fields

rename eval tool

remove eval tool

init files
2024-12-13 19:08:05 -05:00
Carlos Souza
668e87d5e1 Add constructor comments 2024-12-13 11:26:46 -05:00
Carlos Souza
164442223e Organize imports 2024-12-13 11:23:53 -05:00
Carlos Souza
3a095183c5 Use proper options and accept custom FirecrawlApp 2024-12-13 11:20:08 -05:00
Carlos Souza
2cb33b18e5 Remove outdated params 2024-12-13 11:18:59 -05:00
theCyberTech
00418d98f7 resolved conflict 2024-12-13 22:01:04 +08:00
theCyberTech
1fd5805bef Resolved conflict 2024-12-13 21:59:38 +08:00
theCyberTech
b0a948797a feat(serper-dev): implement enhanced search capabilities and error handling
- Add support for multiple search types (general and news)
- Implement knowledge graph integration
- Add structured result processing for organic results, "People Also Ask", and related searches
- Enhance error handling with try-catch blocks and logging
- Update documentation with comprehensive feature list and usage examples
2024-12-13 21:42:01 +08:00
Carlos Souza
1eb5d50a55 Fix url and api_key args on crawler tool 2024-12-12 16:00:24 -05:00
Tony Kipkemboi
a49be2fc52 Merge pull request #142 from crewAIInc/feat/weaviate-tool
setup weaviate vector search tool
2024-12-09 10:44:11 -05:00
Lorenze Jay
d5d83cbd7e fix collection name docs 2024-12-08 21:48:15 -08:00
Lorenze Jay
a0e0c28152 setup weaviate vector search tool 2024-12-08 21:44:19 -08:00
Brandon Hancock (bhancock_ai)
264f1e0f0e Merge pull request #141 from crewAIInc/bugfix/fix-basetool-import
update basetool dependencies to use root crewai repo
2024-12-05 13:36:45 -05:00
Brandon Hancock
d5fb31e645 update basetool dependencies to use root crewai repo 2024-12-05 13:16:48 -05:00
João Moura
e1482d740f Merge pull request #116 from ernestp/main
fix: web scraper concatenate words
2024-12-05 12:00:20 -03:00
João Moura
7c375976ab Merge pull request #128 from mplachta/jina_website_scraper
Jina Website Scraper v1
2024-12-05 11:56:26 -03:00
João Moura
5b813e3d31 Merge pull request #132 from caike/fix-firecrawl-scrape-pydantic-errors
Fix pydantic related errors on FirecrawlScrapeWebsiteTool
2024-12-05 11:56:08 -03:00
João Moura
25969d9db7 Merge pull request #134 from caike/fix-firecrawl-crawl-pydantic-errors
Fix pydantic related errors on FirecrawlCrawlWebsiteTool
2024-12-05 11:55:26 -03:00
João Moura
f64a93b541 Merge pull request #139 from crewAIInc/tools_readme_update
docs: add Discourse community link to contact section
2024-12-05 11:54:41 -03:00
João Moura
569d9e7f75 Merge pull request #137 from siddas27/feature/BraveSearchTool
add brave search tool
2024-12-05 11:08:03 -03:00
siddas27
a64cccbd72 add BraveSearchTool to init 2024-12-04 22:28:30 -06:00
theCyberTech
e0d3ee5b23 docs: add Discourse community link to contact section
Add link to Discourse community platform in the contact section to provide users with an additional support channel alongside Discord.
2024-12-03 20:35:23 +08:00
siddas27
95cc6835a1 update name 2024-11-30 22:30:31 -06:00
siddas27
e7e059d02a add rate limiting 2024-11-30 22:08:29 -06:00
siddas27
5532ea8ff7 add lru caching 2024-11-30 21:51:46 -06:00
siddas27
d168b8e245 add error handling 2024-11-30 21:36:28 -06:00
siddas27
6c242ef3bb add brave search tool 2024-11-30 14:04:06 -06:00
Tony Kipkemboi
0e49353fcd Merge pull request #135 from crewAIInc/fix/nl2sql-readme-typos
docs: fix typos and formatting in NL2SQL tool README
2024-11-30 11:54:14 -05:00
Tony Kipkemboi
41711c1ffe Merge pull request #129 from crewAIInc/docs_fix
Fix API Key Reference in MultiOnTool README
2024-11-30 11:52:45 -05:00
Tony Kipkemboi
ea2994d341 Merge pull request #133 from crewAIInc/docs/fix-codedocssearch-readme
docs: improve CodeDocsSearchTool README
2024-11-30 11:44:01 -05:00
theCyberTech
945ed7aaaa docs: fix typos and formatting in NL2SQL tool README 2024-11-30 10:52:57 +08:00
Carlos Souza
eed6a38ea4 Fix pydantic related errors. 2024-11-29 11:42:07 -05:00
theCyberTech
ec9951e28a docs: improve CodeDocsSearchTool README
- Fix tool name in custom model example
2024-11-30 00:34:04 +08:00
Carlos Souza
e677a271e5 More explicit model config 2024-11-29 05:57:09 -05:00
Carlos Souza
49ad43ff08 Do not reraise exception
Tool use is optional and missing dependency
should not raise error
2024-11-29 05:51:55 -05:00
Carlos Souza
a94470772f Fix pydantic related errors on FirecrawlScrapeWebsiteTool 2024-11-28 19:09:44 -05:00
Mike Plachta
dd18c59a9b Update jina_scrape_website_tool.py 2024-11-27 19:57:52 -08:00
theCyberTech
cbec6d5cd7 docs: fix API key reference in MultiOnTool README 2024-11-28 11:15:18 +08:00
Mike Plachta
15970734e3 Jina Website Scraper v1 2024-11-27 17:52:56 -08:00
Eduardo Chiarotti
601abb2bc3 Merge pull request #125 from crewAIInc/feat/remove-langchain
feat: remove langchain from code and update Dockerfile from CodeInterpreter
2024-11-26 16:56:29 -03:00
Eduardo Chiarotti
488782fb4a feat: remove langchain from code and change to CrewStructuredTool and update Dockerilf CodeInterpreter 2024-11-25 16:14:49 -03:00
theCyberTech
1c37158208 fix: correct variable name typo in exa_base_tool 2024-11-20 18:58:58 +08:00
João Moura
a3630418f9 Merge pull request #121 from piotrm0/piotrm/base_tool
remove independent BaseTool
2024-11-10 19:48:52 -03:00
Piotr Mardziel
10639d8775 Update base_tool.py 2024-11-05 16:22:35 -08:00
Brandon Hancock
2061f8ca41 Improve firecrawl tool 2024-11-01 17:19:59 -04:00
Ernest Poletaev
1f8791953e fix: retain line breaks 2024-10-25 22:33:24 +07:00
Ernest Poletaev
96e52767ad fix: web scraper concatenate words 2024-10-25 22:03:59 +07:00
Rip&Tear
9eac65f9f6 Merge pull request #115 from adanbu/main
Fixing errors of the File Writer tool
2024-10-24 12:28:20 +08:00
Brandon Hancock
8e15bc6386 add support for unsafe code execution 2024-10-23 10:36:29 -04:00
Adan Butto
6a7e917e1d Changed order of the arguments, placing 'content' last.
It tends to forget context when it gets to filling other arguments when content is on the longer side.
2024-10-22 18:47:52 +03:00
Adan Butto
857d6c135c reverted directory variable back to optional 2024-10-20 20:37:59 +03:00
Adan Butto
96429040de Fixed File Writer tool errors for better interaction with the agents 2024-10-20 18:54:01 +03:00
João Moura
c4f8a1cdf1 Merge pull request #107 from masorensen/bug/ragTools-kwargs
Scoping issue causing error in RAG tools
2024-10-17 16:43:11 -03:00
João Moura
d54b8a6e8d Merge pull request #112 from 11bluetree/patch-1
fix: SpiderTool import
2024-10-17 14:19:22 -03:00
Aoki Haruhito
fe172cb4de fix: SpiderTool import 2024-10-17 10:03:37 +09:00
Eduardo Chiarotti
1e76b66234 Merge pull request #111 from crewAIInc/feat/migrate-uv
Feat/migrate uv
2024-10-15 14:49:39 -03:00
Eduardo Chiarotti
90a13cb6f7 feat: change to uv on docs 2024-10-15 09:16:17 -03:00
Mike Sorensen
1cc8966e2e fixed scoping issue causing error in RAG tools 2024-09-23 22:18:22 -05:00
Rip&Tear
a04d98f62f Merge pull request #101 from crewAIInc/brandon/cre-250-llamaindex-pydantic-v2
Pydantic v1 issues
2024-09-13 21:53:32 +08:00
Brandon Hancock
35fe222ca1 Move off v1 2024-09-03 15:57:29 -04:00
Rip&Tear
d19bba72b0 Merge pull request #96 from crewAIInc/docs_update
Updated GitHub repo links and readme.md
2024-08-31 12:32:52 +08:00
theCyberTech
5957573625 Updated github repo links _ readme.md 2024-08-29 17:41:43 +08:00
João Moura
91c394ffce Merge pull request #95 from crewAIInc/feat/update-code-interpreter
feat: Add volume option
2024-08-27 07:25:29 -07:00
Eduardo Chiarotti
d146e4a961 feat: change the anme of user dockerfile path 2024-08-27 09:01:09 -03:00
Eduardo Chiarotti
8007938d6b feat: ADd volume option 2024-08-27 08:35:56 -03:00
Thiago Moretto
859e6162e8 Merge pull request #93 from crewAIInc/fix-nl2sql-pydantic-conflict
Fix NL2SQL pydantic version conflict
2024-08-19 13:49:06 -03:00
Thiago Moretto
e8b185e607 Fix NL2SQL pydantic version conflict 2024-08-14 14:05:44 -03:00
Eduardo Chiarotti
c32023df29 Merge pull request #91 from crewAIInc/fix/dalle-docs
docs: fix issue on Dalle tool docs
2024-08-13 11:25:25 -03:00
Eduardo Chiarotti
a228732423 docs: fix 2024-08-13 08:40:12 -03:00
Eduardo Chiarotti
b47926b1d9 docs: fix plural 2024-08-13 08:39:49 -03:00
Eduardo Chiarotti
64762887f0 docs: fix issue on Dalle tool docs 2024-08-13 08:39:20 -03:00
João Moura
5dd49762e3 Fixing imports and cutting new patch 2024-08-11 00:46:32 -03:00
João Moura
d861dcc3c4 Merge pull request #85 from rafaelsideguide/fix/firecrawl-timeout-description
[Bug] Improvements on default values and timeout description
2024-08-10 19:59:54 -07:00
João Moura
32abada521 Merge pull request #81 from Ryuzaki1415/patch-1
Corrected the acronym 'RAG'
2024-08-10 19:59:15 -07:00
João Moura
2416c08760 Merge pull request #41 from antunsz/feature/add-folder-file-writer
adding file writer tool and documentation
2024-08-10 19:40:24 -07:00
João Moura
fba480c582 Merge branch 'main' into feature/add-folder-file-writer 2024-08-10 19:40:03 -07:00
João Moura
50dc37ad5b adding dalle import 2024-08-10 23:35:46 -03:00
João Moura
1227c3fc7c Merge pull request #35 from antunsz/feature/add-mysql-tool
Feature/add mysql tool
2024-08-10 19:35:21 -07:00
João Moura
2da8cfcf99 Merge branch 'main' into feature/add-mysql-tool 2024-08-10 19:35:08 -07:00
João Moura
e7078f6502 Merge pull request #83 from crewAIInc/feat/add-vision-tool
feat: Add Vision tool to the CrewAI tool
2024-08-10 19:22:01 -07:00
rafaelsideguide
a2e38b6121 Improvements on default values and description 2024-08-06 13:56:44 -03:00
Eduardo Chiarotti
4835c2bf68 feat: Add Vision tool to the CrewAI tool 2024-07-31 17:10:26 -03:00
João Moura
d28dba453e Merge pull request #82 from crewAIInc/feat/dall-e-tool
feat: Add Dall-E tool to generate images
2024-07-30 18:37:34 -07:00
Eduardo Chiarotti
0070df7451 docs: Add documentation for the DallETool 2024-07-30 22:29:45 -03:00
Eduardo Chiarotti
b343c71b9b feat: Add Dall-E tool to generate images 2024-07-30 22:17:23 -03:00
Eduardo Chiarotti
88becbd6e1 Merge pull request #80 from crewAIInc/feat/NL2SQL-tool
feat: Add nl2sql tool to run and execute sql queries in databases
2024-07-26 14:25:01 -03:00
Dheeraj Unni
225ee06030 Corrected the acronym 'RAG' 2024-07-26 17:05:58 +05:30
Eduardo Chiarotti
18a28261a4 docs: Add documentation for NL2SqlTool 2024-07-25 15:25:48 -03:00
Eduardo Chiarotti
c372641be8 feat: format code 2024-07-24 21:39:49 -03:00
Eduardo Chiarotti
6fd02cdf82 feat: remove unecessary code 2024-07-24 21:38:52 -03:00
Eduardo Chiarotti
2df29f3dde feat: Add nl2sql tool to run and execute sql queries in databases 2024-07-24 21:37:22 -03:00
João Moura
8506505301 Merge pull request #78 from wuloi/main
fixing serply_api_tool
2024-07-19 09:33:11 -07:00
ai.flyingwheel
25343727fd fixing serply_api_tool 2024-07-19 23:11:10 +08:00
João Moura
0386120a5a fixing serper tool 2024-07-19 00:28:27 -04:00
Carlos Antunes
21342fa0f6 adding the proper imports into __init__.py files, and fixing the folder name 2024-07-15 13:00:06 -03:00
Carlos Antunes
d5e6b95817 adding the appropriate imports on the __init__.py files 2024-07-15 12:41:53 -03:00
João Moura
d8c98f2e64 Merge pull request #38 from mishushakov/main
updated browserbase tool
2024-07-14 17:10:42 -07:00
João Moura
33a0f05804 Merge pull request #42 from WilliamEspegren/main
Added Spider Tool
2024-07-14 15:24:27 -07:00
João Moura
d9ad8c62b9 Merge branch 'main' into main 2024-07-14 15:23:27 -07:00
João Moura
3f3ef03395 Merge pull request #44 from SuperMuel/add-more-parameters-to-serperdev-search-payload
Add more parameters to serperdev search payload
2024-07-14 14:00:02 -07:00
João Moura
f447f71a8e Update serper_dev_tool.py 2024-07-14 17:59:17 -03:00
João Moura
ac3ee8576d Merge branch 'main' into add-more-parameters-to-serperdev-search-payload 2024-07-14 13:48:54 -07:00
João Moura
7227a0e740 Merge pull request #45 from mazen-r/main
Add Scrapfly website scrape tool
2024-07-14 13:46:19 -07:00
João Moura
1111a1ac6b Merge branch 'main' into main 2024-07-14 13:46:10 -07:00
João Moura
7dd33e0b3a Merge pull request #51 from smsajjadzaidi/fix/serper_dev_tool
fixed use of arg n_results
2024-07-14 13:39:20 -07:00
João Moura
75ee346d18 Merge pull request #53 from googio/adding-serply-api
Adding Serply API
2024-07-14 13:37:03 -07:00
João Moura
2bcb9e7000 Merge branch 'main' into adding-serply-api 2024-07-14 13:36:25 -07:00
João Moura
c9d22489b8 Merge pull request #58 from strnad/fix-ragtool-parameters
fix: Ensure tools handle parameters passed post-creation correctly
2024-07-14 12:08:11 -07:00
João Moura
1a676c6340 Merge pull request #64 from sethcoast/pdf-search-tool-query-fix
Limit PDF search results to the provided PDF (IF a PDF is provided)
2024-07-14 12:07:34 -07:00
João Moura
1cf2ebb07b Merge pull request #55 from theCyberTech/patch-2
Update serper_dev_tool.py
2024-07-14 11:31:14 -07:00
João Moura
acf776f91a Merge pull request #61 from celobusana/busana/fix-selenium-firefox-options
Fix: Selenium incorrect firefox options import
2024-07-14 11:30:46 -07:00
João Moura
f0d924fab1 Merge pull request #71 from strnad/add_tools_params_description
arguments descriptions added to tool description
2024-07-14 11:30:02 -07:00
João Moura
fc52061bc9 Merge pull request #60 from MULTI-ON/main
add multion tool
2024-07-12 09:10:01 -07:00
João Moura
3be455e971 Merge pull request #73 from strnad/fix_ScrapeWebsiteTool_encoding
bugfix: ScrapeWebsiteTool encoding
2024-07-12 09:09:27 -07:00
Naman Garg
676e714c8b Merge branch 'main' into main 2024-07-08 15:12:25 -07:00
Naman Garg
6f45c6ed09 Updated Readme 2024-07-08 15:11:04 -07:00
Jakub Strnad
65855cbe56 bugfix: ScrapeWebsiteTool encoding
fixed problem with garbage output of ScrapeWebsiteTool on some websites
2024-07-08 15:24:26 +02:00
João Moura
f056764132 adding firecrawl imports 2024-07-08 01:15:00 -04:00
Jakub
cb1dc13a9d fixed intendation 2024-07-05 18:42:16 +02:00
Jakub Strnad
a5d2839431 arguments descriptions added to tool description
so now the agent knows how to use the tools params
2024-07-05 16:30:41 +02:00
João Moura
cf67b424c2 Merge pull request #70 from joaomdmoura/fix/code-interpreter-description
fix: fix type hinting, add container name and handle exception and returned old description
2024-07-04 12:59:29 -07:00
Eduardo Chiarotti
ba05d18ab1 fix: fix type hinting, add container name and handle exception and returned old description 2024-07-04 16:42:29 -03:00
João Moura
b4d91d1ce0 adding new result_as_answer options 2024-07-04 00:10:31 -04:00
João Moura
a801f1cd24 Merge pull request #34 from rafaelsideguide/added-firecrawl-tools
added Firecrawl tools
2024-07-03 14:46:44 -07:00
João Moura
f2063d01fa Merge pull request #69 from joaomdmoura/fix/import-code-tool
fix: add code interpreter tool
2024-07-02 09:00:11 -07:00
Eduardo Chiarotti
d000bd2fc8 fix: add code interpreter tool 2024-07-02 12:00:04 -03:00
João Moura
f743a5ce61 Merge pull request #62 from angrybayblade/feat/composio-tool
Add `composio` CrewAI tool wrapper
2024-07-01 18:12:53 -07:00
João Moura
241dc37ba3 Merge branch 'main' into feat/composio-tool 2024-07-01 18:12:45 -07:00
João Moura
f79c385bf7 revamping code interpreter 2024-07-01 00:55:21 -07:00
João Moura
00e573c960 Merge pull request #67 from MervinPraison/main
Update __init__.py to Add CodeInterpreterTool
2024-06-30 20:38:12 -07:00
Mervin Praison
a3d3a70b5a Update __init__.py to Add CodeInterpreterTool 2024-07-01 04:34:39 +01:00
angrybayblade
9a8d88b8aa fix: merge from_app and from_use_case 2024-06-27 13:35:57 +05:30
angrybayblade
58354ec638 chore: update README 2024-06-27 12:23:05 +05:30
angrybayblade
369c03a257 feat: add check for auth accounts 2024-06-27 12:16:22 +05:30
angrybayblade
7ffd8f5129 Merge branch 'main' into feat/composio-tool 2024-06-27 11:56:55 +05:30
angrybayblade
ab484172ef chore: update readme 2024-06-27 11:40:02 +05:30
angrybayblade
be6e1a79dd feat: add search utility methods 2024-06-27 11:39:42 +05:30
angrybayblade
41478abdf5 feat: define ComposioTool in the top level imports 2024-06-27 11:36:52 +05:30
João Moura
7a6e588c58 Merge pull request #59 from joaomdmoura/feat/code-interpreter
Feat: Code Interpreter tool
2024-06-27 02:25:25 -03:00
João Moura
25339f3ee1 Merge branch 'main' into feat/code-interpreter 2024-06-27 02:25:18 -03:00
Seth Donaldson
a95f5c27c6 Create PDFEmbedchainAdapter class and utilize it in PDFSearchTool 2024-06-26 15:52:54 -04:00
Seth Donaldson
f5d092f6a3 clean copy of embedchain_adapter.py 2024-06-26 15:46:14 -04:00
angrybayblade
d4449ee5f0 feat: add composio CrewAI tool wrapper 2024-06-24 20:49:09 +05:30
Marcelo Busana
f9c803a8c1 Fix: Selenium incorrect firefox options import 2024-06-23 15:33:55 -03:00
Naman Garg
d84a616572 update local option description in readme 2024-06-21 15:01:08 -07:00
Naman Garg
c97678bb11 add multion tool 2024-06-21 14:48:24 -07:00
Jakub Strnad
2f80840c74 fix: Ensure tools handle parameters passed post-creation correctly (#3)
- Fixed an issue where multiple tools failed to function if parameters were provided after tool creation.
- Updated tools to correctly process source file/URL passed by the agent post-creation as per documentation.

Closes #<47>
2024-06-21 15:06:17 +02:00
Eduardo Chiarotti
161c72b29f feat: update README 2024-06-20 21:55:25 -03:00
Eduardo Chiarotti
61cce93fd0 feat: remove unused Makefile, update README and update code 2024-06-20 21:41:12 -03:00
Eduardo Chiarotti
94e6651b55 feat: add code-interpreter tool to init and add unit tests 2024-06-20 20:43:19 -03:00
Eduardo Chiarotti
1a4ac76b1e feat: update code 2024-06-20 20:24:47 -03:00
Eduardo Chiarotti
da75d51fe8 feat: add Dockerfile, Makefile and update version of code 2024-06-20 20:24:26 -03:00
João Moura
bd13b55afd Adding new PDFTextWritingTool 2024-06-20 12:56:35 -03:00
Serply
0f703950d9 Merge branch 'main' into adding-serply-api 2024-06-20 08:22:18 -04:00
Eduardo Chiarotti
2b47377a78 feat: add code-interpreter tool 2024-06-19 20:45:04 -03:00
João Moura
f3bf13e1b1 Merge pull request #50 from jerryjliu/jerry/add_llamaindex_tool
add llamaindex tool
2024-06-14 01:12:41 -03:00
teampen
806f884956 using GET in markdown 2024-06-14 01:43:25 +00:00
Rip&Tear
5e8e711170 Update serper_dev_tool.py
Added two additional functionalities:

1) added the ability to save the server results to a file
2) added the ability to  set the number of results returned

Can be used as follows:

serper_tool = SerperDevTool(file_save=True, n_results=20)
2024-06-13 12:53:35 +08:00
teampen
2c0f90dd22 adding serply job search tool 2024-06-11 13:03:17 -04:00
teampen
ffe3829cef adding webpage to markdown 2024-06-10 21:34:53 -04:00
teampen
d8b8edab08 adding google search, sholar, and news 2024-06-10 21:15:21 -04:00
smsajjadzaidi
ff80e6cb79 fixed use of arg n_results 2024-06-10 02:54:21 +05:00
Jerry Liu
7ee7d846e2 cr 2024-06-08 21:42:28 -07:00
Mazen Ramadan
53e9b40725 Add Scrapfly website scrape tool 2024-05-27 14:48:38 +03:00
WilliamEspegren
ad965357ce refined spider_tool.py 2024-05-25 22:40:48 +02:00
WilliamEspegren
f0f1ab175a remove unecessary os import 2024-05-25 22:36:30 +02:00
WilliamEspegren
7d40c98434 remove full tool import 2024-05-25 22:28:48 +02:00
WilliamEspegren
56146b7df4 remove full tool, refined tool 2024-05-25 22:22:50 +02:00
SuperMuel
438c979a2e Add n_results, country, location and locale parameters to payload 2024-05-23 13:51:17 +02:00
WilliamEspegren
5b7276c0bb x 2024-05-23 12:03:48 +02:00
WilliamEspegren
70b5a3ab85 fixed white space 2024-05-22 17:05:46 +02:00
WilliamEspegren
60eb6e7c6f spider_tool working, not spider_full_tool 2024-05-21 23:34:05 +02:00
WilliamEspegren
dd15dab111 added full params 2024-05-21 21:26:12 +02:00
WilliamEspegren
0b49403635 remove print from testing 2024-05-21 12:06:08 +02:00
WilliamEspegren
4e1425665c spider tool 2024-05-21 11:48:52 +02:00
Carlos Antunes
1f08d74015 adding file writer tool and documentation 2024-05-20 22:00:34 -03:00
Mish Ushakov
bedbac2aaf updated browserbase tool readme 2024-05-20 09:02:55 +00:00
Mish Ushakov
5c2d8c4cfa updated browserbase tool 2024-05-20 08:58:25 +00:00
Carlos Antunes
a11cc57345 adding MySQLSearcherTool 2024-05-18 16:58:40 -03:00
Carlos Antunes
e36af697cd adding MySQLSearchTool README 2024-05-18 16:56:06 -03:00
rafaelsideguide
a51a7000c5 added Firecrawl tools 2024-05-16 11:20:36 -03:00
João Moura
53c7d815ae preapring new verison with new version of Exa tool 2024-05-13 21:30:34 -03:00
João Moura
4b11881a70 Merge pull request #32 from slavakurilyak/feature/fix-docx-search-tool
Fix TypeError in DOCXSearchTool Schema
2024-05-08 17:20:03 -03:00
Slava Kurilyak (slavakurilyak.eth)
cecfde6608 Fix TypeError in FixedDOCXSearchToolSchema by correcting Optional usage with Field 2024-05-06 15:21:23 -03:00
Slava Kurilyak (slavakurilyak.eth)
b14f2d4bf1 Revert "Fix TypeError in FixedDOCXSearchToolSchema by correcting Optional usage with Field"
This reverts commit e0840e4826.
2024-05-06 15:21:07 -03:00
Slava Kurilyak (slavakurilyak.eth)
e0840e4826 Fix TypeError in FixedDOCXSearchToolSchema by correcting Optional usage with Field 2024-05-06 15:19:37 -03:00
João Moura
7c6b1249fb cutring new version with improved docs search 2024-05-06 14:02:09 -03:00
João Moura
037e80c6a3 cutting new verison with exa search tool 2024-05-02 23:15:32 -03:00
João Moura
59d9d9eb1f moving EXA env dependency to tool execution 2024-05-02 04:12:45 -03:00
João Moura
cf6231384c quick fix 2024-05-02 03:56:14 -03:00
João Moura
a95cbfdc6a TYPO 2024-05-02 03:04:48 -03:00
João Moura
cf96d5579f Update README.md 2024-05-02 02:54:18 -03:00
João Moura
768bb74a2c renaming exa tool 2024-05-02 02:50:54 -03:00
João Moura
ffd5942b31 pushing initial exa search tool 2024-05-02 02:48:21 -03:00
João Moura
5fb9ddfa2a updating serperdev to allow for query and search_query 2024-05-02 02:37:47 -03:00
João Moura
b992238a5d Merge pull request #13 from eltociear/main
Update serper_dev_tool.py
2024-05-02 02:28:24 -03:00
João Moura
a474745b67 Merge pull request #18 from jeroen-vet/jeroen-vet-patch-1
Update serper_dev_tool.py consider n_results parameter
2024-05-02 02:26:55 -03:00
João Moura
5d64a5c41c Merge branch 'main' into jeroen-vet-patch-1 2024-05-02 02:26:48 -03:00
João Moura
d4fc993f1e Update serper_dev_tool.py 2024-05-02 02:25:55 -03:00
João Moura
843c982ba9 Merge pull request #19 from Tavernari/main
Improve File Reading Robustness in FileReadTool
2024-05-02 02:24:54 -03:00
João Moura
e6da49754d Merge pull request #28 from mishushakov/main
Updated Browserbase load tool
2024-05-02 02:23:41 -03:00
Mish Ushakov
f78011e68c added args_schema to browserbase tool 2024-04-29 11:53:10 +02:00
Mish Ushakov
39aba4cb48 updated browserbase load tool 2024-04-25 12:15:31 +00:00
João Moura
ed58694675 Merge pull request #25 from mishushakov/main
added BrowserbaseLoadTool
2024-04-24 00:03:04 -03:00
Mish Ushakov
e0d799c075 updated browserbase integration 2024-04-19 11:40:03 +00:00
Mish Ushakov
b80dd1ca8b added BrowserbaseLoadTool 2024-04-17 13:36:21 +00:00
João Moura
031fe500fb Merge pull request #24 from Christian24/patch-1
Fix wrong comments / descriptions for SerperDevTool
2024-04-16 10:42:05 -03:00
Christian24
aab3acbaa6 Fix wrong comments / descriptions for SerperDevTool 2024-04-15 22:14:16 +02:00
João Moura
3aa1bc3894 Merge pull request #23 from joaomdmoura/gui/fix-descriptions
Fix tool descriptions
2024-04-10 11:49:28 -03:00
Gui Vieira
c5fd5196e2 Fix tool descriptions 2024-04-10 11:48:23 -03:00
João Moura
be1a60554f TYPO 2024-04-07 18:22:09 -03:00
João Moura
873112d696 fxing docs 2024-04-07 18:12:16 -03:00
João Moura
9f41fb4057 Adding timeout to scrapping website tool 2024-04-07 14:18:41 -03:00
João Moura
dd2349a90a Merge pull request #22 from joaomdmoura/gui/fix-github-search-tool
Fix GithubSearchTool
2024-04-05 18:06:09 -03:00
Gui Vieira
776826ec99 Fix GithubSearchTool 2024-04-05 18:04:45 -03:00
João Moura
9c98ad455d Merge pull request #21 from joaomdmoura/gui/fix-rag-tools
Fix RAG tools
2024-04-04 13:45:28 -03:00
Gui Vieira
4e9709b8fb Fix RAG tools 2024-04-04 13:42:30 -03:00
Victor C Tavernari
92abe0b726 Enhance file reading with error handling
- Wrapped the file reading functionality inside a `_run` method.
- Added error handling to return a descriptive error message if an exception occurs during file reading.
2024-03-31 23:41:02 +01:00
João Moura
80f9613959 Adding two default arguments to cache function 2024-03-27 15:04:45 -03:00
Jeroen Vet
3b77de7b21 Update serper_dev_tool.py consider n_results parameter
In original code n_results is always None so you always get only 10 results from Serper. With this change, when you explicitly set the n_results parameter when creating a SerperDevTool object it is taken into account.
2024-03-23 18:36:08 +01:00
João Moura
f17057898d Merge pull request #17 from joaomdmoura/gui/custom-model-docs
Custom model docs
2024-03-22 03:01:52 -03:00
Gui Vieira
95fb44be88 Custom model docs 2024-03-21 21:13:36 -03:00
Gui Vieira
1c8d010601 Custom model config for RAG tools 2024-03-19 18:47:13 -03:00
João Moura
73cae1997d Merge pull request #15 from joaomdmoura/joaomdmoura/cache-option
adding cache_function to base_tool
2024-03-19 13:42:08 -03:00
João Moura
b8e86b0fb4 adding cache_function to base_tool 2024-03-19 13:33:20 -03:00
Ikko Eltociear Ashimine
c09f62cf47 Update serper_dev_tool.py
stirng -> string
2024-03-17 12:32:08 +09:00
João Moura
cf4f49c6e9 cutting new version 2024-03-07 20:32:18 -03:00
João Moura
37aa8d6b63 Adding docs for all tools 2024-03-03 22:14:30 -03:00
João Moura
8ffbd9665b avoinding organic error on serper dev tool 2024-03-03 12:32:13 -03:00
João Moura
7f683b21f5 preparring new version 2024-03-03 12:29:46 -03:00
João Moura
d19814d7a3 fixing TYPO 2024-03-03 12:29:32 -03:00
João Moura
51358b3cc4 updating scrapping tool 2024-03-02 12:41:55 -03:00
João Moura
ec97e15a3a Adding new description generator 2024-02-29 03:10:11 -03:00
João Moura
640b5a9461 adding intial selenium scrapping tool 2024-02-29 03:10:11 -03:00
João Moura
f2dfa07221 Merge pull request #5 from slavakurilyak/fix-none-type-query-error
Fix NoneType object has no attribute 'query' error by updating app attribute
2024-02-27 23:38:51 -03:00
Slava Kurilyak (slavakurilyak.eth)
467b05532f Fix NoneType object has no attribute 'query' error by updating app attribute 2024-02-27 22:33:04 -03:00
João Moura
79eec51c9a Cutting new version with improved scrapping 2024-02-26 06:52:22 -03:00
João Moura
cff6082f1c improving scrapping tools 2024-02-26 06:20:15 -03:00
João Moura
9e560ff951 adding new scrapping tools 2024-02-26 06:15:15 -03:00
João Moura
80942bf38c properly adding serper tool 2024-02-26 06:01:05 -03:00
João Moura
50bae27948 revamping crewai tool 2024-02-25 21:11:09 -03:00
João Moura
7c99e9ab50 preparing new verion and adding new tools 2024-02-24 03:13:17 -03:00
João Moura
f3c693a5bb very much work in progress version 2024-02-22 19:56:42 -03:00
João Moura
e94fd2cad2 quick fixes 2024-02-15 18:27:38 -03:00
João Moura
b4f270ad1f quick fixes 2024-02-15 18:26:15 -03:00
João Moura
7ee9926f2e quick fixes 2024-02-15 18:24:16 -03:00
João Moura
a20481d023 adding RAG spefic readme and implementing specific helpers 2024-02-15 18:01:53 -03:00
João Moura
aa7e336989 adding assets 2024-02-15 14:03:58 -03:00
João Moura
db5d371769 Quick tools reorganization 2024-02-15 14:02:42 -03:00
João Moura
a232bfbe60 Merge pull request #1 from joaomdmoura/gui/rag-tool
First take on a rag tool
2024-02-15 13:22:52 -03:00
Gui Vieira
c1182eb322 First take on a rag tool 2024-02-13 20:10:56 -03:00
João Moura
54e4554f49 first commit 2024-01-14 11:54:26 -03:00
1146 changed files with 79146 additions and 30600 deletions

View File

@@ -33,7 +33,7 @@ jobs:
- name: Install dependencies and populate cache
run: |
echo "Building global UV cache for Python ${{ matrix.python-version }}..."
uv sync --all-groups --all-extras --no-install-project
uv sync --all-groups --all-extras
echo "Cache populated successfully"
- name: Save uv caches

102
.github/workflows/codeql.yml vendored Normal file
View File

@@ -0,0 +1,102 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced"
on:
push:
branches: [ "main" ]
paths-ignore:
- "src/crewai/cli/templates/**"
pull_request:
branches: [ "main" ]
paths-ignore:
- "src/crewai/cli/templates/**"
jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
# only required for workflows in private repositories
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: actions
build-mode: none
- language: python
build-mode: none
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
# or others). This is typically only required for manual builds.
# - name: Setup runtime (example)
# uses: actions/setup-example@v1
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"

View File

@@ -38,7 +38,7 @@ jobs:
enable-cache: false
- name: Install dependencies
run: uv sync --all-groups --all-extras --no-install-project
run: uv sync --all-packages --all-extras --no-install-project
- name: Get Changed Python Files
id: changed-files

View File

@@ -25,17 +25,17 @@ jobs:
with:
fetch-depth: 0 # Fetch all history for proper diff
- name: Restore global uv cache
id: cache-restore
uses: actions/cache/restore@v4
with:
path: |
~/.cache/uv
~/.local/share/uv
.venv
key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-main-py${{ matrix.python-version }}-
# - name: Restore global uv cache
# id: cache-restore
# uses: actions/cache/restore@v4
# with:
# path: |
# ~/.cache/uv
# ~/.local/share/uv
# .venv
# key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
# restore-keys: |
# uv-main-py${{ matrix.python-version }}-
- name: Install uv
uses: astral-sh/setup-uv@v6
@@ -45,24 +45,24 @@ jobs:
enable-cache: false
- name: Install the project
run: uv sync --all-groups --all-extras
run: uv sync --all-packages --all-extras
- name: Restore test durations
uses: actions/cache/restore@v4
with:
path: .test_durations_py*
key: test-durations-py${{ matrix.python-version }}
# - name: Restore test durations
# uses: actions/cache/restore@v4
# with:
# path: .test_durations_py*
# key: test-durations-py${{ matrix.python-version }}
- name: Run tests (group ${{ matrix.group }} of 8)
run: |
PYTHON_VERSION_SAFE=$(echo "${{ matrix.python-version }}" | tr '.' '_')
DURATION_FILE=".test_durations_py${PYTHON_VERSION_SAFE}"
# Temporarily always skip cached durations to fix test splitting
# When durations don't match, pytest-split runs duplicate tests instead of splitting
echo "Using even test splitting (duration cache disabled until fix merged)"
DURATIONS_ARG=""
# Original logic (disabled temporarily):
# if [ ! -f "$DURATION_FILE" ]; then
# echo "No cached durations found, tests will be split evenly"
@@ -74,8 +74,8 @@ jobs:
# echo "No test changes detected, using cached test durations for optimal splitting"
# DURATIONS_ARG="--durations-path=${DURATION_FILE}"
# fi
uv run pytest \
uv run pytest lib/crewai \
--block-network \
--timeout=30 \
-vv \
@@ -84,14 +84,15 @@ jobs:
$DURATIONS_ARG \
--durations=10 \
-n auto \
--maxfail=3
--maxfail=3 \
-m "not requires_local_services"
- name: Save uv caches
if: steps.cache-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
~/.cache/uv
~/.local/share/uv
.venv
key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
# - name: Save uv caches
# if: steps.cache-restore.outputs.cache-hit != 'true'
# uses: actions/cache/save@v4
# with:
# path: |
# ~/.cache/uv
# ~/.local/share/uv
# .venv
# key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}

View File

@@ -40,7 +40,7 @@ jobs:
enable-cache: false
- name: Install dependencies
run: uv sync --all-groups --all-extras
run: uv sync --all-packages --all-extras
- name: Get changed Python files
id: changed-files

1
.gitignore vendored
View File

@@ -2,7 +2,6 @@
.pytest_cache
__pycache__
dist/
lib/
.env
assets/*
.idea

View File

@@ -6,14 +6,19 @@ repos:
entry: uv run ruff check
language: system
types: [python]
files: ^lib/crewai/src/
exclude: ^lib/crewai/
- id: ruff-format
name: ruff-format
entry: uv run ruff format
language: system
types: [python]
files: ^lib/crewai/src/
exclude: ^lib/crewai/
- id: mypy
name: mypy
entry: uv run mypy
language: system
types: [python]
exclude: ^tests/
files: ^lib/crewai/src/
exclude: ^lib/crewai/

BIN
assets/crew_only_logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
assets/crewai_logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -5,6 +5,82 @@ icon: "clock"
mode: "wide"
---
<Update label="Sep 20, 2025">
## v0.193.2
[View release on GitHub](https://github.com/crewAIInc/crewAI/releases/tag/0.193.2)
## What's Changed
- Updated pyproject templates to use the right version
</Update>
<Update label="Sep 20, 2025">
## v0.193.1
[View release on GitHub](https://github.com/crewAIInc/crewAI/releases/tag/0.193.1)
## What's Changed
- Series of minor fixes and linter improvements
</Update>
<Update label="Sep 19, 2025">
## v0.193.0
[View release on GitHub](https://github.com/crewAIInc/crewAI/releases/tag/0.193.0)
## Core Improvements & Fixes
- Fixed handling of the `model` parameter during OpenAI adapter initialization
- Resolved test duration cache issues in CI workflows
- Fixed flaky test related to repeated tool usage by agents
- Added missing event exports to `__init__.py` for consistent module behavior
- Dropped message storage from metadata in Mem0 to reduce bloat
- Fixed L2 distance metric support for backward compatibility in vector search
## New Features & Enhancements
- Introduced thread-safe platform context management
- Added test duration caching for optimized `pytest-split` runs
- Added ephemeral trace improvements for better trace control
- Made search parameters for RAG, knowledge, and memory fully configurable
- Enabled ChromaDB to use OpenAI API for embedding functions
- Added deeper observability tools for user-level insights
- Unified RAG storage system with instance-specific client support
## Documentation & Guides
- Updated `RagTool` references to reflect CrewAI native RAG implementation
- Improved internal docs for `langgraph` and `openai` agent adapters with type annotations and docstrings
</Update>
<Update label="Sep 11, 2025">
## v0.186.1
[View release on GitHub](https://github.com/crewAIInc/crewAI/releases/tag/0.186.1)
## What's Changed
- Fixed version not being found and silently failing reversion
- Bumped CrewAI version to 0.186.1 and updated dependencies in the CLI
</Update>
<Update label="Sep 10, 2025">
## v0.186.0
[View release on GitHub](https://github.com/crewAIInc/crewAI/releases/tag/0.186.0)
## What's Changed
- Refer to the GitHub release notes for detailed changes
</Update>
<Update label="Sep 04, 2025">
## v0.177.0

View File

@@ -404,6 +404,10 @@ crewai config reset
After resetting configuration, re-run `crewai login` to authenticate again.
</Tip>
<Tip>
CrewAI CLI handles authentication to the Tool Repository automatically when adding packages to your project. Just append `crewai` before any `uv` command to use it. E.g. `crewai uv add requests`. For more information, see [Tool Repository](https://docs.crewai.com/enterprise/features/tool-repository) docs.
</Tip>
<Note>
Configuration settings are stored in `~/.config/crewai/settings.json`. Some settings like organization name and UUID are read-only and managed through authentication and organization commands. Tool repository related settings are hidden and cannot be set directly by users.
</Note>

View File

@@ -52,6 +52,36 @@ researcher = Agent(
)
```
## Adding other packages after installing a tool
After installing a tool from the CrewAI Enterprise Tool Repository, you need to use the `crewai uv` command to add other packages to your project.
Using pure `uv` commands will fail due to authentication to tool repository being handled by the CLI. By using the `crewai uv` command, you can add other packages to your project without having to worry about authentication.
Any `uv` command can be used with the `crewai uv` command, making it a powerful tool for managing your project's dependencies without the hassle of managing authentication through environment variables or other methods.
Say that you have installed a custom tool from the CrewAI Enterprise Tool Repository called "my-tool":
```bash
crewai tool install my-tool
```
And now you want to add another package to your project, you can use the following command:
```bash
crewai uv add requests
```
Other commands like `uv sync` or `uv remove` can also be used with the `crewai uv` command:
```bash
crewai uv sync
```
```bash
crewai uv remove requests
```
This will add the package to your project and update `pyproject.toml` accordingly.
## Creating and Publishing Tools
To create a new tool project:

View File

@@ -27,7 +27,7 @@ Follow the steps below to get Crewing! 🚣‍♂️
<Step title="Navigate to your new crew project">
<CodeGroup>
```shell Terminal
cd latest-ai-development
cd latest_ai_development
```
</CodeGroup>
</Step>

View File

@@ -9,7 +9,7 @@ mode: "wide"
## Description
The `RagTool` is designed to answer questions by leveraging the power of Retrieval-Augmented Generation (RAG) through EmbedChain.
The `RagTool` is designed to answer questions by leveraging the power of Retrieval-Augmented Generation (RAG) through CrewAI's native RAG system.
It provides a dynamic knowledge base that can be queried to retrieve relevant information from various data sources.
This tool is particularly useful for applications that require access to a vast array of information and need to provide contextually relevant answers.
@@ -76,8 +76,8 @@ The `RagTool` can be used with a wide variety of data sources, including:
The `RagTool` accepts the following parameters:
- **summarize**: Optional. Whether to summarize the retrieved content. Default is `False`.
- **adapter**: Optional. A custom adapter for the knowledge base. If not provided, an EmbedchainAdapter will be used.
- **config**: Optional. Configuration for the underlying EmbedChain App.
- **adapter**: Optional. A custom adapter for the knowledge base. If not provided, a CrewAIRagAdapter will be used.
- **config**: Optional. Configuration for the underlying CrewAI RAG system.
## Adding Content
@@ -130,44 +130,23 @@ from crewai_tools import RagTool
# Create a RAG tool with custom configuration
config = {
"app": {
"name": "custom_app",
},
"llm": {
"provider": "openai",
"vectordb": {
"provider": "qdrant",
"config": {
"model": "gpt-4",
"collection_name": "my-collection"
}
},
"embedding_model": {
"provider": "openai",
"config": {
"model": "text-embedding-ada-002"
"model": "text-embedding-3-small"
}
},
"vectordb": {
"provider": "elasticsearch",
"config": {
"collection_name": "my-collection",
"cloud_id": "deployment-name:xxxx",
"api_key": "your-key",
"verify_certs": False
}
},
"chunker": {
"chunk_size": 400,
"chunk_overlap": 100,
"length_function": "len",
"min_chunk_size": 0
}
}
rag_tool = RagTool(config=config, summarize=True)
```
The internal RAG tool utilizes the Embedchain adapter, allowing you to pass any configuration options that are supported by Embedchain.
You can refer to the [Embedchain documentation](https://docs.embedchain.ai/components/introduction) for details.
Make sure to review the configuration options available in the .yaml file.
## Conclusion
The `RagTool` provides a powerful way to create and query knowledge bases from various data sources. By leveraging Retrieval-Augmented Generation, it enables agents to access and retrieve relevant information efficiently, enhancing their ability to provide accurate and contextually appropriate responses.

View File

@@ -5,6 +5,82 @@ icon: "clock"
mode: "wide"
---
<Update label="2025년 9월 20일">
## v0.193.2
[GitHub 릴리스 보기](https://github.com/crewAIInc/crewAI/releases/tag/0.193.2)
## 변경 사항
- 올바른 버전을 사용하도록 pyproject 템플릿 업데이트
</Update>
<Update label="2025년 9월 20일">
## v0.193.1
[GitHub 릴리스 보기](https://github.com/crewAIInc/crewAI/releases/tag/0.193.1)
## 변경 사항
- 일련의 사소한 수정 및 린터 개선
</Update>
<Update label="2025년 9월 19일">
## v0.193.0
[GitHub 릴리스 보기](https://github.com/crewAIInc/crewAI/releases/tag/0.193.0)
## 핵심 개선 사항 및 수정 사항
- OpenAI 어댑터 초기화 중 `model` 매개변수 처리 수정
- CI 워크플로에서 테스트 소요 시간 캐시 문제 해결
- 에이전트의 반복 도구 사용과 관련된 불안정한 테스트 수정
- 일관된 모듈 동작을 위해 누락된 이벤트 내보내기를 `__init__.py`에 추가
- 메타데이터 부하를 줄이기 위해 Mem0에서 메시지 저장 제거
- 벡터 검색의 하위 호환성을 위해 L2 거리 메트릭 지원 수정
## 새로운 기능 및 향상 사항
- 스레드 안전한 플랫폼 컨텍스트 관리 도입
- `pytest-split` 실행 최적화를 위한 테스트 소요 시간 캐싱 추가
- 더 나은 추적 제어를 위한 일시적(trace) 개선
- RAG, 지식, 메모리 검색 매개변수를 완전 구성 가능하게 변경
- ChromaDB가 임베딩 함수에 OpenAI API를 사용할 수 있도록 지원
- 사용자 수준 인사이트를 위한 심화된 관찰 가능성 도구 추가
- 인스턴스별 클라이언트를 지원하는 통합 RAG 스토리지 시스템
## 문서 및 가이드
- CrewAI 네이티브 RAG 구현을 반영하도록 `RagTool` 참조 업데이트
- 타입 주석과 도크스트링을 포함해 `langgraph` 및 `openai` 에이전트 어댑터 내부 문서 개선
</Update>
<Update label="2025년 9월 11일">
## v0.186.1
[GitHub 릴리스 보기](https://github.com/crewAIInc/crewAI/releases/tag/0.186.1)
## 변경 사항
- 버전을 찾지 못해 조용히 되돌리는(reversion) 문제 수정
- CLI에서 CrewAI 버전을 0.186.1로 올리고 의존성 업데이트
</Update>
<Update label="2025년 9월 10일">
## v0.186.0
[GitHub 릴리스 보기](https://github.com/crewAIInc/crewAI/releases/tag/0.186.0)
## 변경 사항
- 자세한 변경 사항은 GitHub 릴리스 노트를 참조하세요
</Update>
<Update label="2025년 9월 4일">
## v0.177.0

View File

@@ -27,7 +27,7 @@ mode: "wide"
<Step title="새로운 crew 프로젝트로 이동하기">
<CodeGroup>
```shell Terminal
cd latest-ai-development
cd latest_ai_development
```
</CodeGroup>
</Step>

View File

@@ -5,6 +5,82 @@ icon: "clock"
mode: "wide"
---
<Update label="20 set 2025">
## v0.193.2
[Ver release no GitHub](https://github.com/crewAIInc/crewAI/releases/tag/0.193.2)
## O que Mudou
- Atualizados templates do pyproject para usar a versão correta
</Update>
<Update label="20 set 2025">
## v0.193.1
[Ver release no GitHub](https://github.com/crewAIInc/crewAI/releases/tag/0.193.1)
## O que Mudou
- Série de pequenas correções e melhorias de linter
</Update>
<Update label="19 set 2025">
## v0.193.0
[Ver release no GitHub](https://github.com/crewAIInc/crewAI/releases/tag/0.193.0)
## Melhorias e Correções Principais
- Corrigido manuseio do parâmetro `model` durante a inicialização do adaptador OpenAI
- Resolvidos problemas de cache da duração de testes nos fluxos de CI
- Corrigido teste instável relacionado ao uso repetido de ferramentas pelos agentes
- Adicionadas exportações de eventos ausentes no `__init__.py` para comportamento consistente do módulo
- Removido armazenamento de mensagem dos metadados no Mem0 para reduzir inchaço
- Corrigido suporte à métrica de distância L2 para compatibilidade retroativa na busca vetorial
## Novos Recursos e Melhorias
- Introduzida gestão de contexto de plataforma com segurança de threads
- Adicionado cache da duração de testes para execuções otimizadas do `pytest-split`
- Melhorias de traces efêmeros para melhor controle de rastreamento
- Parâmetros de busca para RAG, conhecimento e memória totalmente configuráveis
- Habilitado ChromaDB para usar a OpenAI API para funções de embedding
- Adicionadas ferramentas de observabilidade mais profundas para insights ao nível do usuário
- Sistema de armazenamento RAG unificado com suporte a cliente específico por instância
## Documentação e Guias
- Atualizadas referências do `RagTool` para refletir a implementação nativa de RAG do CrewAI
- Melhorada documentação interna para adaptadores de agente `langgraph` e `openai` com anotações de tipo e docstrings
</Update>
<Update label="11 set 2025">
## v0.186.1
[Ver release no GitHub](https://github.com/crewAIInc/crewAI/releases/tag/0.186.1)
## O que Mudou
- Corrigida falha silenciosa de reversão quando a versão não era encontrada
- Versão do CrewAI atualizada para 0.186.1 e dependências do CLI atualizadas
</Update>
<Update label="10 set 2025">
## v0.186.0
[Ver release no GitHub](https://github.com/crewAIInc/crewAI/releases/tag/0.186.0)
## O que Mudou
- Consulte as notas de lançamento no GitHub para detalhes completos
</Update>
<Update label="04 set 2025">
## v0.177.0

View File

@@ -27,7 +27,7 @@ Siga os passos abaixo para começar a tripular! 🚣‍♂️
<Step title="Navegue até o novo projeto da sua tripulação">
<CodeGroup>
```shell Terminal
cd latest-ai-development
cd latest_ai_development
```
</CodeGroup>
</Step>

View File

@@ -0,0 +1 @@
3.13

124
lib/crewai/pyproject.toml Normal file
View File

@@ -0,0 +1,124 @@
[project]
name = "crewai"
dynamic = ["version"]
description = ""
readme = "README.md"
authors = [
{ name = "Greyson Lalonde", email = "greyson.r.lalonde@gmail.com" }
]
keywords = [
"crewai",
"ai",
"agents",
"framework",
"orchestration",
"llm",
"core",
"typed",
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
requires-python = ">=3.10, <3.14"
dependencies = [
# Core Dependencies
"crewai",
"pydantic>=2.11.9",
"openai>=1.13.3",
"litellm==1.74.9",
"instructor>=1.3.3",
# Text Processing
"pdfplumber>=0.11.4",
"regex>=2024.9.11",
# Telemetry and Monitoring
"opentelemetry-api>=1.30.0",
"opentelemetry-sdk>=1.30.0",
"opentelemetry-exporter-otlp-proto-http>=1.30.0",
"tokenizers>=0.20.3",
"openpyxl>=3.1.5",
"pyvis>=0.3.2",
# Authentication and Security
"python-dotenv>=1.1.1",
"pyjwt>=2.9.0",
# Configuration and Utils
"click>=8.1.7",
"appdirs>=1.4.4",
"jsonref>=1.1.0",
"json-repair==0.25.2",
"tomli-w>=1.1.0",
"tomli>=2.0.2",
"blinker>=1.9.0",
"json5>=0.10.0",
"portalocker==2.7.0",
"chromadb~=1.1.0",
"pydantic-settings>=2.10.1",
"uv>=0.4.25",
]
[project.optional-dependencies]
tools = [
"crewai-tools",
]
embeddings = [
"tiktoken~=0.8.0"
]
pdfplumber = [
"pdfplumber>=0.11.4",
]
pandas = [
"pandas>=2.2.3",
]
openpyxl = [
"openpyxl>=3.1.5",
]
mem0 = ["mem0ai>=0.1.94"]
docling = [
"docling>=2.12.0",
]
aisuite = [
"aisuite>=0.1.10",
]
qdrant = [
"qdrant-client[fastembed]>=1.14.3",
]
aws = [
"boto3>=1.40.38",
]
watson = [
"ibm-watsonx-ai>=1.3.39",
]
voyageai = [
"voyageai>=0.3.5",
]
[project.scripts]
crewai = "crewai.cli.cli:crewai"
[project.urls]
Homepage = "https://crewai.com"
Documentation = "https://docs.crewai.com"
Repository = "https://github.com/crewAIInc/crewAI"
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "strict"
asyncio_default_fixture_loop_scope = "function"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.version]
path = "src/crewai/__init__.py"
[tool.hatch.build.targets.wheel]
packages = ["src/crewai"]

View File

@@ -40,7 +40,7 @@ def _suppress_pydantic_deprecation_warnings() -> None:
_suppress_pydantic_deprecation_warnings()
__version__ = "0.186.1"
__version__ = "1.0.0a0"
_telemetry_submitted = False

View File

@@ -1,30 +1,43 @@
import shutil
import subprocess
import time
from collections.abc import Callable, Sequence
from typing import (
Any,
Callable,
Dict,
List,
Literal,
Optional,
Sequence,
Tuple,
Type,
Union,
cast,
)
from pydantic import Field, InstanceOf, PrivateAttr, model_validator
from crewai.agents import CacheHandler
from crewai.agents.agent_builder.base_agent import BaseAgent
from crewai.agents.agent_builder.base_agent import BaseAgent, PlatformAppOrAction
from crewai.agents.crew_agent_executor import CrewAgentExecutor
from crewai.events.event_bus import crewai_event_bus
from crewai.events.types.agent_events import (
AgentExecutionCompletedEvent,
AgentExecutionErrorEvent,
AgentExecutionStartedEvent,
)
from crewai.events.types.knowledge_events import (
KnowledgeQueryCompletedEvent,
KnowledgeQueryFailedEvent,
KnowledgeQueryStartedEvent,
KnowledgeRetrievalCompletedEvent,
KnowledgeRetrievalStartedEvent,
KnowledgeSearchQueryFailedEvent,
)
from crewai.events.types.memory_events import (
MemoryRetrievalCompletedEvent,
MemoryRetrievalStartedEvent,
)
from crewai.knowledge.knowledge import Knowledge
from crewai.knowledge.source.base_knowledge_source import BaseKnowledgeSource
from crewai.knowledge.utils.knowledge_utils import extract_knowledge_context
from crewai.lite_agent import LiteAgent, LiteAgentOutput
from crewai.llm import BaseLLM
from crewai.memory.contextual.contextual_memory import ContextualMemory
from crewai.rag.embeddings.types import EmbedderConfig
from crewai.security import Fingerprint
from crewai.task import Task
from crewai.tools import BaseTool
@@ -38,24 +51,6 @@ from crewai.utilities.agent_utils import (
)
from crewai.utilities.constants import TRAINED_AGENTS_DATA_FILE, TRAINING_DATA_FILE
from crewai.utilities.converter import generate_model_description
from crewai.events.types.agent_events import (
AgentExecutionCompletedEvent,
AgentExecutionErrorEvent,
AgentExecutionStartedEvent,
)
from crewai.events.event_bus import crewai_event_bus
from crewai.events.types.memory_events import (
MemoryRetrievalStartedEvent,
MemoryRetrievalCompletedEvent,
)
from crewai.events.types.knowledge_events import (
KnowledgeQueryCompletedEvent,
KnowledgeQueryFailedEvent,
KnowledgeQueryStartedEvent,
KnowledgeRetrievalCompletedEvent,
KnowledgeRetrievalStartedEvent,
KnowledgeSearchQueryFailedEvent,
)
from crewai.utilities.llm_utils import create_llm
from crewai.utilities.token_counter_callback import TokenCalcHandler
from crewai.utilities.training_handler import CrewTrainingHandler
@@ -84,39 +79,40 @@ class Agent(BaseAgent):
step_callback: Callback to be executed after each step of the agent execution.
knowledge_sources: Knowledge sources for the agent.
embedder: Embedder configuration for the agent.
apps: List of applications that the agent can access through CrewAI Platform.
"""
_times_executed: int = PrivateAttr(default=0)
max_execution_time: Optional[int] = Field(
max_execution_time: int | None = Field(
default=None,
description="Maximum execution time for an agent to execute a task",
)
agent_ops_agent_name: str = None # type: ignore # Incompatible types in assignment (expression has type "None", variable has type "str")
agent_ops_agent_id: str = None # type: ignore # Incompatible types in assignment (expression has type "None", variable has type "str")
step_callback: Optional[Any] = Field(
step_callback: Any | None = Field(
default=None,
description="Callback to be executed after each step of the agent execution.",
)
use_system_prompt: Optional[bool] = Field(
use_system_prompt: bool | None = Field(
default=True,
description="Use system prompt for the agent.",
)
llm: Union[str, InstanceOf[BaseLLM], Any] = Field(
llm: str | InstanceOf[BaseLLM] | Any = Field(
description="Language model that will run the agent.", default=None
)
function_calling_llm: Optional[Union[str, InstanceOf[BaseLLM], Any]] = Field(
function_calling_llm: str | InstanceOf[BaseLLM] | Any | None = Field(
description="Language model that will run the agent.", default=None
)
system_template: Optional[str] = Field(
system_template: str | None = Field(
default=None, description="System format for the agent."
)
prompt_template: Optional[str] = Field(
prompt_template: str | None = Field(
default=None, description="Prompt format for the agent."
)
response_template: Optional[str] = Field(
response_template: str | None = Field(
default=None, description="Response format for the agent."
)
allow_code_execution: Optional[bool] = Field(
allow_code_execution: bool | None = Field(
default=False, description="Enable code execution for the agent."
)
respect_context_window: bool = Field(
@@ -147,31 +143,31 @@ class Agent(BaseAgent):
default=False,
description="Whether the agent should reflect and create a plan before executing a task.",
)
max_reasoning_attempts: Optional[int] = Field(
max_reasoning_attempts: int | None = Field(
default=None,
description="Maximum number of reasoning attempts before executing the task. If None, will try until ready.",
)
embedder: Optional[Dict[str, Any]] = Field(
embedder: EmbedderConfig | None = Field(
default=None,
description="Embedder configuration for the agent.",
)
agent_knowledge_context: Optional[str] = Field(
agent_knowledge_context: str | None = Field(
default=None,
description="Knowledge context for the agent.",
)
crew_knowledge_context: Optional[str] = Field(
crew_knowledge_context: str | None = Field(
default=None,
description="Knowledge context for the crew.",
)
knowledge_search_query: Optional[str] = Field(
knowledge_search_query: str | None = Field(
default=None,
description="Knowledge search query for the agent dynamically generated by the agent.",
)
from_repository: Optional[str] = Field(
from_repository: str | None = Field(
default=None,
description="The Agent's role to be used from your repository.",
)
guardrail: Optional[Union[Callable[[Any], Tuple[bool, Any]], str]] = Field(
guardrail: Callable[[Any], tuple[bool, Any]] | str | None = Field(
default=None,
description="Function or string description of a guardrail to validate agent output",
)
@@ -180,7 +176,7 @@ class Agent(BaseAgent):
)
@model_validator(mode="before")
def validate_from_repository(cls, v):
def validate_from_repository(cls, v): # noqa: N805
if v is not None and (from_repository := v.get("from_repository")):
return load_agent_from_repository(from_repository) | v
return v
@@ -208,7 +204,7 @@ class Agent(BaseAgent):
self.cache_handler = CacheHandler()
self.set_cache_handler(self.cache_handler)
def set_knowledge(self, crew_embedder: Optional[Dict[str, Any]] = None):
def set_knowledge(self, crew_embedder: EmbedderConfig | None = None):
try:
if self.embedder is None and crew_embedder:
self.embedder = crew_embedder
@@ -224,7 +220,7 @@ class Agent(BaseAgent):
)
self.knowledge.add_sources()
except (TypeError, ValueError) as e:
raise ValueError(f"Invalid Knowledge Configuration: {str(e)}")
raise ValueError(f"Invalid Knowledge Configuration: {e!s}") from e
def _is_any_available_memory(self) -> bool:
"""Check if any memory is available."""
@@ -244,8 +240,8 @@ class Agent(BaseAgent):
def execute_task(
self,
task: Task,
context: Optional[str] = None,
tools: Optional[List[BaseTool]] = None,
context: str | None = None,
tools: list[BaseTool] | None = None,
) -> str:
"""Execute a task with the agent.
@@ -277,13 +273,7 @@ class Agent(BaseAgent):
# Add the reasoning plan to the task description
task.description += f"\n\nReasoning Plan:\n{reasoning_output.plan.plan}"
except Exception as e:
if hasattr(self, "_logger"):
self._logger.log(
"error", f"Error during reasoning process: {str(e)}"
)
else:
print(f"Error during reasoning process: {str(e)}")
self._logger.log("error", f"Error during reasoning process: {e!s}")
self._inject_date_to_task(task)
if self.tools_handler:
@@ -335,7 +325,7 @@ class Agent(BaseAgent):
agent=self,
task=task,
)
memory = contextual_memory.build_context_for_task(task, context)
memory = contextual_memory.build_context_for_task(task, context or "")
if memory.strip() != "":
task_prompt += self.i18n.slice("memory").format(memory=memory)
@@ -525,14 +515,14 @@ class Agent(BaseAgent):
try:
return future.result(timeout=timeout)
except concurrent.futures.TimeoutError:
except concurrent.futures.TimeoutError as e:
future.cancel()
raise TimeoutError(
f"Task '{task.description}' execution timed out after {timeout} seconds. Consider increasing max_execution_time or optimizing the task."
)
) from e
except Exception as e:
future.cancel()
raise RuntimeError(f"Task execution failed: {str(e)}")
raise RuntimeError(f"Task execution failed: {e!s}") from e
def _execute_without_timeout(self, task_prompt: str, task: Task) -> str:
"""Execute a task without a timeout.
@@ -554,14 +544,14 @@ class Agent(BaseAgent):
)["output"]
def create_agent_executor(
self, tools: Optional[List[BaseTool]] = None, task=None
self, tools: list[BaseTool] | None = None, task=None
) -> None:
"""Create an agent executor for the agent.
Returns:
An instance of the CrewAgentExecutor class.
"""
raw_tools: List[BaseTool] = tools or self.tools or []
raw_tools: list[BaseTool] = tools or self.tools or []
parsed_tools = parse_tools(raw_tools)
prompt = Prompts(
@@ -587,7 +577,7 @@ class Agent(BaseAgent):
agent=self,
crew=self.crew,
tools=parsed_tools,
prompt=prompt,
prompt=cast(dict[str, str], prompt),
original_tools=raw_tools,
stop_words=stop_words,
max_iter=self.max_iter,
@@ -603,10 +593,20 @@ class Agent(BaseAgent):
callbacks=[TokenCalcHandler(self._token_process)],
)
def get_delegation_tools(self, agents: List[BaseAgent]):
def get_delegation_tools(self, agents: list[BaseAgent]):
agent_tools = AgentTools(agents=agents)
tools = agent_tools.tools()
return tools
return agent_tools.tools()
def get_platform_tools(self, apps: list[PlatformAppOrAction]) -> list[BaseTool]:
try:
from crewai_tools import ( # type: ignore[import-not-found]
CrewaiPlatformTools, # type: ignore[import-untyped]
)
return CrewaiPlatformTools(apps=apps)
except Exception as e:
self._logger.log("error", f"Error getting platform tools: {e!s}")
return []
def get_multimodal_tools(self) -> Sequence[BaseTool]:
from crewai.tools.agent_tools.add_image_tool import AddImageTool
@@ -615,7 +615,9 @@ class Agent(BaseAgent):
def get_code_execution_tools(self):
try:
from crewai_tools import CodeInterpreterTool # type: ignore
from crewai_tools import ( # type: ignore[import-not-found]
CodeInterpreterTool,
)
# Set the unsafe_mode based on the code_execution_mode attribute
unsafe_mode = self.code_execution_mode == "unsafe"
@@ -654,7 +656,7 @@ class Agent(BaseAgent):
)
return task_prompt
def _render_text_description(self, tools: List[Any]) -> str:
def _render_text_description(self, tools: list[Any]) -> str:
"""Render the tool name and description in plain text.
Output will be in the format of:
@@ -664,15 +666,13 @@ class Agent(BaseAgent):
search: This tool is used for search
calculator: This tool is used for math
"""
description = "\n".join(
return "\n".join(
[
f"Tool name: {tool.name}\nTool description:\n{tool.description}"
for tool in tools
]
)
return description
def _inject_date_to_task(self, task):
"""Inject the current date into the task description if inject_date is enabled."""
if self.inject_date:
@@ -696,32 +696,37 @@ class Agent(BaseAgent):
if not is_valid:
raise ValueError(f"Invalid date format: {self.date_format}")
current_date: str = datetime.now().strftime(self.date_format)
current_date = datetime.now().strftime(self.date_format)
task.description += f"\n\nCurrent Date: {current_date}"
except Exception as e:
if hasattr(self, "_logger"):
self._logger.log("warning", f"Failed to inject date: {str(e)}")
self._logger.log("warning", f"Failed to inject date: {e!s}")
else:
print(f"Warning: Failed to inject date: {str(e)}")
print(f"Warning: Failed to inject date: {e!s}")
def _validate_docker_installation(self) -> None:
"""Check if Docker is installed and running."""
if not shutil.which("docker"):
docker_path = shutil.which("docker")
if not docker_path:
raise RuntimeError(
f"Docker is not installed. Please install Docker to use code execution with agent: {self.role}"
)
try:
subprocess.run(
["docker", "info"],
subprocess.run( # noqa: S603
[docker_path, "info"],
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
except subprocess.CalledProcessError:
except subprocess.CalledProcessError as e:
raise RuntimeError(
f"Docker is not running. Please start Docker to use code execution with agent: {self.role}"
)
) from e
except subprocess.TimeoutExpired as e:
raise RuntimeError(
f"Docker command timed out. Please check your Docker installation for agent: {self.role}"
) from e
def __repr__(self):
return f"Agent(role={self.role}, goal={self.goal}, backstory={self.backstory})"
@@ -796,8 +801,8 @@ class Agent(BaseAgent):
def kickoff(
self,
messages: Union[str, List[Dict[str, str]]],
response_format: Optional[Type[Any]] = None,
messages: str | list[dict[str, str]],
response_format: type[Any] | None = None,
) -> LiteAgentOutput:
"""
Execute the agent with the given messages using a LiteAgent instance.
@@ -836,8 +841,8 @@ class Agent(BaseAgent):
async def kickoff_async(
self,
messages: Union[str, List[Dict[str, str]]],
response_format: Optional[Type[Any]] = None,
messages: str | list[dict[str, str]],
response_format: type[Any] | None = None,
) -> LiteAgentOutput:
"""
Execute the agent asynchronously with the given messages using a LiteAgent instance.

View File

@@ -0,0 +1,12 @@
from crewai.agents.cache.cache_handler import CacheHandler
from crewai.agents.parser import AgentAction, AgentFinish, OutputParserError, parse
from crewai.agents.tools_handler import ToolsHandler
__all__ = [
"AgentAction",
"AgentFinish",
"CacheHandler",
"OutputParserError",
"ToolsHandler",
"parse",
]

View File

@@ -1,7 +1,7 @@
from abc import ABC, abstractmethod
from typing import Any, Dict, List, Optional
from typing import Any
from pydantic import PrivateAttr
from pydantic import ConfigDict, PrivateAttr
from crewai.agent import BaseAgent
from crewai.tools import BaseTool
@@ -16,22 +16,21 @@ class BaseAgentAdapter(BaseAgent, ABC):
"""
adapted_structured_output: bool = False
_agent_config: Optional[Dict[str, Any]] = PrivateAttr(default=None)
_agent_config: dict[str, Any] | None = PrivateAttr(default=None)
model_config = {"arbitrary_types_allowed": True}
model_config = ConfigDict(arbitrary_types_allowed=True)
def __init__(self, agent_config: Optional[Dict[str, Any]] = None, **kwargs: Any):
def __init__(self, agent_config: dict[str, Any] | None = None, **kwargs: Any):
super().__init__(adapted_agent=True, **kwargs)
self._agent_config = agent_config
@abstractmethod
def configure_tools(self, tools: Optional[List[BaseTool]] = None) -> None:
def configure_tools(self, tools: list[BaseTool] | None = None) -> None:
"""Configure and adapt tools for the specific agent implementation.
Args:
tools: Optional list of BaseTool instances to be configured
"""
pass
def configure_structured_output(self, structured_output: Any) -> None:
"""Configure the structured output for the specific agent implementation.
@@ -39,4 +38,3 @@ class BaseAgentAdapter(BaseAgent, ABC):
Args:
structured_output: The structured output to be configured
"""
pass

View File

@@ -1,5 +1,5 @@
from abc import ABC, abstractmethod
from typing import Any, List, Optional
from typing import Any
from crewai.tools.base_tool import BaseTool
@@ -12,23 +12,22 @@ class BaseToolAdapter(ABC):
different frameworks and platforms.
"""
original_tools: List[BaseTool]
converted_tools: List[Any]
original_tools: list[BaseTool]
converted_tools: list[Any]
def __init__(self, tools: Optional[List[BaseTool]] = None):
def __init__(self, tools: list[BaseTool] | None = None):
self.original_tools = tools or []
self.converted_tools = []
@abstractmethod
def configure_tools(self, tools: List[BaseTool]) -> None:
def configure_tools(self, tools: list[BaseTool]) -> None:
"""Configure and convert tools for the specific implementation.
Args:
tools: List of BaseTool instances to be configured and converted
"""
pass
def tools(self) -> List[Any]:
def tools(self) -> list[Any]:
"""Return all converted tools."""
return self.converted_tools

View File

@@ -1,8 +1,9 @@
import uuid
from abc import ABC, abstractmethod
from collections.abc import Callable
from copy import copy as shallow_copy
from hashlib import md5
from typing import Any, Callable, Dict, List, Optional, TypeVar
from typing import Any, Literal, TypeVar
from pydantic import (
UUID4,
@@ -21,15 +22,36 @@ from crewai.agents.tools_handler import ToolsHandler
from crewai.knowledge.knowledge import Knowledge
from crewai.knowledge.knowledge_config import KnowledgeConfig
from crewai.knowledge.source.base_knowledge_source import BaseKnowledgeSource
from crewai.rag.embeddings.types import EmbedderConfig
from crewai.security.security_config import SecurityConfig
from crewai.tools.base_tool import BaseTool, Tool
from crewai.utilities import I18N, Logger, RPMController
from crewai.utilities.config import process_config
from crewai.utilities.converter import Converter
from crewai.utilities.string_utils import interpolate_only
T = TypeVar("T", bound="BaseAgent")
PlatformApp = Literal[
"asana",
"box",
"clickup",
"github",
"gmail",
"google_calendar",
"google_sheets",
"hubspot",
"jira",
"linear",
"notion",
"salesforce",
"shopify",
"slack",
"stripe",
"zendesk",
]
PlatformAppOrAction = PlatformApp | str
class BaseAgent(ABC, BaseModel):
"""Abstract Base Class for all third party agents compatible with CrewAI.
@@ -40,11 +62,11 @@ class BaseAgent(ABC, BaseModel):
goal (str): Objective of the agent.
backstory (str): Backstory of the agent.
cache (bool): Whether the agent should use a cache for tool usage.
config (Optional[Dict[str, Any]]): Configuration for the agent.
config (dict[str, Any] | None): Configuration for the agent.
verbose (bool): Verbose mode for the Agent Execution.
max_rpm (Optional[int]): Maximum number of requests per minute for the agent execution.
max_rpm (int | None): Maximum number of requests per minute for the agent execution.
allow_delegation (bool): Allow delegation of tasks to agents.
tools (Optional[List[Any]]): Tools at the agent's disposal.
tools (list[Any] | None): Tools at the agent's disposal.
max_iter (int): Maximum iterations for an agent to execute a task.
agent_executor (InstanceOf): An instance of the CrewAgentExecutor class.
llm (Any): Language model that will run the agent.
@@ -56,18 +78,22 @@ class BaseAgent(ABC, BaseModel):
knowledge_sources: Knowledge sources for the agent.
knowledge_storage: Custom knowledge storage for the agent.
security_config: Security configuration for the agent, including fingerprinting.
apps: List of enterprise applications that the agent can access through CrewAI Enterprise Tools.
actions: List of actions that the agent can access through CrewAI Enterprise Tools.
Methods:
execute_task(task: Any, context: Optional[str] = None, tools: Optional[List[BaseTool]] = None) -> str:
execute_task(task: Any, context: str | None = None, tools: list[BaseTool] | None = None) -> str:
Abstract method to execute a task.
create_agent_executor(tools=None) -> None:
Abstract method to create an agent executor.
get_delegation_tools(agents: List["BaseAgent"]):
get_delegation_tools(agents: list["BaseAgent"]):
Abstract method to set the agents task tools for handling delegation and question asking to other agents in crew.
get_platform_tools(apps: list[PlatformAppOrAction]):
Abstract method to get platform tools for the specified list of applications and/or application/action combinations.
get_output_converter(llm, model, instructions):
Abstract method to get the converter class for the agent to create json/pydantic outputs.
interpolate_inputs(inputs: Dict[str, Any]) -> None:
interpolate_inputs(inputs: dict[str, Any]) -> None:
Interpolate inputs into the agent description and backstory.
set_cache_handler(cache_handler: CacheHandler) -> None:
Set the cache handler for the agent.
@@ -81,17 +107,17 @@ class BaseAgent(ABC, BaseModel):
__hash__ = object.__hash__ # type: ignore
_logger: Logger = PrivateAttr(default_factory=lambda: Logger(verbose=False))
_rpm_controller: Optional[RPMController] = PrivateAttr(default=None)
_rpm_controller: RPMController | None = PrivateAttr(default=None)
_request_within_rpm_limit: Any = PrivateAttr(default=None)
_original_role: Optional[str] = PrivateAttr(default=None)
_original_goal: Optional[str] = PrivateAttr(default=None)
_original_backstory: Optional[str] = PrivateAttr(default=None)
_original_role: str | None = PrivateAttr(default=None)
_original_goal: str | None = PrivateAttr(default=None)
_original_backstory: str | None = PrivateAttr(default=None)
_token_process: TokenProcess = PrivateAttr(default_factory=TokenProcess)
id: UUID4 = Field(default_factory=uuid.uuid4, frozen=True)
role: str = Field(description="Role of the agent")
goal: str = Field(description="Objective of the agent")
backstory: str = Field(description="Backstory of the agent")
config: Optional[Dict[str, Any]] = Field(
config: dict[str, Any] | None = Field(
description="Configuration for the agent", default=None, exclude=True
)
cache: bool = Field(
@@ -100,7 +126,7 @@ class BaseAgent(ABC, BaseModel):
verbose: bool = Field(
default=False, description="Verbose mode for the Agent Execution"
)
max_rpm: Optional[int] = Field(
max_rpm: int | None = Field(
default=None,
description="Maximum number of requests per minute for the agent execution to be respected.",
)
@@ -108,7 +134,7 @@ class BaseAgent(ABC, BaseModel):
default=False,
description="Enable agent to delegate and ask questions among each other.",
)
tools: Optional[List[BaseTool]] = Field(
tools: list[BaseTool] | None = Field(
default_factory=list, description="Tools at agents' disposal"
)
max_iter: int = Field(
@@ -122,27 +148,27 @@ class BaseAgent(ABC, BaseModel):
)
crew: Any = Field(default=None, description="Crew to which the agent belongs.")
i18n: I18N = Field(default=I18N(), description="Internationalization settings.")
cache_handler: Optional[InstanceOf[CacheHandler]] = Field(
cache_handler: InstanceOf[CacheHandler] | None = Field(
default=None, description="An instance of the CacheHandler class."
)
tools_handler: InstanceOf[ToolsHandler] = Field(
default_factory=ToolsHandler,
description="An instance of the ToolsHandler class.",
)
tools_results: List[Dict[str, Any]] = Field(
tools_results: list[dict[str, Any]] = Field(
default=[], description="Results of the tools used by the agent."
)
max_tokens: Optional[int] = Field(
max_tokens: int | None = Field(
default=None, description="Maximum number of tokens for the agent's execution."
)
knowledge: Optional[Knowledge] = Field(
knowledge: Knowledge | None = Field(
default=None, description="Knowledge for the agent."
)
knowledge_sources: Optional[List[BaseKnowledgeSource]] = Field(
knowledge_sources: list[BaseKnowledgeSource] | None = Field(
default=None,
description="Knowledge sources for the agent.",
)
knowledge_storage: Optional[Any] = Field(
knowledge_storage: Any | None = Field(
default=None,
description="Custom knowledge storage for the agent.",
)
@@ -150,16 +176,20 @@ class BaseAgent(ABC, BaseModel):
default_factory=SecurityConfig,
description="Security configuration for the agent, including fingerprinting.",
)
callbacks: List[Callable] = Field(
callbacks: list[Callable] = Field(
default=[], description="Callbacks to be used for the agent"
)
adapted_agent: bool = Field(
default=False, description="Whether the agent is adapted"
)
knowledge_config: Optional[KnowledgeConfig] = Field(
knowledge_config: KnowledgeConfig | None = Field(
default=None,
description="Knowledge configuration for the agent such as limits and threshold",
)
apps: list[PlatformAppOrAction] | None = Field(
default=None,
description="List of applications or application/action combinations that the agent can access through CrewAI Platform. Can contain app names (e.g., 'gmail') or specific actions (e.g., 'gmail/send_email')",
)
@model_validator(mode="before")
@classmethod
@@ -168,7 +198,7 @@ class BaseAgent(ABC, BaseModel):
@field_validator("tools")
@classmethod
def validate_tools(cls, tools: List[Any]) -> List[BaseTool]:
def validate_tools(cls, tools: list[Any]) -> list[BaseTool]:
"""Validate and process the tools provided to the agent.
This method ensures that each tool is either an instance of BaseTool
@@ -195,6 +225,24 @@ class BaseAgent(ABC, BaseModel):
)
return processed_tools
@field_validator("apps")
@classmethod
def validate_apps(
cls, apps: list[PlatformAppOrAction] | None
) -> list[PlatformAppOrAction] | None:
if not apps:
return apps
validated_apps = []
for app in apps:
if app.count("/") > 1:
raise ValueError(
f"Invalid app format '{app}'. Apps can only have one '/' for app/action format (e.g., 'gmail/send_email')"
)
validated_apps.append(app)
return list(set(validated_apps))
@model_validator(mode="after")
def validate_and_set_attributes(self):
# Validate required fields
@@ -221,7 +269,7 @@ class BaseAgent(ABC, BaseModel):
@field_validator("id", mode="before")
@classmethod
def _deny_user_set_id(cls, v: Optional[UUID4]) -> None:
def _deny_user_set_id(cls, v: UUID4 | None) -> None:
if v:
raise PydanticCustomError(
"may_not_set_field", "This field is not to be set by the user.", {}
@@ -252,8 +300,8 @@ class BaseAgent(ABC, BaseModel):
def execute_task(
self,
task: Any,
context: Optional[str] = None,
tools: Optional[List[BaseTool]] = None,
context: str | None = None,
tools: list[BaseTool] | None = None,
) -> str:
pass
@@ -262,9 +310,12 @@ class BaseAgent(ABC, BaseModel):
pass
@abstractmethod
def get_delegation_tools(self, agents: List["BaseAgent"]) -> List[BaseTool]:
def get_delegation_tools(self, agents: list["BaseAgent"]) -> list[BaseTool]:
"""Set the task tools that init BaseAgenTools class."""
pass
@abstractmethod
def get_platform_tools(self, apps: list[PlatformAppOrAction]) -> list[BaseTool]:
"""Get platform tools for the specified list of applications and/or application/action combinations."""
def copy(self: T) -> T: # type: ignore # Signature of "copy" incompatible with supertype "BaseModel"
"""Create a deep copy of the Agent."""
@@ -282,6 +333,8 @@ class BaseAgent(ABC, BaseModel):
"knowledge_sources",
"knowledge_storage",
"knowledge",
"apps",
"actions",
}
# Copy llm
@@ -309,7 +362,7 @@ class BaseAgent(ABC, BaseModel):
copied_data = self.model_dump(exclude=exclude)
copied_data = {k: v for k, v in copied_data.items() if v is not None}
copied_agent = type(self)(
return type(self)(
**copied_data,
llm=existing_llm,
tools=self.tools,
@@ -318,9 +371,7 @@ class BaseAgent(ABC, BaseModel):
knowledge_storage=copied_knowledge_storage,
)
return copied_agent
def interpolate_inputs(self, inputs: Dict[str, Any]) -> None:
def interpolate_inputs(self, inputs: dict[str, Any]) -> None:
"""Interpolate inputs into the agent description and backstory."""
if self._original_role is None:
self._original_role = self.role
@@ -362,5 +413,5 @@ class BaseAgent(ABC, BaseModel):
self._rpm_controller = rpm_controller
self.create_agent_executor()
def set_knowledge(self, crew_embedder: Optional[Dict[str, Any]] = None):
def set_knowledge(self, crew_embedder: EmbedderConfig | None = None):
pass

View File

@@ -1,13 +1,13 @@
import time
from typing import TYPE_CHECKING, Dict, List
from typing import TYPE_CHECKING
from crewai.events.event_listener import event_listener
from crewai.memory.entity.entity_memory_item import EntityMemoryItem
from crewai.memory.long_term.long_term_memory_item import LongTermMemoryItem
from crewai.utilities import I18N
from crewai.utilities.converter import ConverterError
from crewai.utilities.evaluators.task_evaluator import TaskEvaluator
from crewai.utilities.printer import Printer
from crewai.events.event_listener import event_listener
if TYPE_CHECKING:
from crewai.agents.agent_builder.base_agent import BaseAgent
@@ -21,7 +21,7 @@ class CrewAgentExecutorMixin:
task: "Task"
iterations: int
max_iter: int
messages: List[Dict[str, str]]
messages: list[dict[str, str]]
_i18n: I18N
_printer: Printer = Printer()
@@ -46,7 +46,6 @@ class CrewAgentExecutorMixin:
)
except Exception as e:
print(f"Failed to add to short term memory: {e}")
pass
def _create_external_memory(self, output) -> None:
"""Create and save a external-term memory item if conditions are met."""
@@ -67,7 +66,6 @@ class CrewAgentExecutorMixin:
)
except Exception as e:
print(f"Failed to add to external memory: {e}")
pass
def _create_long_term_memory(self, output) -> None:
"""Create and save long-term and entity memory items based on evaluation."""
@@ -113,10 +111,8 @@ class CrewAgentExecutorMixin:
self.crew._entity_memory.save(entity_memories)
except AttributeError as e:
print(f"Missing attributes for long term memory: {e}")
pass
except Exception as e:
print(f"Failed to add to long term memory: {e}")
pass
elif (
self.crew
and self.crew._long_term_memory

View File

@@ -12,7 +12,7 @@ from crewai.agents.agent_builder.base_agent_executor_mixin import CrewAgentExecu
from crewai.agents.parser import (
AgentAction,
AgentFinish,
OutputParserException,
OutputParserError,
)
from crewai.agents.tools_handler import ToolsHandler
from crewai.events.event_bus import crewai_event_bus
@@ -228,7 +228,7 @@ class CrewAgentExecutor(CrewAgentExecutorMixin):
self._invoke_step_callback(formatted_answer)
self._append_message(formatted_answer.text)
except OutputParserException as e:
except OutputParserError as e: # noqa: PERF203
formatted_answer = handle_output_parser_exception(
e=e,
messages=self.messages,
@@ -251,17 +251,20 @@ class CrewAgentExecutor(CrewAgentExecutorMixin):
i18n=self._i18n,
)
continue
else:
handle_unknown_error(self._printer, e)
raise e
handle_unknown_error(self._printer, e)
raise e
finally:
self.iterations += 1
# During the invoke loop, formatted_answer alternates between AgentAction
# (when the agent is using tools) and eventually becomes AgentFinish
# (when the agent reaches a final answer). This assertion confirms we've
# (when the agent reaches a final answer). This check confirms we've
# reached a final answer and helps type checking understand this transition.
assert isinstance(formatted_answer, AgentFinish)
if not isinstance(formatted_answer, AgentFinish):
raise RuntimeError(
"Agent execution ended without reaching a final answer. "
f"Got {type(formatted_answer).__name__} instead of AgentFinish."
)
self._show_logs(formatted_answer)
return formatted_answer
@@ -324,9 +327,7 @@ class CrewAgentExecutor(CrewAgentExecutorMixin):
self.agent,
AgentLogsStartedEvent(
agent_role=self.agent.role,
task_description=(
getattr(self.task, "description") if self.task else "Not Found"
),
task_description=(self.task.description if self.task else "Not Found"),
verbose=self.agent.verbose
or (hasattr(self, "crew") and getattr(self.crew, "verbose", False)),
),
@@ -415,8 +416,7 @@ class CrewAgentExecutor(CrewAgentExecutorMixin):
"""
prompt = prompt.replace("{input}", inputs["input"])
prompt = prompt.replace("{tool_names}", inputs["tool_names"])
prompt = prompt.replace("{tools}", inputs["tools"])
return prompt
return prompt.replace("{tools}", inputs["tools"])
def _handle_human_feedback(self, formatted_answer: AgentFinish) -> AgentFinish:
"""Process human feedback.

View File

@@ -7,18 +7,18 @@ AgentAction or AgentFinish objects.
from dataclasses import dataclass
from json_repair import repair_json
from json_repair import repair_json # type: ignore[import-untyped]
from crewai.agents.constants import (
ACTION_INPUT_ONLY_REGEX,
ACTION_INPUT_REGEX,
ACTION_REGEX,
ACTION_INPUT_ONLY_REGEX,
FINAL_ANSWER_ACTION,
MISSING_ACTION_AFTER_THOUGHT_ERROR_MESSAGE,
MISSING_ACTION_INPUT_AFTER_ACTION_ERROR_MESSAGE,
UNABLE_TO_REPAIR_JSON_RESULTS,
)
from crewai.utilities import I18N
from crewai.utilities.i18n import I18N
_I18N = I18N()
@@ -43,7 +43,7 @@ class AgentFinish:
text: str
class OutputParserException(Exception):
class OutputParserError(Exception):
"""Exception raised when output parsing fails.
Attributes:
@@ -51,7 +51,7 @@ class OutputParserException(Exception):
"""
def __init__(self, error: str) -> None:
"""Initialize OutputParserException.
"""Initialize OutputParserError.
Args:
error: The error message.
@@ -87,7 +87,7 @@ def parse(text: str) -> AgentAction | AgentFinish:
AgentAction or AgentFinish based on the content.
Raises:
OutputParserException: If the text format is invalid.
OutputParserError: If the text format is invalid.
"""
thought = _extract_thought(text)
includes_answer = FINAL_ANSWER_ACTION in text
@@ -104,7 +104,7 @@ def parse(text: str) -> AgentAction | AgentFinish:
final_answer = final_answer[:-3].rstrip()
return AgentFinish(thought=thought, output=final_answer, text=text)
elif action_match:
if action_match:
action = action_match.group(1)
clean_action = _clean_action(action)
@@ -118,19 +118,18 @@ def parse(text: str) -> AgentAction | AgentFinish:
)
if not ACTION_REGEX.search(text):
raise OutputParserException(
raise OutputParserError(
f"{MISSING_ACTION_AFTER_THOUGHT_ERROR_MESSAGE}\n{_I18N.slice('final_answer_format')}",
)
elif not ACTION_INPUT_ONLY_REGEX.search(text):
raise OutputParserException(
if not ACTION_INPUT_ONLY_REGEX.search(text):
raise OutputParserError(
MISSING_ACTION_INPUT_AFTER_ACTION_ERROR_MESSAGE,
)
else:
err_format = _I18N.slice("format_without_tools")
error = f"{err_format}"
raise OutputParserException(
error,
)
err_format = _I18N.slice("format_without_tools")
error = f"{err_format}"
raise OutputParserError(
error,
)
def _extract_thought(text: str) -> str:
@@ -149,8 +148,7 @@ def _extract_thought(text: str) -> str:
return ""
thought = text[:thought_index].strip()
# Remove any triple backticks from the thought string
thought = thought.replace("```", "").strip()
return thought
return thought.replace("```", "").strip()
def _clean_action(text: str) -> str:

View File

@@ -1,8 +1,10 @@
"""Tools handler for managing tool execution and caching."""
import json
from crewai.agents.cache.cache_handler import CacheHandler
from crewai.tools.cache_tools.cache_tools import CacheTools
from crewai.tools.tool_calling import InstructorToolCalling, ToolCalling
from crewai.agents.cache.cache_handler import CacheHandler
class ToolsHandler:
@@ -37,8 +39,16 @@ class ToolsHandler:
"""
self.last_used_tool = calling
if self.cache and should_cache and calling.tool_name != CacheTools().name:
# Convert arguments to string for cache
input_str = ""
if calling.arguments:
if isinstance(calling.arguments, dict):
input_str = json.dumps(calling.arguments)
else:
input_str = str(calling.arguments)
self.cache.add(
tool=calling.tool_name,
input=calling.arguments,
input=input_str,
output=output,
)

View File

@@ -1,5 +1,6 @@
from crewai.cli.authentication.providers.base_provider import BaseProvider
class Auth0Provider(BaseProvider):
def get_authorize_url(self) -> str:
return f"https://{self._get_domain()}/oauth/device/code"
@@ -14,13 +15,20 @@ class Auth0Provider(BaseProvider):
return f"https://{self._get_domain()}/"
def get_audience(self) -> str:
assert self.settings.audience is not None, "Audience is required"
if self.settings.audience is None:
raise ValueError(
"Audience is required. Please set it in the configuration."
)
return self.settings.audience
def get_client_id(self) -> str:
assert self.settings.client_id is not None, "Client ID is required"
if self.settings.client_id is None:
raise ValueError(
"Client ID is required. Please set it in the configuration."
)
return self.settings.client_id
def _get_domain(self) -> str:
assert self.settings.domain is not None, "Domain is required"
if self.settings.domain is None:
raise ValueError("Domain is required. Please set it in the configuration.")
return self.settings.domain

View File

@@ -1,30 +1,26 @@
from abc import ABC, abstractmethod
from crewai.cli.authentication.main import Oauth2Settings
class BaseProvider(ABC):
def __init__(self, settings: Oauth2Settings):
self.settings = settings
@abstractmethod
def get_authorize_url(self) -> str:
...
def get_authorize_url(self) -> str: ...
@abstractmethod
def get_token_url(self) -> str:
...
def get_token_url(self) -> str: ...
@abstractmethod
def get_jwks_url(self) -> str:
...
def get_jwks_url(self) -> str: ...
@abstractmethod
def get_issuer(self) -> str:
...
def get_issuer(self) -> str: ...
@abstractmethod
def get_audience(self) -> str:
...
def get_audience(self) -> str: ...
@abstractmethod
def get_client_id(self) -> str:
...
def get_client_id(self) -> str: ...

View File

@@ -1,5 +1,6 @@
from crewai.cli.authentication.providers.base_provider import BaseProvider
class OktaProvider(BaseProvider):
def get_authorize_url(self) -> str:
return f"https://{self.settings.domain}/oauth2/default/v1/device/authorize"
@@ -14,9 +15,15 @@ class OktaProvider(BaseProvider):
return f"https://{self.settings.domain}/oauth2/default"
def get_audience(self) -> str:
assert self.settings.audience is not None
if self.settings.audience is None:
raise ValueError(
"Audience is required. Please set it in the configuration."
)
return self.settings.audience
def get_client_id(self) -> str:
assert self.settings.client_id is not None
if self.settings.client_id is None:
raise ValueError(
"Client ID is required. Please set it in the configuration."
)
return self.settings.client_id

View File

@@ -1,5 +1,6 @@
from crewai.cli.authentication.providers.base_provider import BaseProvider
class WorkosProvider(BaseProvider):
def get_authorize_url(self) -> str:
return f"https://{self._get_domain()}/oauth2/device_authorization"
@@ -17,9 +18,13 @@ class WorkosProvider(BaseProvider):
return self.settings.audience or ""
def get_client_id(self) -> str:
assert self.settings.client_id is not None, "Client ID is required"
if self.settings.client_id is None:
raise ValueError(
"Client ID is required. Please set it in the configuration."
)
return self.settings.client_id
def _get_domain(self) -> str:
assert self.settings.domain is not None, "Domain is required"
if self.settings.domain is None:
raise ValueError("Domain is required. Please set it in the configuration.")
return self.settings.domain

View File

@@ -17,8 +17,6 @@ def validate_jwt_token(
missing required claims).
"""
decoded_token = None
try:
jwk_client = PyJWKClient(jwks_url)
signing_key = jwk_client.get_signing_key_from_jwt(jwt_token)
@@ -26,7 +24,7 @@ def validate_jwt_token(
_unverified_decoded_token = jwt.decode(
jwt_token, options={"verify_signature": False}
)
decoded_token = jwt.decode(
return jwt.decode(
jwt_token,
signing_key.key,
algorithms=["RS256"],
@@ -40,23 +38,22 @@ def validate_jwt_token(
"require": ["exp", "iat", "iss", "aud", "sub"],
},
)
return decoded_token
except jwt.ExpiredSignatureError:
raise Exception("Token has expired.")
except jwt.InvalidAudienceError:
except jwt.ExpiredSignatureError as e:
raise Exception("Token has expired.") from e
except jwt.InvalidAudienceError as e:
actual_audience = _unverified_decoded_token.get("aud", "[no audience found]")
raise Exception(
f"Invalid token audience. Got: '{actual_audience}'. Expected: '{audience}'"
)
except jwt.InvalidIssuerError:
) from e
except jwt.InvalidIssuerError as e:
actual_issuer = _unverified_decoded_token.get("iss", "[no issuer found]")
raise Exception(
f"Invalid token issuer. Got: '{actual_issuer}'. Expected: '{issuer}'"
)
) from e
except jwt.MissingRequiredClaimError as e:
raise Exception(f"Token is missing required claims: {str(e)}")
raise Exception(f"Token is missing required claims: {e!s}") from e
except jwt.exceptions.PyJWKClientError as e:
raise Exception(f"JWKS or key processing error: {str(e)}")
raise Exception(f"JWKS or key processing error: {e!s}") from e
except jwt.InvalidTokenError as e:
raise Exception(f"Invalid token: {str(e)}")
raise Exception(f"Invalid token: {e!s}") from e

View File

@@ -1,13 +1,16 @@
import os
import subprocess
from importlib.metadata import version as get_version
from typing import Optional
import click
from crewai.cli.config import Settings
from crewai.cli.settings.main import SettingsCommand
from crewai.cli.add_crew_to_flow import add_crew_to_flow
from crewai.cli.config import Settings
from crewai.cli.create_crew import create_crew
from crewai.cli.create_flow import create_flow
from crewai.cli.crew_chat import run_chat
from crewai.cli.settings.main import SettingsCommand
from crewai.cli.utils import build_env_with_tool_repository_credentials, read_toml
from crewai.memory.storage.kickoff_task_outputs_storage import (
KickoffTaskOutputsSQLiteStorage,
)
@@ -34,6 +37,46 @@ def crewai():
"""Top-level command group for crewai."""
@crewai.command(
name="uv",
context_settings=dict(
ignore_unknown_options=True,
),
)
@click.argument("uv_args", nargs=-1, type=click.UNPROCESSED)
def uv(uv_args):
"""A wrapper around uv commands that adds custom tool authentication through env vars."""
env = os.environ.copy()
try:
pyproject_data = read_toml()
sources = pyproject_data.get("tool", {}).get("uv", {}).get("sources", {})
for source_config in sources.values():
if isinstance(source_config, dict):
index = source_config.get("index")
if index:
index_env = build_env_with_tool_repository_credentials(index)
env.update(index_env)
except (FileNotFoundError, KeyError) as e:
raise SystemExit(
"Error. A valid pyproject.toml file is required. Check that a valid pyproject.toml file exists in the current directory."
) from e
except Exception as e:
raise SystemExit(f"Error: {e}") from e
try:
subprocess.run( # noqa: S603
["uv", *uv_args], # noqa: S607
capture_output=False,
env=env,
text=True,
check=True,
)
except subprocess.CalledProcessError as e:
click.secho(f"uv command failed with exit code {e.returncode}", fg="red")
raise SystemExit(e.returncode) from e
@crewai.command()
@click.argument("type", type=click.Choice(["crew", "flow"]))
@click.argument("name")
@@ -237,13 +280,6 @@ def login():
@crewai.group()
def deploy():
"""Deploy the Crew CLI group."""
pass
@crewai.group()
def tool():
"""Tool Repository related commands."""
pass
@deploy.command(name="create")
@@ -263,7 +299,7 @@ def deploy_list():
@deploy.command(name="push")
@click.option("-u", "--uuid", type=str, help="Crew UUID parameter")
def deploy_push(uuid: Optional[str]):
def deploy_push(uuid: str | None):
"""Deploy the Crew."""
deploy_cmd = DeployCommand()
deploy_cmd.deploy(uuid=uuid)
@@ -271,7 +307,7 @@ def deploy_push(uuid: Optional[str]):
@deploy.command(name="status")
@click.option("-u", "--uuid", type=str, help="Crew UUID parameter")
def deply_status(uuid: Optional[str]):
def deply_status(uuid: str | None):
"""Get the status of a deployment."""
deploy_cmd = DeployCommand()
deploy_cmd.get_crew_status(uuid=uuid)
@@ -279,7 +315,7 @@ def deply_status(uuid: Optional[str]):
@deploy.command(name="logs")
@click.option("-u", "--uuid", type=str, help="Crew UUID parameter")
def deploy_logs(uuid: Optional[str]):
def deploy_logs(uuid: str | None):
"""Get the logs of a deployment."""
deploy_cmd = DeployCommand()
deploy_cmd.get_crew_logs(uuid=uuid)
@@ -287,12 +323,17 @@ def deploy_logs(uuid: Optional[str]):
@deploy.command(name="remove")
@click.option("-u", "--uuid", type=str, help="Crew UUID parameter")
def deploy_remove(uuid: Optional[str]):
def deploy_remove(uuid: str | None):
"""Remove a deployment."""
deploy_cmd = DeployCommand()
deploy_cmd.remove_crew(uuid=uuid)
@crewai.group()
def tool():
"""Tool Repository related commands."""
@tool.command(name="create")
@click.argument("handle")
def tool_create(handle: str):
@@ -327,7 +368,6 @@ def tool_publish(is_public: bool, force: bool):
@crewai.group()
def flow():
"""Flow related commands."""
pass
@flow.command(name="kickoff")
@@ -359,7 +399,7 @@ def chat():
and using the Chat LLM to generate responses.
"""
click.secho(
"\nStarting a conversation with the Crew\n" "Type 'exit' or Ctrl+C to quit.\n",
"\nStarting a conversation with the Crew\nType 'exit' or Ctrl+C to quit.\n",
)
run_chat()
@@ -368,7 +408,6 @@ def chat():
@crewai.group(invoke_without_command=True)
def org():
"""Organization management commands."""
pass
@org.command("list")
@@ -396,7 +435,6 @@ def current():
@crewai.group()
def enterprise():
"""Enterprise Configuration commands."""
pass
@enterprise.command("configure")
@@ -410,7 +448,6 @@ def enterprise_configure(enterprise_url: str):
@crewai.group()
def config():
"""CLI Configuration commands."""
pass
@config.command("list")

View File

@@ -1,20 +1,61 @@
import json
import tempfile
from logging import getLogger
from pathlib import Path
from typing import Optional
from pydantic import BaseModel, Field
from crewai.cli.constants import (
DEFAULT_CREWAI_ENTERPRISE_URL,
CREWAI_ENTERPRISE_DEFAULT_OAUTH2_PROVIDER,
CREWAI_ENTERPRISE_DEFAULT_OAUTH2_AUDIENCE,
CREWAI_ENTERPRISE_DEFAULT_OAUTH2_CLIENT_ID,
CREWAI_ENTERPRISE_DEFAULT_OAUTH2_DOMAIN,
CREWAI_ENTERPRISE_DEFAULT_OAUTH2_PROVIDER,
DEFAULT_CREWAI_ENTERPRISE_URL,
)
from crewai.cli.shared.token_manager import TokenManager
logger = getLogger(__name__)
DEFAULT_CONFIG_PATH = Path.home() / ".config" / "crewai" / "settings.json"
def get_writable_config_path() -> Path | None:
"""
Find a writable location for the config file with fallback options.
Tries in order:
1. Default: ~/.config/crewai/settings.json
2. Temp directory: /tmp/crewai_settings.json (or OS equivalent)
3. Current directory: ./crewai_settings.json
4. In-memory only (returns None)
Returns:
Path object for writable config location, or None if no writable location found
"""
fallback_paths = [
DEFAULT_CONFIG_PATH, # Default location
Path(tempfile.gettempdir()) / "crewai_settings.json", # Temporary directory
Path.cwd() / "crewai_settings.json", # Current working directory
]
for config_path in fallback_paths:
try:
config_path.parent.mkdir(parents=True, exist_ok=True)
test_file = config_path.parent / ".crewai_write_test"
try:
test_file.write_text("test")
test_file.unlink() # Clean up test file
logger.info(f"Using config path: {config_path}")
return config_path
except Exception: # noqa: S112
continue
except Exception: # noqa: S112
continue
return None
# Settings that are related to the user's account
USER_SETTINGS_KEYS = [
"tool_repository_username",
@@ -56,20 +97,20 @@ HIDDEN_SETTINGS_KEYS = [
class Settings(BaseModel):
enterprise_base_url: Optional[str] = Field(
enterprise_base_url: str | None = Field(
default=DEFAULT_CLI_SETTINGS["enterprise_base_url"],
description="Base URL of the CrewAI Enterprise instance",
)
tool_repository_username: Optional[str] = Field(
tool_repository_username: str | None = Field(
None, description="Username for interacting with the Tool Repository"
)
tool_repository_password: Optional[str] = Field(
tool_repository_password: str | None = Field(
None, description="Password for interacting with the Tool Repository"
)
org_name: Optional[str] = Field(
org_name: str | None = Field(
None, description="Name of the currently active organization"
)
org_uuid: Optional[str] = Field(
org_uuid: str | None = Field(
None, description="UUID of the currently active organization"
)
config_path: Path = Field(default=DEFAULT_CONFIG_PATH, frozen=True, exclude=True)
@@ -79,7 +120,7 @@ class Settings(BaseModel):
default=DEFAULT_CLI_SETTINGS["oauth2_provider"],
)
oauth2_audience: Optional[str] = Field(
oauth2_audience: str | None = Field(
description="OAuth2 audience value, typically used to identify the target API or resource.",
default=DEFAULT_CLI_SETTINGS["oauth2_audience"],
)
@@ -94,16 +135,32 @@ class Settings(BaseModel):
default=DEFAULT_CLI_SETTINGS["oauth2_domain"],
)
def __init__(self, config_path: Path = DEFAULT_CONFIG_PATH, **data):
"""Load Settings from config path"""
config_path.parent.mkdir(parents=True, exist_ok=True)
def __init__(self, config_path: Path | None = None, **data):
"""Load Settings from config path with fallback support"""
if config_path is None:
config_path = get_writable_config_path()
# If config_path is None, we're in memory-only mode
if config_path is None:
merged_data = {**data}
# Dummy path for memory-only mode
super().__init__(config_path=Path("/dev/null"), **merged_data)
return
try:
config_path.parent.mkdir(parents=True, exist_ok=True)
except Exception:
merged_data = {**data}
# Dummy path for memory-only mode
super().__init__(config_path=Path("/dev/null"), **merged_data)
return
file_data = {}
if config_path.is_file():
try:
with config_path.open("r") as f:
file_data = json.load(f)
except json.JSONDecodeError:
except Exception:
file_data = {}
merged_data = {**file_data, **data}
@@ -123,15 +180,22 @@ class Settings(BaseModel):
def dump(self) -> None:
"""Save current settings to settings.json"""
if self.config_path.is_file():
with self.config_path.open("r") as f:
existing_data = json.load(f)
else:
existing_data = {}
if str(self.config_path) == "/dev/null":
return
updated_data = {**existing_data, **self.model_dump(exclude_unset=True)}
with self.config_path.open("w") as f:
json.dump(updated_data, f, indent=4)
try:
if self.config_path.is_file():
with self.config_path.open("r") as f:
existing_data = json.load(f)
else:
existing_data = {}
updated_data = {**existing_data, **self.model_dump(exclude_unset=True)}
with self.config_path.open("w") as f:
json.dump(updated_data, f, indent=4)
except Exception: # noqa: S110
pass
def _reset_user_settings(self) -> None:
"""Reset all user settings to default values"""

View File

@@ -16,48 +16,72 @@ from crewai.cli.utils import copy_template, load_env_vars, write_env_file
def create_folder_structure(name, parent_folder=None):
import keyword
import re
name = name.rstrip('/')
name = name.rstrip("/")
if not name.strip():
raise ValueError("Project name cannot be empty or contain only whitespace")
folder_name = name.replace(" ", "_").replace("-", "_").lower()
folder_name = re.sub(r'[^a-zA-Z0-9_]', '', folder_name)
folder_name = re.sub(r"[^a-zA-Z0-9_]", "", folder_name)
# Check if the name starts with invalid characters or is primarily invalid
if re.match(r'^[^a-zA-Z0-9_-]+', name):
raise ValueError(f"Project name '{name}' contains no valid characters for a Python module name")
if re.match(r"^[^a-zA-Z0-9_-]+", name):
raise ValueError(
f"Project name '{name}' contains no valid characters for a Python module name"
)
if not folder_name:
raise ValueError(f"Project name '{name}' contains no valid characters for a Python module name")
raise ValueError(
f"Project name '{name}' contains no valid characters for a Python module name"
)
if folder_name[0].isdigit():
raise ValueError(f"Project name '{name}' would generate folder name '{folder_name}' which cannot start with a digit (invalid Python module name)")
raise ValueError(
f"Project name '{name}' would generate folder name '{folder_name}' which cannot start with a digit (invalid Python module name)"
)
if keyword.iskeyword(folder_name):
raise ValueError(f"Project name '{name}' would generate folder name '{folder_name}' which is a reserved Python keyword")
raise ValueError(
f"Project name '{name}' would generate folder name '{folder_name}' which is a reserved Python keyword"
)
if not folder_name.isidentifier():
raise ValueError(f"Project name '{name}' would generate invalid Python module name '{folder_name}'")
raise ValueError(
f"Project name '{name}' would generate invalid Python module name '{folder_name}'"
)
class_name = name.replace("_", " ").replace("-", " ").title().replace(" ", "")
class_name = re.sub(r'[^a-zA-Z0-9_]', '', class_name)
class_name = re.sub(r"[^a-zA-Z0-9_]", "", class_name)
if not class_name:
raise ValueError(f"Project name '{name}' contains no valid characters for a Python class name")
raise ValueError(
f"Project name '{name}' contains no valid characters for a Python class name"
)
if class_name[0].isdigit():
raise ValueError(f"Project name '{name}' would generate class name '{class_name}' which cannot start with a digit")
raise ValueError(
f"Project name '{name}' would generate class name '{class_name}' which cannot start with a digit"
)
# Check if the original name (before title casing) is a keyword
original_name_clean = re.sub(r'[^a-zA-Z0-9_]', '', name.replace("_", "").replace("-", "").lower())
if keyword.iskeyword(original_name_clean) or keyword.iskeyword(class_name) or class_name in ('True', 'False', 'None'):
raise ValueError(f"Project name '{name}' would generate class name '{class_name}' which is a reserved Python keyword")
original_name_clean = re.sub(
r"[^a-zA-Z0-9_]", "", name.replace("_", "").replace("-", "").lower()
)
if (
keyword.iskeyword(original_name_clean)
or keyword.iskeyword(class_name)
or class_name in ("True", "False", "None")
):
raise ValueError(
f"Project name '{name}' would generate class name '{class_name}' which is a reserved Python keyword"
)
if not class_name.isidentifier():
raise ValueError(f"Project name '{name}' would generate invalid Python class name '{class_name}'")
raise ValueError(
f"Project name '{name}' would generate invalid Python class name '{class_name}'"
)
if parent_folder:
folder_path = Path(parent_folder) / folder_name
@@ -172,7 +196,7 @@ def create_crew(name, provider=None, skip_provider=False, parent_folder=None):
)
# Check if the selected provider has predefined models
if selected_provider in MODELS and MODELS[selected_provider]:
if MODELS.get(selected_provider):
while True:
selected_model = select_model(selected_provider, provider_models)
if selected_model is None: # User typed 'q'

View File

@@ -5,7 +5,7 @@ import sys
import threading
import time
from pathlib import Path
from typing import Any, Dict, List, Optional, Set, Tuple
from typing import Any
import click
import tomli
@@ -116,7 +116,7 @@ def show_loading(event: threading.Event):
print()
def initialize_chat_llm(crew: Crew) -> Optional[LLM | BaseLLM]:
def initialize_chat_llm(crew: Crew) -> LLM | BaseLLM | None:
"""Initializes the chat LLM and handles exceptions."""
try:
return create_llm(crew.chat_llm)
@@ -157,7 +157,7 @@ def build_system_message(crew_chat_inputs: ChatInputs) -> str:
)
def create_tool_function(crew: Crew, messages: List[Dict[str, str]]) -> Any:
def create_tool_function(crew: Crew, messages: list[dict[str, str]]) -> Any:
"""Creates a wrapper function for running the crew tool with messages."""
def run_crew_tool_with_messages(**kwargs):
@@ -193,7 +193,7 @@ def chat_loop(chat_llm, messages, crew_tool_schema, available_functions):
user_input, chat_llm, messages, crew_tool_schema, available_functions
)
except KeyboardInterrupt:
except KeyboardInterrupt: # noqa: PERF203
click.echo("\nExiting chat. Goodbye!")
break
except Exception as e:
@@ -221,9 +221,9 @@ def get_user_input() -> str:
def handle_user_input(
user_input: str,
chat_llm: LLM,
messages: List[Dict[str, str]],
crew_tool_schema: Dict[str, Any],
available_functions: Dict[str, Any],
messages: list[dict[str, str]],
crew_tool_schema: dict[str, Any],
available_functions: dict[str, Any],
) -> None:
if user_input.strip().lower() == "exit":
click.echo("Exiting chat. Goodbye!")
@@ -281,7 +281,7 @@ def generate_crew_tool_schema(crew_inputs: ChatInputs) -> dict:
}
def run_crew_tool(crew: Crew, messages: List[Dict[str, str]], **kwargs):
def run_crew_tool(crew: Crew, messages: list[dict[str, str]], **kwargs):
"""
Runs the crew using crew.kickoff(inputs=kwargs) and returns the output.
@@ -304,9 +304,8 @@ def run_crew_tool(crew: Crew, messages: List[Dict[str, str]], **kwargs):
crew_output = crew.kickoff(inputs=kwargs)
# Convert CrewOutput to a string to send back to the user
result = str(crew_output)
return str(crew_output)
return result
except Exception as e:
# Exit the chat and show the error message
click.secho("An error occurred while running the crew:", fg="red")
@@ -314,7 +313,7 @@ def run_crew_tool(crew: Crew, messages: List[Dict[str, str]], **kwargs):
sys.exit(1)
def load_crew_and_name() -> Tuple[Crew, str]:
def load_crew_and_name() -> tuple[Crew, str]:
"""
Loads the crew by importing the crew class from the user's project.
@@ -351,15 +350,17 @@ def load_crew_and_name() -> Tuple[Crew, str]:
try:
crew_module = __import__(crew_module_name, fromlist=[crew_class_name])
except ImportError as e:
raise ImportError(f"Failed to import crew module {crew_module_name}: {e}")
raise ImportError(
f"Failed to import crew module {crew_module_name}: {e}"
) from e
# Get the crew class from the module
try:
crew_class = getattr(crew_module, crew_class_name)
except AttributeError:
except AttributeError as e:
raise AttributeError(
f"Crew class {crew_class_name} not found in module {crew_module_name}"
)
) from e
# Instantiate the crew
crew_instance = crew_class().crew()
@@ -395,7 +396,7 @@ def generate_crew_chat_inputs(crew: Crew, crew_name: str, chat_llm) -> ChatInput
)
def fetch_required_inputs(crew: Crew) -> Set[str]:
def fetch_required_inputs(crew: Crew) -> set[str]:
"""
Extracts placeholders from the crew's tasks and agents.
@@ -405,8 +406,8 @@ def fetch_required_inputs(crew: Crew) -> Set[str]:
Returns:
Set[str]: A set of placeholder names.
"""
placeholder_pattern = re.compile(r"\{(.+?)\}")
required_inputs: Set[str] = set()
placeholder_pattern = re.compile(r"\{(.+?)}")
required_inputs: set[str] = set()
# Scan tasks
for task in crew.tasks:
@@ -435,7 +436,7 @@ def generate_input_description_with_ai(input_name: str, crew: Crew, chat_llm) ->
"""
# Gather context from tasks and agents where the input is used
context_texts = []
placeholder_pattern = re.compile(r"\{(.+?)\}")
placeholder_pattern = re.compile(r"\{(.+?)}")
for task in crew.tasks:
if (
@@ -479,9 +480,7 @@ def generate_input_description_with_ai(input_name: str, crew: Crew, chat_llm) ->
f"{context}"
)
response = chat_llm.call(messages=[{"role": "user", "content": prompt}])
description = response.strip()
return description
return response.strip()
def generate_crew_description_with_ai(crew: Crew, chat_llm) -> str:
@@ -497,7 +496,7 @@ def generate_crew_description_with_ai(crew: Crew, chat_llm) -> str:
"""
# Gather context from tasks and agents
context_texts = []
placeholder_pattern = re.compile(r"\{(.+?)\}")
placeholder_pattern = re.compile(r"\{(.+?)}")
for task in crew.tasks:
# Replace placeholders with input names
@@ -531,6 +530,4 @@ def generate_crew_description_with_ai(crew: Crew, chat_llm) -> str:
f"{context}"
)
response = chat_llm.call(messages=[{"role": "user", "content": prompt}])
crew_description = response.strip()
return crew_description
return response.strip()

View File

@@ -2,8 +2,6 @@ import subprocess
import click
from crewai.cli.subprocess_utils import run_command
def evaluate_crew(n_iterations: int, model: str) -> None:
"""
@@ -19,7 +17,7 @@ def evaluate_crew(n_iterations: int, model: str) -> None:
if n_iterations <= 0:
raise ValueError("The number of iterations must be a positive integer.")
result = run_command(command, capture_output=False, text=True, check=True)
result = subprocess.run(command, capture_output=False, text=True, check=True)
if result.stderr:
click.echo(result.stderr, err=True)

View File

@@ -1,8 +1,6 @@
import subprocess
from functools import lru_cache
from crewai.cli.subprocess_utils import run_command
class Repository:
def __init__(self, path="."):
@@ -16,11 +14,15 @@ class Repository:
self.fetch()
def is_git_installed(self) -> bool:
@staticmethod
def is_git_installed() -> bool:
"""Check if Git is installed and available in the system."""
try:
run_command(
["git", "--version"], capture_output=True, check=True, text=True
subprocess.run(
["git", "--version"], # noqa: S607
capture_output=True,
check=True,
text=True,
)
return True
except (subprocess.CalledProcessError, FileNotFoundError):
@@ -28,29 +30,28 @@ class Repository:
def fetch(self) -> None:
"""Fetch latest updates from the remote."""
run_command(["git", "fetch"], cwd=self.path, check=True)
subprocess.run(["git", "fetch"], cwd=self.path, check=True) # noqa: S607
def status(self) -> str:
"""Get the git status in porcelain format."""
result = run_command(
["git", "status", "--branch", "--porcelain"],
return subprocess.check_output(
["git", "status", "--branch", "--porcelain"], # noqa: S607
cwd=self.path,
capture_output=True,
text=True,
check=True,
)
return result.stdout.strip()
encoding="utf-8",
).strip()
@lru_cache(maxsize=None)
@lru_cache(maxsize=None) # noqa: B019
def is_git_repo(self) -> bool:
"""Check if the current directory is a git repository."""
"""Check if the current directory is a git repository.
Notes:
- TODO: This method is cached to avoid redundant checks, but using lru_cache on methods can lead to memory leaks
"""
try:
run_command(
["git", "rev-parse", "--is-inside-work-tree"],
subprocess.check_output(
["git", "rev-parse", "--is-inside-work-tree"], # noqa: S607
cwd=self.path,
capture_output=True,
text=True,
check=True,
encoding="utf-8",
)
return True
except subprocess.CalledProcessError:
@@ -71,14 +72,13 @@ class Repository:
"""Return True if the Git repository is fully synced with the remote, False otherwise."""
if self.has_uncommitted_changes() or self.is_ahead_or_behind():
return False
else:
return True
return True
def origin_url(self) -> str | None:
"""Get the Git repository's remote URL."""
try:
result = run_command(
["git", "remote", "get-url", "origin"],
result = subprocess.run(
["git", "remote", "get-url", "origin"], # noqa: S607
cwd=self.path,
capture_output=True,
text=True,

View File

@@ -2,8 +2,6 @@ import subprocess
import click
from crewai.cli.subprocess_utils import run_command
# Be mindful about changing this.
# on some environments we don't use this command but instead uv sync directly
@@ -15,7 +13,7 @@ def install_crew(proxy_options: list[str]) -> None:
"""
try:
command = ["uv", "sync", *proxy_options]
run_command(command, check=True, capture_output=False, text=True)
subprocess.run(command, check=True, capture_output=False, text=True) # noqa: S603
except subprocess.CalledProcessError as e:
click.echo(f"An error occurred while running the crew: {e}", err=True)

View File

@@ -2,8 +2,6 @@ import subprocess
import click
from crewai.cli.subprocess_utils import run_command
def kickoff_flow() -> None:
"""
@@ -12,7 +10,7 @@ def kickoff_flow() -> None:
command = ["uv", "run", "kickoff"]
try:
result = run_command(command, capture_output=False, text=True, check=True)
result = subprocess.run(command, capture_output=False, text=True, check=True)
if result.stderr:
click.echo(result.stderr, err=True)

View File

@@ -2,8 +2,6 @@ import subprocess
import click
from crewai.cli.subprocess_utils import run_command
def plot_flow() -> None:
"""
@@ -12,7 +10,7 @@ def plot_flow() -> None:
command = ["uv", "run", "plot"]
try:
result = run_command(command, capture_output=False, text=True, check=True)
result = subprocess.run(command, capture_output=False, text=True, check=True)
if result.stderr:
click.echo(result.stderr, err=True)

View File

@@ -1,11 +1,10 @@
from typing import List, Optional
from urllib.parse import urljoin
import requests
from crewai.cli.config import Settings
from crewai.cli.version import get_crewai_version
from crewai.cli.constants import DEFAULT_CREWAI_ENTERPRISE_URL
from crewai.cli.version import get_crewai_version
class PlusAPI:
@@ -56,9 +55,9 @@ class PlusAPI:
handle: str,
is_public: bool,
version: str,
description: Optional[str],
description: str | None,
encoded_file: str,
available_exports: Optional[List[str]] = None,
available_exports: list[str] | None = None,
):
params = {
"handle": handle,
@@ -167,3 +166,13 @@ class PlusAPI:
json=payload,
timeout=30,
)
def mark_trace_batch_as_failed(
self, trace_batch_id: str, error_message: str
) -> requests.Response:
return self._make_request(
"PATCH",
f"{self.TRACING_RESOURCE}/batches/{trace_batch_id}",
json={"status": "failed", "failure_reason": error_message},
timeout=30,
)

View File

@@ -1,10 +1,10 @@
import os
import certifi
import json
import os
import time
from collections import defaultdict
from pathlib import Path
import certifi
import click
import requests
@@ -25,7 +25,7 @@ def select_choice(prompt_message, choices):
provider_models = get_provider_data()
if not provider_models:
return
return None
click.secho(prompt_message, fg="cyan")
for idx, choice in enumerate(choices, start=1):
click.secho(f"{idx}. {choice}", fg="cyan")
@@ -67,7 +67,7 @@ def select_provider(provider_models):
all_providers = sorted(set(predefined_providers + list(provider_models.keys())))
provider = select_choice(
"Select a provider to set up:", predefined_providers + ["other"]
"Select a provider to set up:", [*predefined_providers, "other"]
)
if provider is None: # User typed 'q'
return None
@@ -102,10 +102,9 @@ def select_model(provider, provider_models):
click.secho(f"No models available for provider '{provider}'.", fg="red")
return None
selected_model = select_choice(
return select_choice(
f"Select a model to use for {provider.capitalize()}:", available_models
)
return selected_model
def load_provider_data(cache_file, cache_expiry):
@@ -165,7 +164,7 @@ def fetch_provider_data(cache_file):
Returns:
- dict or None: The fetched provider data or None if the operation fails.
"""
ssl_config = os.environ['SSL_CERT_FILE'] = certifi.where()
ssl_config = os.environ["SSL_CERT_FILE"] = certifi.where()
try:
response = requests.get(JSON_URL, stream=True, timeout=60, verify=ssl_config)

View File

@@ -2,8 +2,6 @@ import subprocess
import click
from crewai.cli.subprocess_utils import run_command
def replay_task_command(task_id: str) -> None:
"""
@@ -15,7 +13,7 @@ def replay_task_command(task_id: str) -> None:
command = ["uv", "run", "replay", task_id]
try:
result = run_command(command, capture_output=False, text=True, check=True)
result = subprocess.run(command, capture_output=False, text=True, check=True)
if result.stderr:
click.echo(result.stderr, err=True)

View File

@@ -6,7 +6,6 @@ from packaging import version
from crewai.cli.utils import read_toml
from crewai.cli.version import get_crewai_version
from crewai.cli.subprocess_utils import run_command
class CrewType(Enum):
@@ -57,7 +56,7 @@ def execute_command(crew_type: CrewType) -> None:
command = ["uv", "run", "kickoff" if crew_type == CrewType.FLOW else "run_crew"]
try:
run_command(command, capture_output=False, text=True, check=True)
subprocess.run(command, capture_output=False, text=True, check=True) # noqa: S603
except subprocess.CalledProcessError as e:
handle_error(e, crew_type)

View File

@@ -3,7 +3,7 @@ import os
import sys
from datetime import datetime
from pathlib import Path
from typing import Optional
from cryptography.fernet import Fernet
@@ -49,7 +49,7 @@ class TokenManager:
encrypted_data = self.fernet.encrypt(json.dumps(data).encode())
self.save_secure_file(self.file_path, encrypted_data)
def get_token(self) -> Optional[str]:
def get_token(self) -> str | None:
"""
Get the access token if it is valid and not expired.
@@ -113,7 +113,7 @@ class TokenManager:
# Set appropriate permissions (read/write for owner only)
os.chmod(file_path, 0o600)
def read_secure_file(self, filename: str) -> Optional[bytes]:
def read_secure_file(self, filename: str) -> bytes | None:
"""
Read the content of a secure file.

View File

@@ -5,7 +5,7 @@ description = "{{name}} using crewAI"
authors = [{ name = "Your Name", email = "you@example.com" }]
requires-python = ">=3.10,<3.14"
dependencies = [
"crewai[tools]>=0.186.1,<1.0.0"
"crewai[tools]>=0.201.1,<1.0.0"
]
[project.scripts]

Some files were not shown because too many files have changed in this diff Show More