* docs: enterprise hallucination guardrails
Documents the `HallucinationGuardrail` feature for enterprise users, including usage examples, configuration options, and integration patterns.
* fix: update import
in the tin
* chore: add docs.json route
Add route for hallucination guardrail mdx
* feat: Add inject_date flag to Agent for automatic date injection
Co-Authored-By: Joe Moura <joao@crewai.com>
* feat: Add date_format parameter and error handling to inject_date feature
Co-Authored-By: Joe Moura <joao@crewai.com>
* fix: Update test implementation for inject_date feature
Co-Authored-By: Joe Moura <joao@crewai.com>
* fix: Add date format validation to prevent invalid formats
Co-Authored-By: Joe Moura <joao@crewai.com>
* docs: Update documentation for inject_date feature
Co-Authored-By: Joe Moura <joao@crewai.com>
* unnecesary
* new tests
---------
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>
- Add `HallucinationGuardrail` class as enterprise feature placeholder
- Update LLM guardrail events to support `HallucinationGuardrail` instances
- Add comprehensive tests for `HallucinationGuardrail` initialization and behavior
- Add integration tests for `HallucinationGuardrail` with task execution system
- Ensure no-op behavior always returns True
* Refactor Crew class memory initialization and enhance event handling
- Simplified the initialization of the external memory attribute in the Crew class.
- Updated memory system retrieval logic for consistency in key usage.
- Introduced a singleton pattern for the Telemetry class to ensure a single instance.
- Replaced telemetry usage in CrewEvaluator with event bus emissions for test results.
- Added new CrewTestResultEvent to handle crew test results more effectively.
- Updated event listener to process CrewTestResultEvent and log telemetry data accordingly.
- Enhanced tests to validate the singleton pattern in Telemetry and the new event handling logic.
* linted
* Remove unused telemetry attribute from Crew class memory initialization
* fix ordering of test
* Implement thread-safe singleton pattern in Telemetry class
- Introduced a threading lock to ensure safe instantiation of the Telemetry singleton.
- Updated the __new__ method to utilize double-checked locking for instance creation.
* Add reasoning attribute to Agent class
Co-Authored-By: Joe Moura <joao@crewai.com>
* Address PR feedback: improve type hints, error handling, refactor reasoning handler, and enhance tests and docs
Co-Authored-By: Joe Moura <joao@crewai.com>
* Implement function calling for reasoning and move prompts to translations
Co-Authored-By: Joe Moura <joao@crewai.com>
* Simplify function calling implementation with better error handling
Co-Authored-By: Joe Moura <joao@crewai.com>
* Enhance system prompts to leverage agent context (role, goal, backstory)
Co-Authored-By: Joe Moura <joao@crewai.com>
* Fix lint and type-checker issues
Co-Authored-By: Joe Moura <joao@crewai.com>
* Enhance system prompts to better leverage agent context
Co-Authored-By: Joe Moura <joao@crewai.com>
* Fix backstory access in reasoning handler for Python 3.12 compatibility
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>
* Add markdown attribute to Task class for formatting responses in Markdown
Co-Authored-By: Joe Moura <joao@crewai.com>
* Enhance markdown feature based on PR feedback
Co-Authored-By: Joe Moura <joao@crewai.com>
* Fix lint error and validation error in test_markdown_task.py
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>
* Changed test case
* Addd new interaction with llama
* fixed linting issue
* Gemma Flaky test case
* Gemma Flaky test case
* Minor change
* Minor change
* Dropped API key
* Removed falky test case check file
* Enhance string interpolation to support hyphens in variable names and add corresponding test cases. Update existing tests for consistency and formatting.
* Refactor tests in task_test.py by removing unused Task instances to streamline test cases for the interpolate_only method and related functions.
* CLI command added
* Added reset agent knowledge function
* Reduced verbose
* Added test cases
* Added docs
* Llama test case failing
* Changed _reset_agent_knowledge function
* Fixed new line error
* Added docs
* fixed the new line error
* Refractored
* Uncommmented some test cases
* ruff check fixed
* fixed run type checks
* fixed run type checks
* fixed run type checks
* Made reset_fn callable by casting to silence run type checks
* Changed the reset_knowledge as it expects only list of knowledge
* Fixed typo in docs
* Refractored the memory_system
* Minor Changes
* fixed test case
* Fixed linting issues
* Network test cases failing
---------
Co-authored-by: Lucas Gomide <lucaslg200@gmail.com>
During the sys.stdout = FilteredStream(old_stdout) assignment, if any code (including logging, print, or internal library output) writes to sys.stdout immediately, and that write happens before __init__ completes, the write() method is called on a not-fully-initialized object.. hence _lock doesn’t exist yet.
I used ai.dev as the alternate URL as it takes up less space but if this
is likely to confuse users we can use the long form.
Co-authored-by: Tony Kipkemboi <iamtonykipkemboi@gmail.com>
The Gemini & Vertex sections were conflated and a little hard to
distingush, so I have put them in separate sections.
Also added the latest 2.5 and 2.0 flash-lite models, and added a note
that Gemma models work too.
Co-authored-by: Tony Kipkemboi <iamtonykipkemboi@gmail.com>
This commit updates the project version to 0.119.0 and modifies the required version of the `crewai-tools` dependency to 0.44.0 across various configuration files. Additionally, the version number is reflected in the `__init__.py` file and the CLI templates for crew, flow, and tool projects.
* feat: implement knowledge retrieval events in Agent
This commit introduces a series of knowledge retrieval events in the Agent class, enhancing its ability to handle knowledge queries. New events include KnowledgeRetrievalStartedEvent, KnowledgeRetrievalCompletedEvent, KnowledgeQueryGeneratedEvent, KnowledgeQueryFailedEvent, and KnowledgeSearchQueryCompletedEvent. The Agent now emits these events during knowledge retrieval processes, allowing for better tracking and handling of knowledge queries. Additionally, the console formatter has been updated to handle these new events, providing visual feedback during knowledge retrieval operations.
* refactor: update knowledge query handling in Agent
This commit refines the knowledge query processing in the Agent class by renaming variables for clarity and optimizing the query rewriting logic. The system prompt has been updated in the translation file to enhance clarity and context for the query rewriting process. These changes aim to improve the overall readability and maintainability of the code.
* fix: add missing newline at end of en.json file
* fix broken tests
* refactor: rename knowledge query events and enhance retrieval handling
This commit renames the KnowledgeQueryGeneratedEvent to KnowledgeQueryStartedEvent to better reflect its purpose. It also updates the event handling in the EventListener and ConsoleFormatter classes to accommodate the new event structure. Additionally, the retrieval knowledge is now included in the KnowledgeRetrievalCompletedEvent, improving the overall knowledge retrieval process.
* docs for transparancy
* refactor: improve error handling in knowledge query processing
This commit refactors the knowledge query handling in the Agent class by changing the order of checks for LLM compatibility. It now logs a warning and emits a failure event if the LLM is not an instance of BaseLLM before attempting to call the LLM. Additionally, the task_prompt attribute has been removed from the KnowledgeQueryFailedEvent, simplifying the event structure.
* test: add unit test for knowledge search query and VCR cassette
This commit introduces a new test, `test_get_knowledge_search_query`, to verify that the `_get_knowledge_search_query` method in the Agent class correctly interacts with the LLM using the appropriate prompts. Additionally, a VCR cassette is added to record the interactions with the OpenAI API for this test, ensuring consistent and reliable test results.
Updated prereqs and setup steps to point to the now-more-model-agnostic
LLM setup guide, and updated the relevant text to go with it.
Co-authored-by: Tony Kipkemboi <iamtonykipkemboi@gmail.com>