Commit Graph

1159 Commits

Author SHA1 Message Date
devin-ai-integration[bot]
459dd459d5 fix: handle multiple task outputs correctly in conditional tasks (#1937)
* fix: handle multiple task outputs correctly in conditional tasks

- Fix IndexError in _handle_conditional_task by using first output
- Modify _execute_tasks to accumulate task outputs instead of resetting
- Update _create_crew_output to handle multiple outputs correctly
- Add tests for multiple tasks with conditional and multiple conditional tasks

Co-Authored-By: brandon@crewai.com <brandon@crewai.com>

* feat: validate at least one non-conditional task and refine task outputs

Co-Authored-By: brandon@crewai.com <brandon@crewai.com>

* Revert to single output in _create_crew_output; remove redundant empty task check

Co-Authored-By: brandon@crewai.com <brandon@crewai.com>

* Address PR feedback: use last output in conditional tasks, add validation test

Co-Authored-By: brandon@crewai.com <brandon@crewai.com>

* Address PR feedback: updated conditional tasks tests and indexing

Co-Authored-By: brandon@crewai.com <brandon@crewai.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: brandon@crewai.com <brandon@crewai.com>
Co-authored-by: Brandon Hancock <brandon@brandonhancock.io>
Co-authored-by: Brandon Hancock (bhancock_ai) <109994880+bhancockio@users.noreply.github.com>
Co-authored-by: João Moura <joaomdmoura@gmail.com>
2025-02-09 23:56:45 +00:00
João Moura
2f1659daa0 adding shoutout to enterprise 2025-02-09 23:56:45 +00:00
Brandon Hancock (bhancock_ai)
faac5f584e Brandon/general cleanup (#2059)
* clean up. fix type safety. address memory config docs

* improve manager

* Include fix for o1 models not supporting system messages

* more broad with o1

* address fix: Typo in expected_output string #2045

* drop prints

* drop prints

* wip

* wip

* fix failing memory tests

* Fix memory provider issue

* clean up short term memory

* revert ltm

* drop

* clean up linting issues

* more linting
2025-02-09 23:56:45 +00:00
Brandon Hancock (bhancock_ai)
fcbf824b48 clean up google docs (#2061) 2025-02-09 23:56:45 +00:00
Lorenze Jay
f438344dfc Enhance embedding configuration with custom embedder support (#2060)
* Enhance embedding configuration with custom embedder support

- Add support for custom embedding functions in EmbeddingConfigurator
- Update type hints for embedder configuration
- Extend configuration options for various embedding providers
- Add optional embedder configuration to Memory class

* added docs

* Refine custom embedder configuration support

- Update custom embedder configuration method to handle custom embedding functions
- Modify type hints for embedder configuration
- Remove unused model_name parameter in custom embedder configuration
2025-02-09 23:56:45 +00:00
Brandon Hancock (bhancock_ai)
ef1ef8fd80 General Clean UP (#2042)
* clean up. fix type safety. address memory config docs

* improve manager

* Include fix for o1 models not supporting system messages

* more broad with o1

* address fix: Typo in expected_output string #2045

* drop prints

* drop prints

* wip

* wip

* fix failing memory tests

* Fix memory provider issue

* clean up short term memory

* revert ltm

* drop
2025-02-09 23:56:45 +00:00
Vidit Ostwal
df55278476 Added support for logging in JSON format as well. (#1985)
* Added functionality to have json format as well for the logs

* Added additional comments, refractored logging functionality

* Fixed documentation to include the new paramter

* Fixed typo

* Added a Pydantic Error Check between output_log_file and save_as_json parameter

* Removed the save_to_json parameter, incorporated the functionality directly with output_log_file

* Fixed typo

* Sorted the imports using isort

---------

Co-authored-by: Vidit Ostwal <vidit.ostwal@piramal.com>
Co-authored-by: Brandon Hancock (bhancock_ai) <109994880+bhancockio@users.noreply.github.com>
2025-02-09 23:56:45 +00:00
Vidit Ostwal
22ce67a8e7 Added reset memories function inside crew class (#2047)
* Added reset memories function inside crew class

* Fixed typos

* Refractored the code

* Refactor memory reset functionality in Crew class

- Improved error handling and logging for memory reset operations
- Added private methods to modularize memory reset logic
- Enhanced type hints and docstrings
- Updated CLI reset memories command to use new Crew method
- Added utility function to get crew instance in CLI utils

* fix linting issues

* knowledge: Add null check in reset method for storage

* cli: Update memory reset tests to use Crew's reset_memories method

* cli: Enhance memory reset command with improved error handling and validation

---------

Co-authored-by: Lorenze Jay <lorenzejaytech@gmail.com>
Co-authored-by: Brandon Hancock (bhancock_ai) <109994880+bhancockio@users.noreply.github.com>
2025-02-09 23:56:45 +00:00
Brandon Hancock (bhancock_ai)
f29534a2c3 fix manager (#2056) 2025-02-09 23:56:45 +00:00
hyjbrave
4b6abea553 fix unstructured example flow (#2052) 2025-02-09 23:56:45 +00:00
Nicolas Lorin
e1cbeed8fd agent: improve knowledge naming (#2041) 2025-02-09 23:56:45 +00:00
João Moura
9e267ed23b fix version 2025-02-09 23:56:45 +00:00
Thiago Moretto
74d3598cb3 Fix ignored Crew task callback when one is set on the Task (#2040)
* Fix ignored Crew task callback when one is set on the Task

* type checking
2025-02-09 23:56:45 +00:00
Nicolas Lorin
040c0af158 FIX: correctly initialize embedder for crew knowledge (#2035) 2025-02-09 23:56:45 +00:00
Juan Figuera
44d5c3d9c5 Added expected_output field to tasks to prevent ValidationError from Pydantic (#1971)
Co-authored-by: Brandon Hancock (bhancock_ai) <109994880+bhancockio@users.noreply.github.com>
2025-02-09 23:56:44 +00:00
Brandon Hancock (bhancock_ai)
031fd476c2 Brandon/improve llm structured output (#2029)
* code and tests work

* update docs

---------

Co-authored-by: Lorenze Jay <63378463+lorenzejay@users.noreply.github.com>
2025-02-09 23:56:44 +00:00
rishi154
742ee26700 Fix : short_term_memory with bedrock - using user defined model(when passed as attribute) rather than default (#1959)
* Update embedding_configurator.py

Modified  _configure_bedrock method to use user submitted model_name rather than default  amazon.titan-embed-text-v1.

Sending model_name in short_term_memory (embedder_config/config) was not working.


 # Passing model_name to use model_name provide by user than using default. Added if/else for backward compatibility

* Update embedding_configurator.py

Incorporated review comments

---------

Co-authored-by: Brandon Hancock (bhancock_ai) <109994880+bhancockio@users.noreply.github.com>
2025-02-09 23:56:44 +00:00
TomuHirata
40286e2532 Add documentation for mlflow tracing integration (#1988)
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
Co-authored-by: Brandon Hancock (bhancock_ai) <109994880+bhancockio@users.noreply.github.com>
2025-02-09 23:56:44 +00:00
jinx
378bd7d284 Correct current year in tasks, to get more up to date results (#2010)
Co-authored-by: Brandon Hancock (bhancock_ai) <109994880+bhancockio@users.noreply.github.com>
2025-02-09 23:56:44 +00:00
Vidit Ostwal
50f6481e2d Fixed the memory documentation (#2031) 2025-02-09 23:56:44 +00:00
Vidit Ostwal
d9c426a50d Fixed the documentation (#2017)
* Fixed the documentation

* Fixed typo, improved description

---------

Co-authored-by: Vidit Ostwal <vidit.ostwal@piramal.com>
Co-authored-by: Brandon Hancock (bhancock_ai) <109994880+bhancockio@users.noreply.github.com>
2025-02-09 23:56:44 +00:00
Brandon Hancock
f7a0da103f update litellm to support o3-mini and deepseek. Update docs. 2025-02-09 23:56:44 +00:00
Brandon Hancock (bhancock_ai)
5286e04dff Brandon/provide llm additional params (#2018)
* Clean up to match enterprise

* add additional params to LLM calls

* make sure additional params are getting passed to llm

* update docs

* drop print
2025-02-09 23:56:44 +00:00
Brandon Hancock (bhancock_ai)
986d7127f3 Clean up to match enterprise (#2009)
* Clean up to match enterprise

* improve feedback prompting
2025-02-09 23:56:44 +00:00
Brandon Hancock (bhancock_ai)
d4f3c8463f Fix llms (#2003)
* iwp

* add in api_base

---------

Co-authored-by: Lorenze Jay <63378463+lorenzejay@users.noreply.github.com>
2025-02-09 23:56:44 +00:00
Brandon Hancock (bhancock_ai)
8ac51daebd Bugfix/fix broken training (#1993)
* Fixing training while refactoring code

* improve prompts

* make sure to raise an error when missing training data

* Drop comment

* fix failing tests

* add clear

* drop bad code

* fix failing test

* Fix type issues pointed out by lorenze

* simplify training
2025-02-09 23:56:44 +00:00
Lorenze Jay
5178c89ea6 fixes interpolation issues when inputs are type dict,list specificall… (#1992)
* fixes interpolation issues when inputs are type dict,list specifically when defined on expected_output

* improvements with type hints, doc fixes and rm print statements

* more tests

* test passing

---------

Co-authored-by: Brandon Hancock <brandon@brandonhancock.io>
2025-02-09 23:56:44 +00:00
Daniel Barreto
0159a6636a docs: add a "Human Input" row to the Task Attributes table (#1999) 2025-02-09 23:56:44 +00:00
Lorenze Jay
d8536deebe fix breakage when cloning agent/crew using knowledge_sources and enable custom knowledge_storage (#1927)
* fix breakage when cloning agent/crew using knowledge_sources

* fixed typo

* better

* ensure use of other knowledge storage works

* fix copy and custom storage

* added tests

* normalized name

* updated cassette

* fix test

* remove fixture

* fixed test

* fix

* add fixture to this

* add fixture to this

* patch twice since

* fix again

* with fixtures

* better mocks

* fix

* simple

* try

* another

* hopefully fixes test

* hopefully fixes test

* this should fix it !

* WIP: test check with prints

* try this

* exclude knowledge

* fixes

* just drop clone for now

* rm print statements

* printing agent_copy

* checker

* linted

* cleanup

* better docs

---------

Co-authored-by: Brandon Hancock (bhancock_ai) <109994880+bhancockio@users.noreply.github.com>
2025-02-09 23:56:44 +00:00
Brandon Hancock
74b78d4eb0 update litellm 2025-02-09 23:56:44 +00:00
Brandon Hancock (bhancock_ai)
9ca2872688 Fix (#1990)
* Fix

* drop failing files
2025-02-09 23:56:44 +00:00
João Moura
6b2d62e5fe preparing new version 2025-02-09 23:56:44 +00:00
Brandon Hancock (bhancock_ai)
900090b4b7 quick fix for mike (#1987) 2025-02-09 23:56:44 +00:00
Brandon Hancock (bhancock_ai)
e189e2133a fix issue pointed out by mike (#1986)
* fix issue pointed out by mike

* clean up

* Drop logger

* drop unused imports
2025-02-09 23:56:44 +00:00
Brandon Hancock (bhancock_ai)
a8dbe4a109 Bugfix/litellm plus generic exceptions (#1965)
* wip

* More clean up

* Fix error

* clean up test

* Improve chat calling messages

* crewai chat improvements

* working but need to clean up

* Clean up chat
2025-02-09 23:56:44 +00:00
devin-ai-integration[bot]
fed2d6bf0d Add version check to crew_chat.py (#1966)
* Add version check to crew_chat.py with min version 0.98.0

Co-Authored-By: brandon@crewai.com <brandon@crewai.com>

* Fix import sorting in crew_chat.py

Co-Authored-By: brandon@crewai.com <brandon@crewai.com>

* Fix import sorting in crew_chat.py (attempt 3)

Co-Authored-By: brandon@crewai.com <brandon@crewai.com>

* Update error message, add version check helper, fix import sorting

Co-Authored-By: brandon@crewai.com <brandon@crewai.com>

* Fix import sorting with Ruff auto-fix

Co-Authored-By: brandon@crewai.com <brandon@crewai.com>

* Remove poetry check and import comment headers in crew_chat.py

Co-Authored-By: brandon@crewai.com <brandon@crewai.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: brandon@crewai.com <brandon@crewai.com>
2025-02-09 23:56:44 +00:00
Brandon Hancock (bhancock_ai)
ae89471271 Fix litellm issues to be more broad (#1960)
* Fix litellm issues to be more broad

* Fix tests
2025-02-09 23:56:44 +00:00
Bobby Lindsey
6f59dcb8d7 Add SageMaker as a LLM provider (#1947)
* Add SageMaker as a LLM provider

* Removed unnecessary constants; updated docs to align with bootstrap naming convention

---------

Co-authored-by: Brandon Hancock (bhancock_ai) <109994880+bhancockio@users.noreply.github.com>
2025-02-09 23:56:44 +00:00
Brandon Hancock (bhancock_ai)
4f20f78f4f Updated calls and added tests to verify (#1953)
* Updated calls and added tests to verify

* Drop unused import
2025-02-09 23:56:44 +00:00
Brandon Hancock (bhancock_ai)
26723936c1 Bugfix/kickoff hangs when llm call fails (#1943)
* Wip to address https://github.com/crewAIInc/crewAI/issues/1934

* implement proper try / except

* clean up PR

* add tests

* Fix tests and code that was broken

* mnore clean up

* Fixing tests

* fix stop type errors]

* more fixes
2025-02-09 23:56:44 +00:00
Tony Kipkemboi
c81c81893c docs: improve formatting and clarity in CLI and Composio Tool docs (#1946)
* docs: improve formatting and clarity in CLI and Composio Tool docs

- Add Terminal label to shell code blocks in CLI docs
- Update Composio Tool title and fix tip formatting

* docs: improve installation guide with virtual environment details

- Update Python version requirements and commands
- Add detailed virtual environment setup instructions
- Clarify project-specific environment activation steps
- Streamline additional tools installation with UV

* docs: simplify installation guide

- Remove redundant virtual environment instructions
- Simplify project creation steps
- Update UV package manager description
2025-02-09 23:56:44 +00:00
Brandon Hancock (bhancock_ai)
26cce7f3ab add docs for crewai chat (#1936)
* add docs for crewai chat

* add version number
2025-02-09 23:56:44 +00:00
Abhishek Patil
b8e7136fba feat: add Composio docs (#1904)
* feat: update Composio tool docs

* Update composiotool.mdx

* fix: minor changes

---------

Co-authored-by: Brandon Hancock (bhancock_ai) <109994880+bhancockio@users.noreply.github.com>
2025-02-09 23:56:44 +00:00
Sanjeed
eff2d8b5e7 Fix wrong llm value in example (#1929)
Original example had `mixtal-llm` which would result in an error.
Replaced with gpt-4o according to https://docs.crewai.com/concepts/llms
2025-02-09 23:56:44 +00:00
João Moura
f27e173e2c Stateful flows (#1931)
* fix: ensure persisted state overrides class defaults

- Remove early return in Flow.__init__ to allow proper state initialization
- Add test_flow_default_override.py to verify state override behavior
- Fix issue where default values weren't being overridden by persisted state

Fixes the issue where persisted state values weren't properly overriding
class defaults when restarting a flow with a previously saved state ID.

Co-Authored-By: Joe Moura <joao@crewai.com>

* test: improve state restoration verification with has_set_count flag

Co-Authored-By: Joe Moura <joao@crewai.com>

* test: add has_set_count field to PoemState

Co-Authored-By: Joe Moura <joao@crewai.com>

* refactoring test

* fix: ensure persisted state overrides class defaults

- Remove early return in Flow.__init__ to allow proper state initialization
- Add test_flow_default_override.py to verify state override behavior
- Fix issue where default values weren't being overridden by persisted state

Fixes the issue where persisted state values weren't properly overriding
class defaults when restarting a flow with a previously saved state ID.

Co-Authored-By: Joe Moura <joao@crewai.com>

* test: improve state restoration verification with has_set_count flag

Co-Authored-By: Joe Moura <joao@crewai.com>

* test: add has_set_count field to PoemState

Co-Authored-By: Joe Moura <joao@crewai.com>

* refactoring test

* Fixing flow state

* fixing peristed stateful flows

* linter

* type fix

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Joe Moura <joao@crewai.com>
2025-02-09 23:56:44 +00:00
devin-ai-integration[bot]
afac425d1a feat: add colored logging for flow operations (#1923)
* feat: add colored logging for flow operations

- Add flow_id property for easy ID access
- Add yellow colored logging for flow start
- Add bold_yellow colored logging for state operations
- Implement consistent logging across flow lifecycle

Co-Authored-By: Joe Moura <joao@crewai.com>

* fix: sort imports to fix lint error

Co-Authored-By: Joe Moura <joao@crewai.com>

* feat: improve flow logging and error handling

- Add centralized logging method for flow events
- Add robust error handling in persistence decorator
- Add consistent log messages and levels
- Add color-coded error messages

Co-Authored-By: Joe Moura <joao@crewai.com>

* fix: sort imports and improve error handling

Co-Authored-By: Joe Moura <joao@crewai.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Joe Moura <joao@crewai.com>
Co-authored-by: João Moura <joaomdmoura@gmail.com>
2025-02-09 23:56:44 +00:00
João Moura
60d23ef9ee updating tools version 2025-02-09 23:56:44 +00:00
devin-ai-integration[bot]
a4a0946675 docs: add flow persistence section (#1922)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Joe Moura <joao@crewai.com>
2025-02-09 23:56:44 +00:00
Brandon Hancock (bhancock_ai)
84792a0f17 Brandon/new release cleanup (#1918)
* WIP

* fixes to match enterprise changes
2025-02-09 23:56:44 +00:00
João Moura
32f6e7d24c preparing new verison 2025-02-09 23:56:44 +00:00