mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 16:48:30 +00:00
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>
This commit is contained in:
@@ -67,3 +67,9 @@ class Knowledge(BaseModel):
|
||||
source.add()
|
||||
except Exception as e:
|
||||
raise e
|
||||
|
||||
def reset(self) -> None:
|
||||
if self.storage:
|
||||
self.storage.reset()
|
||||
else:
|
||||
raise ValueError("Storage is not initialized.")
|
||||
|
||||
Reference in New Issue
Block a user