* Updated excel_knowledge_source.py to account for excel sheets that have multiple tabs. The old implementation contained a single df=pd.read_excel(excel_file_path), which only reads the first or most recently used excel sheet. The updated functionality reads all sheets in the excel workbook.
* updated load_content() function in excel_knowledge_source.py to reduce memory usage and provide better documentation
* accidentally didn't delete the old load_content() function in last commit - corrected this
* Added an override for the content field from the inheritted BaseFileKnowledgeSource to account for the change in the load_content method to support excel files with multiple tabs/sheets. This change should ensure it passes the type check test, as it failed before since content was assigned a different type in BaseFileKnowledgeSource
* Now removed the commented out imports in _import_dependencies, as requested
* Updated excel_knowledge_source to fix linter errors and type errors. Changed inheritence from basefileknowledgesource to baseknowledgesource because basefileknowledgesource's types conflicted (in particular the load_content function and the content class variable.
---------
Co-authored-by: Lorenze Jay <63378463+lorenzejay@users.noreply.github.com>
* docs: fix long term memory class name in examples
- Replace EnhanceLongTermMemory with LongTermMemory to match actual implementation
- Update code examples to show correct usage
- Fixes#2026
Co-Authored-By: Joe Moura <joao@crewai.com>
* docs: improve memory examples with imports, types and security
- Add proper import statements
- Add type hints for better readability
- Add descriptive comments for each memory type
- Add security considerations section
- Add configuration examples section
- Use environment variables for storage paths
Co-Authored-By: Joe Moura <joao@crewai.com>
* Update memory.mdx
* Update memory.mdx
---------
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>
* fix: ensure proper message formatting for Anthropic models
- Add Anthropic-specific message formatting
- Add placeholder user message when required
- Add test case for Anthropic message formatting
Fixes#1869
Co-Authored-By: Joe Moura <joao@crewai.com>
* refactor: improve Anthropic model handling
- Add robust model detection with _is_anthropic_model
- Enhance message formatting with better edge cases
- Add type hints and improve documentation
- Improve test structure with fixtures
- Add edge case tests
Addresses review feedback on #2063
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>
* 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
* 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
* 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
* 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>
* 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>
* 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>
* 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
* 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>
* 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>
* 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