Commit Graph

1693 Commits

Author SHA1 Message Date
Greyson LaLonde
e93d597721 fix: add type annotations to contextual_memory.py 2025-09-05 09:57:02 -04:00
Greyson LaLonde
a414e7f2a7 fix: update test files to use 'limit' instead of 'latest_n' and fix metadata in MemorySaveCompletedEvent 2025-09-05 09:22:21 -04:00
Greyson LaLonde
fbcd8bcd83 fix: update contextual_memory to use 'limit' instead of 'latest_n' 2025-09-05 09:09:33 -04:00
Greyson LaLonde
5f776bbb0a fix: update import to use crewai.llms.base_llm 2025-09-05 08:58:43 -04:00
Greyson LaLonde
909b2fd0ef fix: use create_default_llm when llm is None in BaseEvaluator 2025-09-05 08:57:58 -04:00
Greyson LaLonde
929f9dadb4 fix: remove unnecessary wraps parameter in test patch 2025-09-04 23:15:20 -04:00
Greyson LaLonde
4ef4632a8c fix: update return type annotations in OpenAIAgentAdapter 2025-09-04 23:08:56 -04:00
Greyson LaLonde
c246df3cb2 fix: add type annotations to converter instance variables 2025-09-04 23:02:13 -04:00
Greyson LaLonde
4fd40e7857 fix: add missing super call in LangGraphConverterAdapter 2025-09-04 22:58:18 -04:00
Greyson LaLonde
25204c6cb8 fix: add type annotations to structured output converter 2025-09-04 22:53:32 -04:00
Greyson LaLonde
b44776c367 fix: resolve mypy type errors across agent adapters and core modules 2025-09-04 22:47:18 -04:00
Greyson LaLonde
843801f554 fix: make task required in CrewAgentExecutor and fix all type annotations
- Make task parameter required in CrewAgentExecutor.__init__
- Update Agent.create_agent_executor to require task parameter
- Handle cases where crew can be None (standalone agent usage)
- Update base class signatures to match
- Remove unnecessary create_agent_executor calls during setup
- Add missing type annotations in base_agent_executor_mixin
- Fix all type errors in base_agent.py using Self return type
- Add assert for agent_executor before use
- Fix crew access checks to handle None case
2025-09-04 22:13:46 -04:00
Greyson LaLonde
2faa13ddcb refactor: improve type annotations and simplify code in CrewAgentExecutor 2025-09-04 17:07:02 -04:00
Greyson LaLonde
e385b45667 fix: update cache test assertions for JSON serialization 2025-09-04 16:10:46 -04:00
Greyson LaLonde
f03567d463 Merge branch 'main' into gl/fix/cache-handler-types-and-imports 2025-09-04 16:01:26 -04:00
Greyson LaLonde
e9f4ac070b chore: Relax mypy to not run on tests dir for now 2025-09-04 15:57:17 -04:00
Greyson LaLonde
bcee792390 fix: resolve mypy errors in storage and tracing modules 2025-09-04 15:39:01 -04:00
Greyson LaLonde
ab82da02f9 refactor: cleanup crew agent executor (#3440)
Some checks failed
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
refactor: cleanup crew agent executor & add docs

- Remove dead code, unused imports, and obsolete methods
- Modernize with updated type hints and static _format_prompt
- Add docstrings for clarity
2025-09-04 15:32:47 -04:00
Greyson LaLonde
221bfcccce refactor: consolidate ChromaDB response extraction logic 2025-09-04 15:21:48 -04:00
Greyson LaLonde
4812986f58 fix: resolve mypy type annotation issues in storage and telemetry modules
- Add proper type parameters for EmbeddingFunction generics
- Fix ChromaDB query response handling with proper type checking
- Add missing return type annotations to telemetry methods
- Fix trace listener type annotations and imports
- Handle potential None values in nested list indexing
- Improve type safety in RAG and knowledge storage modules
2025-09-04 14:58:28 -04:00
Greyson LaLonde
23c60befd8 fix: resolve additional mypy type annotation issues
- Fixed rag_storage.py embedder type compatibility and query response handling
- Fixed knowledge_storage.py dict type parameters and return types
- Added comprehensive type annotations to telemetry.py methods
- Added type annotations to trace_listener.py event handlers and methods
- Fixed ChromaDB response indexing safety checks
2025-09-04 13:23:57 -04:00
Greyson LaLonde
8dd3493e9c fix: resolve additional mypy type annotation issues
- Fixed file_handler.py PickleHandler type annotations
- Fixed task_events.py None checks before accessing task.fingerprint
- Added type annotations to memory_listener.py event handlers
2025-09-04 13:07:37 -04:00
Greyson LaLonde
9306d889a7 fix: resolve remaining mypy type annotation issues
- Applied proper decorator typing with ParamSpec and typing_extensions.Self
- Fixed event bus decorator to preserve type information
- Added type annotations to BaseEventListener and TraceCollectionListener
- Fixed LongTermMemory.search to handle None return from storage.load
- Resolved all type errors tracked in strict mode
2025-09-04 13:00:11 -04:00
Greyson LaLonde
8354cdf061 fix: add missing type annotations to fix mypy strict mode errors
Added type annotations to 10 files to resolve mypy type checking errors:
- Added return type annotations to methods missing them
- Added parameter type annotations where missing
- Fixed Optional type hints to be explicit
- Removed redundant type cast in crew.py
- Changed _execute_with_timeout return type from str to Any in agent.py

Additional type errors remain in other files throughout the codebase.
2025-09-04 11:41:57 -04:00
Greyson LaLonde
2ba48dd82a fix: add type annotations and exclude tests from mypy
- Add type: ignore for mem0 import
- Fix tool_usage.py cache_function None check
- Change _execute_without_timeout return type to Any
- Add type annotations to multiple functions:
  - add_sources() -> None
  - log() with proper parameter types
  - stop_rpm_counter() -> None
  - EventListener.__new__() -> Self
  - setup_listeners() -> None
  - Memory class __init__ methods -> None
  - TaskEvaluator.__init__() -> None
  - get_skipped_task_output() -> TaskOutput
- Exclude tests directory from mypy checks in pyproject.toml
- Update deprecated typing imports to use built-in types
2025-09-04 11:11:59 -04:00
Greyson LaLonde
0bab041531 fix: resolve remaining mypy type errors
- Fix tool_usage.py: rename result variable to avoid redefinition
- Fix lite_agent.py: import TaskOutput from correct module and add type casts
- Add explicit type annotation for data dict in tool_usage.py
2025-09-04 10:40:33 -04:00
Greyson LaLonde
eed2ffde5f fix: resolve additional mypy type errors
- Fix tool_usage.py: proper type annotations for result and fingerprint metadata
- Fix lite_agent.py: proper Union type for guardrail callable accepting both LiteAgentOutput and TaskOutput
- Add missing return type annotations to task_output_storage_handler.py methods
- Fix crew.py: replace Json generic check with str, remove unused type:ignore and redundant cast
2025-09-03 23:23:36 -04:00
Greyson LaLonde
b6e7311d2d fix: update cache tests to use input_data parameter name
The CacheHandler methods use 'input_data' not 'input' as the parameter name
2025-09-03 23:09:51 -04:00
Greyson LaLonde
90ca02b9dc fix: address mypy type errors in multiple files
- Fix return type and argument handling in cache_tools.py
- Add missing return statements in agent.py
- Fix _inject_date_to_task signature to accept Task object
- Remove unused type:ignore comments in tool_usage.py
- Add type annotations to internal methods in mem0_storage.py
2025-09-03 23:05:07 -04:00
Greyson LaLonde
06d5c3f170 fix: update remaining deprecated type annotations in tests 2025-09-03 22:40:05 -04:00
Greyson LaLonde
b94fbd3d3a fix: improve type annotations across codebase 2025-09-03 22:29:41 -04:00
Greyson LaLonde
43880b49a6 Merge branch 'main' into gl/fix/cache-handler-types-and-imports 2025-09-03 21:15:07 -04:00
Lorenze Jay
f0def350a4 chore: update crewAI and tools dependencies to latest versions (#3444)
Some checks failed
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
- Updated `crewai-tools` dependency from version 0.65.0 to 0.69.0 in `pyproject.toml` and `uv.lock`.
- Bumped crewAI version from 0.175.0 to 0.177.0 in `__init__.py`.
- Updated dependency versions in CLI templates for crew, flow, and tool projects to reflect the new crewAI version.
0.177.0
2025-09-03 17:27:05 -07:00
Lorenze Jay
f4f32b5f7f fix: suppress Pydantic deprecation warnings in initialization (#3443)
* fix: suppress Pydantic deprecation warnings in initialization

- Implemented a function to filter out Pydantic deprecation warnings, enhancing the user experience by preventing unnecessary warning messages during execution.
- Removed the previous warning filter setup to streamline the warning suppression process.
- Updated the User-Agent header formatting for consistency.

* fix type check

* dropped

* fix: update type-checker workflow and suppress warnings

- Updated the Python version matrix in the type-checker workflow to use double quotes for consistency.
- Added the `# type: ignore[assignment]` comment to the warning suppression assignment in `__init__.py` to address type checking issues.
- Ensured that the mypy command in the workflow allows for untyped calls and generics, enhancing type checking flexibility.

* better
2025-09-03 16:36:50 -07:00
Greyson LaLonde
bdfc38ba32 refactor: update CacheHandler imports to use direct path
- Update imports from crewai.agents.cache to crewai.agents.cache.cache_handler
- Remove CacheHandler from agents module __all__ export
2025-09-03 18:18:05 -04:00
Greyson LaLonde
94029017c3 refactor: remove __all__ from internal cache module
- Remove __all__ export as this is an internal module
- Add module docstring describing package purpose
2025-09-03 18:17:19 -04:00
Greyson LaLonde
89df777887 refactor: use absolute imports in parser module
- Import I18N directly from utilities.i18n
2025-09-03 18:16:03 -04:00
Greyson LaLonde
d1fbf24d9e fix: add type annotations to CacheHandler methods
- Replace Optional with union syntax
- Rename input parameter to input_data to avoid shadowing
- Add JSON serialization for dict cache keys
- Add thread-safety TODO note
2025-09-03 18:15:46 -04:00
Tony Kipkemboi
49a5ae0e16 Docs/release 0.175.0 docs (#3441)
* docs(install): note OpenAI SDK requirement openai>=1.13.3 for 0.175.0

* docs(cli): document device-code login and config reset guidance; renumber sections

* docs(flows): document conditional @start and resumable execution semantics

* docs(tasks): move max_retries to deprecation note under attributes table

* docs: provider-neutral RAG client config; entity memory batching; trigger payload note; tracing batch manager

* docs(cli): fix duplicate numbering (renumber Login/API Keys/Configuration sections)
2025-09-03 17:27:11 -04:00
Lucas Gomide
d31ffdbb90 docs: update Enterprise Action Auth Token section docs (#3437)
Some checks failed
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
2025-09-02 17:36:28 -04:00
Greyson LaLonde
4555ada91e fix(ruff): remove Python 3.12+ only rules for compatibility (#3436) 2025-09-02 14:15:25 -04:00
Greyson LaLonde
92d71f7f06 chore: migrate CI workflows to uv and update dev tooling (#3426)
chore(dev): update tooling & CI workflows

- Upgrade ruff, mypy (strict), pre-commit; add hooks, stubs, config consolidation
- Add bandit to dev deps and update uv.lock
- Enhance ruff rules (modern Python style, B006 for mutable defaults)
- Update workflows to use uv, matrix strategy, and changed-file type checking
- Include tests in type checking; fix job names and add summary job for branch protection
2025-09-02 12:35:02 -04:00
ZhangYier
dada9f140f fix: README.md example link 404 (#3432)
Some checks failed
Notify Downstream / notify-downstream (push) Has been cancelled
Co-authored-by: Tony Kipkemboi <iamtonykipkemboi@gmail.com>
2025-09-02 10:29:40 -04:00
Greyson LaLonde
878c1a649a refactor: Move events module to crewai.events (#3425)
refactor(events): relocate events module & update imports

- Move events from utilities/ to top-level events/ with types/, listeners/, utils/ structure
- Update all source/tests/docs to new import paths
- Add backwards compatibility stubs in crewai.utilities.events with deprecation warnings
- Restore test mocks and fix related test imports
2025-09-02 10:06:42 -04:00
Greyson LaLonde
1b1a8fdbf4 fix: replace mutable default arguments with None (#3429)
Some checks failed
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
2025-08-31 18:57:45 -04:00
Lorenze Jay
2633b33afc fix: enhance LLM event handling with task and agent metadata (#3422)
Some checks failed
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* fix: enhance LLM event handling with task and agent metadata

- Added `from_task` and `from_agent` parameters to LLM event emissions for improved traceability.
- Updated `_send_events_to_backend` method in TraceBatchManager to return status codes for better error handling.
- Modified `CREWAI_BASE_URL` to remove trailing slash for consistency.
- Improved logging and graceful failure handling in event sending process.

* drop print
2025-08-29 13:48:49 -07:00
Greyson LaLonde
e4c4b81e63 chore: refactor parser & constants, improve tools_handler, update tests
- Move parser constants to dedicated module with pre-compiled regex
- Refactor CrewAgentParser to module functions; remove unused params
- Improve tools_handler with instance attributes
- Update tests to use module-level parser functions
2025-08-29 14:35:08 -04:00
Greyson LaLonde
ec1eff02a8 fix: achieve parity between rag package and current impl (#3418)
Some checks failed
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
- Sanitize ChromaDB collection names and use original dir naming
- Add persistent client with file locking to the ChromaDB factory
- Add upsert support to the ChromaDB client
- Suppress ChromaDB deprecation warnings for `model_fields`
- Extract `suppress_logging` into shared `logger_utils`
- Update tests to reflect upsert behavior
- Docs: add additional note
2025-08-28 11:22:36 -04:00
Lorenze Jay
0f1b764c3e chore: update crewAI version and dependencies to 0.175.0 and tools to 0.65.0 (#3417)
Some checks failed
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* Bump crewAI version from 0.165.1 to 0.175.0 in __init__.py.
* Update tools dependency from 0.62.1 to 0.65.0 in pyproject.toml and uv.lock files.
* Reflect changes in CLI templates for crew, flow, and tool configurations.
0.175.0
2025-08-27 19:33:32 -07:00
Lorenze Jay
6ee9db1d4a fix: enhance PlusAPI and TraceBatchManager with timeout handling and graceful failure logging (#3416)
* Added timeout parameters to PlusAPI trace event methods for improved reliability.
* Updated TraceBatchManager to handle None responses gracefully, logging warnings instead of errors.
* Improved logging messages to provide clearer context during trace batch initialization and event sending failures.
2025-08-27 18:43:03 -07:00